Polymer: Correct(er) TROR walking.

Enumerate the vertical siblings of each walked sector and check them
against the current frustum. No occlusion queries yet, but that should
correct any missing sectors until a flaw in that logic is discovered.

git-svn-id: https://svn.eduke32.com/eduke32@1975 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2011-08-20 21:04:42 +00:00
parent 6de59ef085
commit 936147e33b

View file

@ -1475,6 +1475,8 @@ static void polymer_displayrooms(int16_t dacursectnum)
{
sectortype *sec;
int32_t i;
int16_t bunchnum;
int16_t ns;
GLint result;
int16_t doquery;
int32_t front;
@ -1635,6 +1637,35 @@ static void polymer_displayrooms(int16_t dacursectnum)
i--;
}
// queue ROR neighbors
if ((sec->floorstat & 1024) &&
(bunchnum = yax_getbunch(sectorqueue[front], YAX_FLOOR)) >= 0) {
for (SECTORS_OF_BUNCH(bunchnum, YAX_CEILING, ns)) {
if (ns >= 0 && !drawingstate[ns] &&
polymer_planeinfrustum(&prsectors[ns]->ceil, frustum)) {
sectorqueue[back++] = ns;
drawingstate[ns] = 1;
}
}
}
if ((sec->ceilingstat & 1024) &&
(bunchnum = yax_getbunch(sectorqueue[front], YAX_CEILING)) >= 0) {
for (SECTORS_OF_BUNCH(bunchnum, YAX_FLOOR, ns)) {
if (ns >= 0 && !drawingstate[ns] &&
polymer_planeinfrustum(&prsectors[ns]->floor, frustum)) {
sectorqueue[back++] = ns;
drawingstate[ns] = 1;
}
}
}
i = sec->wallnum-1;
do
{
@ -1660,28 +1691,6 @@ static void polymer_displayrooms(int16_t dacursectnum)
drawingstate[wall[sec->wallptr + i].nextsector] = 1;
}
}
// queue ROR neighbors
if (sec->floorstat & 1024) {
int16_t nextsec;
nextsec = sectorofwall(yax_getnextwall(sec->wallptr + i, YAX_FLOOR));
if (nextsec >= 0 && !drawingstate[nextsec]) {
sectorqueue[back++] = nextsec;
drawingstate[nextsec] = 1;
}
}
if (sec->ceilingstat & 1024) {
int16_t nextsec;
nextsec = sectorofwall(yax_getnextwall(sec->wallptr + i, YAX_CEILING));
if (nextsec >= 0 && !drawingstate[nextsec]) {
sectorqueue[back++] = nextsec;
drawingstate[nextsec] = 1;
}
}
}
while (--i >= 0);