mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- remove unused clipmovex function, extend clipmove sector return to 32bit, mark obsolete clipmove variants deprecated
This commit is contained in:
parent
5510efd920
commit
567d054d42
2 changed files with 31 additions and 21 deletions
|
@ -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)));
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue