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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Fri Oct 2 23:27:11 CEST 2009


Revision: 44547
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44547&view=rev
Author:   athrxx
Date:     2009-10-02 21:27:10 +0000 (Fri, 02 Oct 2009)

Log Message:
-----------
LOL/PC-98: - some more fixes for level graphics (shapes are still not quite right)
- fixed heal spell

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui_lol.cpp
    scummvm/trunk/engines/kyra/lol.cpp
    scummvm/trunk/engines/kyra/scene_lol.cpp
    scummvm/trunk/engines/kyra/screen_lol.cpp
    scummvm/trunk/engines/kyra/sound_towns.cpp

Modified: scummvm/trunk/engines/kyra/gui_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui_lol.cpp	2009-10-02 20:21:07 UTC (rev 44546)
+++ scummvm/trunk/engines/kyra/gui_lol.cpp	2009-10-02 21:27:10 UTC (rev 44547)
@@ -1706,7 +1706,7 @@
 	removeInputTop();
 
 	if (needHealingFlags || needMagicGainFlags) {
-		_screen->fillRect(112, 0, 288, 120, 1);
+		_screen->fillRect(112, 0, 288, 120, _flags.use16ColorMode ? 0x44 : 1);
 		gui_drawAllCharPortraitsWithStats();
 
 		_txt->printMessage(0x8000, "%s", getLangString(0x4057));

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-10-02 20:21:07 UTC (rev 44546)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-10-02 21:27:10 UTC (rev 44547)
@@ -1329,10 +1329,13 @@
 }
 
 void LoLEngine::setCharacterMagicOrHitPoints(int charNum, int type, int points, int mode) {
-	static const uint16 barData[2][5] = {
+	static const uint16 barData[4][5] = {
 		// xPos, bar color, text color, flag, string id
 		{ 0x27, 0x9A, 0x98, 0x01, 0x4254 },
-		{ 0x21, 0xA2, 0xA0, 0x00, 0x4253 }
+		{ 0x21, 0xA2, 0xA0, 0x00, 0x4253 },
+		// 16 color mode
+		{ 0x27, 0x66, 0x55, 0x01, 0x4254 },
+		{ 0x21, 0xAA, 0x99, 0x00, 0x4253 }
 	};
 
 	if (charNum > 3)
@@ -1371,6 +1374,9 @@
 	int step = (newVal > pointsCur) ? 2 : -2;
 	newVal = CLIP(newVal + step, 0, pointsMax);
 
+	if (_flags.use16ColorMode)
+		type += 2;
+
 	if (newVal != pointsCur) {
 		step = (newVal >= pointsCur) ? 2 : -2;
 
@@ -1705,7 +1711,7 @@
 	if (_flags.use16ColorMode) {
 		if (!brightness)
 			modifier = 0;
-		else if (modifier < 0 || modifier > 7 || (_flagsTable[31] & 0x08))
+		else if (modifier < 0 || modifier > 7 || !(_flagsTable[31] & 0x08))
 			modifier = 8;
 		
 		modifier >>= 1;
@@ -2139,7 +2145,21 @@
 int LoLEngine::processMagicHeal(int charNum, int spellLevel) {
 	if (!_healOverlay) {
 		_healOverlay = new uint8[256];
-		_screen->generateGrayOverlay(_screen->getPalette(1), _healOverlay, 52, 22, 20, 0, 256, true);
+		Palette tpal(256);
+		tpal.copy(_screen->getPalette(1));
+
+		if (_flags.use16ColorMode) {
+			tpal.fill(16, 240, 0xff);
+			uint8 *dst = tpal.getData();
+			for (int i = 1; i < 16; i++) {
+				int s = ((i << 4) | i) * 3;
+				SWAP(dst[s], dst[i]);
+				SWAP(dst[s + 1], dst[i + 1]);
+				SWAP(dst[s + 2], dst[i + 2]);
+			}
+		}
+		
+		_screen->generateGrayOverlay(tpal, _healOverlay, 52, 22, 20, 0, 256, true);
 	}
 
 	const uint8 *healShpFrames = 0;

Modified: scummvm/trunk/engines/kyra/scene_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lol.cpp	2009-10-02 20:21:07 UTC (rev 44546)
+++ scummvm/trunk/engines/kyra/scene_lol.cpp	2009-10-02 21:27:10 UTC (rev 44547)
@@ -358,7 +358,9 @@
 	}
 
 	if (_flags.use16ColorMode) {
-		if (_lastSpecialColor == 0x66)
+		if (_lastSpecialColor == 1)
+			_lastSpecialColor = 0x44;
+		else if (_lastSpecialColor == 0x66)
 			_lastSpecialColor = scumm_stricmp(file, "YVEL2") ? 0xcc : 0x44;
 		else if (_lastSpecialColor == 0x6b)
 			_lastSpecialColor = 0xcc;
@@ -400,11 +402,6 @@
 	if (_flags.use16ColorMode) {
 		_screen->loadPalette("LOL.NOL", _screen->getPalette(0));
 
-		/*static const uint8 colTable[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };
-		Palette &pl = _screen->getPalette(0);
-		for (int i = 15; i >= 0; i--)			
-			pl.copy(pl, i, 1, i);*/
-
 	} else {
 		if (_vcnShift)
 			delete[] _vcnShift;
@@ -457,11 +454,21 @@
 
 	Palette tpal(256);
 	tpal.copy(_screen->getPalette(0));
-	tpal.fill(16, 240, 0xff);
+	if (_flags.use16ColorMode) {
+		tpal.fill(16, 240, 0xff);	
+		uint8 *dst = tpal.getData();
+		for (int i = 1; i < 16; i++) {
+			int s = ((i << 4) | i) * 3;
+			SWAP(dst[s], dst[i * 3]);
+			SWAP(dst[s + 1], dst[i * 3 + 1]);
+			SWAP(dst[s + 2], dst[i * 3 + 2]);
+		}
+	}
+
 	for (int i = 0; i < 7; i++) {
 		weight = 100 - (i * _lastSpecialColorWeight);
 		weight = (weight > 0) ? (weight * 255) / 100 : 0;
-		_screen->generateLevelOverlay(tpal/*_screen->getPalette(0)*/, _screen->getLevelOverlay(i), _lastSpecialColor >> 4, weight);
+		_screen->generateLevelOverlay(tpal, _screen->getLevelOverlay(i), _lastSpecialColor, weight);
 
 		int l = _flags.use16ColorMode ? 256 : 128;
 		uint8 *levelOverlay = _screen->getLevelOverlay(i);
@@ -488,12 +495,10 @@
 
 		_screen->loadPalette("LOL.NOL", _screen->getPalette(0));
 
-		static const uint8 colTable[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };
-		
 		for (int i = 0; i < 8; i++) {
 			uint8 *pl = _screen->getLevelOverlay(7 - i);
 			for (int ii = 0; ii < 16; ii++)
-				_vcnExpTable[(i << 4) + ii] = pl[colTable[ii]];
+				_vcnExpTable[(i << 4) + ii] = pl[(ii << 4) | ii];
 		}
 	}
 
@@ -2099,7 +2104,7 @@
 					uint8 bb = _blockBrightness >> 4;
 					if (ov > bb)
 						ov -= bb;
-						else
+					else
 						ov = 0;
 				}
 				ovl = _screen->getLevelOverlay(ov);
@@ -2110,7 +2115,7 @@
 					uint8 bb = _blockBrightness >> 4;
 					if (ov > bb)
 						ov -= bb;
-						else
+					else
 						ov = 0;
 				}
 				ovl = _screen->getLevelOverlay(ov);

Modified: scummvm/trunk/engines/kyra/screen_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.cpp	2009-10-02 20:21:07 UTC (rev 44546)
+++ scummvm/trunk/engines/kyra/screen_lol.cpp	2009-10-02 21:27:10 UTC (rev 44547)
@@ -190,9 +190,7 @@
 	if (weight > 255)
 		weight = 255;
 
-	uint8 *srt = new uint8[768];
-	memset(srt, 0x3f, 768);
-	memcpy(srt, srcPal.getData(), srcPal.getNumColors() * 3);
+	const uint8 *srt = srcPal.getData();
 	
 	uint16 r = srt[opColor * 3];
 	uint16 g = srt[opColor * 3 + 1];
@@ -244,7 +242,6 @@
 		*d++ = l & 0xff;
 	}
 
-	delete []srt;
 	return ovl;
 }
 

Modified: scummvm/trunk/engines/kyra/sound_towns.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_towns.cpp	2009-10-02 20:21:07 UTC (rev 44546)
+++ scummvm/trunk/engines/kyra/sound_towns.cpp	2009-10-02 21:27:10 UTC (rev 44547)
@@ -42,7 +42,7 @@
 class Towns_EuphonyChannel : public MidiChannel {
 public:
 	Towns_EuphonyChannel() {}
-	~Towns_EuphonyChannel() {}
+	virtual ~Towns_EuphonyChannel() {}
 
 	virtual void nextTick(int32 *outbuf, int buflen) = 0;
 	virtual void rate(uint16 r) = 0;


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