fixed #411,support .plist format generated by zwoptex in the last version.

This commit is contained in:
natural-law 2011-03-29 16:59:50 +08:00
parent 987da86c01
commit 87ea85a986
4 changed files with 79 additions and 1 deletions

View File

@ -153,6 +153,32 @@ public:
m_pArray = NULL;
m_bInArray = false;
}
else if (sName == "true")
{
CCString *str = new CCString("1");
if (m_bInArray)
{
m_pArray->addObject(str);
}
else
{
m_pCurDict->setObject(str, m_sCurKey);
}
str->release();
}
else if (sName == "false")
{
CCString *str = new CCString("0");
if (m_bInArray)
{
m_pArray->addObject(str);
}
else
{
m_pCurDict->setObject(str, m_sCurKey);
}
str->release();
}
m_tState = SAX_NONE;
}

View File

@ -149,6 +149,32 @@ void endElement(void *ctx, const XML_Char *name)
m_pArray->release();
m_pArray = NULL;
m_bInArray = false;
}
else if (sName == "true")
{
CCString *str = new CCString("1");
if (m_bInArray)
{
m_pArray->addObject(str);
}
else
{
m_pCurDict->setObject(str, m_sCurKey);
}
str->release();
}
else if (sName == "false")
{
CCString *str = new CCString("0");
if (m_bInArray)
{
m_pArray->addObject(str);
}
else
{
m_pCurDict->setObject(str, m_sCurKey);
}
str->release();
}
m_tState = SAX_NONE;
}

View File

@ -253,6 +253,32 @@ public:
m_pArray = NULL;
m_bInArray = false;
}
else if (sName == "true")
{
CCString *str = new CCString("1");
if (m_bInArray)
{
m_pArray->addObject(str);
}
else
{
m_pCurDict->setObject(str, m_sCurKey);
}
str->release();
}
else if (sName == "false")
{
CCString *str = new CCString("0");
if (m_bInArray)
{
m_pArray->addObject(str);
}
else
{
m_pCurDict->setObject(str, m_sCurKey);
}
str->release();
}
m_tState = SAX_NONE;
}

View File

@ -160,7 +160,7 @@ void CCSpriteFrameCache::addSpriteFramesWithDictionary(CCDictionary<std::string,
CCPoint spriteOffset = CCPointFromString(valueForKey("spriteOffset", frameDict));
CCSize spriteSourceSize = CCSizeFromString(valueForKey("spriteSourceSize", frameDict));
CCRect textureRect = CCRectFromString(valueForKey("textureRect", frameDict));
bool textureRotated = atoi(valueForKey("textureRotated", frameDict)) == 0;
bool textureRotated = atoi(valueForKey("textureRotated", frameDict)) == 0 ? false : true;
// get aliases
CCMutableArray<CCString*> *aliases = (CCMutableArray<CCString*> *) (frameDict->objectForKey(std::string("aliases")));