Making CCMotionStreak _maxPoints framerate independent.

This commit is contained in:
Eric Muxagata 2015-01-06 17:02:32 -02:00
parent 1b96b0bef8
commit e0143167e6
1 changed files with 4 additions and 2 deletions

View File

@ -114,7 +114,9 @@ bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Co
_stroke = stroke;
_fadeDelta = 1.0f/fade;
_maxPoints = (int)(fade*60.0f)+2;
double fps = 1/Director::getInstance()->getAnimationInterval();
_maxPoints = (int)(fade*fps)+2;
_nuPoints = 0;
_pointState = (float *)malloc(sizeof(float) * _maxPoints);
_pointVertexes = (Vec2*)malloc(sizeof(Vec2) * _maxPoints);