GLBasic forum

Codesnippets => Code Snippets => Topic started by: MrTAToad on 2011-Feb-13

Title: Animated background
Post by: MrTAToad on 2011-Feb-13
Originally this was a WMV movie - it was not easy trying to convert it to a set of PNG files, but I eventually did it :)  The file is 101Mb and can be downloaded here : www.un-map.com/TestProgram.exe

Unfortunately I cant remember where I got it from - there is a site that allows you to download royalty-free background WMV's - which is where I got this from.

I'm using Setup&Go, so on Windows 7 you'll need to use Administator mode and manually delete the Test Program directory yourself, after you have finished with it.

One of two things will happen when you run the little program - your computer will grind to a halt loading in 208 720 x 576 files or it will be able to handle it deftly :)  Mine loads and displays it okay, but there is lots of disk activity during the display.

One side effect seems to be caused by the ESET AV program - it seems to have caused a PRE_LEAK_WOW64 Event Message...

I was originally going to use this for Spots, but quickly decided against it for obvious reasons :)



[attachment deleted by admin]
Title: Re: Animated background
Post by: D2O on 2011-Feb-13
Hmmm,

no Startmenü
no Desktopicon
no Running.

Movi ~30mb:
http://www.deuteriumoxid.com/glbasic/Recorder-02-13_101741.flv (http://www.deuteriumoxid.com/glbasic/Recorder-02-13_101741.flv)

Title: Re: Animated background
Post by: MrTAToad on 2011-Feb-13
There is no desktop or startmenu icon.  Did you start the program manually ?  If so, did you get a black screen ?
Title: Re: Animated background
Post by: Ian Price on 2011-Feb-13
I can't even get it to install 1%. The moment I press install it brings up an error message in German(?) - see attachment.


Forgot to mention I'm using Windows 7 and I have Admin priviliges/mode.

[attachment deleted by admin]
Title: Re: Animated background
Post by: D2O on 2011-Feb-13
Sorry for my bad english.

Quote from: MrTAToad on 2011-Feb-13
Did you start the program manually ?
Yes

Quote from: MrTAToad on 2011-Feb-13
If so, did you get a black screen ?
Yes, the screen are black and in Windowscreen, no fullscreen.

If this only Win7 ?
My OS is XP.

How i can start this program otherwise if not Manuel?
Title: Re: Animated background
Post by: MrTAToad on 2011-Feb-13
QuoteYes, the screen are black and in Windowscreen, no fullscreen.
If nothing is displayed after a short while, then it sounds like your system cant handle it...

QuoteI can't even get it to install 1%
It does sound like Setup&Go isn't totally compatible with Windows 7

That can be easily dealt with :)

Its actually a rather good stress test - I did get a run-time error when running it earlier, although it was only once...  :blink:  It was most likely due to the virtual disk space needing to be expanded

Try this one : http://www.un-map.com/Anim.app.rar

It now has a count showing which image has been loaded

Code (glbasic) Select
LOCAL loop%,x%,y%

LIMITFPS -1

SETSHOEBOX "Media.sbx",""
FOR loop%=0 TO 208
PRINT "Loading : "+loop%,0,0,TRUE
LOADSPRITE RIGHT$("0000"+loop%,4)+".png",loop%
GETSPRITESIZE loop%,x%,y%
IF x%=0 OR y%=0
PRINT "Unable to load sprite "+loop%,0,100
ENDIF
SHOWSCREEN
NEXT
SETSHOEBOX "",""

loop%=0
WHILE TRUE
DRAWSPRITE loop%,0,0
SHOWSCREEN
SLEEP 1
INC loop%
IF loop%>208 THEN loop%=0
WEND
Title: Re: Animated background
Post by: D2O on 2011-Feb-13
Hi, works fine in Windowsmode :)

But,
if animation 360° done,
then the animation is still standing for one sec.
Title: Re: Animated background
Post by: MrTAToad on 2011-Feb-13
Thats the computer most likely expanding your swap file.
Title: Re: Animated background
Post by: Ian Price on 2011-Feb-13
After a nice smooth start (about 30secs) the background starts to run at about a million miles an hour. Nice while it was watchable though. :)
Title: Re: Animated background
Post by: MrTAToad on 2011-Feb-13
Interesting - probably lots of hard drive activity causing it
Title: Re: Animated background
Post by: BumbleBee on 2011-Feb-13
While loading i went for a walk.    =D  ;)  It runs fast, faster, dead slow. Less than 10 FPS but i looks very nice :)

Cheers 
Title: Re: Animated background
Post by: MrTAToad on 2011-Feb-13
Its why it cant really be used... :)
Title: Re: Animated background
Post by: Moebius on 2011-Feb-14
Looks very nice.  It was <sarcasm strength="mild">definitely</sarcasm> worth waiting an hour for it to download, 5 minutes for it to load, and another 5 for it to run through a few times! :D
Somehow I can see why you wouldn't use it...
Title: Re: Animated background
Post by: phaelax on 2011-Feb-16
Only took about a minute for it to load for me, but every couple of seconds the animation would freeze or slow down immensely then kick back up to a smooth frame rate.
Title: Re: Animated background
Post by: MrTAToad on 2011-Feb-16
Its not surprising - 208 * 720 x 756 - its around a 1GB of animation there :)