Commit MetaInfo

Revision7f924872d99c72a67b28e6f4edb8406caafbe787 (tree)
Time2021-06-02 20:07:28
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Did some small cleanup of scoreboard_DrawRankings.

Change Summary

Incremental Difference

diff -r c98b5679fdd1 -r 7f924872d99c src/scoreboard.cpp
--- a/src/scoreboard.cpp Wed Jun 02 01:25:41 2021 -0400
+++ b/src/scoreboard.cpp Wed Jun 02 07:07:28 2021 -0400
@@ -2069,10 +2069,6 @@
20692069 //
20702070 static void scoreboard_DrawRankings( ULONG ulPlayer )
20712071 {
2072- ULONG ulIdx;
2073- ULONG ulTeamIdx;
2074- char szString[16];
2075-
20762072 // Nothing to do.
20772073 if ( g_ulNumColumnsUsed < 1 )
20782074 return;
@@ -2081,31 +2077,11 @@
20812077
20822078 // Center this a little better in intermission
20832079 if ( gamestate != GS_LEVEL )
2084- g_ulCurYPos = ( g_bScale == true ) ? (LONG)( 48 * g_fYScale ) : (LONG)( 48 * CleanYfac );
2080+ g_ulCurYPos = static_cast<LONG>( 48 * ( g_bScale ? g_fYScale : CleanYfac ));
20852081
20862082 // Draw the titles for the columns.
2087- for ( ulIdx = 0; ulIdx < g_ulNumColumnsUsed; ulIdx++ )
2088- {
2089- sprintf( szString, "%s", g_pszColumnHeaders[g_aulColumnType[ulIdx]] );
2090- if ( g_bScale )
2091- {
2092- screen->DrawText( g_pColumnHeaderFont, CR_RED,
2093- (LONG)( g_aulColumnX[ulIdx] * g_fXScale ),
2094- g_ulCurYPos,
2095- szString,
2096- DTA_VirtualWidth, g_ValWidth.Int,
2097- DTA_VirtualHeight, g_ValHeight.Int,
2098- TAG_DONE );
2099- }
2100- else
2101- {
2102- screen->DrawText( g_pColumnHeaderFont, CR_RED,
2103- (LONG)( g_aulColumnX[ulIdx] / 320.0f * SCREENWIDTH ),
2104- g_ulCurYPos,
2105- szString,
2106- TAG_DONE );
2107- }
2108- }
2083+ for ( ULONG ulColumn = 0; ulColumn < g_ulNumColumnsUsed; ulColumn++ )
2084+ HUD_DrawText( g_pColumnHeaderFont, CR_RED, static_cast<LONG>( g_aulColumnX[ulColumn] * g_fXScale ), g_ulCurYPos, g_pszColumnHeaders[g_aulColumnType[ulColumn]] );
21092085
21102086 // Draw the player list.
21112087 g_ulCurYPos += 24;
@@ -2114,7 +2090,7 @@
21142090 if ( GAMEMODE_GetCurrentFlags() & GMF_PLAYERSONTEAMS )
21152091 {
21162092 // Draw players on teams.
2117- for ( ulTeamIdx = 0; ulTeamIdx < teams.Size( ); ulTeamIdx++ )
2093+ for ( ULONG ulTeamIdx = 0; ulTeamIdx < teams.Size( ); ulTeamIdx++ )
21182094 {
21192095 // In team LMS, separate the dead players from the living.
21202096 if (( teamlms ) && ( gamestate != GS_INTERMISSION ) && ( LASTMANSTANDING_GetState( ) != LMSS_COUNTDOWN ) && ( LASTMANSTANDING_GetState( ) != LMSS_WAITINGFORPLAYERS ))
Show on old repository browser