diff --git a/source/exhumed/src/engine.h b/source/exhumed/src/engine.h index 6702122a1..540fd495b 100644 --- a/source/exhumed/src/engine.h +++ b/source/exhumed/src/engine.h @@ -42,7 +42,6 @@ enum int movesprite(short spritenum, int dx, int dy, int dz, int ceildist, int flordist, unsigned int clipmask); -void overwritesprite(int thex, int they, short tilenum, signed char shade, char stat, char dapalnum, int basepal = 0); void precache(); void resettiming(); diff --git a/source/exhumed/src/enginesubs.cpp b/source/exhumed/src/enginesubs.cpp index 8ce36dee5..2c138c3a1 100644 --- a/source/exhumed/src/enginesubs.cpp +++ b/source/exhumed/src/enginesubs.cpp @@ -27,33 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS -void overwritesprite(int thex, int they, short tilenum, signed char shade, char stat, char dapalnum, int basepal) -{ - // no animation - uint8_t animbak = picanm[tilenum].sf; - picanm[tilenum].sf = 0; - int offx = 0, offy = 0; - if (stat & 1) - { - offx -= tilesiz[tilenum].x>>1; - if (stat & 8) - offx += tileLeftOffset(tilenum); - else - offx -= tileLeftOffset(tilenum); - offy -= (tilesiz[tilenum].y>>1)+tileTopOffset(tilenum); - } - if (stat&8) - offx += tilesiz[tilenum].x; - if (stat&16) - offy += tilesiz[tilenum].y; - thex += offx; - they += offy; - rotatesprite(thex << 16, they << 16, 65536L, (stat & 8) << 7, tilenum, shade, dapalnum, - 16 + (stat & 2) + ((stat & 4) >> 2) + (((stat & 16) >> 2) ^ ((stat & 8) >> 1)), - windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y, nullptr, basepal); - picanm[tilenum].sf = animbak; -} - void resettiming() { numframes = 0L; diff --git a/source/exhumed/src/sequence.cpp b/source/exhumed/src/sequence.cpp index 5f53bb759..1aa0c04fb 100644 --- a/source/exhumed/src/sequence.cpp +++ b/source/exhumed/src/sequence.cpp @@ -16,6 +16,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "ns.h" +#include "glbackend/glbackend.h" #include "sequence.h" #include "engine.h" #include "exhumed.h" @@ -373,7 +374,7 @@ void seq_DrawPilotLightSeq(int xOffset, int yOffset) int x = ChunkXpos[nFrameBase] + (160 + xOffset); int y = ChunkYpos[nFrameBase] + (100 + yOffset); - rotatesprite(x << 16, y << 16, 0x10000, (-2 * fix16_to_int(nPlayerDAng)) & kAngleMask, nTile, -127, 1, 2, windowxy1.x, windowxy1.y, windowxy2.x, windowxy2.y); + hud_drawsprite(x, y, 65536, (-2 * fix16_to_int(nPlayerDAng)) & kAngleMask, nTile, 0, 0, 1); nFrameBase++; } } @@ -388,10 +389,10 @@ void seq_DrawPilotLightSeq(int xOffset, int yOffset) int seq_DrawGunSequence(int nSeqOffset, short dx, int xOffs, int yOffs, int nShade, int nPal) { - short nFrame = SeqBase[nSeqOffset] + dx; - short nFrameBase = FrameBase[nFrame]; - short nFrameSize = FrameSize[nFrame]; - short frameFlag = FrameFlag[nFrame]; + int nFrame = SeqBase[nSeqOffset] + dx; + int nFrameBase = FrameBase[nFrame]; + int nFrameSize = FrameSize[nFrame]; + int frameFlag = FrameFlag[nFrame]; while (1) { @@ -399,29 +400,27 @@ int seq_DrawGunSequence(int nSeqOffset, short dx, int xOffs, int yOffs, int nSha if (nFrameSize < 0) break; - uint8_t nStat = 3; int x = ChunkXpos[nFrameBase] + 160; int y = ChunkYpos[nFrameBase] + 100; - if (ChunkFlag[nFrameBase] & 1) { - nStat = 11; - } + int stat = 0; + if (ChunkFlag[nFrameBase] & 1) + stat |= RS_XFLIPHUD; - if (ChunkFlag[nFrameBase] & 2) { - nStat |= 0x10; - } + if (ChunkFlag[nFrameBase] & 2) + stat |= RS_YFLIPHUD; short nTile = ChunkPict[nFrameBase]; - if (frameFlag & 4) { + if (frameFlag & 4) nShade = -100; - } + double alpha = 1; if (nPlayerInvisible[nLocalPlayer]) { - nStat |= 0x4; + alpha = 0.3; } - overwritesprite(x + xOffs, y + yOffs, nTile, nShade, nStat, nPal); + hud_drawsprite(x + xOffs, y + yOffs, 65536, 0, nTile, nShade, nPal, stat, alpha); nFrameBase++; }