Fix the Frame class:

* Field initialization order (warning in Xcode)
* Make conditions with && and || more readable for programmers (warning in Xcode)
This commit is contained in:
Vladimir Timofeev 2015-05-01 11:51:20 +03:00
parent ad494a7131
commit 2d8c687d6e
1 changed files with 5 additions and 5 deletions

View File

@ -38,8 +38,8 @@ NS_TIMELINE_BEGIN
Frame::Frame()
: _frameIndex(0)
, _tween(true)
, _tweenType(tweenfunc::TweenType::Linear)
, _enterWhenPassed(false)
, _tweenType(tweenfunc::TweenType::Linear)
, _timeline(nullptr)
, _node(nullptr)
{
@ -282,7 +282,7 @@ void SkewFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
void SkewFrame::onApply(float percent)
{
if (nullptr != _node && _betweenSkewX != 0 || _betweenSkewY != 0)
if ((nullptr != _node && _betweenSkewX != 0) || _betweenSkewY != 0)
{
float skewx = _skewX + percent * _betweenSkewX;
float skewy = _skewY + percent * _betweenSkewY;
@ -342,7 +342,7 @@ void RotationSkewFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
void RotationSkewFrame::onApply(float percent)
{
if (nullptr != _node && _betweenSkewX != 0 || _betweenSkewY != 0)
if ((nullptr != _node && _betweenSkewX != 0) || _betweenSkewY != 0)
{
float skewx = _skewX + percent * _betweenSkewX;
float skewy = _skewY + percent * _betweenSkewY;
@ -460,7 +460,7 @@ void ScaleFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
void ScaleFrame::onApply(float percent)
{
if (nullptr != _node && _betweenScaleX != 0 || _betweenScaleY != 0)
if ((nullptr != _node && _betweenScaleX != 0) || _betweenScaleY != 0)
{
float scaleX = _scaleX + _betweenScaleX * percent;
float scaleY = _scaleY + _betweenScaleY * percent;
@ -694,7 +694,7 @@ void ColorFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
void ColorFrame::onApply(float percent)
{
if (nullptr != _node && _betweenRed != 0 || _betweenGreen != 0 || _betweenBlue != 0)
if ((nullptr != _node && _betweenRed != 0) || _betweenGreen != 0 || _betweenBlue != 0)
{
Color3B color;
color.r = _color.r+ _betweenRed * percent;