mirror of https://github.com/axmolengine/axmol.git
Merge pull request #2529 from rohankuruvilla/cocosplayer
fixed #2128: Bug fixes in CCBReader.
This commit is contained in:
commit
36cc495dd9
|
@ -635,7 +635,7 @@ CCNode * CCBReader::readNodeGraph(CCNode * pParent) {
|
|||
embeddedNode->setScaleY(ccbFileNode->getScaleY());
|
||||
embeddedNode->setTag(ccbFileNode->getTag());
|
||||
embeddedNode->setVisible(true);
|
||||
embeddedNode->ignoreAnchorPointForPosition(ccbFileNode->isIgnoreAnchorPointForPosition());
|
||||
//embeddedNode->ignoreAnchorPointForPosition(ccbFileNode->isIgnoreAnchorPointForPosition());
|
||||
|
||||
mActionManager->moveAnimationsFromNode(ccbFileNode, embeddedNode);
|
||||
|
||||
|
|
|
@ -566,9 +566,11 @@ CCSpriteFrame * CCNodeLoader::parsePropTypeSpriteFrame(CCNode * pNode, CCNode *
|
|||
{
|
||||
spriteFile = pCCBReader->getCCBRootPath() + spriteFile;
|
||||
CCTexture2D * texture = CCTextureCache::sharedTextureCache()->addImage(spriteFile.c_str());
|
||||
if(texture != NULL) {
|
||||
CCRect bounds = CCRectMake(0, 0, texture->getContentSize().width, texture->getContentSize().height);
|
||||
spriteFrame = CCSpriteFrame::createWithTexture(texture, bounds);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CCSpriteFrameCache * frameCache = CCSpriteFrameCache::sharedSpriteFrameCache();
|
||||
|
|
|
@ -10,7 +10,11 @@ NS_CC_EXT_BEGIN
|
|||
|
||||
void CCSpriteLoader::onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader) {
|
||||
if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) {
|
||||
if(pCCSpriteFrame != NULL) {
|
||||
((CCSprite *)pNode)->setDisplayFrame(pCCSpriteFrame);
|
||||
} else {
|
||||
CCLOG("ERROR: SpriteFrame NULL");
|
||||
}
|
||||
} else {
|
||||
CCNodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pCCSpriteFrame, pCCBReader);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue