Arima - your example could double the peak texture memory usage. Take your example but going from level 1 to level 2 instead, which use different image sets (e.g. level 1 is "desert" world, level 2 is "ice" world).
Currently the C2 engine efficiently manages the peak memory usage like this. When switching layout:
- the engine stops running
- any images used on level 1 but not used on level 2 are released
- then any images used on level 2 but not used on level 1 are loaded
- then level 2 begins running
Therefore the peak memory usage is never higher than what level 1 or level 2 would use by themselves. This pretty much can only happen because the engine stops running while this happens, so it doesn't suddenly need an image after releasing it.
If you can load the next layout's images before the current layout finishes, you end up with a pattern like this:
- level 1's images are in memory
- you request to load level 2's images while level 1 keeps running
- briefly, both level 1 and level 2's images are in memory - this could be up to double the memory usage
- when switching to level 2, level 1's images are released and memory usage goes back down
For any games close to the memory limit of the system, this would probably crash the game when it changes layout.
For previewing, it's a different matter really. Maybe we could do something to speed it up, but it's a little complicated: you can't create objects from other layouts or go to a different layout until the rest of the game finishes loading. That could result in some weird preview issues. An advantage of loading the entire game in preview mode is you can jump to any layout at any time.