mehdiacode / cpptweener

Automatically exported from code.google.com/p/cpptweener
0 stars 0 forks source link

Tweener::lastTime member variable should be initialized in the constructor #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run the test sample without the compiler automatically initializing 
variables for you

What is the expected output? What do you see instead?
You should get animation tweened all the times.
Instead, sometimes, wrong values get interpolated.

What version of the product are you using? On what operating system?
HEAD revision from subversion (r6)

Original issue reported on code.google.com by manuel....@gmail.com on 14 Feb 2010 at 3:34

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I Agree with this issue!
System: W7 64, VS2010

On my systen a got not initialized lastTime about -842150451;
So at Tweener::step we get dif with an very huge number

    int  dif = (currentMillis - lastTime); => about +842150451

So our animation is killed right after starting;

Besides it, I have an assertion error at main cycle declaration:

    for (tweensIT = tweens.begin();  tweensIT != tweens.end(); ++tweensIT )

after tweensIT removed from tweens at the end of cylce (tweens size becomes 0)

Original comment by gasu.basu on 2 Feb 2011 at 1:38

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed with Etienne Mouchel Solution

Original comment by wesley.m...@gmail.com on 17 Feb 2011 at 6:43

GoogleCodeExporter commented 8 years ago
On function
 Tweener::step() {
    ....
    removeTween(&(*tweensIT));
    ....
}

you must add a Statement:

"if (0 == tweens.size()){break;}"

Original comment by weolar@gmail.com on 28 Feb 2011 at 8:15