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
This commit is contained in:
helixhorned 2012-08-22 22:46:09 +00:00
parent 19c2c57ffb
commit a53e9b60d8
2 changed files with 13 additions and 11 deletions

View file

@ -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);

View file

@ -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)