diff --git a/source/core/automap.cpp b/source/core/automap.cpp index e963ecbfe..8c899d8da 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -431,7 +431,7 @@ static void drawwhitelines(const DVector2& cpos, const DVector2& cangvect, const for (auto& wal : sector[i].walls) { if (wal.nextwall >= 0) continue; - if (!gFullMap && !wal.walltexture().isValid()) continue; + if (!gFullMap && !wal.walltexture.isValid()) continue; if (isSWALL() && !gFullMap && !show2dwall[wallindex(&wal)]) continue; diff --git a/source/core/maploader.cpp b/source/core/maploader.cpp index 7bbcc7b2f..d5e35fd3c 100644 --- a/source/core/maploader.cpp +++ b/source/core/maploader.cpp @@ -192,10 +192,10 @@ static void ReadWallV7(FileReader& fr, walltype& wall) wall.nextwall = fr.ReadInt16(); wall.nextsector = fr.ReadInt16(); wall.cstat = EWallFlags::FromInt(fr.ReadUInt16()); - wall.wallpicnum = fr.ReadInt16(); - int overpicnum = fr.ReadInt16(); - if (overpicnum == 0) overpicnum = -1; - wall.overpicnum = overpicnum; + wall.setwalltexture(tileGetTextureID(fr.ReadInt16())); + int overpic = fr.ReadInt16(); + if (overpic == 0) overpic = -1; + wall.setovertexture(tileGetTextureID(overpic)); wall.shade = fr.ReadInt8(); wall.pal = fr.ReadUInt8(); wall.xrepeat = fr.ReadUInt8(); @@ -215,10 +215,10 @@ static void ReadWallV6(FileReader& fr, walltype& wall) wall.point2 = fr.ReadInt16(); wall.nextsector = fr.ReadInt16(); wall.nextwall = fr.ReadInt16(); - wall.wallpicnum = fr.ReadInt16(); - int overpicnum = fr.ReadInt16(); - if (overpicnum == 0) overpicnum = -1; - wall.overpicnum = overpicnum; + wall.setwalltexture(tileGetTextureID(fr.ReadInt16())); + int overpic = fr.ReadInt16(); + if (overpic == 0) overpic = -1; + wall.setovertexture(tileGetTextureID(overpic)); wall.shade = fr.ReadInt8(); wall.pal = fr.ReadUInt8(); wall.cstat = EWallFlags::FromInt(fr.ReadUInt16()); @@ -237,10 +237,10 @@ static void ReadWallV5(FileReader& fr, walltype& wall) int y = fr.ReadInt32(); wall.setPosFromMap(x, y); wall.point2 = fr.ReadInt16(); - wall.wallpicnum = fr.ReadInt16(); - int overpicnum = fr.ReadInt16(); - if (overpicnum == 0) overpicnum = -1; - wall.overpicnum = overpicnum; + wall.setwalltexture(tileGetTextureID(fr.ReadInt16())); + int overpic = fr.ReadInt16(); + if (overpic == 0) overpic = -1; + wall.setovertexture(tileGetTextureID(overpic)); wall.shade = fr.ReadInt8(); wall.cstat = EWallFlags::FromInt(fr.ReadUInt16()); wall.xrepeat = fr.ReadUInt8(); diff --git a/source/core/maptypes.h b/source/core/maptypes.h index dad4a8b29..557e03be7 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -244,8 +244,8 @@ struct walltype float ypan_; EWallFlags cstat; - int16_t wallpicnum; - int16_t overpicnum; + FTextureID walltexture; + FTextureID overtexture; union { int16_t lotag, type; }; // type is for Blood int16_t hitag; int16_t extra; @@ -296,10 +296,8 @@ struct walltype bool hasX() const { return _xw != nullptr; } void allocX(); - const FTextureID walltexture() const; - const FTextureID overtexture() const; - void setwalltexture(FTextureID tex); - void setovertexture(FTextureID tex); + void setwalltexture(FTextureID tex) { walltexture = tex; } + void setovertexture(FTextureID tex) { overtexture = tex; } }; // enable for running a compile-check to ensure that renderer-critical variables are not being written to directly. diff --git a/source/core/precache.cpp b/source/core/precache.cpp index ac8c02eeb..37c7b2a82 100644 --- a/source/core/precache.cpp +++ b/source/core/precache.cpp @@ -164,11 +164,11 @@ void precacheMap() for (auto& wal : wall) { - markTextureForPrecache(wal.walltexture(), wal.pal); + markTextureForPrecache(wal.walltexture, wal.pal); if (wal.twoSided()) { - markTextureForPrecache(wal.overtexture(), wal.pal); + markTextureForPrecache(wal.overtexture, wal.pal); } } } \ No newline at end of file diff --git a/source/core/rendering/scene/hw_drawstructs.h b/source/core/rendering/scene/hw_drawstructs.h index 8daa76387..893b85848 100644 --- a/source/core/rendering/scene/hw_drawstructs.h +++ b/source/core/rendering/scene/hw_drawstructs.h @@ -388,7 +388,7 @@ int checkTranslucentReplacement(FTextureID picnum, int pal); inline bool maskWallHasTranslucency(const walltype* wall) { - return (wall->cstat & CSTAT_WALL_TRANSLUCENT) || checkTranslucentReplacement(wall->walltexture(), wall->pal); + return (wall->cstat & CSTAT_WALL_TRANSLUCENT) || checkTranslucentReplacement(wall->walltexture, wall->pal); } inline bool spriteHasTranslucency(const tspritetype* tspr) diff --git a/source/core/rendering/scene/hw_walls.cpp b/source/core/rendering/scene/hw_walls.cpp index d843a53ff..8fccda3fa 100644 --- a/source/core/rendering/scene/hw_walls.cpp +++ b/source/core/rendering/scene/hw_walls.cpp @@ -1012,7 +1012,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec // normal texture - auto tilenum = ((wal->cstat & CSTAT_WALL_1WAY) && wal->nextwall != -1) ? wal->overtexture() : wal->walltexture(); + auto tilenum = ((wal->cstat & CSTAT_WALL_1WAY) && wal->nextwall != -1) ? wal->overtexture : wal->walltexture; texture = TexMan.GetGameTexture(tilenum, true); if (texture && texture->isValid()) { @@ -1048,7 +1048,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec if (bch1a < fch1 || bch2a < fch2) { - auto tilenum = wal->walltexture(); + auto tilenum = wal->walltexture; texture = TexMan.GetGameTexture(tilenum, true); if (texture && texture->isValid()) { @@ -1059,7 +1059,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec if (wal->cstat & (CSTAT_WALL_MASKED | CSTAT_WALL_1WAY)) { - auto tilenum = wal->overtexture(); + auto tilenum = wal->overtexture; texture = TexMan.GetGameTexture(tilenum, true); if (texture && texture->isValid()) { @@ -1083,7 +1083,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec if (bfh1 > ffh1 || bfh2 > ffh2) { auto w = (wal->cstat & CSTAT_WALL_BOTTOM_SWAP) ? backwall : wal; - auto tilenum = w->walltexture(); + auto tilenum = w->walltexture; texture = TexMan.GetGameTexture(tilenum, true); if (texture && texture->isValid()) { diff --git a/source/core/savegamehelp.cpp b/source/core/savegamehelp.cpp index eb0922022..f367e7bfd 100644 --- a/source/core/savegamehelp.cpp +++ b/source/core/savegamehelp.cpp @@ -567,8 +567,8 @@ FSerializer &Serialize(FSerializer &arc, const char *key, walltype &c, walltype ("nextwall", c.nextwall, def->nextwall) ("nextsector", c.nextsector, def->nextsector) ("cstat", c.cstat, def->cstat) - ("picnum", c.wallpicnum, def->wallpicnum) - ("overpicnum", c.overpicnum, def->overpicnum) + ("picnum", c.walltexture, def->walltexture) + ("overpicnum", c.overtexture, def->overtexture) ("shade", c.shade, def->shade) ("pal", c.pal, def->pal) ("xrepeat", c.xrepeat, def->xrepeat) diff --git a/source/core/textures/buildtiles.h b/source/core/textures/buildtiles.h index bfe6a180d..4c3fa32d1 100644 --- a/source/core/textures/buildtiles.h +++ b/source/core/textures/buildtiles.h @@ -14,16 +14,6 @@ // all that's left here is the wrappers that need to go away. -// wrappers that allow partial migration to a textureID-based setup. -inline const FTextureID walltype::walltexture() const -{ - return tileGetTextureID(wallpicnum); -} -inline const FTextureID walltype::overtexture() const -{ - return tileGetTextureID(overpicnum); -} - inline const FTextureID spritetypebase::spritetexture() const { return tileGetTextureID(picnum); @@ -34,19 +24,6 @@ inline void spritetypebase::setspritetexture(FTextureID tex) picnum = legacyTileNum(tex); } - -inline void walltype::setwalltexture(FTextureID tex) -{ - wallpicnum = legacyTileNum(tex); -} - -inline void walltype::setovertexture(FTextureID tex) -{ - if (tex.isValid()) overpicnum = legacyTileNum(tex); - else overpicnum = -1; // unlike the others this one can be invalid. -} - - //[[deprecated]] inline int tileForName(const char* name) { diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 2ff0484fe..7fdd65a78 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -6645,11 +6645,11 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3 case 0: { auto pWall = gHitInfo.hitWall; - nSurf = GetExtInfo(pWall->walltexture()).surftype; + nSurf = GetExtInfo(pWall->walltexture).surftype; if (actCanSplatWall(pWall)) { auto ppos = gHitInfo.hitpos - dv; - int nnSurf = GetExtInfo(pWall->walltexture()).surftype; + int nnSurf = GetExtInfo(pWall->walltexture).surftype; assert(nnSurf < kSurfMax); if (pVectorData->surfHit[nnSurf].fx1 >= 0) { @@ -6667,7 +6667,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3 case 4: { auto pWall = gHitInfo.hitWall; - nSurf = GetExtInfo(pWall->overtexture()).surftype; + nSurf = GetExtInfo(pWall->overtexture).surftype; if (pWall->hasX()) { if (pWall->xw().triggerVector) @@ -6742,7 +6742,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3 if (actCanSplatWall(pWall)) { auto ppos = gHitInfo.hitpos - dv; - int nnSurf = GetExtInfo(pWall->walltexture()).surftype; + int nnSurf = GetExtInfo(pWall->walltexture).surftype; const VECTORDATA* pVectorData1 = &gVectorData[19]; FX_ID t2 = pVectorData1->surfHit[nnSurf].fx2; FX_ID t3 = pVectorData1->surfHit[nnSurf].fx3; diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 33e8f353d..5bf6417e5 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -345,7 +345,7 @@ int VectorScan(DBloodActor* actor, double nOffset, double nZOffset, const DVecto if (pWall->cstat & CSTAT_WALL_YFLIP) nOfs = -nOfs; - auto nTex = TexMan.GetGameTexture(pWall->overtexture()); + auto nTex = TexMan.GetGameTexture(pWall->overtexture); int nSizX = int(nTex->GetDisplayWidth()); int nSizY = int(nTex->GetDisplayHeight()); if (!nSizX || !nSizY) @@ -362,7 +362,7 @@ int VectorScan(DBloodActor* actor, double nOffset, double nZOffset, const DVecto int nHOffset = int(pWall->xpan_ + ((fHOffset * pWall->xrepeat) * 8) / nLength) % nSizX; nnOfs %= nSizY; - auto pData = GetRawPixels(pWall->overtexture()); + auto pData = GetRawPixels(pWall->overtexture); int nPixel = nHOffset * nSizY + nnOfs; if (pData[nPixel] == TRANSPARENT_INDEX) diff --git a/source/games/blood/src/mirrors.cpp b/source/games/blood/src/mirrors.cpp index 82d43040e..2fd320dd6 100644 --- a/source/games/blood/src/mirrors.cpp +++ b/source/games/blood/src/mirrors.cpp @@ -51,7 +51,7 @@ void InitMirrors(void) auto pWalli = &wall[i]; if (mirrorcnt == 16) break; - if (pWalli->overtexture() == mirrortile) + if (pWalli->overtexture == mirrortile) { if (pWalli->extra > 0 && pWalli->type == kWallStack) { @@ -88,7 +88,7 @@ void InitMirrors(void) } continue; } - if (pWalli->walltexture() == mirrortile) + if (pWalli->walltexture == mirrortile) { mirror[mirrorcnt].link = i; mirror[mirrorcnt].mynum = i; diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index b54a79c5c..a078928e1 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -3956,8 +3956,8 @@ bool condCheckMixed(DBloodActor* aCond, const EVENT& event, int cmpOp, bool PUSH walltype* pObj = eob.wall(); switch (cond) { - case 24: return condCmp(GetExtInfo(pObj->walltexture()).surftype, arg1, arg2, cmpOp); - case 25: return condCmp(legacyTileNum(pObj->walltexture()), arg1, arg2, cmpOp); + case 24: return condCmp(GetExtInfo(pObj->walltexture).surftype, arg1, arg2, cmpOp); + case 25: return condCmp(legacyTileNum(pObj->walltexture), arg1, arg2, cmpOp); case 26: return condCmp(pObj->pal, arg1, arg2, cmpOp); case 27: return condCmp(pObj->shade, arg1, arg2, cmpOp); case 28: return (arg3) ? condCmp((pObj->cstat & EWallFlags::FromInt(arg3)), arg1, arg2, cmpOp) : (pObj->cstat & EWallFlags::FromInt(arg1)); @@ -4271,7 +4271,7 @@ bool condCheckWall(DBloodActor* aCond, int cmpOp, bool PUSH) { default: break; case 0: - return condCmp(legacyTileNum(pWall->overtexture()), arg1, arg2, cmpOp); + return condCmp(legacyTileNum(pWall->overtexture), arg1, arg2, cmpOp); case 5: if (PUSH) condPush(aCond, pWall->sectorp()); return true; diff --git a/source/games/blood/src/sectorfx.cpp b/source/games/blood/src/sectorfx.cpp index 08016610f..917067001 100644 --- a/source/games/blood/src/sectorfx.cpp +++ b/source/games/blood/src/sectorfx.cpp @@ -320,7 +320,7 @@ void DoSectorPanning(void) psx = MulScale(psx, pXWall->busy, 16); psy = MulScale(psy, pXWall->busy, 16); } - auto nTex = TexMan.GetGameTexture(pWall->walltexture()); + auto nTex = TexMan.GetGameTexture(pWall->walltexture); int px = (psx << 2) / int(nTex->GetDisplayWidth()); int py = (psy << 2) / int(nTex->GetDisplayHeight()); diff --git a/source/games/blood/src/tile.cpp b/source/games/blood/src/tile.cpp index 272bcac81..41be94610 100644 --- a/source/games/blood/src/tile.cpp +++ b/source/games/blood/src/tile.cpp @@ -126,7 +126,7 @@ int tileGetSurfType(CollisionBase& hit) case kHitSector: return GetExtInfo(hit.hitSector->floortexture).surftype; case kHitWall: - return GetExtInfo(hit.hitWall->walltexture()).surftype; + return GetExtInfo(hit.hitWall->walltexture).surftype; case kHitSprite: return GetExtInfo(hit.hitActor->spr.spritetexture()).surftype; } diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index e44f67105..4b70fdddf 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -2152,10 +2152,9 @@ void handle_se19(DDukeActor *actor) if (actor->temp_data[0] == 1) { actor->temp_data[0]++; - auto bigforce = TexMan.CheckForTexture("BIGFORCE", ETextureType::Any); for (auto& wal : sc->walls) { - if (wal.overtexture() == bigforce) + if (tileflags(wal.overtexture) & TFLAG_FORCEFIELD) { wal.cstat &= (CSTAT_WALL_TRANSLUCENT | CSTAT_WALL_1WAY | CSTAT_WALL_XFLIP | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_BOTTOM_SWAP); wal.setovertexture(FNullTextureID()); @@ -2696,7 +2695,7 @@ void handle_se128(DDukeActor *actor) } // else return; - auto data = breakWallMap.CheckKey(wal->overtexture().GetIndex()); + auto data = breakWallMap.CheckKey(wal->overtexture.GetIndex()); FTextureID newtex = data? data->brokentex : FNullTextureID(); wal->setovertexture(newtex); auto nextwal = wal->nextWall(); diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 69b2ec9c6..a30b368e2 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -1844,8 +1844,8 @@ void destroyit(DDukeActor *actor) auto srcwal = srcsect->walls.Data(); for (unsigned i = 0; i < destsect->walls.Size(); i++, srcwal++, destwal++) { - destwal->setwalltexture(srcwal->walltexture()); - destwal->setovertexture(srcwal->overtexture()); + destwal->setwalltexture(srcwal->walltexture); + destwal->setovertexture(srcwal->overtexture); destwal->shade = srcwal->shade; destwal->xrepeat = srcwal->xrepeat; destwal->yrepeat = srcwal->yrepeat; diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index e6c6fafef..272fbee0c 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -973,11 +973,11 @@ void DoWall(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, i break; case WALL_PICNUM: if (bSet) wallp->setwalltexture(tileGetTextureID(lValue)); - else SetGameVarID(lVar2, legacyTileNum(wallp->walltexture()), sActor, sPlayer); + else SetGameVarID(lVar2, legacyTileNum(wallp->walltexture), sActor, sPlayer); break; case WALL_OVERPICNUM: if (bSet) wallp->setovertexture(tileGetTextureID(lValue)); - else SetGameVarID(lVar2, legacyTileNum(wallp->overtexture()), sActor, sPlayer); + else SetGameVarID(lVar2, legacyTileNum(wallp->overtexture), sActor, sPlayer); break; case WALL_SHADE: if (bSet) wallp->shade = lValue; diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 2f27940cb..247203d77 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -281,7 +281,7 @@ static void shootknee(DDukeActor* actor, int p, DVector3 pos, DAngle ang) if (hit.hitpos.Z >= hit.hitWall->nextSector()->floorz) hit.hitWall =hit.hitWall->nextWall(); - if (!isaccessswitch(hit.hitWall->walltexture())) + if (!isaccessswitch(hit.hitWall->walltexture)) { checkhitwall(knee, hit.hitWall, hit.hitpos); if (p >= 0) checkhitswitch(p, hit.hitWall, nullptr); @@ -451,11 +451,11 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int { spawn(spark, DTILE_SMALLSMOKE); - if (isadoorwall(hit.hitWall->walltexture()) == 1) + if (isadoorwall(hit.hitWall->walltexture) == 1) goto SKIPBULLETHOLE; - if (isablockdoor(hit.hitWall->walltexture()) == 1) + if (isablockdoor(hit.hitWall->walltexture) == 1) goto SKIPBULLETHOLE; - if (p >= 0 && isshootableswitch(hit.hitWall->walltexture())) + if (p >= 0 && isshootableswitch(hit.hitWall->walltexture)) { checkhitswitch(p, hit.hitWall, nullptr); return; @@ -465,7 +465,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int goto SKIPBULLETHOLE; if (hit.hitSector && hit.hitSector->lotag == 0) - if (!(tileflags(hit.hitWall->overtexture()) & TFLAG_FORCEFIELD)) + if (!(tileflags(hit.hitWall->overtexture) & TFLAG_FORCEFIELD)) if ((hit.hitWall->twoSided() && hit.hitWall->nextSector()->lotag == 0) || (!hit.hitWall->twoSided() && hit.hitSector->lotag == 0)) if ((hit.hitWall->cstat & CSTAT_WALL_MASKED) == 0) @@ -940,7 +940,7 @@ static void shootgrowspark(DDukeActor* actor, int p, DVector3 pos, DAngle ang) else if (hit.actor() != nullptr) fi.checkhitsprite(hit.actor(), spark); else if (hit.hitWall != nullptr) { - if (!isaccessswitch(hit.hitWall->walltexture())) + if (!isaccessswitch(hit.hitWall->walltexture)) { checkhitwall(spark, hit.hitWall, hit.hitpos); } @@ -1987,7 +1987,7 @@ int operateTripbomb(int snum) return 0; if (hit.hitWall != nullptr) - if (tileflags(hit.hitWall->overtexture()) & TFLAG_FORCEFIELD) + if (tileflags(hit.hitWall->overtexture) & TFLAG_FORCEFIELD) return 0; DDukeActor* act; diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index df91aa2a7..73ad39d0c 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -172,7 +172,7 @@ static void shootmelee(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int a if (hit.hitpos.Z >= hit.hitWall->nextSector()->floorz) hit.hitWall = hit.hitWall->nextWall(); - if (!isaccessswitch(hit.hitWall->walltexture())) + if (!isaccessswitch(hit.hitWall->walltexture)) { checkhitwall(wpn, hit.hitWall, hit.hitpos); if (p >= 0) checkhitswitch(p, hit.hitWall, nullptr); @@ -344,11 +344,11 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int { spawn(spark, RTILE_SMALLSMOKE); - if (isadoorwall(hit.hitWall->walltexture()) == 1) + if (isadoorwall(hit.hitWall->walltexture) == 1) goto SKIPBULLETHOLE; - if (isablockdoor(hit.hitWall->walltexture()) == 1) + if (isablockdoor(hit.hitWall->walltexture) == 1) goto SKIPBULLETHOLE; - if (p >= 0 && isshootableswitch(hit.hitWall->walltexture())) + if (p >= 0 && isshootableswitch(hit.hitWall->walltexture)) { checkhitswitch(p, hit.hitWall, nullptr); return; @@ -358,7 +358,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int goto SKIPBULLETHOLE; if (hit.hitSector != nullptr && hit.hitSector->lotag == 0) - if (!(tileflags(hit.hitWall->overtexture()) & TFLAG_FORCEFIELD)) + if (!(tileflags(hit.hitWall->overtexture) & TFLAG_FORCEFIELD)) if ((hit.hitWall->twoSided() && hit.hitWall->nextSector()->lotag == 0) || (!hit.hitWall->twoSided() && hit.hitSector->lotag == 0)) if ((hit.hitWall->cstat & CSTAT_WALL_MASKED) == 0) diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 877974f8a..91051c6d8 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -709,7 +709,7 @@ void prelevel_common(int g) numanimwalls = 0; for (auto& wal : wall) { - if (wal.overtexture() == mirrortex && (wal.cstat & CSTAT_WALL_1WAY) != 0) + if (wal.overtexture == mirrortex && (wal.cstat & CSTAT_WALL_1WAY) != 0) { auto sectp = wal.nextSector(); @@ -726,15 +726,15 @@ void prelevel_common(int g) } } - if (tileflags(wal.overtexture()) & (TFLAG_FORCEFIELD | TFLAG_ANIMFORCEFIELD)) + if (tileflags(wal.overtexture) & (TFLAG_FORCEFIELD | TFLAG_ANIMFORCEFIELD)) { animwall[numanimwalls].wall = &wal; animwall[numanimwalls].tag = 0; - animwall[numanimwalls].origtex = wal.overtexture(); + animwall[numanimwalls].origtex = wal.overtexture; animwall[numanimwalls].overpic = true; numanimwalls++; - if (tileflags(wal.overtexture()) & TFLAG_ANIMFORCEFIELD) + if (tileflags(wal.overtexture) & TFLAG_ANIMFORCEFIELD) { if (wal.shade > 31) wal.cstat = 0; @@ -744,11 +744,11 @@ void prelevel_common(int g) wal.nextWall()->lotag = wal.lotag; } } - if (tileflags(wal.walltexture()) & (TFLAG_ANIMSCREEN | TFLAG_ANIMSCREENNOISE)) + if (tileflags(wal.walltexture) & (TFLAG_ANIMSCREEN | TFLAG_ANIMSCREENNOISE)) { animwall[numanimwalls].wall = &wal; animwall[numanimwalls].tag = -1; - animwall[numanimwalls].origtex = wal.walltexture(); + animwall[numanimwalls].origtex = wal.walltexture; animwall[numanimwalls].overpic = false; numanimwalls++; } @@ -864,7 +864,7 @@ static void SpawnPortals() { for (auto& wal : wall) { - if (wal.overtexture() == mirrortex && (wal.cstat & CSTAT_WALL_1WAY)) wal.portalflags |= PORTAL_WALL_MIRROR; + if (wal.overtexture == mirrortex && (wal.cstat & CSTAT_WALL_1WAY)) wal.portalflags |= PORTAL_WALL_MIRROR; } portalClear(); @@ -1147,7 +1147,7 @@ void enterlevel(MapRecord *mi, int gamemode) setLevelStarted(mi); for (auto& wal : wall) { - if (tileflags(wal.walltexture()) & TFLAG_SEASICKWALL) + if (tileflags(wal.walltexture) & TFLAG_SEASICKWALL) StartInterpolation(&wal, Interp_Wall_PanX); } } diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index 4e97811f6..839f1d8c8 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -1248,7 +1248,7 @@ void operateforcefields(DDukeActor *effector, int low) auto wal = animwall[p].wall; if (low == wal->lotag || low == -1) - if (tileflags(wal->overtexture()) & (TFLAG_FORCEFIELD | TFLAG_ANIMFORCEFIELD)) + if (tileflags(wal->overtexture) & (TFLAG_FORCEFIELD | TFLAG_ANIMFORCEFIELD)) { animwall[p].tag = 0; @@ -1273,7 +1273,7 @@ void operateforcefields(DDukeActor *effector, int low) void checkhitwall(DDukeActor* spr, walltype* wal, const DVector3& pos) { - if (wal->overtexture() == mirrortex && actorflag(spr, SFLAG2_BREAKMIRRORS)) + if (wal->overtexture == mirrortex && actorflag(spr, SFLAG2_BREAKMIRRORS)) { lotsofglass(spr, wal, 70); wal->cstat &= ~CSTAT_WALL_MASKED; @@ -1301,14 +1301,14 @@ void checkhitwall(DDukeActor* spr, walltype* wal, const DVector3& pos) if (wal->twoSided() && wal->nextSector()->floorz > pos.Z && wal->nextSector()->floorz - wal->nextSector()->ceilingz) { - auto data = breakWallMap.CheckKey(wal->overtexture().GetIndex()); + auto data = breakWallMap.CheckKey(wal->overtexture.GetIndex()); if (data && (data->flags & 1) && (!(data->flags & 2) || wal->cstat & CSTAT_WALL_MASKED)) { if (handler(data)) wal->setovertexture(data->brokentex); } } - auto data = breakWallMap.CheckKey(wal->walltexture().GetIndex()); + auto data = breakWallMap.CheckKey(wal->walltexture.GetIndex()); if (data && !(data->flags & 1)) { if (handler(data)) wal->setwalltexture(data->brokentex); @@ -1565,7 +1565,7 @@ void togglewallswitches(walltype* wwal, const TexExtInfo& ext, int lotag, int& c { if (lotag != wal.lotag) continue; - auto& other_ext = GetExtInfo(wal.walltexture()); + auto& other_ext = GetExtInfo(wal.walltexture); auto& other_swdef = switches[other_ext.switchindex]; switch (other_swdef.type) @@ -1635,7 +1635,7 @@ bool checkhitswitch(int snum, walltype* wwal, DDukeActor* act) if (lotag == 0) return 0; hitag = wwal->hitag; spos = wwal->pos; - texid = wwal->walltexture(); + texid = wwal->walltexture; switchpal = wwal->pal; } auto& ext = GetExtInfo(texid); @@ -1792,7 +1792,7 @@ void animatewalls(void) { for (auto& wal : wall) { - if (tileflags(wal.walltexture()) & TFLAG_SEASICKWALL) + if (tileflags(wal.walltexture) & TFLAG_SEASICKWALL) wal.addxpan(6); } } @@ -1802,18 +1802,18 @@ void animatewalls(void) for (int p = 0; p < numanimwalls; p++) { auto wal = animwall[p].wall; - auto texid = wal->walltexture(); + auto texid = wal->walltexture; if (!animwall[p].overpic) { - if (tileflags(wal->walltexture()) & TFLAG_ANIMSCREEN) + if (tileflags(wal->walltexture) & TFLAG_ANIMSCREEN) { if ((krand() & 255) < 16) { wal->setwalltexture(noise); } } - else if (tileflags(wal->walltexture()) & TFLAG_ANIMSCREENNOISE) + else if (tileflags(wal->walltexture) & TFLAG_ANIMSCREENNOISE) { if (animwall[p].origtex.isValid()) wal->setwalltexture(animwall[p].origtex); @@ -1827,7 +1827,7 @@ void animatewalls(void) } else { - if (tileflags(wal->overtexture()) & TFLAG_ANIMFORCEFIELD && wal->cstat & CSTAT_WALL_MASKED) + if (tileflags(wal->overtexture) & TFLAG_ANIMFORCEFIELD && wal->cstat & CSTAT_WALL_MASKED) { t = animwall[p].tag; diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index edcafcd90..03c82ca71 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -132,7 +132,7 @@ void checkplayerhurt_d(player_struct* p, const Collision& coll) if (p->hurt_delay > 0) p->hurt_delay--; else if (wal->cstat & (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN)) { - int tf = tileflags(wal->overtexture()); + int tf = tileflags(wal->overtexture); if (tf & TFLAG_ANIMFORCEFIELD) { p->GetActor()->spr.extra -= 5; @@ -390,7 +390,7 @@ void checksectors_d(int snum) if (hitscanwall != nullptr) { - if (dist < 80 && hitscanwall->overtexture() == mirrortex) + if (dist < 80 && hitscanwall->overtexture == mirrortex) if (hitscanwall->lotag > 0 && S_CheckSoundPlaying(hitscanwall->lotag) == 0 && snum == screenpeek) { S_PlayActorSound(hitscanwall->lotag, pact); @@ -467,7 +467,7 @@ void checksectors_d(int snum) if (near.hitWall) { - if (near.hitWall->lotag > 0 && isadoorwall(near.hitWall->walltexture())) + if (near.hitWall->lotag > 0 && isadoorwall(near.hitWall->walltexture)) { if (hitscanwall == near.hitWall || hitscanwall == nullptr) checkhitswitch(snum, near.hitWall, nullptr); diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 2feaa8e30..a5b13b765 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -143,7 +143,7 @@ void checkplayerhurt_r(player_struct* p, const Collision &coll) if (p->hurt_delay > 0) p->hurt_delay--; else if (wal->cstat & (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN)) { - int tf = tileflags(wal->overtexture()); + int tf = tileflags(wal->overtexture); if (tf & TFLAG_FORCEFIELD) { p->hurt_delay = 26; @@ -337,7 +337,7 @@ void checksectors_r(int snum) { if (isRRRA()) { - if (hitscanwall->overtexture() == mirrortex && snum == screenpeek) + if (hitscanwall->overtexture == mirrortex && snum == screenpeek) if (numplayers == 1) { if (S_CheckActorSoundPlaying(pact, 27) == 0 && S_CheckActorSoundPlaying(pact, 28) == 0 && S_CheckActorSoundPlaying(pact, 29) == 0 @@ -360,7 +360,7 @@ void checksectors_r(int snum) } else { - if (hitscanwall->overtexture() == mirrortex) + if (hitscanwall->overtexture == mirrortex) if (hitscanwall->lotag > 0 && S_CheckActorSoundPlaying(pact, hitscanwall->lotag) == 0 && snum == screenpeek) { S_PlayActorSound(hitscanwall->lotag, pact); @@ -466,7 +466,7 @@ void checksectors_r(int snum) if (near.hitWall) { - if (near.hitWall->lotag > 0 && isadoorwall(near.hitWall->walltexture())) + if (near.hitWall->lotag > 0 && isadoorwall(near.hitWall->walltexture)) { if (hitscanwall == near.hitWall || hitscanwall == nullptr) checkhitswitch(snum, near.hitWall, nullptr); diff --git a/source/games/duke/src/vmexports.cpp b/source/games/duke/src/vmexports.cpp index 59e414908..2e1c7cb4e 100644 --- a/source/games/duke/src/vmexports.cpp +++ b/source/games/duke/src/vmexports.cpp @@ -1122,7 +1122,7 @@ DEFINE_ACTION_FUNCTION(_DukePlayer, hitablockingwall) PARAM_SELF_STRUCT_PROLOGUE(player_struct); walltype* pwal; hitawall(self, &pwal); - ACTION_RETURN_BOOL(pwal && pwal->overtexture().isValid()); + ACTION_RETURN_BOOL(pwal && pwal->overtexture.isValid()); } inline double DukePlayer_GetPitchwithView(player_struct* pl) @@ -1334,7 +1334,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, ceilingsurface, duke_ceilingsurface) int duke_wallflags(walltype* wal, int which) { - return tileflags(which? wal->overtexture() : wal->walltexture()); + return tileflags(which? wal->overtexture : wal->walltexture); } DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, wallflags, duke_wallflags) @@ -1347,7 +1347,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, wallflags, duke_wallflags) int duke_ismirror(walltype* wal) { - return wal->walltexture() == mirrortex || wal->overtexture() == mirrortex; + return wal->walltexture == mirrortex || wal->overtexture == mirrortex; } DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, ismirror, duke_ismirror) diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 782ebd6e0..ad905efc5 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -465,7 +465,7 @@ HITSPRITE: else if (pHitWall != nullptr) { HITWALL: - if (pHitWall->walltexture() == tileGetTextureID(kEnergy1)) + if (pHitWall->walltexture == tileGetTextureID(kEnergy1)) { if (pHitWall->twoSided()) { diff --git a/source/games/exhumed/src/lighting.cpp b/source/games/exhumed/src/lighting.cpp index b4b2c4f3d..24f51b9f6 100644 --- a/source/games/exhumed/src/lighting.cpp +++ b/source/games/exhumed/src/lighting.cpp @@ -306,7 +306,7 @@ void AddFlash(sectortype* pSector, const DVector3& pos, int val) wal.shade = max( -127, wal.shade + walldist); - if (!var_1C && !wal.overtexture().isValid() && pNextSector) + if (!var_1C && !wal.overtexture.isValid() && pNextSector) { AddFlash(pNextSector, pos, val); } diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index f77aa74c7..50c339f1f 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -1249,13 +1249,13 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx) if (sTrap[nTrap].pWall1 != nullptr) { sTrap[nTrap].pWall2 = &wal; - sTrap[nTrap].nPicnum2 = wal.walltexture(); + sTrap[nTrap].nPicnum2 = wal.walltexture; break; } else { sTrap[nTrap].pWall1 = &wal; - sTrap[nTrap].nPicnum1 = wal.walltexture(); + sTrap[nTrap].nPicnum1 = wal.walltexture; } } } @@ -2619,7 +2619,7 @@ void PostProcess() for(auto& wal : sect.walls) { - if (wal.walltexture() == texid3603) + if (wal.walltexture == texid3603) { wal.pal = 1; auto pActor = insertActor(§, 407); diff --git a/source/games/exhumed/src/runlist.cpp b/source/games/exhumed/src/runlist.cpp index fed940149..cb94aa56e 100644 --- a/source/games/exhumed/src/runlist.cpp +++ b/source/games/exhumed/src/runlist.cpp @@ -1625,7 +1625,7 @@ void runlist_ProcessWallTag(walltype* pWall, int nLotag, int nHitag) case 1: { - int nWallFace = BuildWallFace(nChannel, pWall, pWall->walltexture()); + int nWallFace = BuildWallFace(nChannel, pWall, pWall->walltexture); runlist_AddRunRec(sRunChannels[nChannel].a, nWallFace, 0x70000); auto nSwitch = BuildSwPressWall(nChannel, BuildLink(2, nEffectTag, 0), pWall); @@ -1643,7 +1643,7 @@ void runlist_ProcessWallTag(walltype* pWall, int nLotag, int nHitag) case 7: // Regular switch { - int nWallFace = BuildWallFace(nChannel, pWall, pWall->walltexture()); + int nWallFace = BuildWallFace(nChannel, pWall, pWall->walltexture); runlist_AddRunRec(sRunChannels[nChannel].a, nWallFace, 0x70000); auto nSwitch = BuildSwPressWall(nChannel, BuildLink(1, 1), pWall); @@ -1653,7 +1653,7 @@ void runlist_ProcessWallTag(walltype* pWall, int nLotag, int nHitag) case 8: // Reverse switch { - int nWallFace = BuildWallFace(nChannel, pWall, pWall->walltexture()); + int nWallFace = BuildWallFace(nChannel, pWall, pWall->walltexture); runlist_AddRunRec(sRunChannels[nChannel].a, nWallFace, 0x70000); auto nSwitch = BuildSwPressWall(nChannel, BuildLink(2, -1, 0), pWall); diff --git a/source/games/sw/src/break.cpp b/source/games/sw/src/break.cpp index 6fe3b41b3..db2c74786 100644 --- a/source/games/sw/src/break.cpp +++ b/source/games/sw/src/break.cpp @@ -468,16 +468,16 @@ BREAK_INFO* SetupWallForBreak(walltype* wallp) { BREAK_INFO* break_info; - break_info = FindWallBreakInfo(wallp->walltexture()); + break_info = FindWallBreakInfo(wallp->walltexture); if (break_info) { wallp->lotag = TAG_WALL_BREAK; wallp->extra |= (WALLFX_DONT_STICK); } - if (wallp->overtexture().isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) + if (wallp->overtexture.isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) { - break_info = FindWallBreakInfo(wallp->overtexture()); + break_info = FindWallBreakInfo(wallp->overtexture); if (break_info) { wallp->lotag = TAG_WALL_BREAK; @@ -568,17 +568,17 @@ int AutoBreakWall(walltype* wallp, const DVector3& hit_pos, DAngle ang, int type // only break ONE of the walls if (nwp->lotag == TAG_WALL_BREAK && - nwp->overtexture().isValid() && + nwp->overtexture.isValid() && (nwp->cstat & CSTAT_WALL_MASKED)) { nwp->lotag = 0; } } - if (wallp->overtexture().isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) - break_info = FindWallBreakInfo(wallp->overtexture()); + if (wallp->overtexture.isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) + break_info = FindWallBreakInfo(wallp->overtexture); else - break_info = FindWallBreakInfo(wallp->walltexture()); + break_info = FindWallBreakInfo(wallp->walltexture); if (!break_info) { @@ -603,7 +603,7 @@ int AutoBreakWall(walltype* wallp, const DVector3& hit_pos, DAngle ang, int type } // change the wall - if (wallp->overtexture().isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) + if (wallp->overtexture.isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) { if (break_info->breaknum == -1) { @@ -673,7 +673,7 @@ bool UserBreakWall(walltype* wp) return true; } - if (wp->walltexture() == actor->texparam) + if (wp->walltexture == actor->texparam) return true; // make it BROKEN @@ -727,7 +727,7 @@ bool UserBreakWall(walltype* wp) else { // increment picnum - wp->setwalltexture(wp->walltexture() + 1); + wp->setwalltexture(wp->walltexture + 1); DoSpawnSpotsForDamage(match); } diff --git a/source/games/sw/src/copysect.cpp b/source/games/sw/src/copysect.cpp index 21a5f98cf..7ccd0c671 100644 --- a/source/games/sw/src/copysect.cpp +++ b/source/games/sw/src/copysect.cpp @@ -58,8 +58,8 @@ void CopySectorWalls(sectortype* dest_sect, sectortype* src_sect) // this looks broken. do { - dwall->setwalltexture(swall->walltexture()); - dwall->setovertexture(swall->overtexture()); + dwall->setwalltexture(swall->walltexture); + dwall->setovertexture(swall->overtexture); dwall->xrepeat = swall->xrepeat; dwall->yrepeat = swall->yrepeat; @@ -76,10 +76,10 @@ void CopySectorWalls(sectortype* dest_sect, sectortype* src_sect) { auto const dest_nextwall = dwall->nextWall(); auto const src_nextwall = swall->nextWall(); - dest_nextwall->setwalltexture(src_nextwall->walltexture()); + dest_nextwall->setwalltexture(src_nextwall->walltexture); dest_nextwall->xrepeat = src_nextwall->xrepeat; dest_nextwall->yrepeat = src_nextwall->yrepeat; - dest_nextwall->setovertexture(src_nextwall->overtexture()); + dest_nextwall->setovertexture(src_nextwall->overtexture); dest_nextwall->pal = src_nextwall->pal; dest_nextwall->cstat = src_nextwall->cstat; dest_nextwall->shade = src_nextwall->shade; diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index adf45383e..2be45656c 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1142,7 +1142,7 @@ void UpdateWallPortalState() continue; } walltype* wal = mirror[i].mirrorWall; - if (wal->walltexture() != tileGetTextureID(MIRRORLABEL)) + if (wal->walltexture != tileGetTextureID(MIRRORLABEL)) { wal->portalflags = 0; continue; diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index 33256f65f..874808a19 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -218,7 +218,7 @@ void JS_SpriteSetup(void) // Check for certain walls to make sounds for(auto& wal : wall) { - int surf = tilesurface(wal.walltexture()); + int surf = tilesurface(wal.walltexture); if (surf == TSURF_WATER || surf == TSURF_LAVA || surf == TSURF_SHALLOWWATER) wal.extra |= WALLFX_DONT_STICK; } @@ -256,7 +256,7 @@ void JS_InitMirrors(void) auto mi = tileGetTextureID(MIRROR); for(auto& wal : wall) { - if (wal.twoSided() && (wal.overtexture() == mi) && (wal.cstat & CSTAT_WALL_1WAY)) + if (wal.twoSided() && (wal.overtexture == mi) && (wal.cstat & CSTAT_WALL_1WAY)) { auto sec = wal.nextSector(); if ((sec->floorstat & CSTAT_SECTOR_SKY) == 0) diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index 14ec0e00f..a0117dbe9 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -192,10 +192,10 @@ void WallSetup(void) for (auto& wal : wall) { /* - if (wal.walltexture() == FAFPlaceMirrorPic[0]) + if (wal.walltexture == FAFPlaceMirrorPic[0]) wal.setwalltexture(FAFMirrorPic[0]); - if (wal.walltexture() == FAFPlaceMirrorPic[1]) + if (wal.walltexture == FAFPlaceMirrorPic[1]) wal.setwalltexture(FAFMirrorPic[1]);*/ // this overwrites the lotag so it needs to be called LAST - its down there