Panel causing initial slowdown...

Posted By: Keith B [Ambit]

Panel causing initial slowdown... - 09/08/01 02:39

Hi, I'm having a slight problem with a panel... The panel is just a red 1600x1200 PCX that appears briefly then fades out when the player is hit. However, the first time the player is hit, the game freezes for about a second, evidently while the panel is loaded. After that, there's no slowdown.

This is the code:

code:

//Bitmap used for blood in first person mode:
bmap bloodmap=<bldfade.pcx>;

panel bloodscreen
{
bmap=bloodmap;
flags=refresh,d3d;
layer=10;
}

function blood_screen()
{
bloodscreen.visible=on;
bloodscreen.transparent=on;
bloodscreen.alpha=100;
while (bloodscreen.alpha>0)
{
bloodscreen.alpha-=20*time;
wait(1);
}
bloodscreen.visible=off;


Any ideas on how I can get rid of the slowdown when the panel is first used?

Thanks,
Keith

Posted By: Anonymous

Re: Panel causing initial slowdown... - 09/08/01 08:52

"Just" 1600x1200...

Anyway, since you say that there is no slowdown after the first time, just show the panel briefly when starting the game. You can set a lower layer flag and hide it behind a titlescreen or even the A4 / A5 logo, just to get it loaded. This will take a second, but since it is during the "loading" phase, it doesn't matter anyway. From then on, it should work.

Can't think of a better solution...

Gnometech

Posted By: Keith B [Ambit]

Re: Panel causing initial slowdown... - 09/08/01 20:18

Hi Gnometech,

Thanks for your reply. That works perfectly - I guess it's just a matter of loading the PCX into memory before playing.

Thanks again,
Keith

Posted By: Anonymous

Re: Panel causing initial slowdown... - 09/08/01 21:22

ya, thats your problem. it seems to me that there is a wdl function that will do that for ya, but i can't seem to remember it. You could go hunting through the manual, but it sounds like you have it fixed, so if you want that, go right ahead. (i still thing the other way would be cleaner though.... )
-merlingames
© 2024 lite-C Forums