From 2f561abdea220b4651b43e38d975b1c871972353 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 28 Apr 2012 02:32:33 +0000 Subject: [PATCH] - Fixed: 3D floors partitioning the world into different "HeightLevels" could strip a midtexture of its clipping information before it was drawn. (On the other hand, I have no idea what this ds->bkup and refreshing stuff is about, so I might have broken something somewhere else.) SVN r3602 (trunk) --- src/r_segs.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 7d2857978..bafc77388 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -221,6 +221,7 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) int i; sector_t tempsec; // killough 4/13/98 fixed_t texheight, textop, texheightscale; + bool notrelevant = false; const sector_t *sec; @@ -360,10 +361,12 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) if ((fake3D & FAKE3D_CLIPBOTTOM) && textop <= sclipBottom - viewz) { + notrelevant = true; goto clearfog; } if ((fake3D & FAKE3D_CLIPTOP) && textop - texheight >= sclipTop - viewz) { + notrelevant = true; goto clearfog; } @@ -483,14 +486,17 @@ clearfog: { R_RenderFakeWallRange(ds, x1, x2); } - if (fake3D & FAKE3D_REFRESHCLIP) + if (!notrelevant) { - assert(ds->bkup >= 0); - memcpy(openings + ds->sprtopclip, openings + ds->bkup, (ds->x2-ds->x1+1) * 2); - } - else - { - clearbufshort(openings + ds->sprtopclip - ds->x1 + x1, x2-x1+1, viewheight); + if (fake3D & FAKE3D_REFRESHCLIP) + { + assert(ds->bkup >= 0); + memcpy(openings + ds->sprtopclip, openings + ds->bkup, (ds->x2-ds->x1+1) * 2); + } + else + { + clearbufshort(openings + ds->sprtopclip - ds->x1 + x1, x2-x1+1, viewheight); + } } return; }