diff options
author | Paul Gilbert | 2017-12-09 19:54:46 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-12-09 19:54:46 -0500 |
commit | 65ecb6e56f91c3ea92a7001d80337efb4a93e004 (patch) | |
tree | 3c6e92932100f3547af302b99d5670e7872c374a | |
parent | deb4261b6ab3bc2afd6c174dc9f224432ef748d8 (diff) | |
download | scummvm-rg350-65ecb6e56f91c3ea92a7001d80337efb4a93e004.tar.gz scummvm-rg350-65ecb6e56f91c3ea92a7001d80337efb4a93e004.tar.bz2 scummvm-rg350-65ecb6e56f91c3ea92a7001d80337efb4a93e004.zip |
XEEN: Do rendering delays like the original did
-rw-r--r-- | engines/xeen/dialogs_map.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/events.cpp | 6 | ||||
-rw-r--r-- | engines/xeen/events.h | 8 | ||||
-rw-r--r-- | engines/xeen/interface.cpp | 11 | ||||
-rw-r--r-- | engines/xeen/interface.h | 8 |
5 files changed, 25 insertions, 10 deletions
diff --git a/engines/xeen/dialogs_map.cpp b/engines/xeen/dialogs_map.cpp index ccc93db114..084ee876ad 100644 --- a/engines/xeen/dialogs_map.cpp +++ b/engines/xeen/dialogs_map.cpp @@ -73,7 +73,7 @@ void MapDialog::execute() { events.updateGameCounter(); do { if (drawFlag) - intf.draw3d(false, true); + intf.draw3d(false); windows[5].writeString("\r"); if (map._isOutdoors) diff --git a/engines/xeen/events.cpp b/engines/xeen/events.cpp index 9299eee040..0f54214409 100644 --- a/engines/xeen/events.cpp +++ b/engines/xeen/events.cpp @@ -161,6 +161,12 @@ void EventsManager::ipause(uint amount) { } while (!_vm->shouldQuit() && timeElapsed() < amount); } +void EventsManager::ipause5(uint amount) { + do { + pollEventsAndWait(); + } while (!_vm->shouldQuit() && timeElapsed5() < amount); +} + void EventsManager::nextFrame() { ++_frameCounter; diff --git a/engines/xeen/events.h b/engines/xeen/events.h index 4ebc36d3f7..921ee56997 100644 --- a/engines/xeen/events.h +++ b/engines/xeen/events.h @@ -109,7 +109,15 @@ public: bool wait(uint numFrames, bool interruptable = true); + /** + * Pause for a set amount + */ void ipause(uint amount); + + /** + * Pauses a set amount past the previous call to timeMark5 + */ + void ipause5(uint amount); }; class GameEvent { diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index c7ed3fd646..f39c2d4278 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -1242,7 +1242,7 @@ void Interface::bash(const Common::Point &pt, Direction direction) { drawParty(true); } -void Interface::draw3d(bool updateFlag, bool skipDelay) { +void Interface::draw3d(bool updateFlag) { Combat &combat = *_vm->_combat; EventsManager &events = *_vm->_events; Party &party = *_vm->_party; @@ -1250,7 +1250,7 @@ void Interface::draw3d(bool updateFlag, bool skipDelay) { Scripts &scripts = *_vm->_scripts; Windows &windows = *_vm->_windows; - events.updateGameCounter(); + events.timeMark5(); if (windows[11]._enabled) return; @@ -1299,12 +1299,7 @@ void Interface::draw3d(bool updateFlag, bool skipDelay) { } party._stepped = false; - if (_vm->_mode == MODE_RECORD_EVENTS) { - // TODO: Save current scripts data? - } - - if (!skipDelay) - events.wait(2, false); + events.ipause5(2); } void Interface::handleFalling() { diff --git a/engines/xeen/interface.h b/engines/xeen/interface.h index 35169288d7..54a9cd179e 100644 --- a/engines/xeen/interface.h +++ b/engines/xeen/interface.h @@ -161,9 +161,15 @@ public: void rest(); + /** + * Handles bash actions + */ void bash(const Common::Point &pt, Direction direction); - void draw3d(bool updateFlag, bool skipDelay = false); + /** + * Handles drawing the elements of the interface and game scene + */ + void draw3d(bool updateFlag); /** * Draw the display borders |