Do not draw battery indicator and delimiter.

This commit is contained in:
Andrey Akhmichin 2022-06-23 06:57:54 +05:00
parent e5a1902661
commit 9f381a7e28
No known key found for this signature in database
GPG Key ID: 1F180D249B0643C0
2 changed files with 0 additions and 65 deletions

View File

@ -71,63 +71,5 @@ int CHudBattery::MsgFunc_Battery( const char *pszName, int iSize, void *pbuf )
int CHudBattery::Draw( float flTime )
{
if( gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH )
return 1;
int r, g, b, x, y, a;
wrect_t rc;
rc = *m_prc2;
rc.top += m_iHeight * ( (float)( 100 - ( Q_min( 100, m_iBat ) ) ) * 0.01f ); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1
UnpackRGB( r, g, b, RGB_YELLOWISH );
if( !( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_SUIT ) ) ) )
return 1;
// Has health changed? Flash the health #
if( m_fFade )
{
if( m_fFade > FADE_TIME )
m_fFade = FADE_TIME;
m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f );
if( m_fFade <= 0 )
{
a = 128;
m_fFade = 0;
}
// Fade the health number back to dim
a = MIN_ALPHA + ( m_fFade / FADE_TIME ) * 128;
}
else
a = MIN_ALPHA;
ScaleColors( r, g, b, a );
int iOffset = ( m_prc1->bottom - m_prc1->top ) / 6;
y = ScreenHeight - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
x = ScreenWidth / 5;
// make sure we have the right sprite handles
if( !m_hSprite1 )
m_hSprite1 = gHUD.GetSprite( gHUD.GetSpriteIndex( "suit_empty" ) );
if( !m_hSprite2 )
m_hSprite2 = gHUD.GetSprite( gHUD.GetSpriteIndex( "suit_full" ) );
SPR_Set( m_hSprite1, r, g, b );
SPR_DrawAdditive( 0, x, y - iOffset, m_prc1 );
if( rc.bottom > rc.top )
{
SPR_Set( m_hSprite2, r, g, b );
SPR_DrawAdditive( 0, x, y - iOffset + ( rc.top - m_prc2->top ), &rc );
}
x += ( m_prc1->right - m_prc1->left );
x = gHUD.DrawHudNumber( x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iBat, r, g, b );
return 1;
}

View File

@ -227,13 +227,6 @@ int CHudHealth::Draw( float flTime )
x = CrossWidth + HealthWidth / 2;
x = gHUD.DrawHudNumber( x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iHealth, r, g, b );
x += HealthWidth / 2;
int iHeight = gHUD.m_iFontHeight;
int iWidth = HealthWidth / 10;
UnpackRGB( r, g, b, RGB_YELLOWISH );
FillRGBA( x, y, iWidth, iHeight, r, g, b, a );
}
DrawDamage( flTime );