aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter van Niftrik2009-08-25 00:18:11 +0000
committerWalter van Niftrik2009-08-25 00:18:11 +0000
commit4c8c31d7698c196c859bb5415a2ffd19088d4737 (patch)
tree5a3d97b1b10f3f1926d468d79007d28bb200008d
parent39d4c2468920530124e6956128dad33a82b8973a (diff)
downloadscummvm-rg350-4c8c31d7698c196c859bb5415a2ffd19088d4737.tar.gz
scummvm-rg350-4c8c31d7698c196c859bb5415a2ffd19088d4737.tar.bz2
scummvm-rg350-4c8c31d7698c196c859bb5415a2ffd19088d4737.zip
SCI: Fix interpretation of ShowMovie speed argument.
svn-id: r43718
-rw-r--r--engines/sci/engine/kgraphics.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 796ca857e8..ffc14716a5 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -3330,7 +3330,7 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t kShowMovie(EngineState *s, int funct_nr, int argc, reg_t *argv) {
const char *filename = kernel_dereference_char_pointer(s, argv[0], 0);
- int framerate = argv[1].toUint16(); // FIXME: verify
+ int delay = argv[1].toUint16(); // Time between frames in ticks
int frameNr = 0;
SeqDecoder seq;
@@ -3341,6 +3341,8 @@ reg_t kShowMovie(EngineState *s, int funct_nr, int argc, reg_t *argv) {
bool play = true;
while (play) {
+ uint32 startTime = g_system->getMillis();
+
gfx_pixmap_t *pixmap = seq.getFrame(play);
if (frameNr++ == 0)
@@ -3351,10 +3353,8 @@ reg_t kShowMovie(EngineState *s, int funct_nr, int argc, reg_t *argv) {
gfxop_update_box(s->gfx_state, gfx_rect(0, 0, 320, 200));
gfx_free_pixmap(pixmap);
- uint32 startTime = g_system->getMillis();
-
// Wait before showing the next frame
- while (play && (g_system->getMillis() < startTime + 1000 / framerate)) {
+ while (play && (g_system->getMillis() < startTime + (delay * 1000 / 60))) {
// FIXME: we should probably make a function that handles quitting in these kinds of situations
Common::Event curEvent;
Common::EventManager *eventMan = g_system->getEventManager();