- Fix clearfog crash

This commit is contained in:
Magnus Norddahl 2017-06-19 20:36:28 +02:00
parent f65c651ffd
commit 8af76b96d8

View file

@ -126,6 +126,7 @@ namespace swrenderer
bool wrap = (curline->linedef->flags & ML_WRAP_MIDTEX) || (curline->sidedef->Flags & WALLF_WRAP_MIDTEX); bool wrap = (curline->linedef->flags & ML_WRAP_MIDTEX) || (curline->sidedef->Flags & WALLF_WRAP_MIDTEX);
// [RH] Draw fog partition // [RH] Draw fog partition
bool renderwall = true;
bool notrelevant = false; bool notrelevant = false;
if (ds->bFogBoundary) if (ds->bFogBoundary)
{ {
@ -135,16 +136,16 @@ namespace swrenderer
RenderFogBoundary renderfog; RenderFogBoundary renderfog;
renderfog.Render(Thread, x1, x2, mceilingclip, mfloorclip, wallshade, rw_light, rw_lightstep, basecolormap); renderfog.Render(Thread, x1, x2, mceilingclip, mfloorclip, wallshade, rw_light, rw_lightstep, basecolormap);
if (!ds->maskedtexturecol) if (ds->maskedtexturecol == nullptr)
renderwall = false;
}
else if ((ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || !visible)
{ {
if (!(ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || visible) renderwall = false;
}
if (renderwall)
notrelevant = RenderWall(ds, x1, x2, walldrawerargs, columndrawerargs, visible, basecolormap, wallshade, wrap); notrelevant = RenderWall(ds, x1, x2, walldrawerargs, columndrawerargs, visible, basecolormap, wallshade, wrap);
}
}
else if (!(ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || visible)
{
notrelevant = RenderWall(ds, x1, x2, walldrawerargs, columndrawerargs, visible, basecolormap, wallshade, wrap);
}
if (ds->bFakeBoundary & 3) if (ds->bFakeBoundary & 3)
{ {