Adding r_mode -2 back

This commit is contained in:
Richard Allen 2012-02-26 15:25:46 +00:00
parent 4d473b2f68
commit 474b074c13

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 )