Thanks for replying. It’s very bizarre, and the behavior is inconsistent. At one point yesterday, I was loading 20 sheets, but immediately after, I fell back to where I can load only 10, even after a game restart. I don’t think I’m failing to remove any frames from the cache.
I’m not getting any errors, it simply doesn’t show a sprite. In fact, the sprite that I pull from the cache isn’t null, but nothing shows up. However, at some point, when I’m adding sheets, I notice that the size of the cache stops growing.
I use SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName)
to load each sheet, and I added this code to that method:
CCLOG("before, _spriteFrames size = %d, _loadedFileNames size = %d",
_spriteFrames.size(), _loadedFileNames->size());
I also call removeSpriteFramesWithFile() before calling the add method. Is removeSpriteFramesWithFile() synchronous? I’ve been assuming it is.
I don’t have any callbacks.
Later, when I want the sprites, I call
jerseySprite = Sprite::createWithSpriteFrameName(jerseyName);
Right now, I’m wondering if maybe I’m doing something wrong. Say I have this:
- plist named my_image.plist
- png named my_image.png
In the plist, what should the textureFileName be? I’ve tried setting it to my_image.plist and to my_image.png, and even tried just leaving it out.