aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2010-07-22 21:46:17 +0000
committerJohannes Schickel2010-07-22 21:46:17 +0000
commit4e02acec85a5844def84e8092e543e4e7c710092 (patch)
tree302ff8454c14e177162985964d3870449e07a2e1
parent9f1c8f149db0c27fa737b4a058a610d36e816e01 (diff)
downloadscummvm-rg350-4e02acec85a5844def84e8092e543e4e7c710092.tar.gz
scummvm-rg350-4e02acec85a5844def84e8092e543e4e7c710092.tar.bz2
scummvm-rg350-4e02acec85a5844def84e8092e543e4e7c710092.zip
KYRA: Implement proper fade out when skipping the intro at any position.
svn-id: r51172
-rw-r--r--engines/kyra/kyra_lok.h12
-rw-r--r--engines/kyra/sequences_lok.cpp60
2 files changed, 37 insertions, 35 deletions
diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h
index c0c9bf06c4..5e32f3fd05 100644
--- a/engines/kyra/kyra_lok.h
+++ b/engines/kyra/kyra_lok.h
@@ -132,7 +132,7 @@ public:
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 @@ protected:
// -> 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);
diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp
index 88c78a6c9e..8bdd85fea4 100644
--- a/engines/kyra/sequences_lok.cpp
+++ b/engines/kyra/sequences_lok.cpp
@@ -114,8 +114,13 @@ void KyraEngine_LoK::seq_intro() {
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 @@ void KyraEngine_LoK::seq_intro() {
_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 @@ void KyraEngine_LoK::seq_introLogos() {
_screen->fadeToBlack();
}
- if (shouldQuit())
- return;
+ if (_abortIntroFlag || shouldQuit())
+ return false;
_screen->clearPage(0);
@@ -170,12 +175,8 @@ void KyraEngine_LoK::seq_introLogos() {
_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 @@ void KyraEngine_LoK::seq_introLogos() {
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 @@ void KyraEngine_LoK::seq_introLogos() {
} 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 @@ void KyraEngine_LoK::seq_introStory() {
_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) {