From: terencehill Date: Fri, 1 Oct 2010 22:41:30 +0000 (+0200) Subject: Other cleanups: - Make scoreboard_active global and use it instead of calling every... X-Git-Tag: xonotic-v0.1.0preview~267^2~19 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d8f99eb2bf10a4fcecdc14501c9b48b5f971325f;p=xonotic%2Fxonotic-data.pk3dir.git Other cleanups: - Make scoreboard_active global and use it instead of calling every time HUD_WouldDrawScoreboard (and remove the check for (intermission == 2 && scoreboard_showscores) because this case is included in the check for scoreboard_showscores) - Initialize vars scoreboard_fade*speed only when needed - Do not call HUD_UpdatePlayerTeams(); if the scoreboard is not shown --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 111db52e1..546ccde5d 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -338,7 +338,7 @@ void CSQC_common_hud(void); void PostInit(void); void CSQC_Demo_Camera(); -float HUD_WouldDrawScoreboard (); +float HUD_WouldDrawScoreboard(); float view_set; float camera_mode; float reticle_type; @@ -532,8 +532,6 @@ void CSQC_UpdateView(float w, float h) } // Draw the Crosshair - float scoreboard_active; - scoreboard_active = HUD_WouldDrawScoreboard(); R_SetView(VF_DRAWCROSSHAIR, 0); //Make sure engine crosshairs are always hidden // Draw the Engine Status Bar (the default Quake HUD) @@ -629,12 +627,12 @@ void CSQC_UpdateView(float w, float h) self.draw2d(); self = e; + scoreboard_active = HUD_WouldDrawScoreboard(); + float hud; hud = getstati(STAT_HUD); if(hud == HUD_SPIDERBOT) - { CSQC_SPIDER_HUD(); - } else if(hud == HUD_WAKIZASHI) CSQC_WAKIZASHI_HUD(); else if(hud == HUD_RAPTOR) @@ -1215,7 +1213,7 @@ void CSQC_common_hud(void) HUD_Main(); // always run these functions for alpha checks HUD_DrawScoreboard(); - if (scoreboard_showscores || scoreboard_showscores_force || getstati(STAT_HEALTH) <= 0 || intermission == 1) // scoreboard/accuracy + if (scoreboard_active) // scoreboard/accuracy { HUD_Reset(); // HUD_DrawScoreboard takes care of centerprint_start diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 906a01928..6cde91110 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -284,10 +284,9 @@ void HUD_DrawCenterPrint (void) sz = 0.8 + (a / 5); - if(centerprint_num * cvar("scr_centersize") > 24 && HUD_WouldDrawScoreboard()) // 24 = height of Scoreboard text - { + if(centerprint_num * cvar("scr_centersize") > 24 && scoreboard_active) // 24 = height of Scoreboard text centerprint_start_y = scoreboard_bottom + centerprint_fontsize_y; - } + pos = centerprint_start; for (i=0; i