From a5b3a1dd3e37dd30e9eee54af36b0d473b5be1ad Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 19 Mar 2021 15:12:54 +0100 Subject: [PATCH] - removed some unused things from engine.cpp. --- source/build/include/build.h | 1 - source/build/src/clip.cpp | 9 +++------ source/build/src/engine.cpp | 23 ++--------------------- source/build/src/engine_priv.h | 20 +------------------- source/games/blood/src/misc.h | 1 - source/games/blood/src/replace.cpp | 9 --------- 6 files changed, 6 insertions(+), 57 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index f38528bab..47a6a90db 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -850,7 +850,6 @@ void markTileForPrecache(int tilenum, int palnum); void precacheMarkedTiles(); extern int32_t(*animateoffs_replace)(int const tilenum, int fakevar); -extern int32_t(*getpalookup_replace)(int32_t davis, int32_t dashade); extern void(*initspritelists_replace)(void); extern int32_t(*insertsprite_replace)(int16_t sectnum, int16_t statnum); extern int32_t(*deletesprite_replace)(int16_t spritenum); diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index f1c02c3c3..e6a9f586c 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -508,7 +508,7 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int { clipyou = 1; } - else if (editstatus == 0) + else { clipmove_tweak_pos(pos, diff.x, diff.y, p1.x, p1.y, p2.x, p2.y, &v.x, &v.y); clipyou = cliptestsector(dasect, wal->nextsector, flordist, ceildist, v, pos->z); @@ -990,11 +990,8 @@ void getzrange(const vec3_t *pos, int16_t sectnum, if (wall[j].cstat&dawalclipmask) continue; // XXX? auto const sec = (usectorptr_t)§or[k]; - if (editstatus == 0) - { - if (((sec->ceilingstat&1) == 0) && (pos->z <= sec->ceilingz+(3<<8))) continue; - if (((sec->floorstat&1) == 0) && (pos->z >= sec->floorz-(3<<8))) continue; - } + if (((sec->ceilingstat&1) == 0) && (pos->z <= sec->ceilingz+(3<<8))) continue; + if (((sec->floorstat&1) == 0) && (pos->z >= sec->floorz-(3<<8))) continue; if (bitmap_test(clipsectormap, k) == 0) addclipsect(k); diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 23db1d7d4..6c8a52cba 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -86,7 +86,6 @@ int32_t showfirstwall=0; int32_t showheightindicators=1; int32_t circlewall=-1; -int16_t editstatus = 0; static fixed_t global100horiz; // (-100..300)-scale horiz (the one passed to drawrooms) static FString printcoords(void) @@ -117,8 +116,6 @@ ADD_STAT(printcoords) return printcoords(); } -int32_t(*getpalookup_replace)(int32_t davis, int32_t dashade) = NULL; - // adapted from build.c static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall, vec2_t *const closest) { @@ -148,7 +145,6 @@ static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall, } int32_t xb1[MAXWALLSB]; // Polymost uses this as a temp array -static int32_t xb2[MAXWALLSB]; int32_t rx1[MAXWALLSB], ry1[MAXWALLSB]; int16_t bunchp2[MAXWALLSB], thesector[MAXWALLSB]; @@ -157,7 +153,7 @@ int16_t bunchfirst[MAXWALLSB], bunchlast[MAXWALLSB]; static vec3_t spritesxyz[MAXSPRITESONSCREEN+1]; -int32_t xdimen = -1, xdimenrecip, halfxdimen, xdimenscale, xdimscale; +int32_t xdimen = -1, xdimenscale, xdimscale; float fxdimen = -1.f; int32_t ydimen; @@ -190,18 +186,6 @@ static_assert(MAXWALLSB < INT16_MAX); int16_t numscans, numbunches; static int16_t numhits; -int16_t searchit; -int16_t searchsector, searchwall, searchstat; //search output - -// SEARCHBOTTOMWALL: -// When aiming at a the bottom part of a 2-sided wall whose bottom part -// is swapped (.cstat&2), searchbottomwall equals that wall's .nextwall. In all -// other cases (when aiming at a wall), searchbottomwall equals searchwall. -// -// SEARCHISBOTTOM: -// When aiming at a 2-sided wall, 1 if aiming at the bottom part, 0 else -int16_t searchbottomwall, searchisbottom; - char inpreparemirror = 0; static int32_t mirrorsx1, mirrorsy1, mirrorsx2, mirrorsy2; @@ -795,8 +779,6 @@ int32_t engineInit(void) paletteloaded = 0; - searchit = 0; searchstat = -1; - g_visibility = 512; parallaxvisibility = 512; @@ -2719,8 +2701,7 @@ void videoSetViewableArea(int32_t x1, int32_t y1, int32_t x2, int32_t y2) windowxy2.x = x2; windowxy2.y = y2; - xdimen = (x2-x1)+1; halfxdimen = (xdimen>>1); - xdimenrecip = DivScale(1L,xdimen, 32); + xdimen = (x2-x1)+1; ydimen = (y2-y1)+1; fxdimen = (float) xdimen; diff --git a/source/build/src/engine_priv.h b/source/build/src/engine_priv.h index cb3e3e6f8..5056dc223 100644 --- a/source/build/src/engine_priv.h +++ b/source/build/src/engine_priv.h @@ -39,7 +39,7 @@ extern int16_t thesector[MAXWALLSB], thewall[MAXWALLSB]; extern int16_t bunchfirst[MAXWALLSB], bunchlast[MAXWALLSB]; extern int16_t maskwall[MAXWALLSB], maskwallcnt; extern tspriteptr_t tspriteptr[MAXSPRITESONSCREEN + 1]; -extern int32_t xdimen, xdimenrecip, halfxdimen, xdimenscale, xdimscale, ydimen; +extern int32_t xdimen, xdimenscale, xdimscale, ydimen; extern float fxdimen; extern int32_t globalposx, globalposy, globalposz; extern fixed_t qglobalhoriz, qglobalang; @@ -53,12 +53,6 @@ extern int16_t globalpicnum; extern int32_t globalorientation; -extern int16_t editstatus; - -extern int16_t searchit; -extern int16_t searchsector, searchwall, searchstat; -extern int16_t searchbottomwall, searchisbottom; - extern char inpreparemirror; extern int16_t sectorborder[256]; @@ -85,18 +79,6 @@ static FORCE_INLINE int32_t bad_tspr(tspriteptr_t tspr) return (tspr->owner < 0 || (unsigned)tspr->picnum >= MAXTILES); } -// -// getpalookup (internal) -// -static FORCE_INLINE int32_t getpalookup(int32_t davis, int32_t dashade) -{ - if (getpalookup_replace) - return getpalookup_replace(davis, dashade); - return min(max(dashade + (davis >> 8), 0), numshades - 1); -} - -static FORCE_INLINE int32_t getpalookupsh(int32_t davis) { return getpalookup(davis, globalshade) << 8; } - static FORCE_INLINE void setgotpic(int32_t tilenume) { gotpic[tilenume>>3] |= pow2char[tilenume&7]; diff --git a/source/games/blood/src/misc.h b/source/games/blood/src/misc.h index 0e5b404e7..f4943eb37 100644 --- a/source/games/blood/src/misc.h +++ b/source/games/blood/src/misc.h @@ -41,7 +41,6 @@ void sub_5571C(char mode); void sub_557C4(int x, int y, int interpolation); void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int viewPlayer); int qanimateoffs(int a1, int a2); -int32_t qgetpalookup(int32_t a1, int32_t a2); void HookReplaceFunctions(); struct QAV; diff --git a/source/games/blood/src/replace.cpp b/source/games/blood/src/replace.cpp index 5ab7c7e1c..9ef9e82e5 100644 --- a/source/games/blood/src/replace.cpp +++ b/source/games/blood/src/replace.cpp @@ -62,14 +62,6 @@ int qanimateoffs(int a1, int a2) return offset; } -int32_t qgetpalookup(int32_t a1, int32_t a2) -{ - if (gFogMode) - return ClipHigh(a1 >> 8, 15) * 16 + ClipRange(a2, 0, 15); - else - return ClipRange((a1 >> 8) + a2, 0, 63); -} - void qinitspritelists(); int32_t qinsertsprite(int16_t nSector, int16_t nStat); int32_t qdeletesprite(int16_t nSprite); @@ -79,7 +71,6 @@ int32_t qchangespritestat(int16_t nSprite, int16_t nStatus); void HookReplaceFunctions(void) { animateoffs_replace = qanimateoffs; - getpalookup_replace = qgetpalookup; initspritelists_replace = qinitspritelists; insertsprite_replace = qinsertsprite; deletesprite_replace = qdeletesprite;