aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2017-05-18 12:09:24 -0500
committerColin Snover2017-07-06 19:12:36 -0500
commit1fbee2f51ef8f1027a638d1a9895fc859568fa4a (patch)
tree93f00a0945816d5034559b6f5b8fe0ac7873a703 /engines/sci
parent9f910535c9d358262b68ad9200e041a9a6d77ce5 (diff)
downloadscummvm-rg350-1fbee2f51ef8f1027a638d1a9895fc859568fa4a.tar.gz
scummvm-rg350-1fbee2f51ef8f1027a638d1a9895fc859568fa4a.tar.bz2
scummvm-rg350-1fbee2f51ef8f1027a638d1a9895fc859568fa4a.zip
SCI32: Allow skipping SEQ animations
In SSCI, SEQ animations cannot be skipped.
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/video32.cpp30
-rw-r--r--engines/sci/graphics/video32.h5
2 files changed, 31 insertions, 4 deletions
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index f4b15517fe..fc35d40e1f 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -71,8 +71,9 @@ static bool flushEvents(EventManager *eventMan) {
#pragma mark SEQPlayer
-SEQPlayer::SEQPlayer(SegManager *segMan) :
+SEQPlayer::SEQPlayer(SegManager *segMan, EventManager *eventMan) :
_segMan(segMan),
+ _eventMan(eventMan),
_decoder(nullptr),
_plane(nullptr),
_screenItem(nullptr) {}
@@ -114,7 +115,32 @@ void SEQPlayer::play(const Common::String &fileName, const int16 numTicks, const
while (!g_engine->shouldQuit() && !_decoder->endOfVideo()) {
g_sci->sleep(_decoder->getTimeToNextFrame());
- renderFrame(bitmap);
+
+ while (_decoder->needsUpdate()) {
+ renderFrame(bitmap);
+ }
+
+ // SSCI did not allow SEQ animations to be bypassed like this
+ SciEvent event = _eventMan->getSciEvent(SCI_EVENT_MOUSE_PRESS | SCI_EVENT_PEEK);
+ if (event.type == SCI_EVENT_MOUSE_PRESS) {
+ break;
+ }
+
+ event = _eventMan->getSciEvent(SCI_EVENT_KEYBOARD | SCI_EVENT_PEEK);
+ if (event.type == SCI_EVENT_KEYBOARD) {
+ bool stop = false;
+ while ((event = _eventMan->getSciEvent(SCI_EVENT_KEYBOARD)),
+ event.type != SCI_EVENT_NONE) {
+ if (event.character == SCI_KEY_ESC) {
+ stop = true;
+ break;
+ }
+ }
+
+ if (stop) {
+ break;
+ }
+ }
}
_segMan->freeBitmap(bitmapId);
diff --git a/engines/sci/graphics/video32.h b/engines/sci/graphics/video32.h
index 7b71b37fb0..41e3016f12 100644
--- a/engines/sci/graphics/video32.h
+++ b/engines/sci/graphics/video32.h
@@ -50,7 +50,7 @@ struct Palette;
*/
class SEQPlayer {
public:
- SEQPlayer(SegManager *segMan);
+ SEQPlayer(SegManager *segMan, EventManager *eventMan);
/**
* Plays a SEQ animation with the given
@@ -61,6 +61,7 @@ public:
private:
SegManager *_segMan;
+ EventManager *_eventMan;
SEQDecoder *_decoder;
/**
@@ -655,7 +656,7 @@ private:
class Video32 : public Common::Serializable {
public:
Video32(SegManager *segMan, EventManager *eventMan) :
- _SEQPlayer(segMan),
+ _SEQPlayer(segMan, eventMan),
_AVIPlayer(segMan, eventMan),
_VMDPlayer(segMan, eventMan),
_robotPlayer(segMan),