aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-21 21:50:08 -0400
committerPaul Gilbert2016-09-21 21:50:08 -0400
commit254f931f2f5db13374fb93d8b0bb0b856c39a630 (patch)
tree02c8256120f10c348c81ad33f9f31ebf0c6c7a62
parent2d74128069453e2872723f6ca15ffdf428e5be5d (diff)
downloadscummvm-rg350-254f931f2f5db13374fb93d8b0bb0b856c39a630.tar.gz
scummvm-rg350-254f931f2f5db13374fb93d8b0bb0b856c39a630.tar.bz2
scummvm-rg350-254f931f2f5db13374fb93d8b0bb0b856c39a630.zip
XEEN: Fixes for Clouds intro
-rw-r--r--engines/xeen/files.cpp7
-rw-r--r--engines/xeen/files.h5
-rw-r--r--engines/xeen/worldofxeen/clouds_cutscenes.cpp27
-rw-r--r--engines/xeen/worldofxeen/clouds_cutscenes.h2
4 files changed, 29 insertions, 12 deletions
diff --git a/engines/xeen/files.cpp b/engines/xeen/files.cpp
index 9c829a1a7b..ff4a56fcb0 100644
--- a/engines/xeen/files.cpp
+++ b/engines/xeen/files.cpp
@@ -270,10 +270,15 @@ Common::String File::readString() {
/*------------------------------------------------------------------------*/
void StringArray::load(const Common::String &name) {
- File f(name);
+ load(name, ANY_ARCHIVE);
+}
+
+void StringArray::load(const Common::String &name, ArchiveType archiveType) {
+ File f(name, archiveType);
clear();
while (f.pos() < f.size())
push_back(f.readString());
}
+
} // End of namespace Xeen
diff --git a/engines/xeen/files.h b/engines/xeen/files.h
index ae97d65c61..4e9e196a5f 100644
--- a/engines/xeen/files.h
+++ b/engines/xeen/files.h
@@ -121,6 +121,11 @@ public:
* Loads a string array from the specified file
*/
void load(const Common::String &name);
+
+ /**
+ * Loads a string array from the specified file
+ */
+ void load(const Common::String &name, ArchiveType archiveType);
};
class XeenSerializer : public Common::Serializer {
diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.cpp b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
index 7b73e12e0e..4328b7bf42 100644
--- a/engines/xeen/worldofxeen/clouds_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
@@ -91,7 +91,7 @@ bool CloudsCutscenes::showCloudsIntro() {
lake("lake.vga"), xeen("xeen.vga"), wizTower("wiztower.vga"),
wizTower2("wiztwer2.vga"), lake2("lake2.vga"), lake3("lake3.vga"),
xeen1("xeen1.vga");
- _subtitles.load("special.bin");
+ _subtitles.load("special.bin", GAME_ARCHIVE);
// Show the production splash screen
sound.playSong("mm4theme.m");
@@ -217,7 +217,10 @@ bool CloudsCutscenes::showCloudsIntro() {
crodo.draw(screen, 0, Common::Point(0, -5));
screen._windows[0].writeString(CLOUDS_INTRO1);
- doScroll(false, true);
+ // Unroll a scroll
+ if (doScroll(false, true))
+ return false;
+
sound.setMusicVolume(75);
screen.restoreBackground();
screen.update();
@@ -226,11 +229,11 @@ bool CloudsCutscenes::showCloudsIntro() {
// Loop through each spoken line
int ctr1 = 0, ctr2 = 0, ctr3 = 0, ctr4 = 0, ctr5 = 0, totalCtr = 0;
for (int lineCtr = 0; lineCtr < 14; ++lineCtr) {
- if (lineCtr != 6 || lineCtr != 7) {
+ if (lineCtr != 6 && lineCtr != 7) {
sound.playSound(_INTRO_VOCS[lineCtr]);
}
- for (int frameNum = 0, lookup = 0; sound.isPlaying() || _subtitleSize; ) {
+ for (int frameCtr = 0, lookup = 0; sound.isPlaying() || _subtitleSize; ) {
groupo.draw(screen, 0);
groupo.draw(screen, 1, Common::Point(160, 0));
@@ -289,10 +292,10 @@ bool CloudsCutscenes::showCloudsIntro() {
}
default:
- crodo.draw(screen, frameNum, Common::Point(0, -5));
+ crodo.draw(screen, frameCtr, Common::Point(0, -5));
if (lookup > 30)
lookup = 30;
- frameNum = _INTRO_FRAMES_VALS[_INTRO_FRAMES_LOOKUP[lineCtr]][lookup];
+ frameCtr = _INTRO_FRAMES_VALS[_INTRO_FRAMES_LOOKUP[lineCtr]][lookup];
screen._windows[0].writeString(CLOUDS_INTRO1);
ctr5 = (ctr5 + 1) % 19;
@@ -302,11 +305,14 @@ bool CloudsCutscenes::showCloudsIntro() {
}
events.updateGameCounter();
- while (events.timeElapsed() < _INTRO_FRAMES_MAX[_INTRO_FRAMES_LOOKUP[lineCtr]][lookup]
- || sound.isPlaying()) {
- WAIT(1);
+ while (events.timeElapsed() < _INTRO_FRAMES_WAIT[_INTRO_FRAMES_LOOKUP[lineCtr]][lookup]
+ && sound.isPlaying()) {
+ events.pollEventsAndWait();
+ if (events.isKeyMousePressed())
+ return false;
}
+ ++lookup;
if (!sound._soundOn && lookup > 30)
lookup = 0;
}
@@ -320,6 +326,7 @@ bool CloudsCutscenes::showCloudsIntro() {
sound.playSound(_INTRO_VOCS[7]);
}
+ // Roll up the scroll again
sound.songCommand(50);
doScroll(true, false);
@@ -366,7 +373,7 @@ const int CloudsCutscenes::_INTRO_FRAMES_VALS[8][32] = {
}
};
-const int CloudsCutscenes::_INTRO_FRAMES_MAX[8][32] = {
+const uint CloudsCutscenes::_INTRO_FRAMES_WAIT[8][32] = {
{
2, 5, 6, 9, 10, 11, 12, 13, 14, 23, 25, 29, 31, 35, 38, 41,
42, 45, 50, 52, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0
diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.h b/engines/xeen/worldofxeen/clouds_cutscenes.h
index 5bc9595239..25c7428686 100644
--- a/engines/xeen/worldofxeen/clouds_cutscenes.h
+++ b/engines/xeen/worldofxeen/clouds_cutscenes.h
@@ -33,7 +33,7 @@ private:
static const char *const _INTRO_VOCS[14];
static const int _INTRO_FRAMES_LOOKUP[14];
static const int _INTRO_FRAMES_VALS[8][32];
- static const int _INTRO_FRAMES_MAX[8][32];
+ static const uint _INTRO_FRAMES_WAIT[8][32];
public:
CloudsCutscenes(XeenEngine *vm) : Cutscenes(vm) {}