From 8af76b96d8a98f0d09b5169d69570821248322b3 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 19 Jun 2017 20:36:28 +0200 Subject: [PATCH] - Fix clearfog crash --- src/swrenderer/line/r_renderdrawsegment.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/swrenderer/line/r_renderdrawsegment.cpp b/src/swrenderer/line/r_renderdrawsegment.cpp index b325207077..47fa2fb763 100644 --- a/src/swrenderer/line/r_renderdrawsegment.cpp +++ b/src/swrenderer/line/r_renderdrawsegment.cpp @@ -126,6 +126,7 @@ namespace swrenderer bool wrap = (curline->linedef->flags & ML_WRAP_MIDTEX) || (curline->sidedef->Flags & WALLF_WRAP_MIDTEX); // [RH] Draw fog partition + bool renderwall = true; bool notrelevant = false; if (ds->bFogBoundary) { @@ -135,17 +136,17 @@ namespace swrenderer RenderFogBoundary renderfog; renderfog.Render(Thread, x1, x2, mceilingclip, mfloorclip, wallshade, rw_light, rw_lightstep, basecolormap); - if (!ds->maskedtexturecol) - { - if (!(ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || visible) - notrelevant = RenderWall(ds, x1, x2, walldrawerargs, columndrawerargs, visible, basecolormap, wallshade, wrap); - } + if (ds->maskedtexturecol == nullptr) + renderwall = false; } - else if (!(ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || visible) + else if ((ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || !visible) { - notrelevant = RenderWall(ds, x1, x2, walldrawerargs, columndrawerargs, visible, basecolormap, wallshade, wrap); + renderwall = false; } + if (renderwall) + notrelevant = RenderWall(ds, x1, x2, walldrawerargs, columndrawerargs, visible, basecolormap, wallshade, wrap); + if (ds->bFakeBoundary & 3) { RenderFakeWallRange(ds, x1, x2, wallshade);