From eb00fe52db4ea9c42b0a4c9b075a7cc02a4e04b3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 30 Dec 2021 12:29:17 +0100 Subject: [PATCH] - more spritetype references eliminated. --- source/build/include/polymost.h | 6 ---- source/build/src/clip.cpp | 29 ++++++++------------ source/core/automap.cpp | 2 +- source/core/gamefuncs.h | 5 ---- source/core/gamestruct.h | 1 - source/core/rendering/scene/hw_drawstructs.h | 1 - 6 files changed, 13 insertions(+), 31 deletions(-) diff --git a/source/build/include/polymost.h b/source/build/include/polymost.h index dfdd98375..c1fd02afc 100644 --- a/source/build/include/polymost.h +++ b/source/build/include/polymost.h @@ -21,12 +21,6 @@ void polymost_drawsprite(int32_t snum); void polymost_drawmaskwall(int32_t damaskwallcnt); void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, uint8_t dapalnum, int32_t dastat, uint8_t daalpha, uint8_t dablend, int32_t uniqid); void polymost_initosdfuncs(void); -void polymost_drawrooms(void); -void polymost_prepareMirror(int32_t dax, int32_t day, int32_t daz, fixed_t daang, fixed_t dahoriz, int16_t mirrorWall); -void polymost_completeMirror(); - -int32_t polymost_maskWallHasTranslucency(walltype const * const wall); -int32_t polymost_spriteHasTranslucency(spritetype const * const tspr); void polymost_glreset(void); void polymost_scansector(int32_t sectnum); diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 039fb51c3..a15c6fc59 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -1337,8 +1337,6 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire int32_t x1, y1=0, z1=0, x2, y2, intx, inty, intz; int32_t i, k, daz; - const spritetype* curspr = NULL; - // tmp: { (int32_t)curidx, (spritetype *)curspr, (!=0 if outer sector) } const int32_t dawalclipmask = (cliptype&65535); const int32_t dasprclipmask = (cliptype >> 16); @@ -1365,7 +1363,6 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire auto wal2 = wal->point2Wall(); auto const nextsect = wal->nextSector(); - if (curspr && !wal->twoSided()) continue; x1 = wal->pos.X; y1 = wal->pos.Y; x2 = wal2->pos.X; y2 = wal2->pos.Y; @@ -1376,22 +1373,20 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire if (abs(intx-sv->X)+abs(inty-sv->Y) >= abs((hitinfo.hitpos.X)-sv->X)+abs((hitinfo.hitpos.Y)-sv->Y)) continue; - if (!curspr) + if ((!wal->twoSided()) || (wal->cstat & EWallFlags::FromInt(dawalclipmask))) { - if ((!wal->twoSided()) || (wal->cstat & EWallFlags::FromInt(dawalclipmask))) - { - hit_set(&hitinfo, sec, wal, nullptr, intx, inty, intz); - continue; - } - - int32_t daz2; - getzsofslopeptr(nextsect,intx,inty,&daz,&daz2); - if (intz <= daz || intz >= daz2) - { - hit_set(&hitinfo, sec, wal, nullptr, intx, inty, intz); - continue; - } + hit_set(&hitinfo, sec, wal, nullptr, intx, inty, intz); + continue; } + + int32_t daz2; + getzsofslopeptr(nextsect,intx,inty,&daz,&daz2); + if (intz <= daz || intz >= daz2) + { + hit_set(&hitinfo, sec, wal, nullptr, intx, inty, intz); + continue; + } + search.Add(nextsect); } diff --git a/source/core/automap.cpp b/source/core/automap.cpp index 066f09c25..534e39036 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -603,7 +603,7 @@ void renderDrawMapView(int cposx, int cposy, int czoom, int cang) LegacyRenderStyles[STYLE_Translucent], windowxy1.X, windowxy1.Y, windowxy2.X + 1, windowxy2.Y + 1); } } - qsort(floorsprites.Data(), floorsprites.Size(), sizeof(spritetype*), [](const void* a, const void* b) + qsort(floorsprites.Data(), floorsprites.Size(), sizeof(DCoreActor*), [](const void* a, const void* b) { auto A = *(DCoreActor**)a; auto B = *(DCoreActor**)b; diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index 18c1de1c8..8c877e3d4 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -264,11 +264,6 @@ inline int shadeToLight(int shade) return PalEntry(255, light, light, light); } -inline void copyfloorpal(spritetype* spr, const sectortype* sect) -{ - if (!lookups.noFloorPal(sect->floorpal)) spr->pal = sect->floorpal; -} - inline void copyfloorpal(tspritetype* spr, const sectortype* sect) { if (!lookups.noFloorPal(sect->floorpal)) spr->pal = sect->floorpal; diff --git a/source/core/gamestruct.h b/source/core/gamestruct.h index d68af8a60..2309f7555 100644 --- a/source/core/gamestruct.h +++ b/source/core/gamestruct.h @@ -12,7 +12,6 @@ bool System_WantGuiCapture(); // During playing this tells us whether the game m class FSerializer; struct FRenderViewpoint; -struct spritetype; struct sectortype; struct tspritetype; class DCoreActor; diff --git a/source/core/rendering/scene/hw_drawstructs.h b/source/core/rendering/scene/hw_drawstructs.h index d28646812..d168b8504 100644 --- a/source/core/rendering/scene/hw_drawstructs.h +++ b/source/core/rendering/scene/hw_drawstructs.h @@ -182,7 +182,6 @@ public: //HWHorizonInfo * horizon; // for horizon information PortalDesc * portal; // stacked sector portals const int * planemirror; // for plane mirrors - spritetype* teleport; // SW's teleport-views }; unsigned int vertindex;