- eliminated global in_area variable.
Removing this made me realize that calling the renderers' FakeFlat functions from the automap is inherently unsafe with the recent refactorings because there is absolutely no guarantee that the data may actually still be defined when the automap is being drawn. So the best approach here is to give the automap its own FakeFlat function that runs independently of render data and assumptions of data preservation. This one can also be a lot simpler because it only needs the floor, not the ceiling info.
This commit is contained in:
parent
4c61048278
commit
d72623b9b5
14 changed files with 161 additions and 74 deletions
|
|
@ -147,9 +147,9 @@ void GLSceneDrawer::AddLine (seg_t *seg, bool portalclip)
|
|||
else
|
||||
{
|
||||
// clipping checks are only needed when the backsector is not the same as the front sector
|
||||
gl_CheckViewArea(seg->v1, seg->v2, seg->frontsector, seg->backsector);
|
||||
CheckViewArea(seg->v1, seg->v2, seg->frontsector, seg->backsector);
|
||||
|
||||
backsector = gl_FakeFlat(seg->backsector, &bs, true);
|
||||
backsector = gl_FakeFlat(seg->backsector, &bs, in_area, true);
|
||||
|
||||
if (gl_CheckClip(seg->sidedef, currentsector, backsector))
|
||||
{
|
||||
|
|
@ -435,7 +435,7 @@ void GLSceneDrawer::DoSubsector(subsector_t * sub)
|
|||
}
|
||||
if (clipper.IsBlocked()) return; // if we are inside a stacked sector portal which hasn't unclipped anything yet.
|
||||
|
||||
fakesector=gl_FakeFlat(sector, &fake, false);
|
||||
fakesector=gl_FakeFlat(sector, &fake, in_area, false);
|
||||
|
||||
if (GLRenderer->mClipPortal)
|
||||
{
|
||||
|
|
@ -502,7 +502,7 @@ void GLSceneDrawer::DoSubsector(subsector_t * sub)
|
|||
sector = sub->render_sector;
|
||||
// the planes of this subsector are faked to belong to another sector
|
||||
// This means we need the heightsec parts and light info of the render sector, not the actual one.
|
||||
fakesector = gl_FakeFlat(sector, &fake, false);
|
||||
fakesector = gl_FakeFlat(sector, &fake, in_area, false);
|
||||
}
|
||||
|
||||
uint8_t &srf = gl_drawinfo->sectorrenderflags[sub->render_sector->sectornum];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue