- fixed: Changing fullscreen while vid_renderer != currentrenderer will cause a fake vid_renderer to be passed to the mode change function in order to prevent a crash.

This commit is contained in:
Rachael Alexanderson 2017-05-02 17:12:54 -04:00 committed by Christoph Oelckers
parent e68da4cd6b
commit 00dab8677a

View file

@ -682,6 +682,13 @@ void D_Display ()
// [RH] change the screen mode if needed // [RH] change the screen mode if needed
if (setmodeneeded) if (setmodeneeded)
{ {
int oldrenderer;
extern int currentrenderer;
EXTERN_CVAR(Int, vid_renderer)
oldrenderer = vid_renderer; // [SP] Save pending vid_renderer setting (hack)
if (currentrenderer != vid_renderer)
vid_renderer = currentrenderer;
// Change screen mode. // Change screen mode.
if (Video->SetResolution (NewWidth, NewHeight, NewBits)) if (Video->SetResolution (NewWidth, NewHeight, NewBits))
{ {
@ -700,6 +707,7 @@ void D_Display ()
// Reset the mouse cursor in case the bit depth changed // Reset the mouse cursor in case the bit depth changed
vid_cursor.Callback(); vid_cursor.Callback();
} }
vid_renderer = oldrenderer; // [SP] Restore pending vid_renderer setting
} }
// change the view size if needed // change the view size if needed