Skip to content

Commit

Permalink
- SW: eliminated the only use of the SPRITE_TAG1 macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Oct 11, 2021
1 parent 9f7b7eb commit afce1ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
13 changes: 7 additions & 6 deletions source/games/sw/src/copysect.cpp
Expand Up @@ -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;

Expand All @@ -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);
Expand All @@ -196,7 +197,7 @@ void CopySectorMatch(short match)
SECTOR_OBJECTp sop;

// find and add sprite to SO
sop = DetectSectorObject(&sector[sprite[src_move].sectnum]);
sop = DetectSectorObject(&sector[sp->sectnum]);
AddSpriteToSectorObject(src_move, sop);

// update sprites postions so they aren't in the
Expand Down
1 change: 0 additions & 1 deletion source/games/sw/src/game.h
Expand Up @@ -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)
Expand Down

0 comments on commit afce1ab

Please sign in to comment.