diff options
author | Oystein Eftevaag | 2007-06-23 08:42:30 +0000 |
---|---|---|
committer | Oystein Eftevaag | 2007-06-23 08:42:30 +0000 |
commit | 62a28d0864976103f678ab16d3401f05cd337693 (patch) | |
tree | eec8cb2d7f38ca16acaf7543bf76019a009131e0 /engines/kyra | |
parent | 55058015338f46f9c35afaecfef4d24dd198a363 (diff) | |
download | scummvm-rg350-62a28d0864976103f678ab16d3401f05cd337693.tar.gz scummvm-rg350-62a28d0864976103f678ab16d3401f05cd337693.tar.bz2 scummvm-rg350-62a28d0864976103f678ab16d3401f05cd337693.zip |
Applying patch 1669536: Kyra2: Intro fixes
svn-id: r27650
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 6 | ||||
-rw-r--r-- | engines/kyra/screen.cpp | 28 | ||||
-rw-r--r-- | engines/kyra/screen.h | 2 | ||||
-rw-r--r-- | engines/kyra/sequences_v2.cpp | 157 |
5 files changed, 168 insertions, 27 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index d0a241fc57..03d1f8e27e 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -112,7 +112,7 @@ void KyraEngine_v2::mainMenu() { case 0: break; case 1: - seq_playSequences(kSequenceOverview, kSequenceLibrary); + seq_playSequences(kSequenceOverview, kSequenceZanFaun); break; case 2: break; diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index ed5c370139..e3dac3f0d5 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -34,7 +34,9 @@ enum kSequences { kSequenceTitle = 2, kSequenceOverview = 3, kSequenceLibrary = 4, - kSequenceHand = 5 + kSequenceHand = 5, + kSequencePoint = 6, + kSequenceZanFaun = 7 }; class WSAMovieV2; @@ -92,6 +94,8 @@ private: int seq_introOverview(int seqNum); int seq_introLibrary(int seqNum); int seq_introHand(int seqNum); + int seq_introPoint(int seqNum); + int seq_introZanFaun(int seqNum); void seq_introOverviewOver1(int currentFrame); void seq_introOverviewForest(int currentFrame); diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 17c6b2219b..4beb371479 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -355,6 +355,34 @@ void Screen::fadeToBlack(int delay) { fadePalette(blackPal, delay); } +void Screen::k2IntroFadeToGrey(int delay) { + debugC(9, kDebugLevelScreen, "Screen::k2IntroFadeToGrey()"); + + for (int i = 0; i <= 50; ++i) { + if (i <= 8 || i >= 30) + { + _currentPalette[3 * i + 0] = (_currentPalette[3 * i + 0] + + _currentPalette[3 * i + 1] + + _currentPalette[3 * i + 2]) / 3; + _currentPalette[3 * i + 1] = _currentPalette[3 * i + 0]; + _currentPalette[3 * i + 2] = _currentPalette[3 * i + 0]; + } + } + + // color 71 is the same in both the overview and closeup scenes + // Converting it to greyscale makes the trees in the closeup look dull + for (int i = 71; i < 200; ++i) { + _currentPalette[3 * i + 0] = (_currentPalette[3 * i + 0] + + _currentPalette[3 * i + 1] + + _currentPalette[3 * i + 2]) / 3; + _currentPalette[3 * i + 1] = _currentPalette[3 * i + 0]; + _currentPalette[3 * i + 2] = _currentPalette[3 * i + 0]; + } + fadePalette(_currentPalette, delay); + // Make the font color white again + setPaletteIndex(254, 254, 254, 254); +} + void Screen::fadeSpecialPalette(int palIndex, int startIndex, int size, int fadeTime) { debugC(9, kDebugLevelScreen, "fadeSpecialPalette(%d, %d, %d, %d)", palIndex, startIndex, size, fadeTime); assert(_vm->palTable1()[palIndex]); diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 5e3869d278..a60cdbd637 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -134,6 +134,8 @@ public: void fadeFromBlack(int delay=0x54); void fadeToBlack(int delay=0x54); + void k2IntroFadeToGrey(int delay=0x54); + void fadeSpecialPalette(int palIndex, int startIndex, int size, int fadeTime); void fadePalette(const uint8 *palData, int delay); diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp index 27b6064fb9..afda1091e6 100644 --- a/engines/kyra/sequences_v2.cpp +++ b/engines/kyra/sequences_v2.cpp @@ -49,7 +49,9 @@ void KyraEngine_v2::seq_playSequences(int startSeq, int endSeq) { {1, "title.wsa", &KyraEngine_v2::seq_introTitle, 6, 10, 26, false, false}, {2, "over.cps", &KyraEngine_v2::seq_introOverview, 16, 30, 1, false, true}, {2, "library.cps", &KyraEngine_v2::seq_introLibrary, 16, 30, 1, false, true}, - {2, "hand.cps", &KyraEngine_v2::seq_introHand, 16, 90, 1, false, true} + {2, "hand.cps", &KyraEngine_v2::seq_introHand, 16, 90, 1, false, true}, + {1, "point.wsa", &KyraEngine_v2::seq_introPoint, 16, 30, 1, false, true}, + {1, "zanfaun.wsa", &KyraEngine_v2::seq_introZanFaun, 16, 90, 1, false, true} }; assert(startSeq >= 0 && endSeq < ARRAYSIZE(sequences) && startSeq <= endSeq); @@ -97,7 +99,9 @@ void KyraEngine_v2::seq_playSequences(int startSeq, int endSeq) { seqDelay += _system->getMillis(); bool mayEndLoop = sequences[i].timeOut; - while (!_quitFlag && !_skipFlag) { + // Skip the movie if esc is pressed or the mouse is clicked + // However, don't skip the menu movie, to match the behavior of the original interpreter + while ((!_quitFlag && !_skipFlag) || i == kSequenceTitle) { uint32 startTime = _system->getMillis(); if (sequences[i].callback) { @@ -140,63 +144,161 @@ void KyraEngine_v2::seq_playSequences(int startSeq, int endSeq) { delete[] _activeChat; } +// FIXME: This part needs game dialogs, as it's not part of the intro, but +// rather a game video. It has speech only in the CD version +int KyraEngine_v2::seq_introZanFaun(int seqNum) { + debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introZanFaun(%i)", seqNum); + + static const SequenceControl zanFaunWSAControl[] = { + {0, 6}, {1, 6}, {2, 6}, {3, 6}, + {4, 6}, {5, 6}, {6, 6}, {7, 6}, + {8, 6}, {9, 6}, {10, 6}, {11, 6}, + {12, 6}, {13, 6}, {14, 6}, {15, 6}, + {16, 6}, {17, 6}, {18, 6}, {19, 6}, + {20, 6}, {21, 6}, {22, 6}, {23, 6}, + {23, 6}, {22, 6}, {21, 6}, {20, 6}, + {19, 6}, {18, 6}, {17, 6}, {16, 6}, + {15, 6}, {14, 6}, {13, 6}, {12, 6}, + {11, 6}, {10, 6}, {9, 6}, {8, 6}, + {7, 6}, {6, 6}, {5, 6}, {4, 6}, + {3, 6}, {2, 6}, {1, 6}, {0, 6}, + {8, 6}, {9, 6}, {10, 6}, {-1, -1} }; + + switch (seqNum) { + case 0: + _sound->playTrack(8); + //XXX: palette stuff + //XXX: load dialogs + break; + case 1: + seq_loadWSA(1, "zanfaun.wsa", 9, 0, zanFaunWSAControl); + break; + case 0x294: + seq_waitForChatsToFinish(); + seq_unloadWSA(1); + return 0; + default: + break; + } + + return -1; +} + +int KyraEngine_v2::seq_introPoint(int seqNum) { + debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introPoint(%i)", seqNum); + + switch (seqNum) { + case 0: + _sound->playTrack(7); + break; + case 1: + seq_loadWSA(1, "point.wsa", 9); + seq_playIntroChat(11); // "Zanthia, youngest of the royal mystics has been selected" + break; + case 0x96: + seq_waitForChatsToFinish(); + seq_unloadWSA(1); + return 0; + default: + break; + } + + return -1; +} + int KyraEngine_v2::seq_introHand(int seqNum) { debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introHand(%i)", seqNum); - static const SequenceControl hand1bWSAControl[] = { + // XXX: commented out to prevent compiler warnings + /*static const SequenceControl hand1bWSAControl[] = { {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}, {7, 6}, {8, 6}, {9, 6}, {10, 6}, {11, 6}, {11, 12}, {12, 12}, {13, 12}, {12, 12}, {11, 12}, {-1, -1} }; static const SequenceControl hand1cWSAControl[] = { {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {3, 6}, - {4, 6}, {5, 64}, {5, 6}, {-1, -1} }; + {4, 6}, {5, 64}, {5, 6}, {-1, -1} };*/ static const SequenceControl hand2WSAControl[] = { {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, - {0, 6}, {1, 6}, {0, 6}, {1, 6}, {-1, -1} }; + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, + {0, 6}, {1, 6}, {0, 6}, {1, 6}, {0, 6}, {1, 6}, {-1, -1} }; static const SequenceControl hand3WSAControl[] = { {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, + {0, 6}, {1, 6}, {2, 6}, {1, 6}, {0, 6}, {-1, -1} }; static const SequenceControl hand4WSAControl[] = { {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, - {3, 6}, {2, 6}, {1, 6}, {-1, -1} }; + {3, 6}, {2, 6}, {1, 6}, {0, 6}, + {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, + {3, 6}, {2, 6}, {1, 6}, {0, 6}, + {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, + {3, 6}, {2, 6}, {1, 6}, {0, 6}, + {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, + {3, 6}, {2, 6}, {1, 6}, {0, 6}, + {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, + {3, 6}, {2, 6}, {1, 6}, {0, 6}, + {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, + {3, 6}, {2, 6}, {1, 6}, {0, 6}, + {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, + {3, 6}, {2, 6}, {1, 6}, {0, 6}, + {0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, + {3, 6}, {2, 6}, {1, 6}, {0, 6}, + {-1, -1} }; switch (seqNum) { case 0: _sound->playTrack(6); - seq_playIntroChat(7); //palette stuff break; case 1: // XXX: these show as garbage. New frame encode? - seq_loadWSA(1, "hand1a.wsa", 9); + /*seq_loadWSA(1, "hand1a.wsa", 9); seq_loadWSA(2, "hand1b.wsa", 9, 0, hand1bWSAControl); - seq_loadWSA(3, "hand1c.wsa", 9, 0, hand1cWSAControl); + seq_loadWSA(3, "hand1c.wsa", 9, 0, hand1cWSAControl);*/ + seq_playIntroChat(7); // "Luckily, the Hand was experienced in these matters" break; case 0xc9: // palette stuff seq_loadWSA(4, "hand2.wsa", 9, 0, hand2WSAControl); - seq_playIntroChat(8); + seq_waitForChatsToFinish(); + seq_playIntroChat(8); // "and finally, a plan was approved" break; case 0x18b: - seq_waitForChatsToFinish(); seq_loadWSA(5, "hand3.wsa", 9, 0, hand3WSAControl); + seq_waitForChatsToFinish(); + seq_playIntroChat(9); // "which required a magic anchorstone" break; case 0x1f4: - seq_waitForChatsToFinish(); seq_loadWSA(6, "hand4.wsa", 9, 0, hand4WSAControl); + seq_waitForChatsToFinish(); + seq_playIntroChat(10); // "to be retrieved from the center of the world" break; - case 0x21c: - seq_playIntroChat(10); - break; - case 0x276: + case 0x320: seq_waitForChatsToFinish(); - seq_unloadWSA(1); + /*seq_unloadWSA(1); seq_unloadWSA(2); - seq_unloadWSA(3); + seq_unloadWSA(3);*/ seq_unloadWSA(4); seq_unloadWSA(5); seq_unloadWSA(6); @@ -217,7 +319,7 @@ int KyraEngine_v2::seq_introLibrary(int seqNum) { switch (seqNum) { case 0: _sound->playTrack(5); - seq_playIntroChat(4); + seq_playIntroChat(4); // "The royal mystics are baffled" //XXX: palette stuff break; case 1: @@ -230,16 +332,18 @@ int KyraEngine_v2::seq_introLibrary(int seqNum) { seq_loadWSA(2, "darm.wsa", 9); break; case 0x68: - seq_playIntroChat(5); + seq_waitForChatsToFinish(); + seq_playIntroChat(5); // "Every reference has been consulted" break; case 0xF0: seq_waitForChatsToFinish(); seq_loadWSA(3, "library.wsa", 9); break; case 0x154: + seq_waitForChatsToFinish(); // palette stuff seq_loadWSA(4, "marco.wsa", 9); - seq_playIntroChat(6); + seq_playIntroChat(6); // "Even Marko and his new valet have been allowed" break; case 0x294: seq_waitForChatsToFinish(); @@ -269,20 +373,23 @@ int KyraEngine_v2::seq_introOverview(int seqNum) { seq_loadWSA(2, "over2.wsa", 9); break; case 120: - seq_playIntroChat(0); + seq_playIntroChat(0); // "Kyrandia is disappearing!" break; case 200: seq_waitForChatsToFinish(); // XXX: fade to grey + _screen->k2IntroFadeToGrey(40); break; case 201: // XXX break; case 282: + seq_waitForChatsToFinish(); seq_loadWSA(3, "forest.wsa", 6, &KyraEngine_v2::seq_introOverviewForest); - seq_playIntroChat(1); + seq_playIntroChat(1); // "Rock by rock..." break; case 434: + seq_waitForChatsToFinish(); seq_loadWSA(4, "dragon.wsa", 6, &KyraEngine_v2::seq_introOverviewDragon); break; case 540: @@ -314,7 +421,7 @@ void KyraEngine_v2::seq_introOverviewForest(int currentFrame) { seq_waitForChatsToFinish(); } else if(currentFrame == 12) { delay(25); - seq_playIntroChat(2); + seq_playIntroChat(2); // "...and tree by tree..." } } @@ -322,7 +429,7 @@ void KyraEngine_v2::seq_introOverviewDragon(int currentFrame) { debugC(9, kDebugLevelMain, "KyraEngine_v2::seq_introOverviewDragon(%i)", currentFrame); if (currentFrame == 3) - seq_playIntroChat(3); + seq_playIntroChat(3); // "Kyrandia ceases to exist!" else if(currentFrame == 11) seq_waitForChatsToFinish(); } |