From a53e9b60d8cde16c02c2c76bab3968aaac27ee7a Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 22 Aug 2012 22:46:09 +0000 Subject: [PATCH] Keep full-screen tints through palette changes again. A debug macro to test tints being stuck at the least intense non-zero value is provided in engine.c. git-svn-id: https://svn.eduke32.com/eduke32@2952 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 6 ++++++ polymer/eduke32/source/game.c | 18 +++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index e218888f6..17fd990f5 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -13932,6 +13932,8 @@ static void setpalettefade_calc(uint8_t offset) } } +//#define DEBUG_PALETTEFADE + // // setpalettefade // @@ -13940,6 +13942,10 @@ void setpalettefade(char r, char g, char b, char offset) palfadergb.r = min(63,r) << 2; palfadergb.g = min(63,g) << 2; palfadergb.b = min(63,b) << 2; +#ifdef DEBUG_PALETTEFADE + if (offset) + offset = max(offset, 32); +#endif palfadedelta = min(63,offset) << 2; setpalettefade_calc(offset); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index ad42c2f00..8ced48743 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -2606,27 +2606,23 @@ void G_DisplayRest(int32_t smoothratio) } #endif // USE_OPENGL -// { -// static int32_t lastpalsf; // HACK - - // this does pain tinting etc from the CON - if ((pp->pals.f > 0 && pp->loogcnt == 0) /*|| (lastpalsf>0 && pp->pals.f==0)*/) // JBF 20040101: pals.f > 0 now >= 0 + // this does pain tinting etc from the CON + // JBF 20040101: pals.f > 0 now >= 0 + // PK: was reset to > 0 (correctly, IMO) by TX in r1625. + if (pp->pals.f > 0 && pp->loogcnt == 0) { Bmemcpy(&tempFade, &pp->pals, sizeof(palette_t)); - g_restorePalette = -1; // JBF 20040101; PK: reset tinting (-1) applyTint = 1; } else if (pp2 && pp2->pals.f > 0 && pp2->loogcnt == 0) { Bmemcpy(&tempFade, &pp2->pals, sizeof(palette_t)); - g_restorePalette = -1; applyTint = 1; } -// lastpalsf = pp->pals.f; -// } - // reset a normal palette - else if (g_restorePalette) + + if (g_restorePalette) { + // reset a normal palette static uint32_t omovethingscnt; if (g_restorePalette < 2 || omovethingscnt+1 == g_moveThingsCount)