From f2e593f8bf358a2324bf8cc61a3de5469ac9f802 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 6 Nov 2018 21:41:16 +0100 Subject: [PATCH] - disabled the hack for fixing the original design of the portal in KDiZD's Z1M1. This portal got fixed in a later re-release of KDiZD and no other portal needs this runtime fix to my knowledge. The main problem here is that this runtime fix requires some manipulation of the render data that does not work anymore. Should other maps need this fix as well they are probably best served with a compatibility entry. --- src/hwrenderer/scene/hw_bsp.cpp | 14 -------------- src/hwrenderer/scene/hw_drawinfo.cpp | 4 ++-- src/hwrenderer/scene/hw_drawinfo.h | 5 ++--- src/hwrenderer/scene/hw_renderhacks.cpp | 6 ++++++ 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/hwrenderer/scene/hw_bsp.cpp b/src/hwrenderer/scene/hw_bsp.cpp index affca42a85..075a93d8f3 100644 --- a/src/hwrenderer/scene/hw_bsp.cpp +++ b/src/hwrenderer/scene/hw_bsp.cpp @@ -702,20 +702,6 @@ void HWDrawInfo::DoSubsector(subsector_t * sub) ss_renderflags[sub->Index()] = (sub->numlines > 2) ? SSRF_PROCESSED|SSRF_RENDERALL : SSRF_PROCESSED; if (sub->hacked & 1) AddHackedSubsector(sub); - - FSectorPortalGroup *portal; - - portal = fakesector->GetPortalGroup(sector_t::ceiling); - if (portal != nullptr) - { - AddSubsectorToPortal(portal, sub); - } - - portal = fakesector->GetPortalGroup(sector_t::floor); - if (portal != nullptr) - { - AddSubsectorToPortal(portal, sub); - } } } } diff --git a/src/hwrenderer/scene/hw_drawinfo.cpp b/src/hwrenderer/scene/hw_drawinfo.cpp index 2dc9aef04a..40bdb8a7a2 100644 --- a/src/hwrenderer/scene/hw_drawinfo.cpp +++ b/src/hwrenderer/scene/hw_drawinfo.cpp @@ -187,8 +187,8 @@ void HWDrawInfo::ClearBuffers() MissingUpperSegs.Clear(); MissingLowerSegs.Clear(); SubsectorHacks.Clear(); - CeilingStacks.Clear(); - FloorStacks.Clear(); + //CeilingStacks.Clear(); + //FloorStacks.Clear(); HandledSubsectors.Clear(); spriteindex = 0; diff --git a/src/hwrenderer/scene/hw_drawinfo.h b/src/hwrenderer/scene/hw_drawinfo.h index 58951473b2..33074b0fd4 100644 --- a/src/hwrenderer/scene/hw_drawinfo.h +++ b/src/hwrenderer/scene/hw_drawinfo.h @@ -167,8 +167,8 @@ struct HWDrawInfo TMap floodFloorSegs; TMap floodCeilingSegs; - TArray CeilingStacks; - TArray FloorStacks; + //TArray CeilingStacks; + //TArray FloorStacks; TArray HandledSubsectors; @@ -300,7 +300,6 @@ public: void DrawPlayerSprites(bool hudModelStep, FRenderState &state); void ProcessLowerMinisegs(TArray &lowersegs); - void AddSubsectorToPortal(FSectorPortalGroup *portal, subsector_t *sub); void AddWall(GLWall *w); void AddMirrorSurface(GLWall *w); diff --git a/src/hwrenderer/scene/hw_renderhacks.cpp b/src/hwrenderer/scene/hw_renderhacks.cpp index 82610c7926..1558b4bba4 100644 --- a/src/hwrenderer/scene/hw_renderhacks.cpp +++ b/src/hwrenderer/scene/hw_renderhacks.cpp @@ -1180,6 +1180,11 @@ void HWDrawInfo::HandleHackedSubsectors() SubsectorHacks.Clear(); } +// This code was meant to fix the portal in KDIZD's Z1M1, but later versions of that mod do not need it anymore. +// I am not aware of other portals ever having been set up so badly as this one so it probably is not needed anymore. +// Even if needed this must be done differently because this code depends on hacking the render data in a bad way. +#if 0 + //========================================================================== // // This merges visplanes that lie inside a sector stack together @@ -1406,3 +1411,4 @@ void HWDrawInfo::AddSubsectorToPortal(FSectorPortalGroup *ptg, subsector_t *sub) ptl->AddSubsector(sub); } +#endif