[iortcw] 37/95: All: Revert to vanilla fullscreen toggle behavior
Simon McVittie
smcv at debian.org
Fri Sep 8 10:41:58 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 50cf8661804154f570c16efd39e27bda95de8ca6
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Sun Feb 26 05:09:33 2017 -0500
All: Revert to vanilla fullscreen toggle behavior
---
MP/code/sdl/sdl_glimp.c | 28 +++++++++-------------------
SP/code/sdl/sdl_glimp.c | 28 +++++++++-------------------
2 files changed, 18 insertions(+), 38 deletions(-)
diff --git a/MP/code/sdl/sdl_glimp.c b/MP/code/sdl/sdl_glimp.c
index fa405d1..9bae76b 100644
--- a/MP/code/sdl/sdl_glimp.c
+++ b/MP/code/sdl/sdl_glimp.c
@@ -908,8 +908,8 @@ void GLimp_EndFrame( void )
if( r_fullscreen->modified )
{
- qboolean fullscreen;
- qboolean needToToggle;
+ qboolean fullscreen;
+ qboolean needToToggle;
// Find out the current state
fullscreen = !!( SDL_GetWindowFlags( SDL_window ) & SDL_WINDOW_FULLSCREEN );
@@ -926,26 +926,16 @@ void GLimp_EndFrame( void )
if( needToToggle )
{
- // Always issue a vid_restart when going to windowed instead of calling SDL_SetWindowFullscreen()
- // Otherwise sdl_input.c::IN_ProcessEvents() will catch a SDL_WINDOWEVENT_RESIZED event
- // That will alter user resolution cvars and issue a vid_restart anyway
- qboolean needVidRestart = qtrue;
-
- if (!fullscreen)
- {
- // Issue a vid_restart if SDL_SetWindowFullscreen() doesn't work
- needVidRestart = SDL_SetWindowFullscreen(SDL_window, SDL_WINDOW_FULLSCREEN) < 0;
- Com_Printf( "Switching to fullscreen rendering\n" );
- }
- else
- {
+ // 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");
}
- if (needVidRestart)
- ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
-
- ri.IN_Restart( );
+ ri.IN_Restart( );
}
r_fullscreen->modified = qfalse;
diff --git a/SP/code/sdl/sdl_glimp.c b/SP/code/sdl/sdl_glimp.c
index fa405d1..9bae76b 100644
--- a/SP/code/sdl/sdl_glimp.c
+++ b/SP/code/sdl/sdl_glimp.c
@@ -908,8 +908,8 @@ void GLimp_EndFrame( void )
if( r_fullscreen->modified )
{
- qboolean fullscreen;
- qboolean needToToggle;
+ qboolean fullscreen;
+ qboolean needToToggle;
// Find out the current state
fullscreen = !!( SDL_GetWindowFlags( SDL_window ) & SDL_WINDOW_FULLSCREEN );
@@ -926,26 +926,16 @@ void GLimp_EndFrame( void )
if( needToToggle )
{
- // Always issue a vid_restart when going to windowed instead of calling SDL_SetWindowFullscreen()
- // Otherwise sdl_input.c::IN_ProcessEvents() will catch a SDL_WINDOWEVENT_RESIZED event
- // That will alter user resolution cvars and issue a vid_restart anyway
- qboolean needVidRestart = qtrue;
-
- if (!fullscreen)
- {
- // Issue a vid_restart if SDL_SetWindowFullscreen() doesn't work
- needVidRestart = SDL_SetWindowFullscreen(SDL_window, SDL_WINDOW_FULLSCREEN) < 0;
- Com_Printf( "Switching to fullscreen rendering\n" );
- }
- else
- {
+ // 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");
}
- if (needVidRestart)
- ri.Cmd_ExecuteText(EXEC_APPEND, "vid_restart\n");
-
- ri.IN_Restart( );
+ ri.IN_Restart( );
}
r_fullscreen->modified = qfalse;
--
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