From f7d1a2a57417b1f947e840e5ed98b622a4bbe36c Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Fri, 12 May 2017 14:05:32 +0200 Subject: [PATCH] - Add polyobj support to softpoly --- src/polyrenderer/scene/poly_cull.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/polyrenderer/scene/poly_cull.cpp b/src/polyrenderer/scene/poly_cull.cpp index 623b6e9df9..647dc54a23 100644 --- a/src/polyrenderer/scene/poly_cull.cpp +++ b/src/polyrenderer/scene/poly_cull.cpp @@ -70,6 +70,26 @@ void PolyCull::CullNode(void *node) void PolyCull::CullSubsector(subsector_t *sub) { + // Mark poly objects first + if (sub->polys) + { + if (sub->BSP == nullptr || sub->BSP->bDirty) + { + sub->BuildPolyBSP(); + } + + if (sub->BSP->Nodes.Size() == 0) + { + CullSubsector(&sub->BSP->Subsectors[0]); + } + else + { + CullNode(&sub->BSP->Nodes.Last()); + } + + return; // Hmm, seems a bit strange the subsector is then ignored. But that's what the sw renderer seems to be doing.. + } + // Update sky heights for the scene if (!FirstSkyHeight) {