From aa922dcd2514c2cf78f60dee35b194f25e4e6695 Mon Sep 17 00:00:00 2001 From: nukeykt Date: Sun, 13 Oct 2019 06:40:48 +0900 Subject: [PATCH] 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 --- source/exhumed/src/light.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/exhumed/src/light.cpp b/source/exhumed/src/light.cpp index b344727ac..360254289 100644 --- a/source/exhumed/src/light.cpp +++ b/source/exhumed/src/light.cpp @@ -391,6 +391,9 @@ void FixPalette() nPalDelay = 5; +#ifdef USE_OPENGL + if (videoGetRenderMode() == REND_CLASSIC) +#endif for (int i = 0; i < 256; i++) { short nVal; @@ -438,6 +441,7 @@ void FixPalette() nPalDiff -= 20; gtint -= 20; rtint -= 20; + btint -= 20; if (gtint < 0) { gtint = 0; @@ -447,10 +451,18 @@ void FixPalette() rtint = 0; } + if (btint < 0) { + btint = 0; + } + if (nPalDiff < 0) { nPalDiff = 0; } +#ifdef USE_OPENGL + if (videoGetRenderMode() >= REND_POLYMOST) videoTintBlood(rtint, gtint, btint); + else +#endif videoUpdatePalette(0, 256); } @@ -515,6 +527,8 @@ void TintPalette(int r, int g, int b) rtint += r; + btint += b; + // do not modify r, g or b variables from this point on b2 = b; int nVal; @@ -533,6 +547,10 @@ void TintPalette(int r, int g, int b) nPalDiff += nVal; +#ifdef USE_OPENGL + if (videoGetRenderMode() >= REND_POLYMOST) videoTintBlood(rtint, gtint, btint); + else +#endif for (int i = 0; i < 256; i++) { pPal->r += r;