Skip to content

Commit

Permalink
client: ammo: increase ammobar size depending on sprites size (extra …
Browse files Browse the repository at this point in the history
…change, not fixed in HL25 yet)

See ValveSoftware/halflife#3728 comment
  • Loading branch information
a1batross committed Dec 22, 2023
1 parent e8db2fa commit e3f44e2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions cl_dll/ammo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,19 @@ int CHudAmmo::VidInit( void )
// If we've already loaded weapons, let's get new sprites
gWR.LoadAllWeaponSprites();

if( ScreenWidth >= 640 )
{
giABWidth = 20;
giABHeight = 4;
}
const int res = GetSpriteRes( ScreenWidth, ScreenHeight );
int factor;
if( res >= 2560 )
factor = 4;
else if( res >= 1280 )
factor = 3;
else if( res >= 640 )
factor = 2;
else
{
giABWidth = 10;
giABHeight = 2;
}
factor = 1;

giABWidth = 10 * factor;
giABHeight = 2 * factor;

return 1;
}
Expand Down

0 comments on commit e3f44e2

Please sign in to comment.