From 5448bdd392609ecc825f5d52f01d3bb0f4d8f60e Mon Sep 17 00:00:00 2001 From: Walzer Date: Fri, 13 Aug 2010 03:16:04 +0000 Subject: [PATCH] issue #18, debug --- cocos2dx/label_nodes/CCBitmapFontAtlas.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cocos2dx/label_nodes/CCBitmapFontAtlas.cpp b/cocos2dx/label_nodes/CCBitmapFontAtlas.cpp index 43b827ca94..7e8cd236a1 100644 --- a/cocos2dx/label_nodes/CCBitmapFontAtlas.cpp +++ b/cocos2dx/label_nodes/CCBitmapFontAtlas.cpp @@ -396,11 +396,12 @@ namespace cocos2d{ CGSize tmpSize = CGSizeZero; UINT32 len = m_sString.length(); - for(UINT32 i=0; ikerningAmountForFirst(prev, (INT16)c); + kerningAmount = this->kerningAmountForFirst(prev, c); ccBitmapFontDef fontDef = m_pConfiguration->m_pBitmapFontArray[c]; @@ -408,8 +409,9 @@ namespace cocos2d{ CCSprite *fontChar; - fontChar = (CCSprite*)(this->getChildByTag(i)); - if( ! fontChar ) { + fontChar = dynamic_cast(this->getChildByTag(i)); + if( ! fontChar ) + { fontChar = new CCSprite(); fontChar->initWithSpriteSheet(this, rect); this->addChild(fontChar, 0, i);