aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorFilippos Karapetis2015-02-25 00:37:07 +0200
committerEugene Sandulenko2015-12-15 00:05:02 +0100
commit16df4305f4334845b52b0bbc999e4d6d04cdbbbb (patch)
treee2bd0c1d3fb4fa65d4663a58bc9fb1269578ba83 /engines/lab
parent6842ffbe90867deb214f4f9e7f0f75476fbefdf9 (diff)
downloadscummvm-rg350-16df4305f4334845b52b0bbc999e4d6d04cdbbbb.tar.gz
scummvm-rg350-16df4305f4334845b52b0bbc999e4d6d04cdbbbb.tar.bz2
scummvm-rg350-16df4305f4334845b52b0bbc999e4d6d04cdbbbb.zip
LAB: Allow skipping the credits in the intro sequence
Also, remove some unused variables and perform some minor renaming
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/engine.cpp13
-rw-r--r--engines/lab/intro.cpp53
-rw-r--r--engines/lab/readdiff.cpp1
3 files changed, 35 insertions, 32 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index b4b64093ab..2916186541 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -696,13 +696,10 @@ static void decIncInv(uint16 *CurInv, bool dec) {
}
-static bool nosvgamem = false;
-static bool didintro = false;
-
/******************************************************************************/
-/* Processes user input events. */
+/* The main game loop */
/******************************************************************************/
-static void process() {
+static void mainGameLoop() {
IntuiMessage *Msg;
uint32 Class;
@@ -1415,16 +1412,16 @@ void LabEngine::go() {
openFont("P:AvanteG.12", &MsgFont);
+ mouseHide();
+
if (dointro && mem) {
- didintro = true;
introSequence();
- didintro = true;
} else
DoBlack = true;
if (mem) {
mouseShow();
- process();
+ mainGameLoop();
} else
debug("\n\nNot enough memory to start game.\n\n");
diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp
index 8d508aebba..e37b347d68 100644
--- a/engines/lab/intro.cpp
+++ b/engines/lab/intro.cpp
@@ -40,7 +40,7 @@ namespace Lab {
static TextFont filler, *msgfont = &filler;
-extern bool nopalchange, noscreenchange, hidemouse, DoBlack, NoFlip, IsHiRes;
+extern bool nopalchange, hidemouse, DoBlack, NoFlip, IsHiRes;
extern char diffcmap[256 * 3];
@@ -248,18 +248,19 @@ void musicDelay() {
static void NReadPict(const char *Filename, bool PlayOnce) {
- char filename[20] = "P:Intro/";
+ Common::String finalFileName = "P:Intro/";
g_music->newCheckMusic();
+ introEatMessages();
if (QuitIntro)
return;
- strcat(filename, Filename);
+ finalFileName += Filename;
DoBlack = IntroDoBlack;
stopDiffEnd();
- readPict(filename, PlayOnce);
+ readPict(finalFileName.c_str(), PlayOnce);
}
@@ -274,13 +275,17 @@ void introSequence() {
DoBlack = true;
if (g_lab->getPlatform() != Common::kPlatformWindows) {
- readPict("p:Intro/EA0", true);
- readPict("p:Intro/EA1", true);
- readPict("p:Intro/EA2", true);
- readPict("p:Intro/EA3", true);
+ NReadPict("EA0", true);
+ NReadPict("EA1", true);
+ NReadPict("EA2", true);
+ NReadPict("EA3", true);
} else {
- readPict("p:Intro/WYRMKEEP", true);
- microDelay(4, 0);
+ NReadPict("WYRMKEEP", true);
+ for (counter = 0; counter < 4; counter++) {
+ if (QuitIntro)
+ break;
+ microDelay(1, 0);
+ }
}
blackAllScreen();
@@ -288,14 +293,15 @@ void introSequence() {
g_music->initMusic();
nopalchange = true;
- noscreenchange = true;
- readPict("p:Intro/TNDcycle2.pic", true);
+ NReadPict("TNDcycle2.pic", true);
nopalchange = false;
- noscreenchange = false;
FadePalette = Palette;
for (counter = 0; counter < 16; counter++) {
+ if (QuitIntro)
+ break;
+
Palette[counter] = ((diffcmap[counter * 3] >> 2) << 8) +
((diffcmap[counter * 3 + 1] >> 2) << 4) +
(diffcmap[counter * 3 + 2] >> 2);
@@ -305,6 +311,9 @@ void introSequence() {
fade(true, 0);
for (int times = 0; times < 150; times++) {
+ if (QuitIntro)
+ break;
+
g_music->newCheckMusic();
uint16 temp = Palette[2];
@@ -322,24 +331,24 @@ void introSequence() {
g_music->newCheckMusic();
- readPict("p:Intro/Title.A", true);
- readPict("p:Intro/AB", true);
+ NReadPict("Title.A", true);
+ NReadPict("AB", true);
musicDelay();
- readPict("p:Intro/BA", true);
- readPict("p:Intro/AC", true);
+ NReadPict("BA", true);
+ NReadPict("AC", true);
musicDelay();
if (g_lab->getPlatform() == Common::kPlatformWindows)
musicDelay(); // more credits on this page now
- readPict("p:Intro/CA", true);
- readPict("p:Intro/AD", true);
+ NReadPict("CA", true);
+ NReadPict("AD", true);
musicDelay();
if (g_lab->getPlatform() == Common::kPlatformWindows)
musicDelay(); // more credits on this page now
- readPict("p:Intro/DA", true);
+ NReadPict("DA", true);
musicDelay();
g_music->newOpen("p:Intro/Intro.1"); /* load the picture into the buffer */
@@ -351,9 +360,7 @@ void introSequence() {
getFont("P:Map.font", msgfont);
nopalchange = true;
- noscreenchange = true;
- readPict("p:Intro/Intro.1", true);
- noscreenchange = false;
+ NReadPict("Intro.1", true);
nopalchange = false;
for (counter = 0; counter < 16; counter++) {
diff --git a/engines/lab/readdiff.cpp b/engines/lab/readdiff.cpp
index d5e29fabf1..fa1a009780 100644
--- a/engines/lab/readdiff.cpp
+++ b/engines/lab/readdiff.cpp
@@ -52,7 +52,6 @@ static bool PlayOnce = false, changedscreen;
bool NoFlip = false, /* Don't flip the new picture to front */
DoBlack = false, /* Black the screen before new picture */
nopalchange = false, /* Don't change the palette. */
- noscreenchange = false, /* Don't change the screen type. */
IsBM = false, /* Just fill in the RawDIFFBM structure */
hidemouse = false, /* Don't set the mouse colors */
stopsound = false,