I've not yet found where are the methods in the source, someone know where they are (I saw currently 2 methods there in the API docs)
Code: Select all
virtual bool loadScene (const c8 *filename, ISceneUserDataSerializer *userDataSerializer=0)=0
Loads a scene. Note that the current scene is not cleared before.
Perhaps the idea is already implemented. What is the ISceneUserDataSerializer?
Here is the idea:
Creating new functions to load scenes, but in step (a per node loader with status).
The current problem I face, is that if I have a big scene (And in my project, I'm sure, the levels will take some time to load) we don't have any feedback and it will leave use with the impression the application is "stuck".
So if a command loaded a level but PER NODE and had some feedback info on the next node that could be loaded and the amount loaded (ex: node 5 on 203). We could create some feedback to let the user know the application is still alive. (It will not help if the mesh is very big, but at least it's a start)
The functions could be created like that (should not replace the older ones for keeping compatibility):
loadScene(const c8 *filename, NodeLoader * loader)
Will load the entire xml file in memory and parse the nodes and put it in the new class NodeLoader.
Once it has been retrieved and the NodeLoader has the info we could then do this:
int currentNode()
Retrieve the position of the current loaded node
int lastNode()
Retrieve the position of the last node in the XML
string nextNodeType()
Retrieve the next node type (Occtree, Animated mesh, skybox, etc.)
c8 nextFilename()
Retrieve the next loading node filename (So you could use the file system to check for the filesize), if the file is big, put a message telling "wait"
bool loadNextNode()
Will load the next scene node and give a return value if the node as been successfully loaded
Once the loading is complete, you would need to destroy(delete) the object (NodeLoader)
I think that in the future I could be able to do this, I would surely need some help to clean the code because, I'm still learning how to code properly in C++. I'll still have to check the source for the current functions because all of the needed code is almost there. I think it would need to be double or tripple checked, because such a source done by a begginer like me could be full of memory leaks as I think memory should be allocated by the heap. (To keep the object data)
Could this be possible or there is a much more efficient way to load a scene with ways to get info at each loaded node?
At first I could at least propose this as a feature request for the next IRRlicht release if the idea is good.