From 2fa7ccf9dd05d15dce433cf81f55f48de2573efa Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 5 Jun 2012 22:21:22 +0000 Subject: [PATCH] TROR/classic: fix a certain class of underdraw glitches. Those were happening when wall drawing in an upper/lower layer "closed" too much of the "curtain" (umost/dmost) for subsequent drawing in that portal. Example: looking down the sewer manhole at the beginning of Retaliation will now render without HOM. git-svn-id: https://svn.eduke32.com/eduke32@2739 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index b164131aa..bac23c948 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -4728,6 +4728,21 @@ static void drawalls(int32_t bunch) if ((cz[2] >= cz[0]) && (cz[3] >= cz[1])) { +#ifdef YAX_ENABLE + int32_t doclip = (yax_globallev <= YAX_MAXDRAWS); + + if (!doclip) + { + for (x=x1; x<=x2; x++) + if (dwall[x] < dmost[x] || uplc[x] < dmost[x]) + { + doclip = 1; + break; + } + } + + if (doclip) +#endif for (x=x1; x<=x2; x++) if (dwall[x] > umost[x]) if (umost[x] <= dmost[x]) @@ -4738,6 +4753,7 @@ static void drawalls(int32_t bunch) } else { +// TROR: TODO: same doclip tweak as above? for (x=x1; x<=x2; x++) if (umost[x] <= dmost[x]) { @@ -4810,6 +4826,21 @@ static void drawalls(int32_t bunch) if ((fz[2] <= fz[0]) && (fz[3] <= fz[1])) { +#ifdef YAX_ENABLE + int32_t doclip = (yax_globallev >= YAX_MAXDRAWS); + + if (!doclip) + { + for (x=x1; x<=x2; x++) + if (uwall[x] > umost[x] || dplc[x] > umost[x]) + { + doclip = 1; + break; + } + } + + if (doclip) +#endif for (x=x1; x<=x2; x++) if (uwall[x] < dmost[x]) if (umost[x] <= dmost[x]) @@ -4820,6 +4851,7 @@ static void drawalls(int32_t bunch) } else { +// TROR: TODO: same doclip tweak as above? for (x=x1; x<=x2; x++) if (umost[x] <= dmost[x]) {