From b83c5c7bd21b66c0df9e797c66e60c6655f7b65f Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 17 Apr 2021 12:25:11 +0200 Subject: [PATCH] Draw images without specifying an extension so to make menu and client code consistent and avoid possible engine bugs whenever 2 images are drawn with and without extension at the same time (see #2469) --- qcsrc/client/hud/crosshair.qc | 16 ++++++++-------- qcsrc/client/hud/panel/pressedkeys.qc | 16 ++++++++-------- qcsrc/client/main.qc | 4 ++-- qcsrc/client/view.qc | 10 +++++----- qcsrc/common/turrets/cl_turrets.qc | 4 ++-- qcsrc/common/vehicles/cl_vehicles.qh | 14 +++++++------- .../common/vehicles/vehicle/bumblebee_weapons.qc | 8 ++++---- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/qcsrc/client/hud/crosshair.qc b/qcsrc/client/hud/crosshair.qc index f45edf961..c697268eb 100644 --- a/qcsrc/client/hud/crosshair.qc +++ b/qcsrc/client/hud/crosshair.qc @@ -533,27 +533,27 @@ void HUD_Crosshair(entity this) ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha; ring_inner_rgb = vec3(autocvar_crosshair_ring_vortex_inner_color_red, autocvar_crosshair_ring_vortex_inner_color_green, autocvar_crosshair_ring_vortex_inner_color_blue); - ring_inner_image = "gfx/crosshair_ring_inner.tga"; + ring_inner_image = "gfx/crosshair_ring_inner"; // draw the outer ring to show the current charge of the weapon ring_value = charge; ring_alpha = autocvar_crosshair_ring_vortex_alpha; ring_rgb = wcross_color; - ring_image = "gfx/crosshair_ring_nexgun.tga"; + ring_image = "gfx/crosshair_ring_nexgun"; } else if (autocvar_crosshair_ring && wepent.activeweapon == WEP_MINE_LAYER && WEP_CVAR(minelayer, limit) && autocvar_crosshair_ring_minelayer) { ring_value = bound(0, wepent.minelayer_mines / WEP_CVAR(minelayer, limit), 1); ring_alpha = autocvar_crosshair_ring_minelayer_alpha; ring_rgb = wcross_color; - ring_image = "gfx/crosshair_ring.tga"; + ring_image = "gfx/crosshair_ring"; } else if (wepent.activeweapon == WEP_HAGAR && wepent.hagar_load && autocvar_crosshair_ring_hagar) { ring_value = bound(0, wepent.hagar_load / WEP_CVAR_SEC(hagar, load_max), 1); ring_alpha = autocvar_crosshair_ring_hagar_alpha; ring_rgb = wcross_color; - ring_image = "gfx/crosshair_ring.tga"; + ring_image = "gfx/crosshair_ring"; } else if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring { @@ -565,9 +565,9 @@ void HUD_Crosshair(entity this) // Note: This is to stop Taoki from complaining that the image doesn't match all potential balances. // if a new image for another weapon is added, add the code (and its respective file/value) here if ((wepent.activeweapon == WEP_RIFLE) && (weapon_clipsize == 80)) - ring_image = "gfx/crosshair_ring_rifle.tga"; + ring_image = "gfx/crosshair_ring_rifle"; else - ring_image = "gfx/crosshair_ring.tga"; + ring_image = "gfx/crosshair_ring"; } else if ( autocvar_crosshair_ring && autocvar_crosshair_ring_arc && arc_heat && wepent.activeweapon == WEP_ARC ) { @@ -575,7 +575,7 @@ void HUD_Crosshair(entity this) ring_alpha = (1-arc_heat)*autocvar_crosshair_ring_arc_cold_alpha + arc_heat*autocvar_crosshair_ring_arc_hot_alpha; ring_rgb = (1-arc_heat)*wcross_color + arc_heat*autocvar_crosshair_ring_arc_hot_color; - ring_image = "gfx/crosshair_ring.tga"; + ring_image = "gfx/crosshair_ring"; } // if in weapon switch animation, fade ring out/in @@ -651,7 +651,7 @@ void HUD_Crosshair(entity this) if((autocvar_crosshair_dot_color_custom) && (autocvar_crosshair_dot_color != "0")) wcross_color = stov(autocvar_crosshair_dot_color); - CROSSHAIR_DRAW(wcross_resolution * autocvar_crosshair_dot_size, "gfx/crosshairdot.tga", f * autocvar_crosshair_dot_alpha); + CROSSHAIR_DRAW(wcross_resolution * autocvar_crosshair_dot_size, "gfx/crosshairdot", f * autocvar_crosshair_dot_alpha); // FIXME why don't we use wcross_alpha here? wcross_color = wcross_color_old; } diff --git a/qcsrc/client/hud/panel/pressedkeys.qc b/qcsrc/client/hud/panel/pressedkeys.qc index 7940e9462..f61dc6663 100644 --- a/qcsrc/client/hud/panel/pressedkeys.qc +++ b/qcsrc/client/hud/panel/pressedkeys.qc @@ -62,16 +62,16 @@ void HUD_PressedKeys() if(autocvar_hud_panel_pressedkeys_attack) { - drawpic_aspect_skin(pos + eX * (3/4 * keysize.x), ((pressedkeys & KEY_ATCK) ? "key_atck_inv.tga" : "key_atck.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawpic_aspect_skin(pos + eX * (7/4 * keysize.x), ((pressedkeys & KEY_ATCK2) ? "key_atck2_inv.tga" : "key_atck2.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(pos + eX * (3/4 * keysize.x), ((pressedkeys & KEY_ATCK) ? "key_atck_inv" : "key_atck"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(pos + eX * (7/4 * keysize.x), ((pressedkeys & KEY_ATCK2) ? "key_atck2_inv" : "key_atck2"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += keysize.y; } - drawpic_aspect_skin(pos, ((pressedkeys & KEY_CROUCH) ? "key_crouch_inv.tga" : "key_crouch.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawpic_aspect_skin(pos + eX * (5/4 * keysize.x), ((pressedkeys & KEY_FORWARD) ? "key_forward_inv.tga" : "key_forward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawpic_aspect_skin(pos + eX * (10/4 * keysize.x), ((pressedkeys & KEY_JUMP) ? "key_jump_inv.tga" : "key_jump.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(pos, ((pressedkeys & KEY_CROUCH) ? "key_crouch_inv" : "key_crouch"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(pos + eX * (5/4 * keysize.x), ((pressedkeys & KEY_FORWARD) ? "key_forward_inv" : "key_forward"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(pos + eX * (10/4 * keysize.x), ((pressedkeys & KEY_JUMP) ? "key_jump_inv" : "key_jump"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); pos.y += keysize.y; - drawpic_aspect_skin(pos + eX * (1/4 * keysize.x), ((pressedkeys & KEY_LEFT) ? "key_left_inv.tga" : "key_left.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawpic_aspect_skin(pos + eX * (5/4 * keysize.x), ((pressedkeys & KEY_BACKWARD) ? "key_backward_inv.tga" : "key_backward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - drawpic_aspect_skin(pos + eX * (9/4 * keysize.x), ((pressedkeys & KEY_RIGHT) ? "key_right_inv.tga" : "key_right.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(pos + eX * (1/4 * keysize.x), ((pressedkeys & KEY_LEFT) ? "key_left_inv" : "key_left"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(pos + eX * (5/4 * keysize.x), ((pressedkeys & KEY_BACKWARD) ? "key_backward_inv" : "key_backward"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); + drawpic_aspect_skin(pos + eX * (9/4 * keysize.x), ((pressedkeys & KEY_RIGHT) ? "key_right_inv" : "key_right"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); } diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index b6e5a87ed..757effd99 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -123,13 +123,13 @@ void CSQC_Init() { get_mi_min_max_texcoords(1); // try the CLEVER way first - minimapname = strcat("gfx/", mi_shortname, "_radar.tga"); + minimapname = strcat("gfx/", mi_shortname, "_radar"); shortmapname = mi_shortname; if (precache_pic(minimapname) == "") { // but maybe we have a non-clever minimap - minimapname = strcat("gfx/", mi_shortname, "_mini.tga"); + minimapname = strcat("gfx/", mi_shortname, "_mini"); if (precache_pic(minimapname) == "") minimapname = ""; // FAIL else diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 8b1314663..871fab3bd 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -955,17 +955,17 @@ void HUD_Draw(entity this) if(STAT(NADE_TIMER) && autocvar_cl_nade_timer) // give nade top priority, as it's a matter of life and death { vector col = '0.25 0.90 1' + vec3(STAT(NADE_TIMER), -STAT(NADE_TIMER), -STAT(NADE_TIMER)); - DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(NADE_TIMER), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); + DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring", STAT(NADE_TIMER), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); drawstring_aspect(eY * 0.64 * vid_conheight, ((autocvar_cl_nade_timer == 2) ? _("Nade timer") : ""), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL); } else if(STAT(CAPTURE_PROGRESS)) { - DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); + DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring", STAT(CAPTURE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); drawstring_aspect(eY * 0.64 * vid_conheight, _("Capture progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL); } else if(STAT(REVIVE_PROGRESS)) { - DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring.tga", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); + DrawCircleClippedPic(vec2(0.5 * vid_conwidth, 0.6 * vid_conheight), 0.1 * vid_conheight, "gfx/crosshair_ring", STAT(REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE); drawstring_aspect(eY * 0.64 * vid_conheight, _("Revival progress"), vec2(vid_conwidth, 0.025 * vid_conheight), '1 1 1', 1, DRAWFLAG_NORMAL); } HUD_Scale_Disable(); @@ -1086,7 +1086,7 @@ void View_NightVision() tc_10 = '1.5 0 0' - '0.2 0 0' * sin(time * 0.5) + '0 0.5 0' * cos(time * 1.7); //tc_11 = '1 1 0' + '0.6 0 0' * sin(time * 0.6) + '0 0.3 0' * cos(time * 0.1); tc_11 = tc_01 + tc_10 - tc_00; - R_BeginPolygon("gfx/nightvision-bg.tga", DRAWFLAG_ADDITIVE, true); + R_BeginPolygon("gfx/nightvision-bg", DRAWFLAG_ADDITIVE, true); R_PolygonVertex('0 0 0', tc_00, rgb, a); R_PolygonVertex(autocvar_vid_conwidth * '1 0 0', tc_10, rgb, a); R_PolygonVertex(autocvar_vid_conwidth * '1 0 0' + autocvar_vid_conheight * '0 1 0', tc_11, rgb, a); @@ -1100,7 +1100,7 @@ void View_NightVision() tc_01 = tc_00 + '0 3 0' * (1 + Noise_White(nightvision_noise2, frametime) * 0.2); tc_10 = tc_00 + '2 0 0' * (1 + Noise_White(nightvision_noise2, frametime) * 0.3); tc_11 = tc_01 + tc_10 - tc_00; - R_BeginPolygon("gfx/nightvision-fg.tga", DRAWFLAG_ADDITIVE, true); + R_BeginPolygon("gfx/nightvision-fg", DRAWFLAG_ADDITIVE, true); R_PolygonVertex('0 0 0', tc_00, rgb, a); R_PolygonVertex(autocvar_vid_conwidth * '1 0 0', tc_10, rgb, a); R_PolygonVertex(autocvar_vid_conwidth * '1 0 0' + autocvar_vid_conheight * '0 1 0', tc_11, rgb, a); diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 84812fc46..2157062b2 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -88,9 +88,9 @@ void turret_draw2d(entity this) if(hud != HUD_NORMAL) { if((get_turretinfo(this.m_id)).spawnflags & TUR_FLAG_MOVE) - txt = "gfx/vehicles/turret_moving.tga"; + txt = "gfx/vehicles/turret_moving"; else - txt = "gfx/vehicles/turret_stationary.tga"; + txt = "gfx/vehicles/turret_stationary"; vector pz = drawgetimagesize(txt) * autocvar_cl_vehicles_crosshair_size; drawpic(o - pz * 0.5, txt, pz , '1 1 1', 0.7, DRAWFLAG_NORMAL); diff --git a/qcsrc/common/vehicles/cl_vehicles.qh b/qcsrc/common/vehicles/cl_vehicles.qh index ff9448fdd..76bdc6731 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qh +++ b/qcsrc/common/vehicles/cl_vehicles.qh @@ -10,13 +10,13 @@ bool autocvar__vehicles_shownchasemessage; vector autocvar_hud_progressbar_vehicles_ammo1_color; vector autocvar_hud_progressbar_vehicles_ammo2_color; -const string vCROSS_BURST = "gfx/vehicles/crosshair_burst.tga"; -const string vCROSS_DROP = "gfx/vehicles/crosshair_drop.tga"; -const string vCROSS_GUIDE = "gfx/vehicles/crosshair_guide.tga"; -const string vCROSS_HEAL = "gfx/vehicles/crosshair_heal.tga"; -const string vCROSS_HINT = "gfx/vehicles/crosshair_hint.tga"; -const string vCROSS_LOCK = "gfx/vehicles/crosshair_lock.tga"; -const string vCROSS_RAIN = "gfx/vehicles/crosshair_rain.tga"; +const string vCROSS_BURST = "gfx/vehicles/crosshair_burst"; +const string vCROSS_DROP = "gfx/vehicles/crosshair_drop"; +const string vCROSS_GUIDE = "gfx/vehicles/crosshair_guide"; +const string vCROSS_HEAL = "gfx/vehicles/crosshair_heal"; +const string vCROSS_HINT = "gfx/vehicles/crosshair_hint"; +const string vCROSS_LOCK = "gfx/vehicles/crosshair_lock"; +const string vCROSS_RAIN = "gfx/vehicles/crosshair_rain"; entity dropmark; diff --git a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc index 0afd31f8c..5d3922e77 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc @@ -110,17 +110,17 @@ void bumble_raygun_draw(entity this) al = 0.25 + random() * 0.5; _vtmp1 = this.origin + _dir * _len * (0.25 + i); _vtmp1 += (randomvec() * (_len * 0.2) * (frametime * 2)); //this.raygun_l1; - Draw_CylindricLine(this.origin, _vtmp1, sz, "gfx/colors/white.tga", 1, 1, this.colormod, al, df, view_origin); + Draw_CylindricLine(this.origin, _vtmp1, sz, "gfx/colors/white", 1, 1, this.colormod, al, df, view_origin); _vtmp2 = this.origin + _dir * _len * (0.5 + i); _vtmp2 += (randomvec() * (_len * 0.2) * (frametime * 5)); //this.raygun_l2; - Draw_CylindricLine(_vtmp1, _vtmp2, sz, "gfx/colors/white.tga", 1, 1, this.colormod, al, df, view_origin); + Draw_CylindricLine(_vtmp1, _vtmp2, sz, "gfx/colors/white", 1, 1, this.colormod, al, df, view_origin); _vtmp1 = this.origin + _dir * _len * (0.75 + i); _vtmp1 += randomvec() * (_len * 0.2) * (frametime * 10); //this.raygun_l3; - Draw_CylindricLine(_vtmp2, _vtmp1, sz, "gfx/colors/white.tga", 1, 1, this.colormod, al, df, view_origin); + Draw_CylindricLine(_vtmp2, _vtmp1, sz, "gfx/colors/white", 1, 1, this.colormod, al, df, view_origin); - Draw_CylindricLine(_vtmp1, this.bumble_origin + randomvec() * 32, sz, "gfx/colors/white.tga", 1, 1, this.colormod, al, df, view_origin); + Draw_CylindricLine(_vtmp1, this.bumble_origin + randomvec() * 32, sz, "gfx/colors/white", 1, 1, this.colormod, al, df, view_origin); } } -- 2.39.2