Style guide

This commit is contained in:
Tobias Loose
2013-12-05 23:22:50 +01:00
parent cbe6c0c842
commit 93d1a637b6
5 changed files with 82 additions and 31 deletions

View File

@@ -13,20 +13,33 @@ public:
Easing(float val): start_value(val), delta_value(0), value(val), duration(0), time_acc(0)
{}
{
}
void reset()
{
value = start_value;
time_acc = 0;
}
void finish()
{
value = start_value + delta_value;
time_acc = 0; duration = 0;
}
void reset(){ value = start_value; time_acc = 0;}
void finish(){ value = start_value + delta_value; time_acc = 0; duration = 0;}
virtual void update(float dt) = 0;
void start(float targetValue, float _duration){
void start(float targetValue, float _duration)
{
start_value = value;
delta_value = targetValue - start_value;
time_acc = 0;
duration = _duration;
}
void translate(float delta_value){
void translate(float delta_value)
{
start_value += delta_value;
value += delta_value;
}
@@ -42,8 +55,10 @@ class InOutQuadEasing : public Easing
public:
InOutQuadEasing(float val): Easing(val) {}
void update(float dt){
if(duration > 0){
void update(float dt)
{
if(duration > 0)
{
time_acc += dt;
if(time_acc > duration)