]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/View.qc
Remove the old saturation slider from the menu, and add the armor based saturation...
[voretournament/voretournament.git] / data / qcsrc / client / View.qc
index f88392ead701ff9805ddf4f8eebc554339112755..e6f9a562a584045863c29ea27dd471b2ce5d24e6 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 and 50 armor. 0 armor is saturation 0.5, and 0.5 armor or above is saturation 1\r
+\r
+               if(cvar("hud_saturation") && armor_enabled && spectatee_status != -1 && getstati(STAT_HEALTH) > 0)\r
+               {\r
+                       float saturation;\r
+                       saturation = 0.5 + (getstati(STAT_ARMOR) * 1 * 0.01);\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