Revision | a9cfc72f3930bfd8be9c31b4c9ced13a4a19608d (tree) |
---|---|
Time | 2021-06-01 22:44:05 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Made small changes in SCOREBOARD_Render.
@@ -344,21 +344,22 @@ | ||
344 | 344 | g_ValWidth = con_virtualwidth.GetGenericRep( CVAR_Int ); |
345 | 345 | g_ValHeight = con_virtualheight.GetGenericRep( CVAR_Int ); |
346 | 346 | |
347 | - if (( con_scaletext ) && ( con_virtualwidth > 0 ) && ( con_virtualheight > 0 )) | |
347 | + g_bScale = HUD_IsScaled( ); | |
348 | + g_ulTextHeight = SmallFont->GetHeight( ) + 1; | |
349 | + | |
350 | + if ( g_bScale ) | |
348 | 351 | { |
349 | - g_bScale = true; | |
350 | - g_fXScale = (float)g_ValWidth.Int / 320.0f; | |
351 | - g_fYScale = (float)g_ValHeight.Int / 200.0f; | |
352 | - g_rXScale = (float)g_ValWidth.Int / SCREENWIDTH; | |
353 | - g_rYScale = (float)g_ValHeight.Int / SCREENHEIGHT; | |
354 | - g_ulTextHeight = Scale( SCREENHEIGHT, SmallFont->GetHeight( ) + 1, con_virtualheight ); | |
352 | + g_fXScale = static_cast<float>( g_ValWidth.Int ) / 320.0f; | |
353 | + g_fYScale = static_cast<float>( g_ValHeight.Int ) / 200.0f; | |
354 | + g_rXScale = static_cast<float>( g_ValWidth.Int ) / SCREENWIDTH; | |
355 | + g_rYScale = static_cast<float>( g_ValHeight.Int ) / SCREENHEIGHT; | |
356 | + g_ulTextHeight = Scale( SCREENHEIGHT, g_ulTextHeight, con_virtualheight ); | |
355 | 357 | } |
356 | 358 | else |
357 | 359 | { |
358 | - g_bScale = false; | |
359 | - g_rXScale = 1; | |
360 | - g_rYScale = 1; | |
361 | - g_ulTextHeight = SmallFont->GetHeight( ) + 1; | |
360 | + g_fXScale = static_cast<float>( SCREENWIDTH ) / 320.0f; | |
361 | + g_fYScale = static_cast<float>( SCREENHEIGHT ) / 200.0f; | |
362 | + g_rXScale = g_rYScale = 1.0f; | |
362 | 363 | } |
363 | 364 | |
364 | 365 | // Draw the main scoreboard. |
@@ -395,16 +396,15 @@ | ||
395 | 396 | if ( !players[ulDisplayPlayer].bSpectating ) |
396 | 397 | { |
397 | 398 | // Draw the player's rank and spread in FFA modes. |
398 | - if( !(GAMEMODE_GetCurrentFlags() & GMF_PLAYERSONTEAMS )) | |
399 | - if( (GAMEMODE_GetCurrentFlags() & GMF_PLAYERSEARNFRAGS )) | |
400 | - SCOREBOARD_RenderStats_RankSpread( ); | |
399 | + if ((( GAMEMODE_GetCurrentFlags( ) & GMF_PLAYERSONTEAMS ) == false ) && ( GAMEMODE_GetCurrentFlags( ) & GMF_PLAYERSEARNFRAGS )) | |
400 | + SCOREBOARD_RenderStats_RankSpread( ); | |
401 | 401 | |
402 | 402 | // [BB] Draw number of lives left. |
403 | 403 | if ( GAMEMODE_AreLivesLimited ( ) ) |
404 | 404 | { |
405 | - char szString[64]; | |
406 | - sprintf( szString, "Lives: %d / %d", static_cast<unsigned int> (players[ulDisplayPlayer].ulLivesLeft+1), GAMEMODE_GetMaxLives() ); | |
407 | - HUD_DrawText ( SmallFont, CR_RED, 0, static_cast<int> ( g_rYScale * ( ST_Y - g_ulTextHeight + 1 ) ), szString ); | |
405 | + FString text; | |
406 | + text.Format( "Lives: %d / %d", static_cast<unsigned int>( players[ulDisplayPlayer].ulLivesLeft + 1 ), GAMEMODE_GetMaxLives( )); | |
407 | + HUD_DrawText ( SmallFont, CR_RED, 0, static_cast<int> ( g_rYScale * ( ST_Y - g_ulTextHeight + 1 ) ), text ); | |
408 | 408 | } |
409 | 409 | } |
410 | 410 |