aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2007-04-02 18:59:00 +0000
committerGregory Montoir2007-04-02 18:59:00 +0000
commit20ec8d2d343bbeea79b939c185fc2ed0772500bb (patch)
tree9704756a10ddf76a02a5aafd8377220c794046b8
parent47f5e30857b6baca1f31b0aefc931b8013bb62a9 (diff)
downloadscummvm-rg350-20ec8d2d343bbeea79b939c185fc2ed0772500bb.tar.gz
scummvm-rg350-20ec8d2d343bbeea79b939c185fc2ed0772500bb.tar.bz2
scummvm-rg350-20ec8d2d343bbeea79b939c185fc2ed0772500bb.zip
This should make the game match the original DOS version speed.
svn-id: r26371
-rw-r--r--engines/queen/input.cpp7
-rw-r--r--engines/queen/input.h4
-rw-r--r--engines/queen/queen.cpp9
-rw-r--r--engines/queen/queen.h1
4 files changed, 11 insertions, 10 deletions
diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp
index 02573d4d3e..0b58c46036 100644
--- a/engines/queen/input.cpp
+++ b/engines/queen/input.cpp
@@ -81,11 +81,10 @@ Input::Input(Common::Language language, OSystem *system) :
}
}
-void Input::delay() {
- delay(_fastMode ? DELAY_SHORT : DELAY_NORMAL);
-}
-
void Input::delay(uint amount) {
+ if (_fastMode && amount > DELAY_SHORT) {
+ amount = DELAY_SHORT;
+ }
if (_idleTime < DELAY_SCREEN_BLANKER) {
_idleTime += amount;
}
diff --git a/engines/queen/input.h b/engines/queen/input.h
index e1d3086b65..169652bb0d 100644
--- a/engines/queen/input.h
+++ b/engines/queen/input.h
@@ -46,10 +46,6 @@ public:
Input(Common::Language language, OSystem *system);
- //! calls the other delay() with a value adjusted depending on _fastMode
- void delay();
-
- //! moved QueenEngine::delay() here
void delay(uint amount);
//! convert input to verb
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index 46a0f42f36..148e40af80 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -177,7 +177,12 @@ void QueenEngine::update(bool checkPlayerInput) {
_graphics->update(_logic->currentRoom());
_logic->update();
- _input->delay();
+ int frameDelay = (_lastUpdateTime + Input::DELAY_NORMAL - _system->getMillis());
+ if (frameDelay <= 0) {
+ frameDelay = 1;
+ }
+ _input->delay(frameDelay);
+ _lastUpdateTime = _system->getMillis();
if (!_resource->isInterview()) {
_display->palCustomScroll(_logic->currentRoom());
@@ -333,7 +338,7 @@ int QueenEngine::go() {
if (ConfMan.hasKey("save_slot") && canLoadOrSave()) {
loadGameState(ConfMan.getInt("save_slot"));
}
- _lastSaveTime = _system->getMillis();
+ _lastSaveTime = _lastUpdateTime = _system->getMillis();
_quit = false;
while (!_quit) {
if (_logic->newRoom() > 0) {
diff --git a/engines/queen/queen.h b/engines/queen/queen.h
index 072975432e..8678ba1274 100644
--- a/engines/queen/queen.h
+++ b/engines/queen/queen.h
@@ -133,6 +133,7 @@ protected:
bool _subtitles;
bool _quit;
uint32 _lastSaveTime;
+ uint32 _lastUpdateTime;
BamScene *_bam;
BankManager *_bankMan;