bug in CCTextureCache::textureForKey()

bug in CCTextureCache::textureForKey()
0.0 0


There is a bug on iOS in CCTextureCache when using retina images, the textureForKey() and removeTextureForKey() methods need to strip off the -hd suffix by adding:


after the call to:



You can refer http://code.google.com/p/cocos2d-iphone/issues/detail?can=1&q=1040&colspec=ID%20Type%20Status%20Priority%20Milestone%20Component%20Owner%20Summary&id=1040.
In your code, you should not use ~~hd.
In engine,~~hd will be strip, so the key is stored without -hd.


The call to CCFileUtils::fullPathFromRelativePath(key) will add the -hd suffix, and it won’t find it in the cache because the key will be wrong.


I think you are right.
#1045 is created.

Thank you.