]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Optimize team color loading a bit
authorterencehill <piuntn@gmail.com>
Wed, 1 May 2013 11:09:57 +0000 (13:09 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 1 May 2013 11:09:57 +0000 (13:09 +0200)
qcsrc/client/View.qc
qcsrc/client/hud.qc
qcsrc/client/hud.qh

index e7e7f9059509ba46139c54a3230ec9801bb3cea6..547f90268ec14904bf71cda677bf4dc248fcf367 100644 (file)
@@ -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;
index 1b2be1154f7c014cc1d4abf7868cb8ae40d46ab1..e49ac603ac201900897fd223e6c8449dcbf0656d 100644 (file)
@@ -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;
index ef94976dcfec2ffcde6bf26377873d3084f8fb74..19cd36ddb0b0551bd4bc6833ef5b73f8be5da9d4 100644 (file)
@@ -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 {\