dxx-rebirth/similar
Kp ca804d5186 Clear canvas to fix missing exit tunnel movie
Global variable `grd_curcanv` is set to a variety of canvases, some of
which are local stack variables.  Use of global variables in this way is
fragile, but works as long as the global is not used beyond the life of
the backing local.

Unfortunately, some existing uses do access the canvas beyond the
lifetime of the backing local.  Playing movies sets the font of the
current canvas.  If the current canvas is an expired stack variable,
setting the font overwrites other stack data.  This data corruption
causes various symptoms, such as inability to play the escape tunnel
movie.

Prior to 03cca2b3dc, the corruption on
playing the endlevel movie had no user-visible effect.  That commit
created a large local variable, which changed stack layout.  Starting
with that commit, the corruption causes the movie to play as all black.

Fix this, and protect against some other data corruption possiblities,
by clearing the global when the local goes out of scope.

Reported-by: Havner <https://github.com/dxx-rebirth/dxx-rebirth/issues/345> (only as cutscene failure to play, not as the underlying corruption issue)
2017-11-05 20:49:08 +00:00
..
2d Use constexpr integral_constant for various magic numbers 2017-10-14 17:10:30 +00:00
3d Use constexpr integral_constant for various magic numbers 2017-10-14 17:10:30 +00:00
arch Clear canvas to fix missing exit tunnel movie 2017-11-05 20:49:08 +00:00
editor Simplify calls to gr_set_default_canvas 2017-11-05 20:49:08 +00:00
main Clear canvas to fix missing exit tunnel movie 2017-11-05 20:49:08 +00:00
misc Move various SDL-only scanline functions to !DXX_USE_OGL 2017-11-01 02:01:20 +00:00