Image Index Anomalies

Reporter: RobertBColton  |  Status: open  |  Last Modified: November 17, 2020, 07:48:20 pm

There are three anomalies with image index currently that I am able to repro. I'm not sure if they are regressions. Somewhat related to #865 and #1021. TheExDeus did mention in #865 that it's redundant for us to modulo image_index in both the events file and in the engine functions, and it could be the cause of these anomalies.

  1. An instance with no sprite in GM8.1 and GMSv1.4 are supposed to increment image index without bound. We can test this with a single object in a room in a new game and the following draw code. The image index doesn't increase in ENIGMA.
  2. An instance with a sprite does allow manually image_index+=1 incrementing the image index past the number of subimages. We can test this by giving the above example object a sprite with one subframe and adding the manual increment to the draw event. In GM8.1 and GMSv1.4 the image index will increase without bound.
  3. Giving -1 subimage index to any sprite drawing function can crash when in a scope that doesn't have a current instance. This includes from engine places like the main event loop or even just the room create code. This specifically effects the implementation of cursor_sprite which still doesn't animate due to this issue.

My testing of eba60ae indicates this is not a regression as polygonz original logic didn't support it either, even though in #2089 it has been removed from the new EGM events.

Please sign in to post comments, or you can view this issue on GitHub.