views:

85

answers:

0

I first store the 3 value into a pair of map like this:

void AddMenuAtlasTexture( int tag, const char* filename, const char* textureName )
{
 map<const char*, const char*> _item;
 _item.insert(pair<const char*, const char*>(filename, textureName));

 m_texturesToLoad.insert(pair<int, map<const char*, const char*> >(tag, _item));
};

then I pass the value to another function like this:

map<const char*, const char*>::iterator _content;
int _tag = (*m_texturesToLoadIterator).first;
_content = (*m_texturesToLoadIterator).second.begin();
AtlasManagerSingleton->AddAtlas((*_content).first, (*_content).second, _tag);

the "textureName" is an absolute path like this kind: "/Users/eddy/Library/Application Support/iPhone Simulator/User/Applications/5FDE0091-2E93-42FE-BB62-05A16429551D/Ranch.app/../Documents/shop_tex.png"

my problem is the first function can get the "textureName" right, but the second function "AddAtlas" can not get the path, the "(*_content).second" is NULL.

and the "AddAtlas" prototype is:

void AtlasManager :: AddAtlas( const char *a_configFile, const char *a_spriteName, int a_nKey ) 

I develop this in iPhone dev using XCode.