aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2010-08-03 16:43:57 +0000
committerJohannes Schickel2010-08-03 16:43:57 +0000
commit13824582d1dc3d1d6df6b57e171f6357799e0489 (patch)
tree7b02861b4f235359a92bc46b560279008cbb5313 /engines/kyra
parent64585b40ebd8fac26d151aa12e6c6a22f631c20c (diff)
downloadscummvm-rg350-13824582d1dc3d1d6df6b57e171f6357799e0489.tar.gz
scummvm-rg350-13824582d1dc3d1d6df6b57e171f6357799e0489.tar.bz2
scummvm-rg350-13824582d1dc3d1d6df6b57e171f6357799e0489.zip
LOL: Minor adjustment to latest generateOverlay changes.
svn-id: r51705
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/lol.cpp4
-rw-r--r--engines/kyra/screen_v2.cpp14
-rw-r--r--engines/kyra/screen_v2.h2
3 files changed, 15 insertions, 5 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 5a066e5d0c..98f0e31b69 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -810,8 +810,8 @@ void LoLEngine::startup() {
pal.fill(0, 1, 0x3F);
pal.fill(2, 126, 0x3F);
pal.fill(192, 4, 0x3F);
- _screen->generateOverlay(pal, _screen->_paletteOverlay1, 1, 96);
- _screen->generateOverlay(pal, _screen->_paletteOverlay2, 144, 65);
+ _screen->generateOverlay(pal, _screen->_paletteOverlay1, 1, 96, 254);
+ _screen->generateOverlay(pal, _screen->_paletteOverlay2, 144, 65, 254);
_screen->copyPalette(0, 1);
}
diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp
index dec380c3e8..3907f844cb 100644
--- a/engines/kyra/screen_v2.cpp
+++ b/engines/kyra/screen_v2.cpp
@@ -38,7 +38,7 @@ Screen_v2::~Screen_v2() {
delete[] _wsaFrameAnimBuffer;
}
-uint8 *Screen_v2::generateOverlay(const Palette &pal, uint8 *buffer, int opColor, uint weight) {
+uint8 *Screen_v2::generateOverlay(const Palette &pal, uint8 *buffer, int opColor, uint weight, int maxColor) {
if (!buffer)
return buffer;
@@ -51,7 +51,17 @@ uint8 *Screen_v2::generateOverlay(const Palette &pal, uint8 *buffer, int opColor
uint8 *dst = buffer;
*dst++ = 0;
- const int maxIndex = (_vm->gameFlags().gameID == GI_LOL) ? (_use16ColorMode ? 255 : 127) : 255;
+ int maxIndex = maxColor;
+ if (maxIndex == -1) {
+ if (_vm->gameFlags().gameID == GI_LOL) {
+ if (_use16ColorMode)
+ maxIndex = 255;
+ else
+ maxIndex = 127;
+ } else {
+ maxIndex = 255;
+ }
+ }
for (int i = 1; i != 256; ++i) {
const byte curR = pal[i * 3 + 0] - ((((pal[i * 3 + 0] - opR) * weight) >> 7) & 0x7F);
diff --git a/engines/kyra/screen_v2.h b/engines/kyra/screen_v2.h
index 2850c96e02..92aeb3525d 100644
--- a/engines/kyra/screen_v2.h
+++ b/engines/kyra/screen_v2.h
@@ -40,7 +40,7 @@ public:
void checkedPageUpdate(int srcPage, int dstPage);
// palette handling
- uint8 *generateOverlay(const Palette &pal, uint8 *buffer, int color, uint weight);
+ uint8 *generateOverlay(const Palette &pal, uint8 *buffer, int color, uint weight, int maxColor = -1);
void applyOverlay(int x, int y, int w, int h, int pageNum, const uint8 *overlay);
int findLeastDifferentColor(const uint8 *paletteEntry, const Palette &pal, uint8 firstColor, uint16 numColors, bool skipSpecialColors = false);