From af6af3438bcfb90283d2601710ae363825ddd9f2 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 16 Feb 2012 17:53:00 +0100 Subject: [PATCH] powerup sharpen/blur: do not always set r_glsl_postprocess 1, only enable it if needed --- defaultXonotic.cfg | 2 +- qcsrc/client/View.qc | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 734f9c8bb..30c70dd0b 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -785,7 +785,7 @@ set g_multijump_speed -999999 "Minimum vertical speed a player must have in orde // effects r_glsl_vertextextureblend_usebothalphas 1 // allows to abuse texture blending as detail texture -r_glsl_postprocess 1 +r_glsl_postprocess 0 // but note, hud_postprocessing enables this r_picmipsprites 0 // Xonotic uses sprites that should never be picmipped (team mate, typing, waypoints) r_picmipworld 1 gl_picmip_world 0 diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index f1112b33a..f0810e5e2 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -917,12 +917,14 @@ void CSQC_UpdateView(float w, float h) } } - if(autocvar_hud_postprocessing) // TODO: Remove this code and re-do the postprocess handling in the engine, where it properly belongs. + float e1 = (autocvar_hud_postprocessing_maxbluralpha != 0); + float e2 = (autocvar_hud_powerup != 0); + if(autocvar_hud_postprocessing && (e1 || e2)) // TODO: Remove this code and re-do the postprocess handling in the engine, where it properly belongs. { // enable or disable rendering types if they are used or not - if(cvar("r_glsl_postprocess_uservec1_enable") != (autocvar_hud_postprocessing_maxbluralpha != 0)) { cvar_set("r_glsl_postprocess_uservec1_enable", ftos(autocvar_hud_postprocessing_maxbluralpha != 0)); } - if(cvar("r_glsl_postprocess_uservec2_enable") != (autocvar_hud_powerup != 0)) { cvar_set("r_glsl_postprocess_uservec2_enable", ftos(autocvar_hud_powerup != 0)); } - + if(cvar("r_glsl_postprocess_uservec1_enable") != e1) { cvar_set("r_glsl_postprocess_uservec1_enable", ftos(e1)); } + if(cvar("r_glsl_postprocess_uservec2_enable") != e2) { cvar_set("r_glsl_postprocess_uservec2_enable", ftos(e2)); } + // blur postprocess handling done first (used by hud_damage and hud_contents) if((damage_blurpostprocess_x || content_blurpostprocess_x) && autocvar_chase_active >= 0) // not while the event chase camera is active { @@ -962,7 +964,12 @@ void CSQC_UpdateView(float w, float h) cvar_set("r_glsl_postprocess_uservec2", "0 0 0 0"); old_sharpen_intensity = 0; } + + if(cvar("r_glsl_postprocess") == 0) + cvar_set("r_glsl_postprocess", "2"); } + else if(cvar("r_glsl_postprocess") == 2) + cvar_set("r_glsl_postprocess", "0"); if(menu_visible) menu_show(); -- 2.39.2