mirror of https://github.com/axmolengine/axmol.git
Fixed #5533: Fix usage of new SpriteFrame in engine
This commit is contained in:
parent
92a33225ff
commit
8bc531a0fb
|
@ -114,7 +114,7 @@ public:
|
|||
// Overrides
|
||||
virtual SpriteFrame *clone() const override;
|
||||
|
||||
//CC_CONSTRUCTOR_ACCESS:
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
/**
|
||||
* @lua NA
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue