- remove unused clipmovex function, extend clipmove sector return to 32bit, mark obsolete clipmove variants deprecated

This commit is contained in:
Christoph Oelckers 2021-11-07 18:20:41 +01:00
parent 5510efd920
commit 567d054d42
2 changed files with 31 additions and 21 deletions

View file

@ -31,10 +31,33 @@ int clipinsideboxline(int x, int y, int x1, int y1, int x2, int y2, int walldist
extern int32_t clipmoveboxtracenum; 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))); 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, &sect32, 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) 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;
}
[[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 }; vec3_t xyz = { *x,*y,*z };
int retval = clipmove(&xyz, sect, xv, yv, wal, ceil, flor, ct); int retval = clipmove(&xyz, sect, xv, yv, wal, ceil, flor, ct);
@ -44,8 +67,6 @@ inline int clipmove(int* x, int* y, int* z, short* sect, int xv, int yv, int wal
return retval; 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)));
int pushmove(vec3_t *const vect, int16_t *const sectnum, int32_t const walldist, int32_t const ceildist, int32_t const flordist, 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))); uint32_t const cliptype, bool clear = true) ATTRIBUTE((nonnull(1, 2)));

View file

@ -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 ^^^^^ 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) // raytrace (internal)
// //
@ -469,7 +453,7 @@ static void clipupdatesector(vec2_t const pos, int16_t * const sectnum, int wall
// //
// clipmove // 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) int32_t const walldist, int32_t const ceildist, int32_t const flordist, uint32_t const cliptype)
{ {
if ((xvect|yvect) == 0 || *sectnum < 0) 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) 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, &sect16, rad);
*sectnum = sect16;
}
pos->x = vec.x; pos->x = vec.x;
pos->y = vec.y; pos->y = vec.y;