diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 1a4944b54..017183c87 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -342,9 +342,9 @@ int VectorScan(DBloodActor* actor, double nOffset, double nZOffset, const DVecto if (pWall->cstat & CSTAT_WALL_YFLIP) nOfs = -nOfs; - int nPicnum = pWall->overpicnum; - int nSizX = tileWidth(nPicnum); - int nSizY = tileHeight(nPicnum); + auto nTex = TexMan.GetGameTexture(pWall->overtexture()); + int nSizX = int(nTex->GetDisplayWidth()); + int nSizY = int(nTex->GetDisplayHeight()); if (!nSizX || !nSizY) return 0; @@ -359,7 +359,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 = tilePtr(nPicnum); + auto pData = tilePtr(pWall->overpicnum); int nPixel = nHOffset * nSizY + nnOfs; if (pData[nPixel] == TRANSPARENT_INDEX) diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 3aecd68fc..7d8923b54 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -4260,7 +4260,7 @@ bool condCheckWall(DBloodActor* aCond, int cmpOp, bool PUSH) { default: break; case 0: - return condCmp(pWall->overpicnum, 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/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index a9bc7abfa..7a90f1b55 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -972,12 +972,12 @@ void DoWall(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, i else SetGameVarID(lVar2, wallp->cstat, sActor, sPlayer); break; case WALL_PICNUM: - if (bSet) wallp->wallpicnum = lValue; - else SetGameVarID(lVar2, wallp->wallpicnum, sActor, sPlayer); + if (bSet) wallp->setwalltexture(tileGetTextureID(lValue)); + else SetGameVarID(lVar2, legacyTileNum(wallp->walltexture()), sActor, sPlayer); break; case WALL_OVERPICNUM: - if (bSet) wallp->overpicnum = lValue; - else SetGameVarID(lVar2, wallp->overpicnum, sActor, sPlayer); + if (bSet) wallp->setovertexture(tileGetTextureID(lValue)); + else SetGameVarID(lVar2, legacyTileNum(wallp->overtexture()), sActor, sPlayer); break; case WALL_SHADE: if (bSet) wallp->shade = lValue; diff --git a/source/games/exhumed/src/lighting.cpp b/source/games/exhumed/src/lighting.cpp index c2bfe6e13..3304601c9 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.overpicnum && pNextSector) + if (!var_1C && !wal.overtexture().isValid() && pNextSector) { AddFlash(pNextSector, pos, val); } diff --git a/source/games/sw/src/break.cpp b/source/games/sw/src/break.cpp index ee757b93d..af2b9488d 100644 --- a/source/games/sw/src/break.cpp +++ b/source/games/sw/src/break.cpp @@ -483,7 +483,7 @@ BREAK_INFO* SetupWallForBreak(walltype* wallp) wallp->extra |= (WALLFX_DONT_STICK); } - if (wallp->overpicnum > 0 && (wallp->cstat & CSTAT_WALL_MASKED)) + if (wallp->overtexture().isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) { break_info = FindWallBreakInfo(wallp->overpicnum); if (break_info) @@ -583,7 +583,7 @@ int AutoBreakWall(walltype* wallp, const DVector3& hit_pos, DAngle ang, int type } } - if (wallp->overpicnum > 0 && (wallp->cstat & CSTAT_WALL_MASKED)) + if (wallp->overtexture().isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) break_info = FindWallBreakInfo(wallp->overpicnum); else break_info = FindWallBreakInfo(wallp->wallpicnum); diff --git a/source/games/sw/src/copysect.cpp b/source/games/sw/src/copysect.cpp index 4b4a20ce8..2c231735a 100644 --- a/source/games/sw/src/copysect.cpp +++ b/source/games/sw/src/copysect.cpp @@ -58,7 +58,8 @@ void CopySectorWalls(sectortype* dest_sect, sectortype* src_sect) // this looks broken. do { - dwall->wallpicnum = swall->wallpicnum; + dwall->setwalltexture(swall->walltexture()); + dwall->setovertexture(swall->overtexture()); dwall->xrepeat = swall->xrepeat; dwall->yrepeat = swall->yrepeat;