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 / LoadAnimation and PlayAnimationToImage

Author
Message
Unkelben
20
Years of Service
User Offline
Joined: 2nd Feb 2004
Location: Montréal, Canada
Posted: 27th Oct 2005 19:59
I use these all the time in my game, problem is, it seems dbPlayAnimationToImage doesn\\\'t wait for the animation to be fully loaded before executing. That results in getting a certain number of black screens before the animation starts. The slower the computer, the longer the black screen.

That really hurts the look of the game, I\\\'d like to be able to go from one animation to another without visual interruption, even if that means waiting a bit longer before getting the new one.

Is there a way to check if the animation is ready to to play before going on?

Jonathan
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 28th Oct 2005 15:41 Edited at: 28th Oct 2005 15:42
Quote: "
even if that means waiting a bit longer before getting the new one.
"


Then find out how much it takes to load with dbTimer(), and use that info to make the program wait and do not play the animation until you know that it is fully loaded.

Or maybe you could pre-load those animations at start-up and keep them loaded until play time, then unload...
Unkelben
20
Years of Service
User Offline
Joined: 2nd Feb 2004
Location: Montréal, Canada
Posted: 28th Oct 2005 18:22
The problem is : how do I know when it's fully loaded? The only way I've found so far is to sample random pixel on the Image generated by PlayAnimationToImage to see if it's something else than 0.

As for the timing, it would be useless becaue it's going to be different from one computer to the other.

Jonathan
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Oct 2005 18:44
LoadAnimation would never really be able to load it all in memory - some AVI files can get very, very big...

What you could do is detect when it starts playing...

Come to the third DarkBasic Pro Sci Fi Con - Be there and be square
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Unkelben
20
Years of Service
User Offline
Joined: 2nd Feb 2004
Location: Montréal, Canada
Posted: 28th Oct 2005 18:50
Right! But how?

Jonathan
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 28th Oct 2005 20:04
providing enough time? Yeah, maybe the time isn't the same in all computers, but you can give a reasonable time, enough for most computers.
If someone has a low-end PC, it is kind of natural to experience some delays, or maybe the animations could be smaller for them.

I know, it's only a workaround
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 29th Oct 2005 03:02
dbAnimationPlaying

Come to the third DarkBasic Pro Sci Fi Con - Be there and be square
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk

Login to post a reply

Server time is: 2024-05-02 20:34:56
Your offset time is: 2024-05-02 20:34:56