mirror of https://github.com/axmolengine/axmol.git
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:
parent
ad494a7131
commit
2d8c687d6e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue