From: terencehill Date: Wed, 1 May 2013 11:09:57 +0000 (+0200) Subject: Optimize team color loading a bit X-Git-Tag: xonotic-v0.7.0~62^2~1 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=913fbbe3ab975d21a368c0b5bf566d6de97f9f71;hp=-c Optimize team color loading a bit --- 913fbbe3ab975d21a368c0b5bf566d6de97f9f71 diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index e7e7f90595..547f90268e 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -445,6 +445,7 @@ void CSQC_UpdateView(float w, float h) if(myteam != prev_myteam) { + myteamcolors = colormapPaletteColor(myteam, 1); for(i = 0; i < HUD_PANEL_NUM; ++i) hud_panel[i].update_time = time; prev_myteam = myteam; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 1b2be1154f..e49ac603ac 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4419,7 +4419,7 @@ void HUD_Main (void) if(autocvar__hud_configure && myteam == NUM_SPECTATOR) color = '1 0 0' * hud_dock_color_team; else - color = colormapPaletteColor(myteam, 1) * hud_dock_color_team; + color = myteamcolors * hud_dock_color_team; } else if(autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && hud_dock_color_team) { color = '1 0 0' * hud_dock_color_team; diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index ef94976dcf..19cd36ddb0 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -54,6 +54,8 @@ float hud_fade_alpha; string hud_skin_path; string hud_skin_prev; +vector myteamcolors; + var vector progressbar_color; entity highlightedPanel_backup; @@ -189,7 +191,7 @@ if((teamplay) && panel_bg_color_team) {\ if(autocvar__hud_configure && myteam == NUM_SPECTATOR)\ panel_bg_color = '1 0 0' * panel_bg_color_team;\ else\ - panel_bg_color = colormapPaletteColor(myteam, 1) * panel_bg_color_team;\ + panel_bg_color = myteamcolors * panel_bg_color_team;\ } else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && panel_bg_color_team) {\ panel_bg_color = '1 0 0' * panel_bg_color_team;\ } else {\