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,13 +132,12 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu
|
|||
ow = abs(ow);
|
||||
oh = abs(oh);
|
||||
// create frame
|
||||
spriteFrame = new SpriteFrame();
|
||||
spriteFrame->initWithTexture(texture,
|
||||
Rect(x, y, w, h),
|
||||
false,
|
||||
Vec2(ox, oy),
|
||||
Size((float)ow, (float)oh)
|
||||
);
|
||||
spriteFrame = SpriteFrame::createWithTexture(texture,
|
||||
Rect(x, y, w, h),
|
||||
false,
|
||||
Vec2(ox, oy),
|
||||
Size((float)ow, (float)oh)
|
||||
);
|
||||
}
|
||||
else if(format == 1 || format == 2)
|
||||
{
|
||||
|
@ -155,13 +154,12 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu
|
|||
Size sourceSize = SizeFromString(frameDict["sourceSize"].asString());
|
||||
|
||||
// create frame
|
||||
spriteFrame = new SpriteFrame();
|
||||
spriteFrame->initWithTexture(texture,
|
||||
frame,
|
||||
rotated,
|
||||
offset,
|
||||
sourceSize
|
||||
);
|
||||
spriteFrame = SpriteFrame::createWithTexture(texture,
|
||||
frame,
|
||||
rotated,
|
||||
offset,
|
||||
sourceSize
|
||||
);
|
||||
}
|
||||
else if (format == 3)
|
||||
{
|
||||
|
@ -186,17 +184,15 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu
|
|||
}
|
||||
|
||||
// create frame
|
||||
spriteFrame = new SpriteFrame();
|
||||
spriteFrame->initWithTexture(texture,
|
||||
Rect(textureRect.origin.x, textureRect.origin.y, spriteSize.width, spriteSize.height),
|
||||
textureRotated,
|
||||
spriteOffset,
|
||||
spriteSourceSize);
|
||||
spriteFrame = SpriteFrame::createWithTexture(texture,
|
||||
Rect(textureRect.origin.x, textureRect.origin.y, spriteSize.width, spriteSize.height),
|
||||
textureRotated,
|
||||
spriteOffset,
|
||||
spriteSourceSize);
|
||||
}
|
||||
|
||||
// add sprite frame
|
||||
_spriteFrames.insert(spriteFrameName, spriteFrame);
|
||||
spriteFrame->release();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue