issue #2747: [Best C++ practice] Deprecating Sprite::displayFrame, adding Sprite::getDisplayFrame.

This commit is contained in:
James Chen 2013-08-28 18:17:05 +08:00
parent 3942c12293
commit 2578d15420
3 changed files with 7 additions and 4 deletions

View File

@ -2065,7 +2065,7 @@ void Animate::startWithTarget(Node *target)
if (_animation->getRestoreOriginalFrame())
{
_origFrame = pSprite->displayFrame();
_origFrame = pSprite->getDisplayFrame();
_origFrame->retain();
}
_nextFrame = 0;

View File

@ -1004,7 +1004,7 @@ bool Sprite::isFrameDisplayed(SpriteFrame *frame) const
frame->getOffset().equals(_unflippedOffsetPositionFromCenter));
}
SpriteFrame* Sprite::displayFrame(void)
SpriteFrame* Sprite::getDisplayFrame()
{
return SpriteFrame::createWithTexture(_texture,
CC_RECT_POINTS_TO_PIXELS(_rect),
@ -1013,7 +1013,7 @@ SpriteFrame* Sprite::displayFrame(void)
CC_SIZE_POINTS_TO_PIXELS(_contentSize));
}
SpriteBatchNode* Sprite::getBatchNode(void)
SpriteBatchNode* Sprite::getBatchNode()
{
return _batchNode;
}

View File

@ -329,10 +329,13 @@ public:
*/
virtual bool isFrameDisplayed(SpriteFrame *pFrame) const;
/** @deprecated Use getDisplayFrame() instead */
CC_DEPRECATED_ATTRIBUTE virtual SpriteFrame* displayFrame() { return getDisplayFrame(); };
/**
* Returns the current displayed frame.
*/
virtual SpriteFrame* displayFrame(void);
virtual SpriteFrame* getDisplayFrame();
/// @} End of frames methods