Merge pull request #9823 from ericmux/frame-independent-ms

Making CCMotionStreak _maxPoints framerate independent.
This commit is contained in:
minggo 2016-06-28 18:29:14 +08:00 committed by GitHub
commit 0c290540df
1 changed files with 4 additions and 2 deletions

View File

@ -112,8 +112,10 @@ 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);