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->setScaleY(ccbFileNode->getScaleY());
|
||||||
embeddedNode->setTag(ccbFileNode->getTag());
|
embeddedNode->setTag(ccbFileNode->getTag());
|
||||||
embeddedNode->setVisible(true);
|
embeddedNode->setVisible(true);
|
||||||
embeddedNode->ignoreAnchorPointForPosition(ccbFileNode->isIgnoreAnchorPointForPosition());
|
//embeddedNode->ignoreAnchorPointForPosition(ccbFileNode->isIgnoreAnchorPointForPosition());
|
||||||
|
|
||||||
mActionManager->moveAnimationsFromNode(ccbFileNode, embeddedNode);
|
mActionManager->moveAnimationsFromNode(ccbFileNode, embeddedNode);
|
||||||
|
|
||||||
|
|
|
@ -566,8 +566,10 @@ CCSpriteFrame * CCNodeLoader::parsePropTypeSpriteFrame(CCNode * pNode, CCNode *
|
||||||
{
|
{
|
||||||
spriteFile = pCCBReader->getCCBRootPath() + spriteFile;
|
spriteFile = pCCBReader->getCCBRootPath() + spriteFile;
|
||||||
CCTexture2D * texture = CCTextureCache::sharedTextureCache()->addImage(spriteFile.c_str());
|
CCTexture2D * texture = CCTextureCache::sharedTextureCache()->addImage(spriteFile.c_str());
|
||||||
CCRect bounds = CCRectMake(0, 0, texture->getContentSize().width, texture->getContentSize().height);
|
if(texture != NULL) {
|
||||||
spriteFrame = CCSpriteFrame::createWithTexture(texture, bounds);
|
CCRect bounds = CCRectMake(0, 0, texture->getContentSize().width, texture->getContentSize().height);
|
||||||
|
spriteFrame = CCSpriteFrame::createWithTexture(texture, bounds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,11 @@ NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
void CCSpriteLoader::onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader) {
|
void CCSpriteLoader::onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader) {
|
||||||
if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) {
|
if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) {
|
||||||
((CCSprite *)pNode)->setDisplayFrame(pCCSpriteFrame);
|
if(pCCSpriteFrame != NULL) {
|
||||||
|
((CCSprite *)pNode)->setDisplayFrame(pCCSpriteFrame);
|
||||||
|
} else {
|
||||||
|
CCLOG("ERROR: SpriteFrame NULL");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
CCNodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pCCSpriteFrame, pCCBReader);
|
CCNodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pCCSpriteFrame, pCCBReader);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue