From 1b5489f413da353063c3b82d0f91172ca77035d5 Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Mon, 27 Jul 2015 16:19:44 +0200 Subject: [PATCH] Remove null.tga and instead test for empty string --- gfx/hud/default/null.tga | Bin 22 -> 0 bytes gfx/hud/luma/null.tga | Bin 22 -> 0 bytes qcsrc/client/vehicles/all.qc | 46 ++++++++++++++++++++++------------- 3 files changed, 29 insertions(+), 17 deletions(-) delete mode 100644 gfx/hud/default/null.tga delete mode 100644 gfx/hud/luma/null.tga diff --git a/gfx/hud/default/null.tga b/gfx/hud/default/null.tga deleted file mode 100644 index 0aa07001431f106f59e12a584a3da506f030cdd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22 UcmZQzU}As)Mg~R(1r87o00B4vEdT%j diff --git a/gfx/hud/luma/null.tga b/gfx/hud/luma/null.tga deleted file mode 100644 index 0aa07001431f106f59e12a584a3da506f030cdd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22 UcmZQzU}As)Mg~R(1r87o00B4vEdT%j diff --git a/qcsrc/client/vehicles/all.qc b/qcsrc/client/vehicles/all.qc index 09a3d8337..e86b0f72b 100644 --- a/qcsrc/client/vehicles/all.qc +++ b/qcsrc/client/vehicles/all.qc @@ -225,8 +225,11 @@ void Vehicles_drawHUD( else drawpic_skin(tmpPos, vehicle, tmpSize, '1 1 1' * health + '1 0 0' * (1 - health), hudAlpha, DRAWFLAG_NORMAL); - drawpic_skin(tmpPos, vehicleWeapon1, tmpSize, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), hudAlpha, DRAWFLAG_NORMAL); - drawpic_skin(tmpPos, vehicleWeapon2, tmpSize, '1 1 1' * ammo2 + '1 0 0' * (1 - ammo2), hudAlpha, DRAWFLAG_NORMAL); + if(vehicleWeapon1) + drawpic_skin(tmpPos, vehicleWeapon1, tmpSize, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), hudAlpha, DRAWFLAG_NORMAL); + if(vehicleWeapon2) + drawpic_skin(tmpPos, vehicleWeapon2, tmpSize, '1 1 1' * ammo2 + '1 0 0' * (1 - ammo2), hudAlpha, DRAWFLAG_NORMAL); + drawpic_skin(tmpPos, "vehicle_shield", tmpSize, '1 1 1' * shield + '1 0 0' * (1 - shield), hudAlpha * shield, DRAWFLAG_NORMAL); // Health bar @@ -316,18 +319,24 @@ void Vehicles_drawHUD( tmpPos.x = hudPos.x + hudSize.x * (624/768); tmpPos.y = hudPos.y + hudSize.y * (48/256); - if(ammo1) - drawpic_skin(tmpPos, iconAmmo1, tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL); - else - drawpic_skin(tmpPos, iconAmmo1, tmpSize, '1 1 1', hudAlpha * 0.2, DRAWFLAG_NORMAL); + if(iconAmmo1) + { + if(ammo1) + drawpic_skin(tmpPos, iconAmmo1, tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL); + else + drawpic_skin(tmpPos, iconAmmo1, tmpSize, '1 1 1', hudAlpha * 0.2, DRAWFLAG_NORMAL); + } // Ammo2 icon tmpPos.y = hudPos.y + hudSize.y / 2; - if(ammo2) - drawpic_skin(tmpPos, iconAmmo2, tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL); - else - drawpic_skin(tmpPos, iconAmmo2, tmpSize, '1 1 1', hudAlpha * 0.2, DRAWFLAG_NORMAL); + if(iconAmmo2) + { + if(ammo2) + drawpic_skin(tmpPos, iconAmmo2, tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL); + else + drawpic_skin(tmpPos, iconAmmo2, tmpSize, '1 1 1', hudAlpha * 0.2, DRAWFLAG_NORMAL); + } // Bumblebee gunner crosshairs if(hud == HUD_BUMBLEBEE) @@ -401,11 +410,14 @@ void Vehicles_drawHUD( } // Crosshair - tmpSize = draw_getimagesize(crosshair) * autocvar_cl_vehicles_crosshair_size; - tmpPos.x = (vid_conwidth - tmpSize.x) / 2; - tmpPos.y = (vid_conheight - tmpSize.y) / 2; + if(crosshair) + { + tmpSize = draw_getimagesize(crosshair) * autocvar_cl_vehicles_crosshair_size; + tmpPos.x = (vid_conwidth - tmpSize.x) / 2; + tmpPos.y = (vid_conheight - tmpSize.y) / 2; - drawpic(tmpPos, crosshair, tmpSize, '1 1 1', autocvar_crosshair_alpha, DRAWFLAG_NORMAL); + drawpic(tmpPos, crosshair, tmpSize, '1 1 1', autocvar_crosshair_alpha, DRAWFLAG_NORMAL); + } } void CSQC_BUMBLE_HUD() @@ -418,10 +430,10 @@ void CSQC_BUMBLE_HUD() void CSQC_BUMBLE_GUN_HUD() { - Vehicles_drawHUD("vehicle_gunner", "vehicle_gunner_weapon1", "null", + Vehicles_drawHUD("vehicle_gunner", "vehicle_gunner_weapon1", string_null, "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color, - "null", '0 0 0', - "null"); + string_null, '0 0 0', + string_null); } void CSQC_SPIDER_HUD() -- 2.39.2