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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Jul 22 23:46:17 CEST 2010


Revision: 51172
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51172&view=rev
Author:   lordhoto
Date:     2010-07-22 21:46:17 +0000 (Thu, 22 Jul 2010)

Log Message:
-----------
KYRA: Implement proper fade out when skipping the intro at any position.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_lok.h
    scummvm/trunk/engines/kyra/sequences_lok.cpp

Modified: scummvm/trunk/engines/kyra/kyra_lok.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_lok.h	2010-07-22 21:45:55 UTC (rev 51171)
+++ scummvm/trunk/engines/kyra/kyra_lok.h	2010-07-22 21:46:17 UTC (rev 51172)
@@ -132,7 +132,7 @@
 	int _paletteChanged;
 	int16 _northExitHeight;
 
-	typedef void (KyraEngine_LoK::*IntroProc)();
+	typedef bool (KyraEngine_LoK::*IntroProc)();
 
 	// static data access
 	const char * const *seqWSATable() { return _seq_WSATable; }
@@ -157,11 +157,11 @@
 
 	// -> intro
 	void seq_intro();
-	void seq_introLogos();
-	void seq_introStory();
-	void seq_introMalcolmTree();
-	void seq_introKallakWriting();
-	void seq_introKallakMalcolm();
+	bool seq_introLogos();
+	bool seq_introStory();
+	bool seq_introMalcolmTree();
+	bool seq_introKallakWriting();
+	bool seq_introKallakMalcolm();
 
 	// -> ingame animations
 	void seq_createAmuletJewel(int jewel, int page, int noSound, int drawOnly);

Modified: scummvm/trunk/engines/kyra/sequences_lok.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_lok.cpp	2010-07-22 21:45:55 UTC (rev 51171)
+++ scummvm/trunk/engines/kyra/sequences_lok.cpp	2010-07-22 21:46:17 UTC (rev 51172)
@@ -114,8 +114,13 @@
 		snd_playTheme(0, 2);
 	_text->setTalkCoords(144);
 
-	for (int i = 0; i < ARRAYSIZE(introProcTable) && !seq_skipSequence(); ++i)
-		(this->*introProcTable[i])();
+	for (int i = 0; i < ARRAYSIZE(introProcTable) && !seq_skipSequence(); ++i) {
+		if ((this->*introProcTable[i])() && !shouldQuit()) {
+			resetSkipFlag();
+			_screen->fadeToBlack();
+			_screen->clearPage(0);
+		}
+	}
 
 	_text->setTalkCoords(136);
 	delay(30 * _tickLength);
@@ -127,7 +132,7 @@
 		_res->unloadPakFile("INTRO.VRM");
 }
 
-void KyraEngine_LoK::seq_introLogos() {
+bool KyraEngine_LoK::seq_introLogos() {
 	if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
 		_screen->loadBitmap("LOGO.CPS", 3, 3, &_screen->getPalette(0));
 		_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
@@ -147,8 +152,8 @@
 		_screen->fadeToBlack();
 	}
 
-	if (shouldQuit())
-		return;
+	if (_abortIntroFlag || shouldQuit())
+		return false;
 
 	_screen->clearPage(0);
 
@@ -170,12 +175,8 @@
 	_screen->updateScreen();
 	_screen->fadeFromBlack();
 
-	if (_seq->playSequence(_seq_WestwoodLogo, skipFlag()) || shouldQuit()) {
-		resetSkipFlag();
-		_screen->fadeToBlack();
-		_screen->clearPage(0);
-		return;
-	}
+	if (_seq->playSequence(_seq_WestwoodLogo, skipFlag()) || shouldQuit())
+		return true;
 
 	delay(60 * _tickLength);
 
@@ -186,17 +187,14 @@
 
 	Screen::FontId of = _screen->setFont(Screen::FID_8_FNT);
 
-	if ((_seq->playSequence(_seq_KyrandiaLogo, skipFlag()) && !seq_skipSequence()) || shouldQuit()) {
-		resetSkipFlag();
-		_screen->fadeToBlack();
-		_screen->clearPage(0);
-		return;
-	}
+	if (_seq->playSequence(_seq_KyrandiaLogo, skipFlag()) || shouldQuit())
+		return true;
+
 	_screen->setFont(of);
 	_screen->fillRect(0, 179, 319, 199, 0);
 
 	if (shouldQuit())
-		return;
+		return false;
 
 	if (_flags.platform == Common::kPlatformAmiga) {
 		_screen->copyPalette(0, 2);
@@ -238,20 +236,20 @@
 		} while (!doneFlag && !shouldQuit() && !_abortIntroFlag);
 	}
 
-	if (shouldQuit())
-		return;
+	if (_abortIntroFlag || shouldQuit())
+		return true;
 
-	_seq->playSequence(_seq_Forest, true);
+	return _seq->playSequence(_seq_Forest, true);
 }
 
-void KyraEngine_LoK::seq_introStory() {
+bool KyraEngine_LoK::seq_introStory() {
 	_screen->clearPage(3);
 	_screen->clearPage(0);
 
 	// HACK: The Italian fan translation uses an special text screen here
 	// so we show it even when text is disabled
 	if (!textEnabled() && speechEnabled() && _flags.lang != Common::IT_ITA)
-		return;
+		return false;
 
 	if ((_flags.lang == Common::EN_ANY && !_flags.isTalkie && _flags.platform == Common::kPlatformPC) || _flags.platform == Common::kPlatformAmiga)
 		_screen->loadBitmap("TEXT.CPS", 3, 3, &_screen->getPalette(0));
@@ -305,26 +303,30 @@
 
 	_screen->updateScreen();
 	delay(360 * _tickLength);
+
+	return _abortIntroFlag;
 }
 
-void KyraEngine_LoK::seq_introMalcolmTree() {
+bool KyraEngine_LoK::seq_introMalcolmTree() {
 	_screen->_curPage = 0;
 	_screen->clearPage(3);
-	_seq->playSequence(_seq_MalcolmTree, true);
+	return _seq->playSequence(_seq_MalcolmTree, true);
 }
 
-void KyraEngine_LoK::seq_introKallakWriting() {
+bool KyraEngine_LoK::seq_introKallakWriting() {
 	_seq->makeHandShapes();
 	_screen->setAnimBlockPtr(5060);
 	_screen->_charWidth = -2;
 	_screen->clearPage(3);
-	_seq->playSequence(_seq_KallakWriting, true);
+	const bool skipped = _seq->playSequence(_seq_KallakWriting, true);
 	_seq->freeHandShapes();
+
+	return skipped;
 }
 
-void KyraEngine_LoK::seq_introKallakMalcolm() {
+bool KyraEngine_LoK::seq_introKallakMalcolm() {
 	_screen->clearPage(3);
-	_seq->playSequence(_seq_KallakMalcolm, true);
+	return _seq->playSequence(_seq_KallakMalcolm, true);
 }
 
 void KyraEngine_LoK::seq_createAmuletJewel(int jewel, int page, int noSound, int drawOnly) {


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