PDA

View Full Version : Animation or Progressbar while loading stuff - how?



Firlefanz
17-01-2006, 08:32 AM
Hello,

I am having a scene that shows wile loading imagelists or 3D objects and textures:


procedure TCommandoForm.do_loadingscene;
var no: integer;
begin
if boolloaded=false then begin
no:=random(9);
if (no=0) or (lastscene=d3dlogo) then play_oggspeech('MC-please-stand-by-dist.ogg') else
if no=1 then play_oggspeech('funk-dudel-dist.ogg') else
if no=2 then play_oggspeech('funk-dudel-echo.ogg') else
if no=3 then play_oggspeech('MC-pwease-stand-by1b-dist.ogg') else
if no=4 then play_oggspeech('MC-pwease-stand-by2-dist.ogg') else
if no=5 then play_oggspeech('MC-pwease-stand-by3-dist.ogg') else
if no=6 then play_oggspeech('MC-pwease-stand-by4b-dist.ogg') else
if no=7 then play_oggspeech('MC-pwease-stand-by5-dist.ogg') else
if no=8 then play_oggspeech('MC-pwease-stand-by6b-dist.ogg');
boolloaded:=true;
end;
xenScreen.BeginRender;
xenScreen.ClearScreen(0,0,0,0);
set_camera;
draw_skymap;
set_sunlight;
draw_asteroids(false);
xenscreen.device.setrenderstate(d3drs_alphablenden able,dword(true));
xenscreen.Device.setTextureStageState(0, D3DTSS_COLOROP,D3DTOP_modulate);
xenscreen.Device.setTextureStageState(0, D3DTSS_COLORARG1, D3DTA_texture);
xenscreen.Device.setTextureStageState(1, D3DTSS_COLOROP,D3DTOP_modulate);
xenscreen.Device.setTextureStageState(1, D3DTSS_COLORARG1, D3DTA_diffuse);
imagelistloading.ImageList.Items[0].draw(350,350,0 ,0.5,0.5,1,1,255,255,255,255,false,0,bmnormal);
if nextscene=glevelsurface then printmidfast(250,'LOADING SURFACE MISSION...') else
if nextscene=gstormspace then printmidfast(250,'LOADING ASTEROID STORM BONUS MISSION...') else
if nextscene=glevelspace then printmidfast(250,'LOADING SPACE MISSION...') else
if nextscene=gshop then printmidfast(250,'LOADING SHOP AND SPACE MISSION...') else
if nextscene=d3dmap then printmidfast(250,'LOADING 3D XENIDIS MAP') else
if nextscene=d3dintro then printmidfast(250,'LOADING INTRO...') else
if nextscene=gmedicspace then printmidfast(250,'LOADING MEDIC BONUS MISSION');
printmidfast(500,sloadtext);
printmidfast(530,sloadtext2);
xenscreen.EndRender;
end;


Nothing special. The Omegatimer is still enbled.
So it should be called from time to time.
but it does not, it is called one time and shows a screen but the when I start loading, it is not called anymore by the timer. I would like to have a progressbar here but it wont move.

In the routine where I load all the needed stuff, I added some application.ProcessMessages;
between two loadings but does not seem to help?
How do I get the timer also working when loading imagelists or 3D stuff?

Thanks,
firle

Firlefanz
18-01-2006, 06:19 PM
No Problem, I am just calling do_loadingscene now manually after loading each single imagelist and then it slowly moves. :wink:

Firle

savage
18-01-2006, 06:39 PM
Another suggestion would be to have the another thread which checks and reports on progress.