Applying patch 1669536: Kyra2: Intro fixes

svn-id: r27650
This commit is contained in:
Oystein Eftevaag 2007-06-23 08:42:30 +00:00
parent 5505801533
commit 62a28d0864
5 changed files with 169 additions and 28 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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]);

View File

@ -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);

View File

@ -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);
break;
case 0x21c:
seq_playIntroChat(10);
break;
case 0x276:
seq_waitForChatsToFinish();
seq_unloadWSA(1);
seq_playIntroChat(10); // "to be retrieved from the center of the world"
break;
case 0x320:
seq_waitForChatsToFinish();
/*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();
}