[quake3-commits] r2311 - in trunk: . code/sdl

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Aug 27 10:52:45 EDT 2012


Author: ztm
Date: 2012-08-27 10:52:41 -0400 (Mon, 27 Aug 2012)
New Revision: 2311

Modified:
   trunk/README
   trunk/code/sdl/sdl_glimp.c
Log:
Added r_mode -2, uses desktop resolution. Bug #5408. Patch by Andrei Drexler and myself.

Modified: trunk/README
===================================================================
--- trunk/README	2012-08-24 18:04:44 UTC (rev 2310)
+++ trunk/README	2012-08-27 14:52:41 UTC (rev 2311)
@@ -273,6 +273,8 @@
                                       captured using screenshotJPEG
   r_aviMotionJpegQuality            - Controls quality of video capture when
                                       cl_aviMotionJpeg is enabled
+  r_mode -2                         - This new video mode automatically uses the
+                                      desktop resolution.
 
 New commands
   video [filename]        - start video capture (use with demo command)

Modified: trunk/code/sdl/sdl_glimp.c
===================================================================
--- trunk/code/sdl/sdl_glimp.c	2012-08-24 18:04:44 UTC (rev 2310)
+++ trunk/code/sdl/sdl_glimp.c	2012-08-27 14:52:41 UTC (rev 2311)
@@ -250,8 +250,26 @@
 
 	ri.Printf (PRINT_ALL, "...setting mode %d:", mode );
 
-	if ( !R_GetModeInfo( &glConfig.vidWidth, &glConfig.vidHeight, &glConfig.windowAspect, mode ) )
+	if (mode == -2)
 	{
+		// use desktop video resolution
+		if( videoInfo->current_h > 0 )
+		{
+			glConfig.vidWidth = videoInfo->current_w;
+			glConfig.vidHeight = videoInfo->current_h;
+		}
+		else
+		{
+			glConfig.vidWidth = 480;
+			glConfig.vidHeight = 640;
+			ri.Printf( PRINT_ALL,
+					"Cannot determine display resolution, assuming 640x480\n" );
+		}
+
+		glConfig.windowAspect = (float)glConfig.vidWidth / (float)glConfig.vidHeight;
+	}
+	else if ( !R_GetModeInfo( &glConfig.vidWidth, &glConfig.vidHeight, &glConfig.windowAspect, mode ) )
+	{
 		ri.Printf( PRINT_ALL, " invalid mode\n" );
 		return RSERR_INVALID_MODE;
 	}



More information about the quake3-commits mailing list