Page 1 of 1

Loading system and OnNextFrame

PostPosted: Sep 15, 2010 @ 2:54am
by totoch
Hi,

I am making a class (a module) which loads the assets of my game for a specific "screen".
While the screen's assets are being loaded, I would like to have a loading screen (with some animated/translated/rotated/whatever surfaces) that plays all along. My EdgeMain/ClassMain class deals with all the logic (animating, translating, etc.), so I would have to call it everytime a number (1 to 10 for example) of assets have been loaded.

I was wondering what was the way to do so ? Should I call by hand the OnNextFrame of my ClassMain class ? The problem is I would have to give a timedelta (see the function's declaration) and I would have to give a timedelta (which would have to be 0 or an arbitrary number as my Asset Loading Module doesn't keep track of the timedelta).

Is this timedelta overwritten by the EdgeLib ? (I which would be great, because I use it for my time-based animation and rotation).
Do I have to (and must) use my module's OnNextFrame function of my Asset Loading Module(which I would rather avoid) to do the loading of my assets so as to have a timedelta to give to my ClassMain ?

Well, that's pretty much all, and oh, I hope I've been clear. :)

Thank you very much

Re: Loading system and OnNextFrame

PostPosted: Sep 16, 2010 @ 3:33pm
by edge
Hi,

The best way to handle this is to use an array of loading tasks. Each frame you will handle one of these tasks and update the progress bar. The task list could be an enum, and handling each task can be handled by a list of switch/case statements.

Re: Loading system and OnNextFrame

PostPosted: Sep 17, 2010 @ 11:20pm
by totoch
Thank you, but this does not really answe my question unfortunately.
What I was asking was : am I obliged to do all my loading in the OnNextFrame method of my LoaderModule (so as to have a timedelta to give) that will in turn call my ClassMain's OnNextFrame function (with the timedelta).
Isn't it possible just to call the ClassMain's OnNextFrame function without a timedelta ?
I'd like to limit the OnNextFrame method only to Run() stuff, not to also Load() it. That's the principal goal of a "main loop".

Looking forward for your answer,
Thanks again.

Re: Loading system and OnNextFrame

PostPosted: Sep 28, 2010 @ 7:32pm
by edge