- 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.
This commit is contained in:
Christoph Oelckers 2018-04-30 23:48:16 +02:00
parent ecb1578a7a
commit 7aea010892
3 changed files with 6 additions and 27 deletions

View file

@ -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; i<numsubsectors; i++, ss++)
{
ss->render_sector->subsectorcount++;
}
for (i=0; i<numsectors; i++)
{
sectors[i].subsectors = subsectorbuffer;
subsectorbuffer += sectors[i].subsectorcount;
sectors[i].subsectorcount = 0;
}
for(i=0, ss = subsectors; i<numsubsectors; i++, ss++)
{
ss->render_sector->subsectors[ss->render_sector->subsectorcount++]=ss;
}
#endif
}

View file

@ -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)

View file

@ -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];
};