From 1dbf34fe56e76252d874b8ecc7794a5d7335aa75 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 4 Jul 2021 21:05:33 +1000 Subject: [PATCH] - Repair some potential issues from 1354d52c05799f50d804b1b97fd2143e626021de that might be causing issues with #455. --- source/build/include/build.h | 4 ++-- source/build/src/clip.cpp | 8 ++++---- source/build/src/engine.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index 3a704a86f..d0b545751 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -56,8 +56,8 @@ enum TSPR_TEMP = 99, - CLIPMASK0 = (IntToFixed(1)+1), - CLIPMASK1 = (IntToFixed(256)+64), + CLIPMASK0 = (1 << 16) + 1, + CLIPMASK1 = (256 << 16) + 64 }; diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 11a4946ac..663acdd3d 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -480,7 +480,7 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int int const initialsectnum = *sectnum; int32_t const dawalclipmask = (cliptype & 65535); // CLIPMASK0 = 0x00010001 - int32_t const dasprclipmask = FixedToInt(cliptype); // CLIPMASK1 = 0x01000040 + int32_t const dasprclipmask = (cliptype >> 16); // CLIPMASK1 = 0x01000040 vec2_t const move = { xvect, yvect }; vec2_t goal = { pos->x + (xvect >> 14), pos->y + (yvect >> 14) }; @@ -857,7 +857,7 @@ int pushmove(vec3_t *const vect, int16_t *const sectnum, int bad; const int32_t dawalclipmask = (cliptype&65535); - // const int32_t dasprclipmask = FixedToInt(cliptype); + // const int32_t dasprclipmask = (cliptype >> 16); if (*sectnum < 0) return -1; @@ -983,7 +983,7 @@ void getzrange(const vec3_t *pos, int16_t sectnum, const int32_t xmax = pos->x+extradist, ymax = pos->y+extradist; const int32_t dawalclipmask = (cliptype&65535); - const int32_t dasprclipmask = FixedToInt(cliptype); + const int32_t dasprclipmask = (cliptype >> 16); vec2_t closest = pos->vec2; if (enginecompatibility_mode == ENGINECOMPATIBILITY_NONE) @@ -1298,7 +1298,7 @@ int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32 // tmp: { (int32_t)curidx, (spritetype *)curspr, (!=0 if outer sector) } intptr_t *tmpptr=NULL; const int32_t dawalclipmask = (cliptype&65535); - const int32_t dasprclipmask = FixedToInt(cliptype); + const int32_t dasprclipmask = (cliptype >> 16); hit->sect = -1; hit->wall = -1; hit->sprite = -1; if (sectnum < 0) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 8a4ea5697..5d48b5bf7 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -505,7 +505,7 @@ int32_t lintersect(const int32_t originX, const int32_t originY, const int32_t o // // rintersect (internal) // -// returns: -1 if didn't intersect, coefficient IntToFixed(x3--x4 fraction) else +// returns: -1 if didn't intersect, coefficient (x3--x4 fraction)<<16 else int32_t rintersect_old(int32_t x1, int32_t y1, int32_t z1, int32_t vx, int32_t vy, int32_t vz, int32_t x3, int32_t y3, int32_t x4, int32_t y4,