r_mode -2 (desktop resolution)

This commit is contained in:
Andrei Drexler 2011-03-07 15:51:17 +00:00
parent b16a94f91b
commit 5be4c556f6

View file

@ -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 )