[Scummvm-cvs-logs] SF.net SVN: scummvm:[51704] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue Aug 3 18:22:12 CEST 2010


Revision: 51704
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51704&view=rev
Author:   lordhoto
Date:     2010-08-03 16:22:12 +0000 (Tue, 03 Aug 2010)

Log Message:
-----------
KYRA: Get rid of Screen_LoL::generateLevelOverlay.

This function is actually exactly the same as Screen_v2::generateOverlay,
after I fixed the implementation of the latter last commit.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/scene_lol.cpp
    scummvm/trunk/engines/kyra/screen_lol.cpp
    scummvm/trunk/engines/kyra/screen_lol.h

Modified: scummvm/trunk/engines/kyra/scene_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lol.cpp	2010-08-03 16:21:45 UTC (rev 51703)
+++ scummvm/trunk/engines/kyra/scene_lol.cpp	2010-08-03 16:22:12 UTC (rev 51704)
@@ -468,7 +468,7 @@
 	for (int i = 0; i < 7; i++) {
 		weight = 100 - (i * _lastSpecialColorWeight);
 		weight = (weight > 0) ? (weight * 255) / 100 : 0;
-		_screen->generateLevelOverlay(tpal, _screen->getLevelOverlay(i), _lastSpecialColor, weight);
+		_screen->generateOverlay(tpal, _screen->getLevelOverlay(i), _lastSpecialColor, weight);
 
 		int l = _flags.use16ColorMode ? 256 : 128;
 		uint8 *levelOverlay = _screen->getLevelOverlay(i);

Modified: scummvm/trunk/engines/kyra/screen_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.cpp	2010-08-03 16:21:45 UTC (rev 51703)
+++ scummvm/trunk/engines/kyra/screen_lol.cpp	2010-08-03 16:22:12 UTC (rev 51704)
@@ -183,68 +183,6 @@
 		grayOverlay[i] = findLeastDifferentColor(tmpPal.getData() + 3 * i, srcPal, 0, lastColor, skipSpecialColors);
 }
 
-uint8 *Screen_LoL::generateLevelOverlay(const Palette &srcPal, uint8 *ovl, int opColor, int weight) {
-	if (!ovl)
-		return ovl;
-
-	if (weight > 255)
-		weight = 255;
-
-	const uint8 *srt = srcPal.getData();
-
-	uint16 r = srt[opColor * 3];
-	uint16 g = srt[opColor * 3 + 1];
-	uint16 b = srt[opColor * 3 + 2];
-
-	uint8 *d = ovl;
-	*d++ = 0;
-
-	for (int i = 1; i != 256; i++) {
-		uint16 a = srt[i * 3];
-		uint8 dr = a - ((((a - r) * (weight >> 1)) << 1) >> 8);
-		a = srt[i * 3 + 1];
-		uint8 dg = a - ((((a - g) * (weight >> 1)) << 1) >> 8);
-		a = srt[i * 3 + 2];
-		uint8 db = a - ((((a - b) * (weight >> 1)) << 1) >> 8);
-
-		int l = opColor;
-		int m = _use16ColorMode ? 0xffff : 0x7fff;
-		int ii = _use16ColorMode ? 255 : 127;
-		int x = 1;
-		const uint8 *s = srt + 3;
-
-		do {
-			if (!_use16ColorMode && i == x) {
-				s += 3;
-			} else {
-				int t = *s++ - dr;
-				int c = t * t;
-				t = *s++ - dg;
-				c += (t * t);
-				t = *s++ - db;
-				c += (t * t);
-
-				if (!c) {
-					l = x;
-					break;
-				}
-
-				if (c <= m) {
-					if (!_use16ColorMode || (x == opColor || i != x)) {
-						m = c;
-						l = x;
-					}
-				}
-			}
-			x++;
-		} while (--ii);
-
-		*d++ = l & 0xff;
-	}
-
-	return ovl;
-}
-
 void Screen_LoL::createTransparencyTablesIntern(const uint8 *ovl, int a, const uint8 *fxPal1, const uint8 *fxPal2, uint8 *outTable1, uint8 *outTable2, int b) {
 	Palette screenPal(256);
 	screenPal.copy(fxPal2, 0, 256);

Modified: scummvm/trunk/engines/kyra/screen_lol.h
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.h	2010-08-03 16:21:45 UTC (rev 51703)
+++ scummvm/trunk/engines/kyra/screen_lol.h	2010-08-03 16:22:12 UTC (rev 51704)
@@ -79,7 +79,6 @@
 	Palette **generateFadeTable(Palette **dst, Palette *src1, Palette *src2, int numTabs);
 
 	void generateGrayOverlay(const Palette &Pal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool skipSpecialColors);
-	uint8 *generateLevelOverlay(const Palette &Pal, uint8 *ovl, int opColor, int weight);
 	uint8 *getLevelOverlay(int index) { return _levelOverlays[index]; }
 
 	void createTransparencyTablesIntern(const uint8 *ovl, int a, const uint8 *fxPal1, const uint8 *fxPal2, uint8 *outTable1, uint8 *outTable2, int b);


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