Skip to content

Commit

Permalink
Fix various HUD positioning on non-standard resolutions
Browse files Browse the repository at this point in the history
 - GetHudSize gets the root panel size when applicable which seems to be more reliable than the raw ScreenSize
 - See #252
  • Loading branch information
squeek502 committed May 20, 2016
1 parent 4991fa9 commit 5d02afa
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cl_dll/ff/c_ff_timers.cpp
Expand Up @@ -27,7 +27,7 @@ C_FFTimer::C_FFTimer( std::string strName, const float flDuration )
SetHiddenBits( 0 );

int iScreenWidth, iScreenHeight;
surface()->GetScreenSize( iScreenWidth, iScreenHeight );
GetHudSize( iScreenWidth, iScreenHeight );

int iWidth = iScreenWidth / 4 + 2, iHeight = 22;
int nTimers = g_FFTimers.Count();
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/ff/ff_hud_buildable_messages.cpp
Expand Up @@ -223,7 +223,7 @@ void CHudBuildableMessages::CalculateWidthHeight( void )

// Get the screen width/height
int iScreenWide, iScreenTall;
surface()->GetScreenSize( iScreenWide, iScreenTall );
GetHudSize( iScreenWide, iScreenTall );

// Get our current x/y position of this 'panel'
int x, y;
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/ff/ff_hud_crosshairinfo.cpp
Expand Up @@ -583,7 +583,7 @@ void CHudCrosshairInfo::OnTick( void )
{
// Get the screen width/height
int iScreenWide, iScreenTall;
surface()->GetScreenSize( iScreenWide, iScreenTall );
GetHudSize( iScreenWide, iScreenTall );

int iWide = UTIL_ComputeStringWidth( m_hTextFont, m_pText );
int iTall = surface()->GetFontTall( m_hTextFont );
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/ff/ff_hud_objectiveicon.cpp
Expand Up @@ -103,7 +103,7 @@ void CHudObjectiveIcon::VidInit( void )

// Set up our screen position and stuff before drawing
int iWide, iTall;
surface()->GetScreenSize( iWide, iTall );
GetHudSize( iWide, iTall );

// Set up the panel to take up the WHOLE screen
SetPos( 0, 0 );
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/ff/ff_hud_radiotag.cpp
Expand Up @@ -87,7 +87,7 @@ void CHudRadioTag::VidInit( void )

// Set up our screen position and stuff before drawing
int iWide, iTall;
surface()->GetScreenSize( iWide, iTall );
GetHudSize( iWide, iTall );

// Set up the panel to take up the WHOLE screen
SetPos( 0, 0 );
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/ff/ff_hud_statusicons.cpp
Expand Up @@ -166,7 +166,7 @@ void CStatusIcons::Init( void )
void CStatusIcons::OnTick( void )
{
/* int iWide, iTall;
surface()->GetScreenSize( iWide, iTall );
GetHudSize( iWide, iTall );
int displayed = 0;
for (int i=0; i<MAX_STATUSICONS; i++)
Expand Down

0 comments on commit 5d02afa

Please sign in to comment.