aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lure/events.cpp7
-rw-r--r--engines/lure/intro.cpp28
-rw-r--r--engines/lure/intro.h1
3 files changed, 26 insertions, 10 deletions
diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp
index 68dc808392..c93ae257e9 100644
--- a/engines/lure/events.cpp
+++ b/engines/lure/events.cpp
@@ -205,10 +205,9 @@ bool Events::interruptableDelay(uint32 milliseconds) {
if (events.quitFlag) return true;
if (events.pollEvent()) {
- if (events.type() == Common::EVENT_KEYDOWN)
- return events.event().kbd.keycode == 27;
- else if (events.type() == Common::EVENT_LBUTTONDOWN)
- return false;
+ if ((events.type() == Common::EVENT_KEYDOWN) ||
+ (events.type() == Common::EVENT_LBUTTONDOWN))
+ return true;
}
uint32 delayAmount = delayCtr - g_system->getMillis();
diff --git a/engines/lure/intro.cpp b/engines/lure/intro.cpp
index f1ca06d90e..e59f21d3ad 100644
--- a/engines/lure/intro.cpp
+++ b/engines/lure/intro.cpp
@@ -59,18 +59,34 @@ bool Introduction::showScreen(uint16 screenId, uint16 paletteId, uint16 delaySiz
Palette p(paletteId);
_screen.paletteFadeIn(&p);
- bool result = events.interruptableDelay(delaySize);
+ bool result = interruptableDelay(delaySize);
if (events.quitFlag) return true;
_screen.paletteFadeOut();
return result;
}
+// interruptableDelay
+// Delays for a given number of milliseconds. If it returns true, it indicates that
+// the Escape has been pressed to abort whatever sequence is being displayed
+
+bool Introduction::interruptableDelay(uint32 milliseconds) {
+ Events &events = Events::getReference();
+
+ if (events.interruptableDelay(milliseconds)) {
+ if (events.type() == Common::EVENT_KEYDOWN)
+ return events.event().kbd.keycode == 27;
+ else if (events.type() == Common::EVENT_LBUTTONDOWN)
+ return false;
+ }
+
+ return false;
+}
+
// show
// Main method for the introduction sequence
bool Introduction::show() {
- Events &events = Events::getReference();
_screen.setPaletteEmpty();
// Initial game company and then game screen
@@ -104,13 +120,13 @@ bool Introduction::show() {
anim = new AnimationSequence(_screen, _system, curr_anim->resourceId,
coll.getPalette(curr_anim->paletteIndex), fadeIn);
if (curr_anim->initialPause != 0)
- if (events.interruptableDelay(curr_anim->initialPause * 1000 / 50)) return true;
+ if (interruptableDelay(curr_anim->initialPause * 1000 / 50)) return true;
result = false;
switch (anim->show()) {
case ABORT_NONE:
if (curr_anim->endingPause != 0) {
- result = events.interruptableDelay(curr_anim->endingPause * 1000 / 50);
+ result = interruptableDelay(curr_anim->endingPause * 1000 / 50);
}
break;
@@ -134,9 +150,9 @@ bool Introduction::show() {
result = false;
anim = new AnimationSequence(_screen, _system, 0x48, coll.getPalette(4), false);
do {
- result = events.interruptableDelay(2000);
+ result = interruptableDelay(2000);
_screen.paletteFadeOut();
- if (!result) result = events.interruptableDelay(500);
+ if (!result) result = interruptableDelay(500);
if (result) break;
} while (anim->step());
delete anim;
diff --git a/engines/lure/intro.h b/engines/lure/intro.h
index 14c733e16b..d6b42c455b 100644
--- a/engines/lure/intro.h
+++ b/engines/lure/intro.h
@@ -36,6 +36,7 @@ private:
OSystem &_system;
bool showScreen(uint16 screenId, uint16 paletteId, uint16 delaySize);
+ bool interruptableDelay(uint32 milliseconds);
public:
Introduction(Screen &screen, OSystem &system): _screen(screen), _system(system) {}