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: https://git.rm.cloudns.org/?a=commitdiff_plain;h=913fbbe3ab975d21a368c0b5bf566d6de97f9f71;p=xonotic%2Fxonotic-data.pk3dir.git Optimize team color loading a bit --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index e7e7f9059..547f90268 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 1b2be1154..e49ac603a 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 ef94976dc..19cd36ddb 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 {\