From 42e88ef1206bcaacd43f4435f9bc21c5f5cf3d41 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 18 Apr 2016 12:58:40 +0200 Subject: [PATCH] - removed sector_t::FloorDisplacement and CeilingDisplacement. Using the values these return directly is just as much code. --- src/p_sectors.cpp | 8 ++++---- src/r_defs.h | 11 ----------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index 357b608723..50925f57a6 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -897,7 +897,7 @@ double sector_t::HighestCeilingAt(const DVector2 &p, sector_t **resultsec) // Continue until we find a blocking portal or a portal below where we actually are. while (!check->PortalBlocksMovement(ceiling) && planeheight < check->SkyBoxes[ceiling]->specialf1) { - pos += check->CeilingDisplacement(); + pos += check->SkyBoxes[ceiling]->Scale; planeheight = check->SkyBoxes[ceiling]->specialf1; check = P_PointInSector(pos); } @@ -920,7 +920,7 @@ double sector_t::LowestFloorAt(const DVector2 &p, sector_t **resultsec) // Continue until we find a blocking portal or a portal above where we actually are. while (!check->PortalBlocksMovement(floor) && planeheight > check->SkyBoxes[floor]->specialf1) { - pos += check->FloorDisplacement(); + pos += check->SkyBoxes[floor]->Scale; planeheight = check->SkyBoxes[floor]->specialf1; check = P_PointInSector(pos); } @@ -964,7 +964,7 @@ double sector_t::NextHighestCeilingAt(double x, double y, double bottomz, double } else { - DVector2 pos = sec->CeilingDisplacement(); + DVector2 pos = sec->SkyBoxes[ceiling]->Scale; x += pos.X; y += pos.Y; planeheight = sec->SkyBoxes[ceiling]->specialf1; @@ -1009,7 +1009,7 @@ double sector_t::NextLowestFloorAt(double x, double y, double z, int flags, doub } else { - DVector2 pos = sec->FloorDisplacement(); + DVector2 pos = sec->SkyBoxes[floor]->Scale; x += pos.X; y += pos.Y; planeheight = sec->SkyBoxes[floor]->specialf1; diff --git a/src/r_defs.h b/src/r_defs.h index 79af0929f2..9be31e1843 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -957,17 +957,6 @@ public: return (SkyBoxes[plane] != NULL && SkyBoxes[plane]->special1 == SKYBOX_LINKEDPORTAL); } - // These may only be called if the portal has been validated - DVector2 FloorDisplacement() - { - return Displacements.getOffset(PortalGroup, SkyBoxes[sector_t::floor]->Sector->PortalGroup); - } - - DVector2 CeilingDisplacement() - { - return Displacements.getOffset(PortalGroup, SkyBoxes[sector_t::ceiling]->Sector->PortalGroup); - } - int GetTerrain(int pos) const; void TransferSpecial(sector_t *model);