Added r_mode -2, uses desktop resolution. Bug #5408. Patch by Andrei Drexler and myself.

This commit is contained in:
Zack Middleton 2012-08-27 14:52:41 +00:00
parent a3ae0dc5ef
commit 42d3ff8d1d
2 changed files with 21 additions and 1 deletions

2
README
View file

@ -273,6 +273,8 @@ New cvars
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)

View file

@ -250,7 +250,25 @@ 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)
{
// 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;