Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / My Loading Screen function didn't work...How to?

Author
Message
marlou
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location:
Posted: 22nd Feb 2009 15:08
Here's a code of my loading screen..Its on the initialize function.
My loading screen doesn't work and i dont know why..

How do I make or implement a loading screen correctly?



When a person has nothing but a dream, can he dare to dream.
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 22nd Feb 2009 15:10
after the dbPrint() put dbSync();
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 22nd Feb 2009 16:00 Edited at: 22nd Feb 2009 16:26
[First part wrong]

Why don't you do something like this:



And by the way, if you're only loading a couple of small files like this, it's likely that you won't really see the loading screen because it won't take that much time to load.

#ifdef _DEBUG
FixBugs(All);
#endif
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 22nd Feb 2009 16:07 Edited at: 22nd Feb 2009 16:09
Static means it only declares it once, but I don't know if you can only use a variable in a function for one call, or if static keeps it there. If you have a loop and do this:


you would not get 999 repeated lots of times, but 999 all the way down to 1
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 22nd Feb 2009 16:16 Edited at: 22nd Feb 2009 16:27
But won't the boolean just reset once it goes out of scope?
And be set to false again? I tested it and it was always false.

Edit: Ahhh you're right. Well, you learn something new everyday.

#ifdef _DEBUG
FixBugs(All);
#endif
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 22nd Feb 2009 18:37
Quote: "after the dbPrint() put dbSync(); "

If I remember correctly, one had to call dbSync twice for the loading screen to show up, because the first call doesn't display, only sets it up.
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 22nd Feb 2009 19:07
Ah so it does.. I just checked my code, and sure enough, there is 2 dbSync();
Orac
18
Years of Service
User Offline
Joined: 16th May 2006
Location: Billingham
Posted: 23rd Feb 2009 13:12
The initialiize() function is a bit dodgy - you are not returning anything on the first call. You should have a return statement inside the if statement.

If you only need to call it once then why put it in the main loop where it will constantly be called? Your best bet would be to call it once before you enter the loop.



Of all the things I've lost .. I miss my marbles most of all.
marlou
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location:
Posted: 23rd Feb 2009 14:59
Thank you for the help...

Quote: "If you only need to call it once then why put it in the main loop where it will constantly be called? Your best bet would be to call it once before you enter the loop."


Yeah you're right.hehe

I was thinking ahead of myself. I was thinking of many different initializations for my map levels(as if I have that many..hahaha).

I'm still not sure how to implement initializations of different map levels or areas during gameplay. Thanks.

Thanks for the help guys ^__^

When a person has nothing but a dream, can he dare to dream.

Login to post a reply

Server time is: 2024-11-25 15:27:59
Your offset time is: 2024-11-25 15:27:59