Another bugfix from Xonotic.
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 23 Mar 2011 17:26:54 +0000 (19:26 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 23 Mar 2011 17:26:54 +0000 (19:26 +0200)
data/qcsrc/client/View.qc

index 5e9d75c..2d50c99 100644 (file)
@@ -275,6 +275,7 @@ void CSQC_UpdateView(float w, float h)
        float a;\r
 \r
        vector reticle_pos, reticle_size;\r
+       vector splash_pos, splash_size;\r
        vector artwork_pos, artwork_size;\r
 \r
        WaypointSprite_Load();\r
@@ -591,6 +592,11 @@ void CSQC_UpdateView(float w, float h)
 \r
        if(cvar("hud_damage"))\r
        {\r
+               splash_size_x = max(vid_conwidth, vid_conheight);\r
+               splash_size_y = max(vid_conwidth, vid_conheight);\r
+               splash_pos_x = (vid_conwidth - splash_size_x) / 2;\r
+               splash_pos_y = (vid_conheight - splash_size_y) / 2;\r
+\r
                float myhealth_flash_temp;\r
                myhealth = getstati(STAT_HEALTH);\r
 \r
@@ -647,7 +653,7 @@ void CSQC_UpdateView(float w, float h)
                        drawfill('0 0 0', '1 0 0' * vid_conwidth + '0 1 0' * vid_conheight, myhealth_gentlergb, cvar("hud_damage_gentle_alpha_multiplier") * bound(0, myhealth_flash_temp, 1) * cvar("hud_damage"), DRAWFLAG_NORMAL);\r
                }\r
                else\r
-                       drawpic('0 0 0', "gfx/blood", '1 0 0' * vid_conwidth + '0 1 0' * vid_conheight, stov(cvar_string("hud_damage_color")), bound(0, myhealth_flash_temp, 1) * cvar("hud_damage"), DRAWFLAG_NORMAL);\r
+                       drawpic(splash_pos, "gfx/blood", splash_size, stov(cvar_string("hud_damage_color")), bound(0, myhealth_flash_temp, 1) * cvar("hud_damage"), DRAWFLAG_NORMAL);\r
 \r
                if(cvar("hud_postprocessing"))\r
                {\r
@@ -691,7 +697,7 @@ void CSQC_UpdateView(float w, float h)
                        stomachsplash_alpha = 0;\r
 \r
                stomachsplash_alpha = bound(0, stomachsplash_alpha, 1);\r
-               drawpic('0 0 0', "gfx/food", '1 0 0' * vid_conwidth + '0 1 0' * vid_conheight, stov(cvar_string("hud_stomach_color")), stomachsplash_alpha, DRAWFLAG_NORMAL);\r
+               drawpic(splash_pos, "gfx/food", splash_size, stov(cvar_string("hud_stomach_color")), stomachsplash_alpha, DRAWFLAG_NORMAL);\r
        }\r
 \r
        if(cvar("hud_postprocessing"))\r