From 9fde5434f825d6ce7b0d2d799dfb6d646b316ae7 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 13 Jul 2019 21:26:10 +0000 Subject: [PATCH] Fix translucent masked wall sorting issue in Polymost git-svn-id: https://svn.eduke32.com/eduke32@7792 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/engine.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 986984cf3..b31da02f6 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -8920,17 +8920,17 @@ killsprite: } polymost_setClamp(false); - for (i = 0; i < maskwallcnt;) + int32_t numMaskWalls = maskwallcnt; + maskwallcnt = 0; + for (i = 0; i < numMaskWalls; i++) { - if (polymost_maskWallHasTranslucency((uwalltype *) &wall[thewall[maskwall[maskwallcnt-1]]])) + if (polymost_maskWallHasTranslucency((uwalltype *) &wall[thewall[maskwall[i]]])) { - int16_t maskSwap = maskwall[i]; - maskwall[i] = maskwall[maskwallcnt-1]; - maskwall[maskwallcnt-1] = maskSwap; - ++i; + maskwall[maskwallcnt] = maskwall[i]; + maskwallcnt++; } else - renderDrawMaskedWall(--maskwallcnt); + renderDrawMaskedWall(i); } glEnable(GL_BLEND);