From 00dab8677a50d232cbafdd703925bafb53dc98a2 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Tue, 2 May 2017 17:12:54 -0400 Subject: [PATCH] - 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. --- src/d_main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/d_main.cpp b/src/d_main.cpp index 36d57e280..bed80387b 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -682,6 +682,13 @@ void D_Display () // [RH] change the screen mode if needed 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. if (Video->SetResolution (NewWidth, NewHeight, NewBits)) { @@ -700,6 +707,7 @@ void D_Display () // Reset the mouse cursor in case the bit depth changed vid_cursor.Callback(); } + vid_renderer = oldrenderer; // [SP] Restore pending vid_renderer setting } // change the view size if needed