Merge pull request #2529 from rohankuruvilla/cocosplayer

fixed #2128: Bug fixes in CCBReader.
This commit is contained in:
James Chen 2013-05-07 18:55:38 -07:00
commit 36cc495dd9
3 changed files with 10 additions and 4 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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);
}