[Scummvm-cvs-logs] SF.net SVN: scummvm:[51705] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Tue Aug 3 18:43:57 CEST 2010
Revision: 51705
http://scummvm.svn.sourceforge.net/scummvm/?rev=51705&view=rev
Author: lordhoto
Date: 2010-08-03 16:43:57 +0000 (Tue, 03 Aug 2010)
Log Message:
-----------
LOL: Minor adjustment to latest generateOverlay changes.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/lol.cpp
scummvm/trunk/engines/kyra/screen_v2.cpp
scummvm/trunk/engines/kyra/screen_v2.h
Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp 2010-08-03 16:22:12 UTC (rev 51704)
+++ scummvm/trunk/engines/kyra/lol.cpp 2010-08-03 16:43:57 UTC (rev 51705)
@@ -810,8 +810,8 @@
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);
}
Modified: scummvm/trunk/engines/kyra/screen_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen_v2.cpp 2010-08-03 16:22:12 UTC (rev 51704)
+++ scummvm/trunk/engines/kyra/screen_v2.cpp 2010-08-03 16:43:57 UTC (rev 51705)
@@ -38,7 +38,7 @@
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 *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);
Modified: scummvm/trunk/engines/kyra/screen_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/screen_v2.h 2010-08-03 16:22:12 UTC (rev 51704)
+++ scummvm/trunk/engines/kyra/screen_v2.h 2010-08-03 16:43:57 UTC (rev 51705)
@@ -40,7 +40,7 @@
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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list