- made the common render hacks functional again as separate render items.

This commit is contained in:
Christoph Oelckers 2018-11-06 20:31:44 +01:00
commit ddc75f7ba5
9 changed files with 123 additions and 114 deletions

View file

@ -632,10 +632,9 @@ public:
void ConstructOutput(FSectionContainer &output)
{
output.allSections.Resize(groups.Size());
output.allIndices.Resize(level.subsectors.Size() + level.sides.Size() + 2*level.sectors.Size());
output.sectionForSidedefPtr = &output.allIndices[0];
output.firstSectionForSectorPtr = &output.allIndices[level.sides.Size()];
output.numberOfSectionForSectorPtr = &output.allIndices[level.sides.Size() + level.sectors.Size()];
output.allIndices.Resize(2*level.sectors.Size());
output.firstSectionForSectorPtr = &output.allIndices[0];
output.numberOfSectionForSectorPtr = &output.allIndices[level.sectors.Size()];
memset(output.firstSectionForSectorPtr, -1, sizeof(int) * level.sectors.Size());
memset(output.numberOfSectionForSectorPtr, 0, sizeof(int) * level.sectors.Size());
@ -713,7 +712,6 @@ public:
while (it.NextPair(pair))
{
output.allSides[numsides++] = &level.sides[pair->Key];
output.sectionForSidedefPtr[pair->Key] = curgroup;
}
for (auto ssi : group.subsectors)
{

View file

@ -102,26 +102,9 @@ public:
TArray<subsector_t *> allSubsectors;
TArray<int> allIndices;
int *sectionForSidedefPtr; // also stored inside allIndices;
int *firstSectionForSectorPtr; // ditto.
int *numberOfSectionForSectorPtr; // ditto.
FSection *SectionForSidedef(side_t *side)
{
return SectionForSidedef(side->Index());
}
FSection *SectionForSidedef(int sindex)
{
return sindex < 0 ? nullptr : &allSections[sectionForSidedefPtr[sindex]];
}
int SectionNumForSidedef(side_t *side)
{
return SectionNumForSidedef(side->Index());
}
int SectionNumForSidedef(int sindex)
{
return sindex < 0 ? -1 : sectionForSidedefPtr[sindex];
}
TArrayView<FSection> SectionsForSector(sector_t *sec)
{
return SectionsForSector(sec->Index());