Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Quintaros on Tue 10/01/2006 23:16:32

Title: Illegal exception trying to draw sprite (SOLVED)
Post by: Quintaros on Tue 10/01/2006 23:16:32
While experimenting with the rotate sprite function I got the following error message:

Quote
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x0043B598 ; program pointer is -42, ACI version 2.71.894, gtags (1,130)

(...)

in Global script (line 76)

The code from this part of the script is:


  DynamicSprite *Plane=DynamicSprite.CreateFromExistingSprite(1);
  Plane.Rotate(angle(0,1));
  RawDrawImage(vectors[0].x, vectors[0].y, Plane.Graphic); // line 76
  Plane.Delete();


If anybody could shed some light on the problem it would be greatly apreciated.  It's been quite a while since I've done any scripting so it may be a pretty obvious problem.
Title: Re: Error Message while testing
Post by: Gilbert on Wed 11/01/2006 01:43:06
Hmmm, just wild guess would it be possible that either of vectors[0].x or vectors[0].y be a positive or negative number having VERY large magnitude?
Title: Re: Error Message while testing
Post by: Pumaman on Wed 11/01/2006 19:04:55
What function is that script in? It wouldn't happen to be called from game_start, would it?

If so, remember that no room is loaded when game_start is run, and therefore there is no room background for RawDrawImage to draw onto.
Title: Re: Error Message while testing
Post by: Quintaros on Wed 11/01/2006 21:56:23
It is called from game start.  Thanks for the explanation.