From 044929ad062debe08258951c69a15f9bc97d5c87 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 27 Aug 2022 10:13:15 +0200 Subject: [PATCH] - replaced all remaining read access to __int_floorz and __int_ceilingz with wrappers. --- source/core/automap.cpp | 8 ++++---- source/core/interpolate.cpp | 4 ++-- source/core/vmexports.cpp | 8 ++++---- source/games/blood/src/triggers.cpp | 4 ++-- source/games/duke/src/sectors.cpp | 4 ++-- source/games/sw/src/game.h | 2 +- source/games/sw/src/interpso.cpp | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/core/automap.cpp b/source/core/automap.cpp index 91d848d3d..6ab42502d 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -389,10 +389,10 @@ bool ShowRedLine(int j, int i) } if (automapMode == am_full) { - if (sector[i].__int_floorz != sector[i].__int_ceilingz) + if (sector[i].int_floorz() != sector[i].int_ceilingz()) if (wal->nextSector()->int_floorz() != wal->nextSector()->int_ceilingz()) if (((wal->cstat | wal->nextWall()->cstat) & (CSTAT_WALL_MASKED | CSTAT_WALL_1WAY)) == 0) - if (sector[i].__int_floorz == wal->nextSector()->int_floorz()) + if (sector[i].int_floorz() == wal->nextSector()->int_floorz()) return false; if (sector[i].floorpicnum != wal->nextSector()->floorpicnum) return false; @@ -420,8 +420,8 @@ void drawredlines(int cposx, int cposy, int czoom, int cang) { if (!gFullMap && !show2dsector[i]) continue; - int z1 = sector[i].__int_ceilingz; - int z2 = sector[i].__int_floorz; + int z1 = sector[i].int_ceilingz(); + int z2 = sector[i].int_floorz(); for (auto& wal : wallsofsector(i)) { diff --git a/source/core/interpolate.cpp b/source/core/interpolate.cpp index 857de4afc..aad1ed199 100644 --- a/source/core/interpolate.cpp +++ b/source/core/interpolate.cpp @@ -41,8 +41,8 @@ double Get(int index, DCoreActor* actor, int type) { switch(type) { - case Interp_Sect_Floorz: return sector[index].__int_floorz; - case Interp_Sect_Ceilingz: return sector[index].__int_ceilingz; + case Interp_Sect_Floorz: return sector[index].int_floorz(); + case Interp_Sect_Ceilingz: return sector[index].int_ceilingz(); case Interp_Sect_Floorheinum: return sector[index].floorheinum; case Interp_Sect_Ceilingheinum: return sector[index].ceilingheinum; case Interp_Sect_FloorPanX: return sector[index].floorxpan_; diff --git a/source/core/vmexports.cpp b/source/core/vmexports.cpp index bb5c19910..310d43a03 100644 --- a/source/core/vmexports.cpp +++ b/source/core/vmexports.cpp @@ -107,25 +107,25 @@ DEFINE_GLOBAL(sector) double sector_floorz(sectortype* sect) { if (!sect) ThrowAbortException(X_READ_NIL, nullptr); - return sect->__int_floorz * zinttoworld; + return sect->int_floorz() * zinttoworld; } DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, floorz, sector_floorz) { PARAM_SELF_STRUCT_PROLOGUE(sectortype); - ACTION_RETURN_FLOAT(self->__int_floorz * zinttoworld); + ACTION_RETURN_FLOAT(sector_floorz(self)); } double sector_ceilingz(sectortype* sect) { if (!sect) ThrowAbortException(X_READ_NIL, nullptr); - return sect->__int_ceilingz * zinttoworld; + return sect->int_ceilingz() * zinttoworld; } DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, ceilingz, sector_ceilingz) { PARAM_SELF_STRUCT_PROLOGUE(sectortype); - ACTION_RETURN_FLOAT(self->__int_ceilingz * zinttoworld); + ACTION_RETURN_FLOAT(sector_ceilingz(self)); } void sector_setfloorz(sectortype* sect, double val) diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 0db0dc47b..7be5a41e5 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -1064,7 +1064,7 @@ void ZTranslateSector(sectortype* pSector, XSECTOR* pXSector, int a3, int a4) if (ac && (ac->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD)) { viewBackupSpriteLoc(ac); - ac->add_int_z(pSector->__int_floorz - oldZ); + ac->add_int_z(pSector->int_floorz() - oldZ); } } } @@ -1102,7 +1102,7 @@ void ZTranslateSector(sectortype* pSector, XSECTOR* pXSector, int a3, int a4) if (ac && (ac->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE)) { viewBackupSpriteLoc(ac); - ac->add_int_z(pSector->__int_ceilingz - oldZ); + ac->add_int_z(pSector->int_ceilingz() - oldZ); } } } diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index 6c2702939..725386397 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -282,9 +282,9 @@ double getanimatevalue(int type, int index) switch (type) { case anim_floorz: - return sector[index].__int_floorz; + return sector[index].int_floorz(); case anim_ceilingz: - return sector[index].__int_ceilingz; + return sector[index].int_ceilingz(); case anim_vertexx: return wall[index].wall_int_pos().X; case anim_vertexy: diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 199a76866..5e79734d3 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -2113,7 +2113,7 @@ struct ANIM switch (animtype) { case ANIM_Floorz: - return sector[animindex].__int_floorz; + return sector[animindex].int_floorz(); case ANIM_SopZ: return SectorObject[animindex].pmid.Z; case ANIM_Spritez: diff --git a/source/games/sw/src/interpso.cpp b/source/games/sw/src/interpso.cpp index 873864413..b98e7e24a 100644 --- a/source/games/sw/src/interpso.cpp +++ b/source/games/sw/src/interpso.cpp @@ -99,9 +99,9 @@ static double getvalue(so_interp::interp_data& element) case soi_wally: return wall[index].pos.Y; case soi_ceil: - return sector[index].__int_ceilingz; + return sector[index].int_ceilingz(); case soi_floor: - return sector[index].__int_floorz; + return sector[index].int_floorz(); case soi_sox: return SectorObject[index].pmid.X; case soi_soy: