Implement tint in gl modes

# Conflicts:
#	source/build/include/palette.h
#	source/build/src/palette.cpp
#	source/build/src/sdlayer.cpp
#	source/build/src/sdlayer12.cpp
#	source/build/src/winlayer.cpp
This commit is contained in:
nukeykt 2019-10-13 06:40:48 +09:00 committed by Christoph Oelckers
parent 2ef835fcb8
commit aa922dcd25
1 changed files with 18 additions and 0 deletions

View File

@ -391,6 +391,9 @@ void FixPalette()
nPalDelay = 5; nPalDelay = 5;
#ifdef USE_OPENGL
if (videoGetRenderMode() == REND_CLASSIC)
#endif
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
{ {
short nVal; short nVal;
@ -438,6 +441,7 @@ void FixPalette()
nPalDiff -= 20; nPalDiff -= 20;
gtint -= 20; gtint -= 20;
rtint -= 20; rtint -= 20;
btint -= 20;
if (gtint < 0) { if (gtint < 0) {
gtint = 0; gtint = 0;
@ -447,10 +451,18 @@ void FixPalette()
rtint = 0; rtint = 0;
} }
if (btint < 0) {
btint = 0;
}
if (nPalDiff < 0) { if (nPalDiff < 0) {
nPalDiff = 0; nPalDiff = 0;
} }
#ifdef USE_OPENGL
if (videoGetRenderMode() >= REND_POLYMOST) videoTintBlood(rtint, gtint, btint);
else
#endif
videoUpdatePalette(0, 256); videoUpdatePalette(0, 256);
} }
@ -515,6 +527,8 @@ void TintPalette(int r, int g, int b)
rtint += r; rtint += r;
btint += b;
// do not modify r, g or b variables from this point on // do not modify r, g or b variables from this point on
b2 = b; b2 = b;
int nVal; int nVal;
@ -533,6 +547,10 @@ void TintPalette(int r, int g, int b)
nPalDiff += nVal; nPalDiff += nVal;
#ifdef USE_OPENGL
if (videoGetRenderMode() >= REND_POLYMOST) videoTintBlood(rtint, gtint, btint);
else
#endif
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
{ {
pPal->r += r; pPal->r += r;