- Redo r4164 fix: Don't clear fake planes when clearing skybox planes.

SVN r4172 (trunk)
This commit is contained in:
Randy Heit 2013-03-02 01:54:40 +00:00
parent 8f7cd73a41
commit 1107bebfcf
3 changed files with 35 additions and 11 deletions

View File

@ -140,7 +140,6 @@ void R_3D_EnterSkybox()
height_top = NULL; height_top = NULL;
height_cur = NULL; height_cur = NULL;
height_max = -1; height_max = -1;
fakeActive = 0;
CurrentSkybox++; CurrentSkybox++;
} }
@ -158,7 +157,6 @@ void R_3D_LeaveSkybox()
height_top = current.height_top; height_top = current.height_top;
height_cur = current.height_cur; height_cur = current.height_cur;
height_max = current.height_max; height_max = current.height_max;
fakeActive = height_top != NULL;
CurrentSkybox--; CurrentSkybox--;
} }

View File

@ -492,13 +492,39 @@ void R_ClearPlanes (bool fullclear)
{ {
int i, max; int i, max;
// kg3D - we can't just clear planes if there are fake planes // Don't clear fake planes if not doing a full clear.
if(!fullclear && fakeActive) return; if (!fullclear)
{
for (i = 0; i <= MAXVISPLANES-1; i++) // new code -- killough
{
for (visplane_t **probe = &visplanes[i]; *probe != NULL; )
{
if ((*probe)->sky < 0)
{ // fake: move past it
probe = &(*probe)->next;
}
else
{ // not fake: move to freelist
visplane_t *vis = *probe;
*freehead = vis;
*probe = vis->next;
vis->next = NULL;
freehead = &vis->next;
}
}
}
}
else
{
max = fullclear ? MAXVISPLANES : MAXVISPLANES-1; max = fullclear ? MAXVISPLANES : MAXVISPLANES-1;
for (i = 0; i <= max; i++) // new code -- killough for (i = 0; i <= MAXVISPLANES; i++) // new code -- killough
{
for (*freehead = visplanes[i], visplanes[i] = NULL; *freehead; ) for (*freehead = visplanes[i], visplanes[i] = NULL; *freehead; )
{
freehead = &(*freehead)->next; freehead = &(*freehead)->next;
}
}
}
if (fullclear) if (fullclear)
{ {

View File

@ -1430,7 +1430,7 @@ void RP_Subsector (subsector_t *sub)
frontsector->ceiling_yscale, frontsector->ceiling_yscale,
frontsector->ceiling_angle + frontsector->base_ceiling_angle, frontsector->ceiling_angle + frontsector->base_ceiling_angle,
frontsector->sky, frontsector->sky,
frontsector->CeilingSkyBox frontsector->CeilingSkyBox,
) : NULL;*/ ) : NULL;*/
basecolormap = frontsector->ColorMap; basecolormap = frontsector->ColorMap;