diff --git a/cl_dll/ui/hud/ammohistory.cpp b/cl_dll/ui/hud/ammohistory.cpp index a8177f0..2332b5e 100644 --- a/cl_dll/ui/hud/ammohistory.cpp +++ b/cl_dll/ui/hud/ammohistory.cpp @@ -139,7 +139,7 @@ int HistoryResource::DrawAmmoHistory( float flTime ) SPR_DrawAdditive( 0, xpos, ypos, &rcPic ); } - gHUD.DrawHudNumberStringReverse( xpos - 10, ypos, xpos - 100, rgAmmoHistory[i].iCount, r, g, b ); + gHUD.DrawHudNumberStringReverse( xpos - 10, ypos, rgAmmoHistory[i].iCount, r, g, b ); } else if( rgAmmoHistory[i].type == HISTSLOT_WEAP ) { diff --git a/cl_dll/ui/hud/hud.h b/cl_dll/ui/hud/hud.h index cfb86a5..13e7ca2 100644 --- a/cl_dll/ui/hud/hud.h +++ b/cl_dll/ui/hud/hud.h @@ -600,9 +600,9 @@ class CHud int DrawHudNumber( int x, int y, int iNumber, int r, int g, int b ); int DrawHudNumberCentered( int x, int y, int iNumber, int r, int g, int b ); int DrawHudString( int x, int y, const char *szString, int r, int g, int b ); - int DrawHudStringReverse( int xpos, int ypos, int iMinX, const char *szString, int r, int g, int b ); + int DrawHudStringReverse( int xpos, int ypos, const char *szString, int r, int g, int b ); int DrawHudNumberString( int xpos, int ypos, int iNumber, int r, int g, int b ); - int DrawHudNumberStringReverse( int xpos, int ypos, int iMinX, int iNumber, int r, int g, int b ); + int DrawHudNumberStringReverse( int xpos, int ypos, int iNumber, int r, int g, int b ); int GetNumWidth( int iNumber, int iFlags ); int DrawHudStringLen( const char *szIt ); int GetHudStringWidth(const char* string); diff --git a/cl_dll/ui/hud/hud_redraw.cpp b/cl_dll/ui/hud/hud_redraw.cpp index 3123fd3..d455cae 100644 --- a/cl_dll/ui/hud/hud_redraw.cpp +++ b/cl_dll/ui/hud/hud_redraw.cpp @@ -322,11 +322,11 @@ int CHud::DrawHudNumberString( int xpos, int ypos, int iNumber, int r, int g, in return DrawHudString( xpos, ypos, szString, r, g, b ); } -int CHud::DrawHudNumberStringReverse( int xpos, int ypos, int iMinX, int iNumber, int r, int g, int b ) +int CHud::DrawHudNumberStringReverse( int xpos, int ypos, int iNumber, int r, int g, int b ) { char szString[32]; sprintf( szString, "%d", iNumber ); - return DrawHudStringReverse( xpos, ypos, iMinX, szString, r, g, b ); + return DrawHudStringReverse( xpos, ypos, szString, r, g, b ); } @@ -338,13 +338,12 @@ int CHud::DrawHudNumberStringFixed( int xpos, int ypos, int iNumber, int r, int } // draws a string from right to left (right-aligned) -int CHud::DrawHudStringReverse( int xpos, int ypos, int iMinX, const char *szString, int r, int g, int b ) +int CHud::DrawHudStringReverse( int xpos, int ypos, const char *szString, int r, int g, int b ) { // find the end of the string for( const char *szIt = szString; *szIt != 0; szIt++ ) xpos -= gHUD.m_scrinfo.charWidths[(unsigned char)*szIt]; - if( xpos < iMinX ) - xpos = iMinX; + DrawHudString( xpos, ypos, szString, r, g, b ); return xpos; } diff --git a/cl_dll/ui/hud/menu.cpp b/cl_dll/ui/hud/menu.cpp index 7b7f896..371e621 100644 --- a/cl_dll/ui/hud/menu.cpp +++ b/cl_dll/ui/hud/menu.cpp @@ -195,7 +195,7 @@ int CHudMenu::Draw( float flTime ) if ( menu_ralign ) { // IMPORTANT: Right-to-left rendered text does not parse escape tokens! - menu_x = gHUD.DrawHudStringReverse( menu_x, y, 0, menubuf, menu_r, menu_g, menu_b ); + menu_x = gHUD.DrawHudStringReverse( menu_x, y, menubuf, menu_r, menu_g, menu_b ); } else { diff --git a/cl_dll/ui/hud/scoreboard.cpp b/cl_dll/ui/hud/scoreboard.cpp index e486250..588ecd4 100644 --- a/cl_dll/ui/hud/scoreboard.cpp +++ b/cl_dll/ui/hud/scoreboard.cpp @@ -175,7 +175,7 @@ int CHudScoreboard::Draw( float fTime ) char player_count[256]; sprintf(player_count, "%d/%d", get_player_count(), gEngfuncs.GetMaxClients()); - gHUD.DrawHudStringReverse( COUNT_PLAYERS_POS + xpos_rel, info_pos, 0, player_count, 255, 140, 0 ); + gHUD.DrawHudStringReverse( COUNT_PLAYERS_POS + xpos_rel, info_pos, player_count, 255, 140, 0 ); if( !gHUD.m_Teamplay ) { @@ -185,10 +185,10 @@ int CHudScoreboard::Draw( float fTime ) else gHUD.DrawHudString( xpos, ypos, CHudTextMessage::BufferedLocaliseTextString("#TEAMS"), 255, 140, 0 ); - gHUD.DrawHudStringReverse( KILLS_RANGE_MAX + xpos_rel, ypos, 0, CHudTextMessage::BufferedLocaliseTextString("#SCORE"), 255, 140, 0 ); + gHUD.DrawHudStringReverse( KILLS_RANGE_MAX + xpos_rel, ypos, CHudTextMessage::BufferedLocaliseTextString("#SCORE"), 255, 140, 0 ); gHUD.DrawHudString( DIVIDER_POS + xpos_rel, ypos, "/", 255, 140, 0 ); gHUD.DrawHudString( DEATHS_RANGE_MIN + xpos_rel + 5, ypos, CHudTextMessage::BufferedLocaliseTextString("#DEATHS"), 255, 140, 0 ); - gHUD.DrawHudStringReverse( PING_RANGE_MAX + xpos_rel + 15, ypos, 0, CHudTextMessage::BufferedLocaliseTextString("#LATENCY"), 255, 140, 0 ); + gHUD.DrawHudStringReverse( PING_RANGE_MAX + xpos_rel + 15, ypos, CHudTextMessage::BufferedLocaliseTextString("#LATENCY"), 255, 140, 0 ); list_slot += 1.2f; ypos = ROW_TOP + ROW_RANGE_MIN + ( list_slot * ROW_GAP ); @@ -312,7 +312,7 @@ int CHudScoreboard::Draw( float fTime ) // draw kills (right to left) xpos = KILLS_RANGE_MAX + xpos_rel; - gHUD.DrawHudNumberStringReverse( xpos, ypos, 0, team_info->frags, r, g, b ); + gHUD.DrawHudNumberStringReverse( xpos, ypos, team_info->frags, r, g, b ); // draw divider xpos = DIVIDER_POS + xpos_rel; @@ -328,7 +328,7 @@ int CHudScoreboard::Draw( float fTime ) sprintf( buf, "%d/%d", team_info->ping, team_info->packetloss ); xpos = ( ( PING_RANGE_MAX - PING_RANGE_MIN ) / 2) + PING_RANGE_MIN + xpos_rel + 40; UnpackRGB( r, g, b, gHUD.m_iDefaultHUDColor ); - gHUD.DrawHudStringReverse( xpos, ypos, 0, buf, r, g, b ); + gHUD.DrawHudStringReverse( xpos, ypos, buf, r, g, b ); team_info->already_drawn = TRUE; // set the already_drawn to be TRUE, so this team won't get drawn again list_slot++; @@ -448,7 +448,7 @@ int CHudScoreboard::DrawPlayers( int xpos_rel, float list_slot, int nameoffset, // draw kills (right to left) xpos = KILLS_RANGE_MAX + xpos_rel; - gHUD.DrawHudNumberStringReverse( xpos, ypos, 0, g_PlayerExtraInfo[best_player].frags, r, g, b ); + gHUD.DrawHudNumberStringReverse( xpos, ypos, g_PlayerExtraInfo[best_player].frags, r, g, b ); // draw divider xpos = DIVIDER_POS + xpos_rel; @@ -462,7 +462,7 @@ int CHudScoreboard::DrawPlayers( int xpos_rel, float list_slot, int nameoffset, static char buf[64]; sprintf( buf, "%d/%d", g_PlayerInfoList[best_player].ping, g_PlayerInfoList[best_player].packetloss ); xpos = ( ( PING_RANGE_MAX - PING_RANGE_MIN ) / 2 ) + PING_RANGE_MIN + xpos_rel + 40; - gHUD.DrawHudStringReverse( xpos, ypos, 0, buf, r, g, b ); + gHUD.DrawHudStringReverse( xpos, ypos, buf, r, g, b ); pl_info->name = NULL; // set the name to be NULL, so this client won't get drawn again list_slot++;