From 85292f2213d0454b8739208c43178d97b80f67f9 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 14 Oct 2015 21:52:21 +0200 Subject: [PATCH] Add an alpha check to avoid a drawpic call every frame --- qcsrc/client/view.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 0e04f70136..124a677535 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -547,7 +547,7 @@ void HitSound() void HUD_Crosshair() {SELFPARAM(); static float rainbow_last_flicker; - static vector rainbow_prev_color; + static vector rainbow_prev_color; entity e = self; float f, i, j; vector v; @@ -1750,7 +1750,7 @@ void CSQC_UpdateView(float w, float h) drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL); } - else + else if(myhealth_flash_temp > 0) drawpic(splash_pos, "gfx/blood", splash_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL); if(autocvar_hud_postprocessing) // we still need to set this anyway even when chase_active is set, this way it doesn't get stuck on. -- 2.39.2