From a0f18c360a8f6f539a94e181fcb7388df0600283 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 13 Oct 2022 18:07:41 +0200 Subject: [PATCH] - made some minor edits to clipmove to get rid of a few deprecated wrapper functions. --- source/build/src/clip.cpp | 20 +++++++++++--------- source/core/gamefuncs.h | 39 --------------------------------------- 2 files changed, 11 insertions(+), 48 deletions(-) diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 10848d3ab..5f3ffdbec 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -527,7 +527,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, { vec2_t const vec = pos->vec2; keepaway(&pos->X, &pos->Y, i); - if (inside_p(pos->X,pos->Y, *sectnum) != 1) + if (inside(pos->X,pos->Y, §or[*sectnum]) != 1) pos->vec2 = vec; break; } @@ -599,42 +599,44 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect, if (enginecompatibility_mode != ENGINECOMPATIBILITY_NONE) { + DVector3 fpos(pos->X* inttoworld, pos->Y* inttoworld, pos->Z* inttoworld); + for (int j=0; jX, pos->Y, clipsectorlist[j]) == 1) + if (inside(fpos.X, fpos.Y, §or[clipsectorlist[j]]) == 1) { *sectnum = clipsectorlist[j]; return clipReturn; } - int32_t tempint2, tempint1 = INT32_MAX; + double tempint2, tempint1 = INT32_MAX; *sectnum = -1; for (int j = (int)sector.Size() - 1; j >= 0; j--) { auto sect = §or[j]; - if (inside(pos->X, pos->Y, sect) == 1) + if (inside(fpos.X, fpos.Y, sect) == 1) { - tempint2 = int_getceilzofslopeptr(sect, pos->X, pos->Y) - pos->Z; + tempint2 = getceilzofslopeptr(sect, fpos.X, fpos.Y) - fpos.Z; if (tempint2 > 0) { if (tempint2 < tempint1) { - *sectnum = (int16_t)j; + *sectnum = j; tempint1 = tempint2; } } else { - tempint2 = pos->Z - int_getflorzofslopeptr(sect, pos->X, pos->Y); + tempint2 = fpos.Z - getflorzofslopeptr(sect, fpos.X, fpos.Y); if (tempint2 <= 0) { - *sectnum = (int16_t)j; + *sectnum = j; return clipReturn; } if (tempint2 < tempint1) { - *sectnum = (int16_t)j; + *sectnum = j; tempint1 = tempint2; } } diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index c6f3e8cc2..27e2e96f7 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -320,9 +320,6 @@ inline void PlanesAtPoint(const sectortype* sec, float dax, float day, float* pc } -// only used by clipmove et.al. -void getcorrectzsofslope(int sectnum, int dax, int day, double* ceilz, double* florz); - //========================================================================== // // for the game engine @@ -541,31 +538,6 @@ inline DAngle ClampViewPitch(const DAngle pitch) // //========================================================================== -[[deprecated]] -inline int int_getceilzofslopeptr(const sectortype* sec, int dax, int day) -{ - double z; - calcSlope(sec, dax * inttoworld, day * inttoworld, &z, nullptr); - return int(z * zworldtoint); -} - -[[deprecated]] -inline int int_getflorzofslopeptr(const sectortype* sec, int dax, int day) -{ - double z; - calcSlope(sec, dax * inttoworld, day * inttoworld, nullptr, &z); - return int(z * zworldtoint); -} - -[[deprecated]] -inline void int_getzsofslopeptr(const sectortype* sec, int dax, int day, int* ceilz, int* florz) -{ - double c, f; - calcSlope(sec, dax * inttoworld, day * inttoworld, &c, &f); - *ceilz = int(c * zworldtoint); - *florz = int(f * zworldtoint); -} - [[deprecated]] inline int rintersect(int x1, int y1, int z1, int vx, int vy, int vz, int x3, int y3, int x4, int y4, int* intx, int* inty, int* intz) { @@ -579,23 +551,12 @@ inline int rintersect(int x1, int y1, int z1, int vx, int vy, int vz, int x3, in return FloatToFixed(result); } -[[deprecated]] -inline int cansee(int x1, int y1, int z1, sectortype* sect1, int x2, int y2, int z2, sectortype* sect2) -{ - return cansee(DVector3(x1 * inttoworld, y1 * inttoworld, z1 * zinttoworld), sect1, DVector3(x2 * inttoworld, y2 * inttoworld, z2 * zinttoworld), sect2); -} - [[deprecated]] inline int inside(int x, int y, const sectortype* sect) { return inside(x * inttoworld, y * inttoworld, sect); } -// still needed by some parts in the engine. -[[deprecated]] -inline int inside_p(int x, int y, int sectnum) { return (sectnum >= 0 && inside(x * inttoworld, y * inttoworld, §or[sectnum]) == 1); } - -