mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-03-11 05:21:07 +00:00
engine: simplify force version drawing logic
This commit is contained in:
parent
fa0e7e4369
commit
19582cdf11
@ -2056,16 +2056,13 @@ void Con_DrawVersion( void )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !host.force_draw_version )
|
|
||||||
{
|
|
||||||
if(( cls.key_dest != key_menu && !draw_version ) || CL_IsDevOverviewMode() == 2 || net_graph->value )
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( host.force_draw_version_time > host.realtime )
|
if( host.force_draw_version_time > host.realtime )
|
||||||
host.force_draw_version = false;
|
draw_version = true;
|
||||||
|
|
||||||
if( host.force_draw_version || draw_version )
|
if(( cls.key_dest != key_menu && !draw_version ) || CL_IsDevOverviewMode() == 2 || net_graph->value )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( draw_version )
|
||||||
Q_snprintf( curbuild, MAX_STRING, XASH_ENGINE_NAME " v%i/" XASH_VERSION " (%s-%s build %i)", PROTOCOL_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
|
Q_snprintf( curbuild, MAX_STRING, XASH_ENGINE_NAME " v%i/" XASH_VERSION " (%s-%s build %i)", PROTOCOL_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
|
||||||
else Q_snprintf( curbuild, MAX_STRING, "v%i/" XASH_VERSION " (%s-%s build %i)", PROTOCOL_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
|
else Q_snprintf( curbuild, MAX_STRING, "v%i/" XASH_VERSION " (%s-%s build %i)", PROTOCOL_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ typedef enum
|
|||||||
|
|
||||||
#define GameState (&host.game)
|
#define GameState (&host.game)
|
||||||
|
|
||||||
#define FORCE_DRAW_VERSION_TIME 5.0f // draw version for 5 seconds
|
#define FORCE_DRAW_VERSION_TIME 5.0 // draw version for 5 seconds
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
void DBG_AssertFunction( qboolean fExpr, const char* szExpr, const char* szFile, int szLine, const char* szMessage );
|
void DBG_AssertFunction( qboolean fExpr, const char* szExpr, const char* szFile, int szLine, const char* szMessage );
|
||||||
@ -360,8 +360,7 @@ typedef struct host_parm_s
|
|||||||
qboolean change_game; // initialize when game is changed
|
qboolean change_game; // initialize when game is changed
|
||||||
qboolean mouse_visible; // vgui override cursor control (never change outside Platform_SetCursorType!)
|
qboolean mouse_visible; // vgui override cursor control (never change outside Platform_SetCursorType!)
|
||||||
qboolean shutdown_issued; // engine is shutting down
|
qboolean shutdown_issued; // engine is shutting down
|
||||||
qboolean force_draw_version; // used when fraps is loaded
|
double force_draw_version_time;
|
||||||
float force_draw_version_time;
|
|
||||||
qboolean apply_game_config; // when true apply only to game cvars and ignore all other commands
|
qboolean apply_game_config; // when true apply only to game cvars and ignore all other commands
|
||||||
qboolean apply_opengl_config;// when true apply only to opengl cvars and ignore all other commands
|
qboolean apply_opengl_config;// when true apply only to opengl cvars and ignore all other commands
|
||||||
qboolean config_executed; // a bit who indicated was config.cfg already executed e.g. from valve.rc
|
qboolean config_executed; // a bit who indicated was config.cfg already executed e.g. from valve.rc
|
||||||
|
@ -248,7 +248,6 @@ static void SDLash_KeyEvent( SDL_KeyboardEvent key )
|
|||||||
case SDL_SCANCODE_COMMA: keynum = ','; break;
|
case SDL_SCANCODE_COMMA: keynum = ','; break;
|
||||||
case SDL_SCANCODE_PRINTSCREEN:
|
case SDL_SCANCODE_PRINTSCREEN:
|
||||||
{
|
{
|
||||||
host.force_draw_version = true;
|
|
||||||
host.force_draw_version_time = host.realtime + FORCE_DRAW_VERSION_TIME;
|
host.force_draw_version_time = host.realtime + FORCE_DRAW_VERSION_TIME;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -374,7 +373,6 @@ static void SDLash_ActiveEvent( int gain )
|
|||||||
{
|
{
|
||||||
SNDDMA_Activate( true );
|
SNDDMA_Activate( true );
|
||||||
}
|
}
|
||||||
host.force_draw_version = true;
|
|
||||||
host.force_draw_version_time = host.realtime + FORCE_DRAW_VERSION_TIME;
|
host.force_draw_version_time = host.realtime + FORCE_DRAW_VERSION_TIME;
|
||||||
if( vid_fullscreen->value )
|
if( vid_fullscreen->value )
|
||||||
VID_SetMode();
|
VID_SetMode();
|
||||||
@ -398,8 +396,7 @@ static void SDLash_ActiveEvent( int gain )
|
|||||||
{
|
{
|
||||||
SNDDMA_Activate( false );
|
SNDDMA_Activate( false );
|
||||||
}
|
}
|
||||||
host.force_draw_version = true;
|
host.force_draw_version_time = host.realtime + 2.0;
|
||||||
host.force_draw_version_time = host.realtime + 2;
|
|
||||||
VID_RestoreScreenResolution();
|
VID_RestoreScreenResolution();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -626,7 +623,6 @@ static void SDLash_EventFilter( SDL_Event *event )
|
|||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_RESTORED:
|
case SDL_WINDOWEVENT_RESTORED:
|
||||||
host.status = HOST_FRAME;
|
host.status = HOST_FRAME;
|
||||||
host.force_draw_version = true;
|
|
||||||
host.force_draw_version_time = host.realtime + FORCE_DRAW_VERSION_TIME;
|
host.force_draw_version_time = host.realtime + FORCE_DRAW_VERSION_TIME;
|
||||||
if( vid_fullscreen->value )
|
if( vid_fullscreen->value )
|
||||||
VID_SetMode();
|
VID_SetMode();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user