diff --git a/source/build/include/clip.h b/source/build/include/clip.h index 117213e18..2448b4157 100644 --- a/source/build/include/clip.h +++ b/source/build/include/clip.h @@ -31,21 +31,42 @@ int clipinsideboxline(int x, int y, int x1, int y1, int x2, int y2, int walldist extern int32_t clipmoveboxtracenum; -int32_t clipmove(vec3_t *const pos, int16_t *const sectnum, int32_t xvect, int32_t yvect, int32_t const walldist, int32_t const ceildist, +int32_t clipmove(vec3_t *const pos, int *const sectnum, int32_t xvect, int32_t yvect, int32_t const walldist, int32_t const ceildist, int32_t const flordist, uint32_t const cliptype) ATTRIBUTE((nonnull(1, 2))); +[[deprecated]] +int32_t clipmove(vec3_t *const pos, int16_t *const sectnum, int32_t xvect, int32_t yvect, int32_t const walldist, int32_t const ceildist, + int32_t const flordist, uint32_t const cliptype) +{ + int sect32 = *sectnum; + int retval = clipmove(pos, §32, xvect, yvect, walldist, ceildist, flordist, cliptype); + *sectnum = sect32; + return retval; +} +[[deprecated]] inline int clipmove(int* x, int* y, int* z, short* sect, int xv, int yv, int wal, int ceil, int flor, int ct) { vec3_t xyz = { *x,*y,*z }; + int sect32 = *sect; int retval = clipmove(&xyz, sect, xv, yv, wal, ceil, flor, ct); + *sect = sect32; *x = xyz.x; *y = xyz.y; *z = xyz.z; return retval; } -int32_t clipmovex(vec3_t *const pos, int16_t *const sectnum, int32_t xvect, int32_t yvect, int32_t const walldist, int32_t const ceildist, - int32_t const flordist, uint32_t const cliptype, uint8_t const noslidep) ATTRIBUTE((nonnull(1, 2))); +[[deprecated]] +inline int clipmove(int* x, int* y, int* z, int* sect, int xv, int yv, int wal, int ceil, int flor, int ct) +{ + vec3_t xyz = { *x,*y,*z }; + int retval = clipmove(&xyz, sect, xv, yv, wal, ceil, flor, ct); + *x = xyz.x; + *y = xyz.y; + *z = xyz.z; + return retval; +} + int pushmove(vec3_t *const vect, int16_t *const sectnum, int32_t const walldist, int32_t const ceildist, int32_t const flordist, uint32_t const cliptype, bool clear = true) ATTRIBUTE((nonnull(1, 2))); diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 38b8a4b5a..8a5c62520 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -272,22 +272,6 @@ static int cliptestsector(int const dasect, int const nextsect, int32_t const fl dacz2 > dacz+CLIPCURBHEIGHT)); // ceilings check the same conditions ^^^^^ } -int32_t clipmovex(vec3_t *pos, int16_t *sectnum, - int32_t xvect, int32_t yvect, - int32_t const walldist, int32_t const ceildist, int32_t const flordist, uint32_t const cliptype, - uint8_t const noslidep) -{ - const int32_t oboxtracenum = clipmoveboxtracenum; - - if (noslidep) - clipmoveboxtracenum = 1; - int32_t ret = clipmove(pos, sectnum, xvect, yvect, - walldist, ceildist, flordist, cliptype); - clipmoveboxtracenum = oboxtracenum; - - return ret; -} - // // raytrace (internal) // @@ -469,7 +453,7 @@ static void clipupdatesector(vec2_t const pos, int16_t * const sectnum, int wall // // clipmove // -int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int32_t yvect, +int32_t clipmove(vec3_t * const pos, int * const sectnum, int32_t xvect, int32_t yvect, int32_t const walldist, int32_t const ceildist, int32_t const flordist, uint32_t const cliptype) { if ((xvect|yvect) == 0 || *sectnum < 0) @@ -789,7 +773,12 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int } if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE) - clipupdatesector(vec, sectnum, rad); + { + // the pervasiveness of 16 bit in the engine is staggering... :( + int16_t sect16 = *sectnum; + clipupdatesector(vec, §16, rad); + *sectnum = sect16; + } pos->x = vec.x; pos->y = vec.y;