From 5be4c556f6240780e91aa1f73b17ffae6ad51e19 Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Mon, 7 Mar 2011 15:51:17 +0000 Subject: [PATCH] r_mode -2 (desktop resolution) --- reaction/code/sdl/sdl_glimp.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/reaction/code/sdl/sdl_glimp.c b/reaction/code/sdl/sdl_glimp.c index f9e677d5..c861b340 100644 --- a/reaction/code/sdl/sdl_glimp.c +++ b/reaction/code/sdl/sdl_glimp.c @@ -250,7 +250,15 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder) ri.Printf (PRINT_ALL, "...setting mode %d:", mode ); - if ( !R_GetModeInfo( &glConfig.vidWidth, &glConfig.vidHeight, &glConfig.windowAspect, mode ) ) + if (mode == -2) + { + glConfig.vidWidth = videoInfo->current_w; + glConfig.vidHeight = videoInfo->current_h; + glConfig.windowAspect = displayAspect; + fullscreen = qtrue; + noborder = qtrue; + } + else if ( !R_GetModeInfo( &glConfig.vidWidth, &glConfig.vidHeight, &glConfig.windowAspect, mode ) ) { ri.Printf( PRINT_ALL, " invalid mode\n" ); return RSERR_INVALID_MODE; @@ -475,6 +483,14 @@ static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qbool fullscreen = qfalse; } + if (!fullscreen && mode == -2) + { + ri.Printf( PRINT_ALL, "Windowed not allowed with r_mode -2\n"); + ri.Cvar_Set( "r_fullscreen", "1" ); + r_fullscreen->modified = qfalse; + fullscreen = qtrue; + } + err = GLimp_SetMode(mode, fullscreen, noborder); switch ( err )