Fatal Exception with RawDrawLine (SOLVED)

Started by Akumayo, Tue 19/09/2006 03:46:47

Previous topic - Next topic

Akumayo

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:
Code: ags

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!
"Power is not a means - it is an end."

Gilbert

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?

charliechuck

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.

Khris

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.

charliechuck

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

Pumaman


Akumayo

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
"Power is not a means - it is an end."

Gilbert

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.

SMF spam blocked by CleanTalk