Crystal Space
Welcome, Guest. Please login or register.
August 22, 2014, 05:06:21 pm

Login with username, password and session length
Search:     Advanced search
9005 Posts in 2043 Topics by 8333 Members
Latest Member: Deminagomez76
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Image while load level
« previous next »
Pages: [1] Print
Author Topic: Image while load level  (Read 2484 times)
Edu
Guest


Email
« on: September 15, 2005, 01:15:29 pm »

How can I do to see a image and a progress bar while I load my level in CS? My level's load time is about 1 minute and I think than is very useful show an image during this time.

Nowadays I see a black screen while my level is loading.

Thanks.



Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: September 15, 2005, 02:18:55 pm »

How can I do to see a image and a progress bar while I load my level in CS? My level's load time is about 1 minute and I think than is very useful show an image during this time.

Nowadays I see a black screen while my level is loading.

Thanks.





Loading an image is easy. Just display it right before you start loading and it will remain threre during loading. Displaying a progress bar is very hard.

Greetings,
Logged
stephb7
Newbie
*
Posts: 13


View Profile
« Reply #2 on: September 15, 2005, 05:25:25 pm »

I'm also interested in a method to display a progress bar as a big level is loaded.  I looked through the Planeshift source code for guidance.  For reference:

cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/planeshift login
<press ENTER as the password>
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/planeshift co -P planeshift

Basically Planeshift uses a state variable to break down the loading process into multiple steps.  Once a step is finished the next step is started, until everything has been loaded. 

planeshift/src/client/psengine.cpp's psEngine::HandleEvent() is at the heart of this process.  It is frequently called (I'm assuming every frame).  This function calls psEngine::LoadGame(), who handles the various loading steps.  One such step is to parse the xml file that describes the zone/level.

My plan is parse the level xml file twice.  The first time would calculate a value to be used in the progress bar.  This calculated value could be generated on the server and then downloaded to clients.  The second time the xml would be parsed to actually load the level information and display the progress in the progress bar.

The difficulty with this approach is in finding an appropriate measure.  Maybe a mix of meshes and textures.  Once any of those are loaded a message is sent to psEngine::HandleEvent() and the progress bar is updated.

I have not done any coding yet (still reading examples and source files).  Is there a better approach?
Logged
sunshine
Administrator
Sr. Member
*****
Posts: 294


View Profile
« Reply #3 on: September 15, 2005, 05:30:05 pm »

In the past, at least, the engine would respect a supplied iProgressMeter for some aspects of loading (calculating lights, etc.). I don't have the sources in front of me, at present, to check if this is still the case.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #4 on: September 15, 2005, 05:52:13 pm »

In the past, at least, the engine would respect a supplied iProgressMeter for some aspects of loading (calculating lights, etc.). I don't have the sources in front of me, at present, to check if this is still the case.

Yes but unfortunatelly that is only used during lighting calculation which will typically not occur in released games (it will be precalculated). In the future we should contemplate some other way to get progress from the loader.

Greetings,
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.179 seconds with 15 queries.