screen_init needs dealt with/room transition flicker

Reporter: RobertBColton  |  Status: open  |  Last Modified: September 24, 2018, 05:18:54 PM

I've already deduplicated screen_redraw in #1311 but screen_init still needs to go that way.

First of all, I'm not even sure the purpose of screen_init when we already have both EnableDrawing and graphicssystem_initialize. It seems like one of these three should just go away.

Second, at the very least screen_init does not need duplicated for all of the graphics systems and can safely be moved to general. First, somebody will have to write a version that calls the user/generic functions to set the drawing state.

Here's some things screen_init does in ENIGMA that GM doesn't do and need fixed too:

  • Drawing color/alpha/other state should NOT be reset on room transition
  • The previous room drawing should not be cleared until the next draw event
  • <
RobertBColton  
Ok, I made a test case for the room transition issues: room-transition-state-test.zip

In the test you can just press spacebar to go to the next room. There are actually more issues than just the flicker, we are also unnecessarily and incorrectly resetting the render state (draw color back to white and alpha back to 1.0).

This is what occurs in GM8.1 and GMSv1.4:

  • window appears but room is black for 1 second
  • "hello! 0" appears in the italic font with a reddish transparent coloring
  • Press spacebar and the image stays the same for 1 second
  • "hello! 1" appears in the italic font with a reddish transparent coloring

This is what occurs in ENIGMA master:

  • window does not appear at all for 1 second
  • "hello! 0" appears in the italic font with a reddish transparent coloring
  • Press spacebar and the room goes black for 1 second
  • "hello! 1" appears in the italic font but white and transparent

I know this is not a regression because ENIGMA has had screen_init for a very long time. We just need to stop calling it during a room transition and once at game start.

RobertBColton  

Even though the transition flicker has been fixed by #1387, this is staying open until the state cleanup happens. There's no need to have screen_init duplicated in each graphics system.
Please sign in to post comments, or you can view this issue on GitHub.