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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Mar 28 02:28:02 CET 2008


Revision: 31285
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31285&view=rev
Author:   lordhoto
Date:     2008-03-27 18:28:02 -0700 (Thu, 27 Mar 2008)

Log Message:
-----------
Implemented command text fadeout.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_v2.cpp
    scummvm/trunk/engines/kyra/kyra_v2.h
    scummvm/trunk/engines/kyra/saveload_v2.cpp
    scummvm/trunk/engines/kyra/timer_v2.cpp

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-28 01:10:58 UTC (rev 31284)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-28 01:28:02 UTC (rev 31285)
@@ -601,7 +601,7 @@
 	_timer->update();
 	updateItemAnimations();
 	updateInvWsa();
-	//sub_1574C();
+	fadeMessagePalette();
 	_screen->updateScreen();
 }
 
@@ -609,7 +609,7 @@
 	updateInput();
 
 	updateMouse();
-	//sub_157C();
+	fadeMessagePalette();
 	updateSpecialSceneScripts();
 	_timer->update();
 	updateItemAnimations();
@@ -1041,7 +1041,7 @@
 	_screen->fillRect(0, 190, 319, 199, 0xCF);
 
 	if (string) {
-		if (palIndex != -1 || _msgUnk1) {
+		if (palIndex != -1 || _fadeMessagePalette) {
 			palIndex *= 3;
 			memcpy(_messagePal, _screen->_currentPalette + palIndex, 3);
 			memmove(_screen->_currentPalette + 765, _screen->_currentPalette + palIndex, 3);
@@ -1054,7 +1054,7 @@
 		setTimer1DelaySecs(7);
 	}
 
-	_msgUnk1 = 0;
+	_fadeMessagePalette = false;
 	_screen->showMouse();
 }
 
@@ -1086,6 +1086,29 @@
 	showMessage((char*)_unkBuf500Bytes, palIndex);
 }
 
+void KyraEngine_v2::fadeMessagePalette() {
+	if (!_fadeMessagePalette)
+		return;
+
+	bool updatePalette = false;
+	for (int i = 0; i < 3; ++i) {
+		if (_messagePal[i] >= 4) {
+			_messagePal[i] -= 4;
+			updatePalette = true;
+		} else if (_messagePal[i] != 0) {
+			_messagePal[i] = 0;
+			updatePalette = true;
+		}
+	}
+
+	if (updatePalette) {
+		memcpy(_screen->getPalette(0) + 765, _messagePal, 3);
+		_screen->setScreenPalette(_screen->getPalette(0));
+	} else {
+		_fadeMessagePalette = false;
+	}
+}
+
 #pragma mark -
 
 void KyraEngine_v2::loadMouseShapes() {

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2008-03-28 01:10:58 UTC (rev 31284)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2008-03-28 01:28:02 UTC (rev 31285)
@@ -774,7 +774,8 @@
 	const char *_shownMessage;
 
 	byte _messagePal[3];
-	int _msgUnk1;
+	bool _fadeMessagePalette;
+	void fadeMessagePalette();
 
 	// chat
 	int _vocHigh;

Modified: scummvm/trunk/engines/kyra/saveload_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/saveload_v2.cpp	2008-03-28 01:10:58 UTC (rev 31284)
+++ scummvm/trunk/engines/kyra/saveload_v2.cpp	2008-03-28 01:28:02 UTC (rev 31285)
@@ -317,7 +317,7 @@
 
 	setTimer1DelaySecs(7);
 	_shownMessage = " ";
-	_msgUnk1 = 0;
+	_fadeMessagePalette = false;
 
 	if (setFlag1EE)
 		setGameFlag(0x1EE);

Modified: scummvm/trunk/engines/kyra/timer_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/timer_v2.cpp	2008-03-28 01:10:58 UTC (rev 31284)
+++ scummvm/trunk/engines/kyra/timer_v2.cpp	2008-03-28 01:28:02 UTC (rev 31285)
@@ -44,7 +44,7 @@
 void KyraEngine_v2::timerFadeOutMessage(int arg) {
 	debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v2::timerFadeOutMessage(%d)", arg);
 	if (_shownMessage)
-		_msgUnk1 = 1;
+		_fadeMessagePalette = 1;
 }
 
 void KyraEngine_v2::timerCauldronAnimation(int arg) {


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