aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorrichiesams2013-08-05 19:07:55 -0500
committerrichiesams2013-08-05 19:07:55 -0500
commit946f98b34d01c06fdea5416f0f0bbd6457bb1b86 (patch)
tree0a890369d14ec8c2542ab3485debe7c78a855ad5 /engines
parent6598bb20fda6aec37d5d7c96ceb6ecde47fda866 (diff)
downloadscummvm-rg350-946f98b34d01c06fdea5416f0f0bbd6457bb1b86.tar.gz
scummvm-rg350-946f98b34d01c06fdea5416f0f0bbd6457bb1b86.tar.bz2
scummvm-rg350-946f98b34d01c06fdea5416f0f0bbd6457bb1b86.zip
ZVISION: Fix frame delay calculation being reversed. Also convert to int to ensure proper 0 clamping
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/zvision.cpp2
-rw-r--r--engines/zvision/zvision.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index a27f4cbc68..7c9bdd8877 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -134,7 +134,7 @@ Common::Error ZVision::run() {
_renderManager->updateScreen(_console->isActive());
// Calculate the frame delay based off a desired frame time
- int delay = _desiredFrameTime - (currentTime - _system->getMillis());
+ int delay = _desiredFrameTime - int32(_system->getMillis() - currentTime);
// Ensure non-negative
delay = delay < 0 ? 0 : delay;
_system->delayMillis(delay);
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index 990b6e8b93..5bb3d7cb1d 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -68,7 +68,7 @@ private:
const int _height;
const Graphics::PixelFormat _pixelFormat;
- const uint _desiredFrameTime;
+ const int _desiredFrameTime;
// We need random numbers
Common::RandomSource *_rnd;