fixed warning and logic error

This commit is contained in:
yinkaile 2014-06-20 10:52:14 +08:00
parent 0ce51162af
commit 043c640037
2 changed files with 8 additions and 8 deletions

View File

@ -175,7 +175,7 @@ void RotationFrame::onEnter(Frame *nextFrame)
void RotationFrame::apply(float percent) void RotationFrame::apply(float percent)
{ {
if (_tween && percent != 0 || _betwennRotation != 0) if (_tween && percent != 0 && _betwennRotation != 0)
{ {
float rotation = _rotation + percent * _betwennRotation; float rotation = _rotation + percent * _betwennRotation;
_node->setRotation(rotation); _node->setRotation(rotation);
@ -227,7 +227,7 @@ void SkewFrame::onEnter(Frame *nextFrame)
void SkewFrame::apply(float percent) void SkewFrame::apply(float percent)
{ {
if (_tween && percent != 0 || (_betweenSkewX != 0 || _betweenSkewY != 0)) if (_tween && percent != 0 && (_betweenSkewX != 0 || _betweenSkewY != 0))
{ {
float skewx = _skewX + percent * _betweenSkewX; float skewx = _skewX + percent * _betweenSkewX;
float skewy = _skewY + percent * _betweenSkewY; float skewy = _skewY + percent * _betweenSkewY;
@ -282,7 +282,7 @@ void RotationSkewFrame::onEnter(Frame *nextFrame)
void RotationSkewFrame::apply(float percent) void RotationSkewFrame::apply(float percent)
{ {
if (_tween && percent != 0 || (_betweenSkewX != 0 || _betweenSkewY != 0)) if (_tween && percent != 0 && (_betweenSkewX != 0 || _betweenSkewY != 0))
{ {
float skewx = _skewX + percent * _betweenSkewX; float skewx = _skewX + percent * _betweenSkewX;
float skewy = _skewY + percent * _betweenSkewY; float skewy = _skewY + percent * _betweenSkewY;
@ -335,7 +335,7 @@ void PositionFrame::onEnter(Frame *nextFrame)
void PositionFrame::apply(float percent) void PositionFrame::apply(float percent)
{ {
if (_tween && percent != 0 || (_betweenX != 0 || _betweenY != 0)) if (_tween && percent != 0 && (_betweenX != 0 || _betweenY != 0))
{ {
Point p; Point p;
p.x = _position.x + _betweenX * percent; p.x = _position.x + _betweenX * percent;
@ -389,7 +389,7 @@ void ScaleFrame::onEnter(Frame *nextFrame)
void ScaleFrame::apply(float percent) void ScaleFrame::apply(float percent)
{ {
if (_tween && percent != 0 || (_betweenScaleX != 0 || _betweenScaleY != 0)) if (_tween && percent != 0 && (_betweenScaleX != 0 || _betweenScaleY != 0))
{ {
float scaleX = _scaleX + _betweenScaleX * percent; float scaleX = _scaleX + _betweenScaleX * percent;
float scaleY = _scaleY + _betweenScaleY * percent; float scaleY = _scaleY + _betweenScaleY * percent;
@ -523,7 +523,7 @@ void ColorFrame::onEnter(Frame *nextFrame)
void ColorFrame::apply(float percent) void ColorFrame::apply(float percent)
{ {
if (_tween && percent != 0 || (_betweenAlpha !=0 || _betweenRed != 0 || _betweenGreen != 0 || _betweenBlue != 0)) if (_tween && percent != 0 && (_betweenAlpha !=0 || _betweenRed != 0 || _betweenGreen != 0 || _betweenBlue != 0))
{ {
GLubyte alpha = _alpha + _betweenAlpha * percent; GLubyte alpha = _alpha + _betweenAlpha * percent;

View File

@ -383,9 +383,9 @@ Node* NodeReader::loadSprite(const rapidjson::Value& json)
bool flipY = DICTOOL->getBooleanValue_json(json, FLIPY); bool flipY = DICTOOL->getBooleanValue_json(json, FLIPY);
if(flipX != false) if(flipX != false)
sprite->setFlipX(flipX); sprite->setFlippedX(flipX);
if(flipY != false) if(flipY != false)
sprite->setFlipY(flipY); sprite->setFlippedY(flipY);
return sprite; return sprite;
} }