mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-05 03:24:39 +00:00
client: hud: detect the availability of HD spritesheets
This commit is contained in:
parent
ed88ebf6d5
commit
9119ab812f
@ -171,7 +171,7 @@ inline int GetSpriteRes( int width, int height )
|
||||
i = 2560;
|
||||
}
|
||||
|
||||
return i;
|
||||
return Q_min( i, gHUD.m_iMaxRes );
|
||||
}
|
||||
|
||||
void ScaleColors( int &r, int &g, int &b, int a );
|
||||
|
@ -482,13 +482,28 @@ void CHud::VidInit( void )
|
||||
m_hsprLogo = 0;
|
||||
m_hsprCursor = 0;
|
||||
|
||||
// a1ba: don't break the loading order here and
|
||||
// don't cause memory leak but check
|
||||
// maximum HUD sprite resolution we have
|
||||
m_iMaxRes = 640;
|
||||
client_sprite_t *pSpriteList = m_pSpriteList ? m_pSpriteList :
|
||||
SPR_GetList( "sprites/hud.txt", &m_iSpriteCountAllRes );
|
||||
if( pSpriteList )
|
||||
{
|
||||
for( int i = 0; i < m_iSpriteCountAllRes; i++ )
|
||||
{
|
||||
if( m_iMaxRes < pSpriteList[i].iRes )
|
||||
m_iMaxRes = pSpriteList[i].iRes;
|
||||
}
|
||||
}
|
||||
|
||||
m_iRes = GetSpriteRes( ScreenWidth, ScreenHeight );
|
||||
|
||||
// Only load this once
|
||||
if( !m_pSpriteList )
|
||||
{
|
||||
// we need to load the hud.txt, and all sprites within
|
||||
m_pSpriteList = SPR_GetList( "sprites/hud.txt", &m_iSpriteCountAllRes );
|
||||
m_pSpriteList = pSpriteList;
|
||||
|
||||
if( m_pSpriteList )
|
||||
{
|
||||
|
@ -555,6 +555,7 @@ public:
|
||||
int m_iFOV;
|
||||
int m_Teamplay;
|
||||
int m_iRes;
|
||||
int m_iMaxRes;
|
||||
cvar_t *m_pCvarStealMouse;
|
||||
cvar_t *m_pCvarDraw;
|
||||
cvar_t *m_pAllowHD;
|
||||
|
Loading…
x
Reference in New Issue
Block a user