- fixed clipping info not properly reset when rendering the scene in two passes.

We need to reset the gotsector array for that, but since we also need the accumulate result of both passes there's now two such arrays.
This commit is contained in:
Christoph Oelckers 2021-04-07 16:52:17 +02:00
parent caa8efd3d5
commit 7a03967ceb
3 changed files with 27 additions and 21 deletions

View file

@ -85,6 +85,7 @@ void BunchDrawer::StartScene()
Bunches.Clear();
CompareData.Clear();
gotsector.Zero();
gotsector2.Zero();
gotwall.Zero();
}
@ -435,8 +436,8 @@ int BunchDrawer::FindClosestBunch()
void BunchDrawer::ProcessSector(int sectnum, bool portal)
{
if (gotsector[sectnum]) return;
gotsector.Set(sectnum);
if (gotsector2[sectnum]) return;
gotsector2.Set(sectnum);
auto sect = &sector[sectnum];
bool inbunch;
@ -445,6 +446,9 @@ void BunchDrawer::ProcessSector(int sectnum, bool portal)
SetupSprite.Clock();
int z;
if (!gotsector[sectnum])
{
gotsector.Set(sectnum);
SectIterator it(sectnum);
while ((z = it.NextIndex()) >= 0)
{
@ -467,6 +471,7 @@ void BunchDrawer::ProcessSector(int sectnum, bool portal)
}
}
SetupSprite.Unclock();
}
if (automapping)
show2dsector.Set(sectnum);
@ -547,6 +552,7 @@ void BunchDrawer::RenderScene(const int* viewsectors, unsigned sectcount, bool p
ang2 = bamang(rotang + ANGLE_90);
process();
clipper->Clear();
gotsector2.Zero();
ang1 = bamang(rotang + ANGLE_90);
ang2 = bamang(rotang - ANGLE_90);
process();

View file

@ -28,6 +28,7 @@ class BunchDrawer
vec2_t iview;
float gcosang, gsinang;
FixedBitArray<MAXSECTORS> gotsector;
FixedBitArray<MAXSECTORS> gotsector2;
FixedBitArray<MAXWALLS> gotwall;
binangle ang1, ang2;

View file

@ -1046,7 +1046,6 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
}
}
}
globalr = globalg = globalb = 255;
}
void HWWall::ProcessWallSprite(HWDrawInfo* di, spritetype* spr, sectortype* sector)