Fixed #5533: Fix usage of new SpriteFrame in engine

This commit is contained in:
pandamicro 2014-06-10 12:04:20 +08:00
parent 92a33225ff
commit 8bc531a0fb
2 changed files with 18 additions and 22 deletions

View File

@ -114,7 +114,7 @@ public:
// Overrides
virtual SpriteFrame *clone() const override;
//CC_CONSTRUCTOR_ACCESS:
CC_CONSTRUCTOR_ACCESS:
/**
* @lua NA
*/

View File

@ -132,8 +132,7 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu
ow = abs(ow);
oh = abs(oh);
// create frame
spriteFrame = new SpriteFrame();
spriteFrame->initWithTexture(texture,
spriteFrame = SpriteFrame::createWithTexture(texture,
Rect(x, y, w, h),
false,
Vec2(ox, oy),
@ -155,8 +154,7 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu
Size sourceSize = SizeFromString(frameDict["sourceSize"].asString());
// create frame
spriteFrame = new SpriteFrame();
spriteFrame->initWithTexture(texture,
spriteFrame = SpriteFrame::createWithTexture(texture,
frame,
rotated,
offset,
@ -186,8 +184,7 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu
}
// create frame
spriteFrame = new SpriteFrame();
spriteFrame->initWithTexture(texture,
spriteFrame = SpriteFrame::createWithTexture(texture,
Rect(textureRect.origin.x, textureRect.origin.y, spriteSize.width, spriteSize.height),
textureRotated,
spriteOffset,
@ -196,7 +193,6 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu
// add sprite frame
_spriteFrames.insert(spriteFrameName, spriteFrame);
spriteFrame->release();
}
}