I'm currently loading entire levels synchronously, which is causing the game to freeze while everything is loaded and set up. Ideally I need to show a small animation or message while the level is loading and keep the game responsive.
I'm already have asynchronous file I/O implemented at the lowest level, but I'm not currently making proper use of it - my resource loader classes just request an asynchronous read and then immediately wait for completion.
It seems this asynchronous file I/O isn't the solution though - one level worth of data is roughly 20 Mb, which is read from disk very quickly. The code that's eating up cycles appears to be parsing XML and texture data for the objects and materials.
I was wondering if anyone can suggest a way of solving this? I might need a separate thread to parse the data, but this is likely to get tangled. If there's a simpler mechanism I'd prefer to give that a try first.
Also, perhaps importantly, I don't need to stream anything while the game is running - this is purely a load-time problem. Can anyone give their opinion?
Many thanks for any assistance!
In case it is helpful, this is what my existing resource system looks like. There might be a way to modify it to load asynchronously. Any class can be used as a resource - plugging it in just involves specialising the ResourceLoader<T> template for that class.
Edited by Telios, 13 August 2012 - 11:52 AM.