]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/View.qc
Attempt to port the shownames feature from Xonotic (floating names above players...
[voretournament/voretournament.git] / data / qcsrc / client / View.qc
index f88392ead701ff9805ddf4f8eebc554339112755..8a5144fbc8dae7267fb47a60d54b30ee416082ba 100644 (file)
@@ -597,7 +597,7 @@ void CSQC_UpdateView(float w, float h)
                        \r
                contentalpha_temp = bound(0, drawframetime / max(0.0001, contentfadetime), 1);\r
                contentavgalpha = contentavgalpha * (1 - contentalpha_temp) + incontent * contentalpha_temp;\r
-               \r
+\r
                if(contentavgalpha)\r
                        drawfill('0 0 0', '1 0 0' * vid_conwidth + '0 1 0' * vid_conheight, liquidcolor_prev, contentavgalpha * liquidalpha_prev, DRAWFLAG_NORMAL);\r
 \r
@@ -741,6 +741,10 @@ void CSQC_UpdateView(float w, float h)
        {\r
                // all of this should be done in the engine eventually\r
 \r
+               // disable damage blur when dead, but keep content blur\r
+               if(getstati(STAT_HEALTH) <= 0)\r
+                       damage_blurpostprocess = '0 0 0';\r
+\r
                // enable or disable rendering types if they are used or not\r
                if(cvar("r_glsl_postprocess_uservec1_enable") != (cvar("hud_postprocessing_maxbluralpha") != 0))\r
                        cvar_set("r_glsl_postprocess_uservec1_enable", ftos(cvar("hud_postprocessing_maxbluralpha") != 0));\r
@@ -804,6 +808,24 @@ void CSQC_UpdateView(float w, float h)
                cvar_set("r_glsl_postprocess_uservec2_enable", "0");\r
        }\r
 \r
+       if(cvar("hud_postprocessing"))\r
+       {\r
+               // change saturation based on the amount of armor we have\r
+               // ranges between 0.5 and 1 saturation, over 0 armor and half the armor limit\r
+\r
+               if(cvar("hud_saturation") && armor_max && spectatee_status != -1 && getstati(STAT_HEALTH) > 0)\r
+               {\r
+                       float saturation;\r
+                       saturation = 0.5 + (getstati(STAT_ARMOR) / armor_max);\r
+                       saturation = bound(0, saturation, 1);\r
+\r
+                       if(cvar("r_glsl_saturation") != saturation)\r
+                               cvar_set("r_glsl_saturation", ftos(saturation));\r
+               }\r
+               else if(cvar("r_glsl_saturation") != 1)\r
+                       cvar_set("r_glsl_saturation", "1");\r
+       }\r
+\r
        // volume cutting\r
        if(cvar("cl_vore_cutvolume_sound") < 1 || cvar("cl_vore_cutvolume_music") < 1)\r
        {\r
@@ -885,6 +907,7 @@ void CSQC_UpdateView(float w, float h)
                if(self.draw2d)\r
                        self.draw2d();\r
        self = e;\r
+       Draw_ShowNames_All();\r
 \r
        // draw radar\r
        if(\r