From dfa9daa5d3d0a9ff236d03217ad876866fca5177 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 28 May 2014 22:40:14 +0000 Subject: [PATCH] Polymost: in NPOT wall ypanning "correction", behave like Polymer in one corner case. Specifically, the handling of one-way walls ([1] in Mapster32) was slightly different. git-svn-id: https://svn.eduke32.com/eduke32@4484 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 4 ++-- polymer/eduke32/build/src/polymost.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 078c6049f..3c46b9ebc 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -2997,7 +2997,7 @@ static void polymer_updatewall(int16_t wallnum) } if (wal->ypanning) - // white + // white (but not 1-way) ypancoef = calc_ypancoef(wal->ypanning, curpicnum, !(wal->cstat & 4)); else ypancoef = 0; @@ -3186,7 +3186,7 @@ static void polymer_updatewall(int16_t wallnum) curpicnum = walloverpicnum; if (wal->ypanning) - // mask + // mask / 1-way ypancoef = calc_ypancoef(wal->ypanning, curpicnum, 0); else ypancoef = 0; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index e1a289fdb..87e523996 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -3026,6 +3026,8 @@ static void polymost_drawalls(int32_t bunch) if ((nextsectnum < 0) || (wal->cstat&32)) //White/1-way wall { + const int32_t maskingOneWay = (nextsectnum >= 0 && (wal->cstat&32)); + if (nextsectnum < 0) globalpicnum = wal->picnum; else globalpicnum = wal->overpicnum; globalshade = wal->shade; globalpal = (int32_t)((uint8_t)wal->pal); globvis = globalvisibility; @@ -3036,8 +3038,8 @@ static void polymost_drawalls(int32_t bunch) if (nextsectnum >= 0) { if (!(wal->cstat&4)) i = nextsec->ceilingz; else i = sec->ceilingz; } else { if (!(wal->cstat&4)) i = sec->ceilingz; else i = sec->floorz; } - // white - calc_ypanning(i, ryp0, ryp1, x0, x1, wal->ypanning, wal->yrepeat, !(wal->cstat&4)); + // white / 1-way + calc_ypanning(i, ryp0, ryp1, x0, x1, wal->ypanning, wal->yrepeat, !maskingOneWay && !(wal->cstat&4)); if (wal->cstat&8) //xflip {