mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: always read and set vid_fullscreen value directly with it's object
This commit is contained in:
parent
81c752da2b
commit
05560c7607
@ -204,7 +204,7 @@ Default build-depended cvar and constant values
|
||||
#endif // DEFAULT_ALLOWCONSOLE
|
||||
|
||||
#ifndef DEFAULT_FULLSCREEN
|
||||
#define DEFAULT_FULLSCREEN 1
|
||||
#define DEFAULT_FULLSCREEN "1" // must be a string
|
||||
#endif // DEFAULT_FULLSCREEN
|
||||
|
||||
#endif // DEFAULTS_H
|
||||
|
@ -36,7 +36,6 @@ static struct inputstate_s
|
||||
float lastpitch, lastyaw;
|
||||
} inputstate;
|
||||
|
||||
extern convar_t *vid_fullscreen;
|
||||
convar_t *m_pitch;
|
||||
convar_t *m_yaw;
|
||||
|
||||
|
@ -557,11 +557,11 @@ static void SetFullscreenModeFromCommandLine( void )
|
||||
#if !XASH_MOBILE_PLATFORM
|
||||
if( Sys_CheckParm( "-fullscreen" ))
|
||||
{
|
||||
Cvar_Set( "fullscreen", "1" );
|
||||
Cvar_DirectSet( vid_fullscreen, "1" );
|
||||
}
|
||||
else if( Sys_CheckParm( "-windowed" ))
|
||||
{
|
||||
Cvar_Set( "fullscreen", "0" );
|
||||
Cvar_DirectSet( vid_fullscreen, "0" );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ static qboolean VID_SetScreenResolution( int width, int height )
|
||||
void VID_RestoreScreenResolution( void )
|
||||
{
|
||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||
if( !Cvar_VariableInteger("fullscreen") )
|
||||
if( !vid_fullscreen->value )
|
||||
{
|
||||
SDL_SetWindowBordered( host.hWnd, SDL_TRUE );
|
||||
}
|
||||
@ -1117,7 +1117,6 @@ Set the described video mode
|
||||
*/
|
||||
qboolean VID_SetMode( void )
|
||||
{
|
||||
qboolean fullscreen = false;
|
||||
int iScreenWidth, iScreenHeight;
|
||||
rserr_t err;
|
||||
|
||||
@ -1146,14 +1145,13 @@ qboolean VID_SetMode( void )
|
||||
}
|
||||
|
||||
if( !FBitSet( vid_fullscreen->flags, FCVAR_CHANGED ) )
|
||||
Cvar_SetValue( "fullscreen", DEFAULT_FULLSCREEN );
|
||||
Cvar_DirectSet( vid_fullscreen, DEFAULT_FULLSCREEN );
|
||||
else
|
||||
ClearBits( vid_fullscreen->flags, FCVAR_CHANGED );
|
||||
|
||||
SetBits( gl_vsync->flags, FCVAR_CHANGED );
|
||||
fullscreen = Cvar_VariableInteger("fullscreen") != 0;
|
||||
|
||||
if(( err = R_ChangeDisplaySettings( iScreenWidth, iScreenHeight, fullscreen )) == rserr_ok )
|
||||
if(( err = R_ChangeDisplaySettings( iScreenWidth, iScreenHeight, vid_fullscreen->value )) == rserr_ok )
|
||||
{
|
||||
sdlState.prev_width = iScreenWidth;
|
||||
sdlState.prev_height = iScreenHeight;
|
||||
@ -1162,7 +1160,7 @@ qboolean VID_SetMode( void )
|
||||
{
|
||||
if( err == rserr_invalid_fullscreen )
|
||||
{
|
||||
Cvar_SetValue( "fullscreen", 0 );
|
||||
Cvar_DirectSet( vid_fullscreen, "0" );
|
||||
Con_Reportf( S_ERROR "VID_SetMode: fullscreen unavailable in this mode\n" );
|
||||
Sys_Warn("fullscreen unavailable in this mode!");
|
||||
if(( err = R_ChangeDisplaySettings( iScreenWidth, iScreenHeight, false )) == rserr_ok )
|
||||
|
Loading…
x
Reference in New Issue
Block a user