[iortcw] 24/95: All: Always exec a vid_restart when r_fullscreen is toggled

Simon McVittie smcv at debian.org
Fri Sep 8 10:41:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to tag 1.51
in repository iortcw.

commit 2e6b6c5a04d97fd89a6b62fa6a0b365bbdcb8e51
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Sun Jan 29 06:43:27 2017 -0500

    All: Always exec a vid_restart when r_fullscreen is toggled
---
 MP/code/sdl/sdl_glimp.c | 12 +++++++-----
 SP/code/sdl/sdl_glimp.c | 12 +++++++-----
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/MP/code/sdl/sdl_glimp.c b/MP/code/sdl/sdl_glimp.c
index cc19043..45627ad 100644
--- a/MP/code/sdl/sdl_glimp.c
+++ b/MP/code/sdl/sdl_glimp.c
@@ -910,7 +910,6 @@ void GLimp_EndFrame( void )
 	{
 		int         fullscreen;
 		qboolean    needToToggle;
-		qboolean    sdlToggled = qfalse;
 
 		// Find out the current state
 		fullscreen = !!( SDL_GetWindowFlags( SDL_window ) & SDL_WINDOW_FULLSCREEN );
@@ -927,11 +926,14 @@ void GLimp_EndFrame( void )
 
 		if( needToToggle )
 		{
-			sdlToggled = SDL_SetWindowFullscreen( SDL_window, r_fullscreen->integer ) >= 0;
-
-			// SDL_WM_ToggleFullScreen didn't work, so do it the slow way
-			if( !sdlToggled )
+			// Need the vid_restart here since r_fullscreen is only latched
+			if( fullscreen ) {
+				Com_Printf( "Switching to windowed rendering\n" );
+				ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
+			} else {
+				Com_Printf( "Switching to fullscreen rendering\n" );
 				ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
+			}
 
 			ri.IN_Restart( );
 		}
diff --git a/SP/code/sdl/sdl_glimp.c b/SP/code/sdl/sdl_glimp.c
index cc19043..45627ad 100644
--- a/SP/code/sdl/sdl_glimp.c
+++ b/SP/code/sdl/sdl_glimp.c
@@ -910,7 +910,6 @@ void GLimp_EndFrame( void )
 	{
 		int         fullscreen;
 		qboolean    needToToggle;
-		qboolean    sdlToggled = qfalse;
 
 		// Find out the current state
 		fullscreen = !!( SDL_GetWindowFlags( SDL_window ) & SDL_WINDOW_FULLSCREEN );
@@ -927,11 +926,14 @@ void GLimp_EndFrame( void )
 
 		if( needToToggle )
 		{
-			sdlToggled = SDL_SetWindowFullscreen( SDL_window, r_fullscreen->integer ) >= 0;
-
-			// SDL_WM_ToggleFullScreen didn't work, so do it the slow way
-			if( !sdlToggled )
+			// Need the vid_restart here since r_fullscreen is only latched
+			if( fullscreen ) {
+				Com_Printf( "Switching to windowed rendering\n" );
+				ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
+			} else {
+				Com_Printf( "Switching to fullscreen rendering\n" );
 				ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
+			}
 
 			ri.IN_Restart( );
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list