From 7e632ec382115535fdcb699d6fc814c8ceb2ff34 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 27 Nov 2021 11:51:59 +0100 Subject: [PATCH] - added missing xflip option for weapon sprites and removed the bit shifting voodoo in overwritesprite. We can use the correct options directly without having to go through that mess. --- source/games/whaven/src/drawweapon.cpp | 12 +++++++----- source/games/whaven/src/weapons.cpp | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/games/whaven/src/drawweapon.cpp b/source/games/whaven/src/drawweapon.cpp index b7c43f227..8066ec659 100644 --- a/source/games/whaven/src/drawweapon.cpp +++ b/source/games/whaven/src/drawweapon.cpp @@ -10,9 +10,7 @@ BEGIN_WH_NS static void overwritesprite(double thex, double they, int tilenum, int shade, int stat, int dapalnum) { - int dastat = (((stat & RS_TRANS1) ^ RS_TRANS1) << 4) + (stat & RS_AUTO) + ((stat & RS_YFLIP) >> 2) + RS_NOCLIP + - (((stat & RS_TOPLEFT) >> 2) ^ ((stat & RS_NOCLIP) >> 1)) + (stat & RS_ALIGN_L) + (stat & RS_ALIGN_R); - hud_drawsprite(thex, they, 65536, (stat & RS_NOCLIP) << 7, tilenum, shade, dapalnum, dastat); + hud_drawsprite(thex, they, 65536, 0, tilenum, shade, dapalnum, stat); } void drawweapons(int snum, double const dasmoothratio) { @@ -40,9 +38,13 @@ void drawweapons(int snum, double const dasmoothratio) { int dabits; if (plr.invisibletime > 0) - dabits = RS_TRANS1; + dabits = RS_TOPLEFT | RS_TRANS1; else - dabits = 0; + dabits = RS_TOPLEFT; + + if (plr.currweaponflip == 1) + dabits |= RS_XFLIPHUD; + switch (plr.currweapon) { case 1: diff --git a/source/games/whaven/src/weapons.cpp b/source/games/whaven/src/weapons.cpp index 9233da00c..255c092e9 100644 --- a/source/games/whaven/src/weapons.cpp +++ b/source/games/whaven/src/weapons.cpp @@ -557,7 +557,7 @@ void weaponsprocess(int snum) { plr.hasshot = 0; plr.currweaponflip = 1; } - if (plr.ammo[3] > 0) { + else if (plr.ammo[3] > 0) { plr.currweapon = 3; plr.currweapontics = 6; plr.currweaponanim = 0;