enigma-dev/enigma-dev — pull request #71 by forthevin (2013-03-13 15:34:53+00:00)
Title: Room changing 

The commit changes how rooms are changed.
Rooms are now not changed immediately
when a call to one of the room changings is made or when the
room variable is changed, but instead delayed until later.
Once the event execution for the current instance is done,
and rooms are being changed,
control skips the remaining events in the event sequences
and restarts the room.

The changes ensure that room changing is done correctly,
and that room changing can happen in the draw event
(which could not be done in general before).
Current events that have "Instead" in their event description
and thus handle looping through instances themselves have been changed
to fit with the new room changing (the only relevant event
was the draw event). Possible future events (such as "Draw GUI")
should be handled such that it detects if room changing
is done while looping internally through instances, and if so,
stop the looping.

The commit also changes the redrawing of the room
such that the room is redrawn with the color black if
views are active and there is no background color assigned.

The changes have been tested on different games and examples, and everything seems to work properly. Furthermore, room changing in draw events has been tested to work now. The stopping of execution after executing the current instance's event is also in line with the behaviour of GM.