Question

As far as I know from Cocos2D 2.0 a 1025*1025 texture does NOT use 4 times more memory than a 1024*1024 texture, just proportionally more.

If I put my textures to an atlas, there is some unused space almost all the time. This is wasted. (Not to mention the iOS5 POT textures memory bug, which makes POT Texture Atlases waste 33% more memory.) But If I just use my textures the way they are, then there is no memory wasted. The only advantage of Texture Atlases in my opinion is the ability to use a SpriteBatchNode. But my app is heavily memory limited, and I only support devices which support NPOT textures. I know that NPOT texture handling is a bit slower, but saving memory is the most important for me.

I might be wrong, please confirm me, or show me why I am wrong. Thank you! :)

Was it helpful?

Solution

You should design for the worst case. Assume the bug always exists, and design your app's memory usage accordingly. There's no telling whether the bug will go away, reappear or an even worse bug introduced with a newer iOS version.

Riding on the brink of full memory usage is not a good idea, you always have to leave a threshold to allow for the occasional oddity. A new iOS version might introduce another bug, take more memory, the user might have apps running in background that use up more memory, there may be a tiny memory leak adding up over time, etc.

Also, CCSpriteBatchNode can be used with any texture, not just texture atlases.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top