Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Akumayo on Tue 19/09/2006 03:46:47

Title: Fatal Exception with RawDrawLine (SOLVED)
Post by: Akumayo on Tue 19/09/2006 03:46:47
Quote
---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x0043B7F9 ; program pointer is -42, ACI version 2.71.894, gtags (24,12)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.

in Fractals (line 29)
from Global script (line 20)


Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OK   
---------------------------

There's the error, here's the line's:

if (iteration == max_iteration) RawSetColor(0);
else RawSetColor(iteration);
RawDrawLine(mx, my, mx, my);


'RawDrawLine' line is 29, the error references it.  I haven't a clue what the problem is.  Ideas?

-Regards, Akumayo

PS:

Aaarrg!
Title: Re: Fatal Exception with RawDrawLine (what'did I do now?... :p)
Post by: Gilbert on Tue 19/09/2006 05:17:06
Can you use a Display() and check what mx and my were when the crash happened ? (Just display them before the RawDrawLine() )

Maybe they're having some ridiculous out-of-bound values?
Title: Re: Fatal Exception with RawDrawLine (what'did I do now?... :p)
Post by: charliechuck on Tue 19/09/2006 12:41:58
I don't know if this is related or not, but when i did my fractal generator, i had problems drawing a line on a single point (i.e same from and to coordinates), it wouldnt work, can't remember if I got an error or it just wouldn't work, so I rawdrawed a box instead (or rectangle) mx,my to mx+1,my+1, the code then overwrites the second pixel on next iteration.

If it's not anything to do with this please ignore me and i apologise.
Title: Re: Fatal Exception with RawDrawLine (what'did I do now?... :p)
Post by: Khris on Tue 19/09/2006 13:32:53
I've successfully used this line: RawDrawLine(sx[c], sy[c], sx[c], sy[c]);
Worked fine, I've used it both to erase and draw snowdrops.
I don't think it matters but the build was 2.71.631.
Title: Re: Fatal Exception with RawDrawLine (what'did I do now?... :p)
Post by: charliechuck on Tue 19/09/2006 13:40:10
I used 2.71 as well, I must have been doing something else wrong and fixed it the same time, sorry for confusing the issue
Title: Re: Fatal Exception with RawDrawLine (what'did I do now?... :p)
Post by: Pumaman on Tue 19/09/2006 22:05:47
You're not calling it from game_start, are you?
Title: Re: Fatal Exception with RawDrawLine (what'did I do now?... :p)
Post by: Akumayo on Wed 20/09/2006 00:55:25
Quote from: Pumaman on Tue 19/09/2006 22:05:47
You're not calling it from game_start, are you?

Umm.... maybe.... does that make for a problem... ehehehe?
(I'll move it, and see if the problem persists)

EDIT:  Fixed, moved to on_key_press, thanks for the help
Title: Re: Fatal Exception with RawDrawLine (SOLVED)
Post by: Gilbert on Wed 20/09/2006 02:30:31
In game_start() most of the stuff aren't initialized, where not even a room is loaded, so there's no background that you can raw draw to.

You can only do simple stuff like initiating variables, or setup some of the engine options.