]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an alpha check to avoid a drawpic call every frame
authorterencehill <piuntn@gmail.com>
Wed, 14 Oct 2015 19:52:21 +0000 (21:52 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 14 Oct 2015 19:52:21 +0000 (21:52 +0200)
qcsrc/client/view.qc

index 0e04f70136818e7dd7bfea5d583541e2a2a22a4c..124a677535cdc83eb997a8ca988631d891df2c6f 100644 (file)
@@ -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.