Fix an update issue with the recent screen tint retaining on palette change.

git-svn-id: https://svn.eduke32.com/eduke32@2307 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-02-02 17:34:30 +00:00
parent 15c7460059
commit 55699e1240

View file

@ -2621,7 +2621,6 @@ void G_DisplayRest(int32_t smoothratio)
int32_t cposx, cposy, cang; int32_t cposx, cposy, cang;
#ifdef USE_OPENGL #ifdef USE_OPENGL
// this takes care of fullscreen tint for OpenGL // this takes care of fullscreen tint for OpenGL
if (getrendermode() >= 3) if (getrendermode() >= 3)
{ {
@ -2642,15 +2641,22 @@ void G_DisplayRest(int32_t smoothratio)
hictinting[MAXPALOOKUPS-1].b = 255; hictinting[MAXPALOOKUPS-1].b = 255;
} }
} }
#endif /* USE_OPENGL && POLYMOST */ #endif // USE_OPENGL
{
static int32_t lastpalsf; // HACK
// this does pain tinting etc from the CON // this does pain tinting etc from the CON
if (pp->pals.f > 0 && pp->loogcnt == 0) // JBF 20040101: pals.f > 0 now >= 0 if ((pp->pals.f > 0 && pp->loogcnt == 0) || (lastpalsf>0 && pp->pals.f==0)) // JBF 20040101: pals.f > 0 now >= 0
{ {
Bmemcpy(&tempFade, &pp->pals, sizeof(palette_t)); Bmemcpy(&tempFade, &pp->pals, sizeof(palette_t));
g_restorePalette = 1; // JBF 20040101 g_restorePalette = 1; // JBF 20040101
applyTint = 1; applyTint = 1;
} }
lastpalsf = pp->pals.f;
}
// reset a normal palette // reset a normal palette
if (g_restorePalette) if (g_restorePalette)
{ {
@ -2676,7 +2682,7 @@ void G_DisplayRest(int32_t smoothratio)
applyTint = 1; applyTint = 1;
} }
if (tempFade.f > tempTint.f) if (tempFade.f > 0 /*tempTint.f*/)
Bmemcpy(&tempTint, &tempFade, sizeof(palette_t)); Bmemcpy(&tempTint, &tempFade, sizeof(palette_t));
if (ud.show_help) if (ud.show_help)