diff options
author | Filippos Karapetis | 2010-06-16 23:28:20 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-16 23:28:20 +0000 |
commit | 93890a49c1f62791f39e4ee07c2366c8fdb8fb37 (patch) | |
tree | d8e5ed002e543409e54be9f9c4a1d0ff3bcc3d8a /engines/sci/engine/kgraphics.cpp | |
parent | fa0011f51216d926d0922fba7bfb1ed65958dff2 (diff) | |
download | scummvm-rg350-93890a49c1f62791f39e4ee07c2366c8fdb8fb37.tar.gz scummvm-rg350-93890a49c1f62791f39e4ee07c2366c8fdb8fb37.tar.bz2 scummvm-rg350-93890a49c1f62791f39e4ee07c2366c8fdb8fb37.zip |
Added back the functionality to skip videos
svn-id: r49911
Diffstat (limited to 'engines/sci/engine/kgraphics.cpp')
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 424d5049e5..5c84ddfb49 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -1160,8 +1160,9 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { if (videoDecoder) { uint16 x = (screenWidth - videoDecoder->getWidth()) / 2; uint16 y = (screenHeight - videoDecoder->getHeight()) / 2; + bool skipVideo = false; - while (!g_engine->shouldQuit() && !videoDecoder->endOfVideo()) { + while (!g_engine->shouldQuit() && !videoDecoder->endOfVideo() && !skipVideo) { if (videoDecoder->needsUpdate()) { Graphics::Surface *frame = videoDecoder->decodeNextFrame(); if (frame) { @@ -1175,8 +1176,10 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) { } Common::Event event; - while (g_system->getEventManager()->pollEvent(event)) - ; + while (g_system->getEventManager()->pollEvent(event)) { + if ((event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) || event.type == Common::EVENT_LBUTTONUP) + skipVideo = true; + } g_system->delayMillis(10); } |