GLBasic forum

Main forum => Bug Reports => Topic started by: FutureCow on 2009-Jan-07

Title: Loadanim/drawanim bug
Post by: FutureCow on 2009-Jan-07
It took me a while to find what appears to be crashing my game in progress.

I had the following :-
LOADANIM "xyz.png",1,100,25
DRAWANIM 1,0,PlayerX,PlayerY

Which worked as expected (my png file had 3 frames in it and was 100 x 75 in total size).

I did some modifications to the png file, and ended up making the file smaller than what LoadAnim had in the command. (eg, the end size of xyz.png was 80x20).
The loadanim didn't cause any problems (which I think it should have).
When it tries to do the drawanim command now it crashes the program with
programname.exe has encountered a problem and needs to close.  We are sorry for the inconvenience.

Thoughts?
Title: Re: Loadanim/drawanim bug
Post by: Moru on 2009-Jan-07
Activate debugging first of all, if the program crashes like that you are not running in debugging mode.

My thought is that the program is crashing because of trying to do what you tell it to do :-)

On the other hand this is basic so it's supposed to inform you clearly of what you are doing wrong since this is a language for beginners.
Title: Re: Loadanim/drawanim bug
Post by: FutureCow on 2009-Jan-07
I did turn on debug, it doesn't do anything. The program window opens then closes again and goes straight back to the IDE. The debug pane on the right hand side remains empty.

So unless I'm missing a vital step in how you run your program in debug (other than "Toggle Debug Mode on" then "Build" and "Run") , debug has a bug too.
Title: Re: Loadanim/drawanim bug
Post by: Moru on 2009-Jan-07
Yes but this is where GLBasic should tell you the error, now we have the real bug :-)
Title: Re: Loadanim/drawanim bug
Post by: FutureCow on 2009-Jan-07
My dodgy code available on request  :P
Title: Re: Loadanim/drawanim bug
Post by: Kitty Hello on 2009-Jan-07
post the image, or at least the image size you use.
Title: Re: Loadanim/drawanim bug
Post by: Moru on 2009-Jan-07
The image size was 80x20 as stated in the first post and I tried it with a png created in photoshop 7 and get the same error. (no error in debug, just exit program, runtime error if I turn off debug)
Title: Re: Loadanim/drawanim bug
Post by: FutureCow on 2009-Jan-07
I've attached the image but as per Moru's post, it seems to happen with any image (at least, any png image). I've just tried it with a 4x9 png file that I loaded with LOADANIM "propeller.png",5,5,9 - the same fault occurs - so it seems to happen regardless of the size.

The 4x9 image is attached. This is the code that will break.
Code :
Code (glbasic) Select

SETSCREEN 1024,768,0
LOADANIM "propeller.png",5,5,9
DRAWANIM 5,0,1,1 // Propeller
SHOWSCREEN
END



[attachment deleted by admin]
Title: Re: Loadanim/drawanim bug
Post by: Kitty Hello on 2009-Jan-07
Yikes!!!
Only one line, and a few pixels left crashed. I've fixed it for the next update.
So far, make the image a bit taller, to force 2 lines.
Title: Re: Loadanim/drawanim bug
Post by: FutureCow on 2009-Jan-07
Are you saying that, for example, if I have a png with 2 animation frames in it that they should always be drawn like

**
**

rather than

**  **

in the file?
Title: Re: Loadanim/drawanim bug
Post by: Kitty Hello on 2009-Jan-08
get an update, it's fixed now.