{\r
cvar_set("r_glsl_postprocess_uservec1", "0 0 0 0");\r
cvar_set("r_glsl_postprocess_uservec1_enable", "0");\r
+ old_blurradius = 0;\r
+ old_bluralpha = 0;\r
}\r
\r
- if(cvar("hud_powerup"))\r
+ float sharpen_intensity;\r
+ if (getstatf(STAT_STRENGTH_FINISHED) - time > 0)\r
+ sharpen_intensity += (getstatf(STAT_STRENGTH_FINISHED) - time);\r
+ if (getstatf(STAT_INVINCIBLE_FINISHED) - time > 0)\r
+ sharpen_intensity += (getstatf(STAT_INVINCIBLE_FINISHED) - time);\r
+\r
+ if(cvar("hud_powerup") && sharpen_intensity > 0)\r
{\r
- float sharpen_intensity;\r
- if (getstatf(STAT_STRENGTH_FINISHED) - time > 0)\r
- sharpen_intensity += (getstatf(STAT_STRENGTH_FINISHED) - time);\r
- if (getstatf(STAT_INVINCIBLE_FINISHED) - time > 0)\r
- sharpen_intensity += (getstatf(STAT_INVINCIBLE_FINISHED) - time);\r
sharpen_intensity = bound(0, sharpen_intensity, 5); // powerup warning time is 5 seconds, so fade the effect from there\r
\r
- if(sharpen_intensity > 0)\r
+ if(sharpen_intensity != old_sharpen_intensity) // reduce cvar_set spam as much as possible\r
{\r
- if(sharpen_intensity != old_sharpen_intensity) // reduce cvar_set spam as much as possible\r
- {\r
- cvar_set("r_glsl_postprocess_uservec2", strcat("0 ", ftos(-sharpen_intensity * cvar("hud_powerup")), " 0 0"));\r
- cvar_set("r_glsl_postprocess_uservec2_enable", "1");\r
- old_sharpen_intensity = sharpen_intensity;\r
- }\r
- }\r
- else if(cvar("r_glsl_postprocess_uservec2_enable")) // reduce cvar_set spam as much as possible\r
- {\r
- cvar_set("r_glsl_postprocess_uservec2", "0 0 0 0");\r
- cvar_set("r_glsl_postprocess_uservec2_enable", "0");\r
+ cvar_set("r_glsl_postprocess_uservec2", strcat("0 ", ftos(-sharpen_intensity * cvar("hud_powerup")), " 0 0"));\r
+ cvar_set("r_glsl_postprocess_uservec2_enable", "1");\r
+ old_sharpen_intensity = sharpen_intensity;\r
}\r
}\r
+ else if(cvar("r_glsl_postprocess_uservec2_enable")) // reduce cvar_set spam as much as possible\r
+ {\r
+ cvar_set("r_glsl_postprocess_uservec2", "0 0 0 0");\r
+ cvar_set("r_glsl_postprocess_uservec2_enable", "0");\r
+ old_sharpen_intensity = 0;\r
+ }\r
}\r
\r
if(cvar("hud_postprocessing") && !cvar("hud_postprocessing_maxbluralpha"))\r