Skip to content

Commit

Permalink
- removed pointless BOUND_4PIX macro
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Oct 10, 2021
1 parent 3220a6d commit cc912fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
3 changes: 0 additions & 3 deletions source/games/sw/src/mytypes.h
Expand Up @@ -65,9 +65,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms

#define TRUNC4(x) ((x) & ~3)

// moves value to closest power of 2 pixel boundry

#define BOUND_4PIX(x) ( TRUNC4((x) + MOD4(x)) )

/*
===========================
Expand Down
22 changes: 9 additions & 13 deletions source/games/sw/src/track.cpp
Expand Up @@ -53,10 +53,6 @@ ANIMATOR NinjaJumpActionFunc;
#define ACTOR_STD_JUMP (-384)
int GlobSpeedSO;

#undef BOUND_4PIX
//#define BOUND_4PIX(x) ( TRUNC4((x) + MOD4(x)) )
#define BOUND_4PIX(x) (x)

// determine if moving down the track will get you closer to the player
short
TrackTowardPlayer(SPRITEp sp, TRACKp t, TRACK_POINTp start_point)
Expand Down Expand Up @@ -1636,8 +1632,8 @@ MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
pp->RevolveDeltaAng = 0;
}

pp->posx += BOUND_4PIX(nx);
pp->posy += BOUND_4PIX(ny);
pp->posx += nx;
pp->posy += ny;

if (TEST(sop->flags, SOBJ_DONT_ROTATE))
{
Expand All @@ -1664,8 +1660,8 @@ MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
// Player is NOT moving

// Move saved x&y variables
pp->RevolveX += BOUND_4PIX(nx);
pp->RevolveY += BOUND_4PIX(ny);
pp->RevolveX += nx;
pp->RevolveY += ny;

// Last known angle is now adjusted by the delta angle
pp->RevolveAng = pp->angle.ang - buildang(pp->RevolveDeltaAng);
Expand Down Expand Up @@ -1705,8 +1701,8 @@ MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny)
PlayerMove = false;

// move along little midpoint
sop->xmid += BOUND_4PIX(nx);
sop->ymid += BOUND_4PIX(ny);
sop->xmid += nx;
sop->ymid += ny;

if (sop->xmid >= MAXSO)
PlayerMove = false;
Expand Down Expand Up @@ -1738,12 +1734,12 @@ MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny)

if (wp->extra && TEST(wp->extra, WALLFX_LOOP_OUTER))
{
dragpoint(k, wp->x += BOUND_4PIX(nx), wp->y += BOUND_4PIX(ny), 0);
dragpoint(k, wp->x += nx, wp->y += ny, 0);
}
else
{
wp->x += BOUND_4PIX(nx);
wp->y += BOUND_4PIX(ny);
wp->x += nx;
wp->y += ny;
}

rot_ang = delta_ang;
Expand Down

0 comments on commit cc912fb

Please sign in to comment.