From add3481e404746e70af282385cece8604ad7d2fe Mon Sep 17 00:00:00 2001 From: Mitch Richters Date: Sat, 30 Oct 2021 22:03:08 +1100 Subject: [PATCH] - SW: Replace use of `pushmove_old()` inline wrapper with `pushmove()` and remove inline wrappers. --- source/build/include/build.h | 17 ----------------- source/games/sw/src/sprite.cpp | 7 +++---- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index ed6387c82..a8e9a6219 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -627,23 +627,6 @@ static inline int64_t compat_maybe_truncate_to_int32(int64_t val) return enginecompatibility_mode != ENGINECOMPATIBILITY_NONE ? (int32_t)val : val; } -static inline int32_t pushmove_old(int32_t *x, int32_t *y, int32_t *z, int16_t *sectnum, int32_t walldist, - int32_t ceildist, int32_t flordist, uint32_t cliptype) ATTRIBUTE((nonnull(1,2,3,4))); - -static inline int32_t pushmove_old(int32_t *x, int32_t *y, int32_t *z, int16_t *sectnum, int32_t walldist, - int32_t ceildist, int32_t flordist, uint32_t cliptype) -{ - vec3_t vector = { *x, *y, *z }; - - int32_t result = pushmove(&vector, sectnum, walldist, ceildist, flordist, cliptype); - - *x = vector.x; - *y = vector.y; - *z = vector.z; - - return result; -} - static inline void getzrange_old(int32_t x, int32_t y, int32_t z, int16_t sectnum, int32_t *ceilz, int32_t *ceilhit, int32_t *florz, int32_t *florhit, int32_t walldist, uint32_t cliptype) ATTRIBUTE((nonnull(5,6,7,8))); diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index a245b472a..fe6b1184b 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -6957,11 +6957,10 @@ int pushmove_sprite(short SpriteNum) SPRITEp sp = &sprite[SpriteNum]; USERp u = User[SpriteNum].Data(); short sectnum, ret; - int daz; - daz = sp->z - u->zclip; + sp->z -= u->zclip; sectnum = sp->sectnum; - ret = pushmove_old(&sp->x, &sp->y, &daz, §num, + ret = pushmove(&sp->pos, §num, (((int)sp->clipdist)<<2)-GETZRANGE_CLIP_ADJ, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR); if (sectnum != sp->sectnum && sectnum >= 0) @@ -6973,7 +6972,7 @@ int pushmove_sprite(short SpriteNum) MONO_PRINT(ds); } - sp->z = daz + u->zclip; + sp->z += u->zclip; return 0; }