I'm developing app in cocos2d. Architecture of the app is pretty simple: Main Menu from which you can choose one from six submenus. After tap submenu starts. In main menu there are lot of textures in high resolution (for Retina iPads) after loading all textures it took approximately 408 MB (450MB max because I'm using removeUnusedTextures method) on Retina iPad.
And now I have two scenarios of optimising textures:
First: I'm loading minimal set of textures in the beginning of the app and when they needed other textures.
Drawback: when loading textures when app it freezes for moment to load data from disk.
Can't load textures using GCD because not all cocos2d classes are thread safe and cocos is grumbling that all textures are not using the same id(CCSprite is not using the same texture id
). (note: I'm loading *.pvr.ccz files with using CCSpriteBatchNode
Second: Loading all textures in the beginning of the scene.
Drawback: when switching between scenes for some time in memory there are resources from two scenes (menu and submenu especially when moving back from submenu to main menu). Because of that memory grows to 600MB and iOS kills app, crash, armageddon.
How to solve this issue? I tried to find something in Internet but without luck.
P.S I used TexturePacker to optimise texture as best as I can.