2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-28 13:02:13 +01:00

engine: client: only load paused icon when requested

This commit is contained in:
Alibek Omarov 2024-11-23 15:01:12 +03:00
parent b316af13d6
commit 689e29bc42
3 changed files with 18 additions and 7 deletions

View File

@ -952,7 +952,11 @@ void CL_DrawHUD( int state )
CL_DrawCenterPrint ();
clgame.dllFuncs.pfnRedraw( cl.time, cl.intermission );
if( showpause.value )
CL_DrawLoadingOrPaused( cls.pauseIcon );
{
if( !cls.pauseIcon )
cls.pauseIcon = SCR_LoadPauseIcon();
CL_DrawLoadingOrPaused( Q_max( 0, cls.pauseIcon ));
}
break;
case CL_LOADING:
CL_DrawLoadingOrPaused( cls.loadingBar );

View File

@ -793,6 +793,18 @@ static void SCR_InstallParticlePalette( void )
}
}
int SCR_LoadPauseIcon( void )
{
int texnum = 0;
if( FS_FileExists( "gfx/paused.lmp", false ))
texnum = ref.dllFuncs.GL_LoadTexture( "gfx/paused.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
else if( FS_FileExists( "gfx/pause.lmp", false ))
texnum = ref.dllFuncs.GL_LoadTexture( "gfx/pause.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
return texnum ? texnum : -1;
}
/*
================
SCR_RegisterTextures
@ -803,12 +815,6 @@ INTERNAL RESOURCE
void SCR_RegisterTextures( void )
{
// register gfx.wad images
if( FS_FileExists( "gfx/paused.lmp", false ))
cls.pauseIcon = ref.dllFuncs.GL_LoadTexture( "gfx/paused.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
else if( FS_FileExists( "gfx/pause.lmp", false ))
cls.pauseIcon = ref.dllFuncs.GL_LoadTexture( "gfx/pause.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
if( FS_FileExists( "gfx/lambda.lmp", false ))
{
if( cl_allow_levelshots.value )

View File

@ -953,6 +953,7 @@ void SCR_VidInit( void );
void SCR_TileClear( void );
void SCR_DirtyScreen( void );
void SCR_EndLoadingPlaque( void );
int SCR_LoadPauseIcon( void );
void SCR_RegisterTextures( void );
void SCR_LoadCreditsFont( void );
void SCR_MakeScreenShot( void );