From 9f381a7e285eca3c2051fe59c8255126bb1382f0 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Thu, 23 Jun 2022 06:57:54 +0500 Subject: [PATCH] Do not draw battery indicator and delimiter. --- cl_dll/battery.cpp | 58 ---------------------------------------------- cl_dll/health.cpp | 7 ------ 2 files changed, 65 deletions(-) diff --git a/cl_dll/battery.cpp b/cl_dll/battery.cpp index b6cd9e0b..46c58888 100644 --- a/cl_dll/battery.cpp +++ b/cl_dll/battery.cpp @@ -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; } diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index e14182b8..3ffa14a2 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -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 );