From afce1aba882f7d0147775ec4e4df81e67cf47454 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 11 Oct 2021 23:02:54 +0200 Subject: [PATCH] - SW: eliminated the only use of the SPRITE_TAG1 macro. --- source/games/sw/src/copysect.cpp | 13 +++++++------ source/games/sw/src/game.h | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/games/sw/src/copysect.cpp b/source/games/sw/src/copysect.cpp index 6e92e5e3e..907fc6eda 100644 --- a/source/games/sw/src/copysect.cpp +++ b/source/games/sw/src/copysect.cpp @@ -168,8 +168,9 @@ void CopySectorMatch(short match) itsec.Reset(src_sp->sectnum); while ((src_move = itsec.NextIndex()) >= 0) { + auto sp = &sprite[src_move]; // don't move ST1 Copy Tags - if (SPRITE_TAG1(src_move) != SECT_COPY_SOURCE) + if (SP_TAG1(sp) != SECT_COPY_SOURCE) { int sx,sy,dx,dy,src_xoff,src_yoff,trash; @@ -180,12 +181,12 @@ void CopySectorMatch(short match) SectorMidPoint(dest_sp->sectnum, &dx, &dy, &trash); // get offset - src_xoff = sx - sprite[src_move].x; - src_yoff = sy - sprite[src_move].y; + src_xoff = sx - sp->x; + src_yoff = sy - sp->y; // move sprite to dest sector - sprite[src_move].x = dx - src_xoff; - sprite[src_move].y = dy - src_yoff; + sp->x = dx - src_xoff; + sp->y = dy - src_yoff; // change sector changespritesect(src_move, dest_sp->sectnum); @@ -196,7 +197,7 @@ void CopySectorMatch(short match) SECTOR_OBJECTp sop; // find and add sprite to SO - sop = DetectSectorObject(§or[sprite[src_move].sectnum]); + sop = DetectSectorObject(§or[sp->sectnum]); AddSpriteToSectorObject(src_move, sop); // update sprites postions so they aren't in the diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index ec82e1c76..d514499fb 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -198,7 +198,6 @@ inline int32_t FIXED(int32_t msw, int32_t lsw) #define SET_SP_TAG13(sp,val) (*((short*)&(sp)->xoffset)) = LittleShort((short)val) #define SET_SP_TAG14(sp,val) (*((short*)&(sp)->xrepeat)) = LittleShort((short)val) -#define SPRITE_TAG1(sp) (sprite[sp].hitag) #define SPRITE_TAG2(sp) (sprite[sp].lotag) #define SPRITE_TAG3(sp) (sprite[sp].clipdist) #define SPRITE_TAG4(sp) (sprite[sp].ang)