From 7aea0108924928e3ead6f776f425bc15fc8ebf95 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 30 Apr 2018 23:48:16 +0200 Subject: [PATCH] - added a sector index to the subsector struct. This will be used to process dynamic lights for flats in the processing pass, allowing to remove the lights-only pass entirely. --- src/p_glnodes.cpp | 23 ----------------------- src/r_data/renderinfo.cpp | 2 +- src/r_defs.h | 8 +++++--- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/src/p_glnodes.cpp b/src/p_glnodes.cpp index 1e7ce6505a..576affe246 100644 --- a/src/p_glnodes.cpp +++ b/src/p_glnodes.cpp @@ -1437,27 +1437,4 @@ void P_SetRenderSector() break; } } - -#if 0 // may be useful later so let's keep it here for now - // now group the subsectors by sector - subsector_t ** subsectorbuffer = new subsector_t * [numsubsectors]; - - for(i=0, ss=subsectors; irender_sector->subsectorcount++; - } - - for (i=0; irender_sector->subsectors[ss->render_sector->subsectorcount++]=ss; - } -#endif - } diff --git a/src/r_data/renderinfo.cpp b/src/r_data/renderinfo.cpp index 5b6cc6d13f..2d8343e15a 100644 --- a/src/r_data/renderinfo.cpp +++ b/src/r_data/renderinfo.cpp @@ -248,7 +248,7 @@ static void PrepareSectorData() for (auto &sub : level.subsectors) { - sub.render_sector->subsectorcount++; + sub.sectorindex = (uint16_t)sub.render_sector->subsectorcount++; } for (auto &sec : level.sectors) diff --git a/src/r_defs.h b/src/r_defs.h index 00062f6686..fd702c5964 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -1431,15 +1431,17 @@ struct subsector_t seg_t *firstline; sector_t *render_sector; uint32_t numlines; - int flags; + uint16_t flags; + uint16_t sectorindex; - void BuildPolyBSP(); - int Index() const; // subsector related GL data FLightNode * lighthead; // Light nodes (blended and additive) int validcount; short mapsection; char hacked; // 1: is part of a render hack + + void BuildPolyBSP(); + int Index() const; // 2: has one-sided walls FPortalCoverage portalcoverage[2]; };