aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/threads/timerthread.cpp
diff options
context:
space:
mode:
authorjohndoe1232015-11-19 17:40:13 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit09bbb482a8ccdfb8e36128d40364900b99aa2a13 (patch)
tree45aba751e4c2fc6826c3e9db26ee4bee28e0da9d /engines/illusions/threads/timerthread.cpp
parent601c6f408210344c73dcf4f3bab34b493132387a (diff)
downloadscummvm-rg350-09bbb482a8ccdfb8e36128d40364900b99aa2a13.tar.gz
scummvm-rg350-09bbb482a8ccdfb8e36128d40364900b99aa2a13.tar.bz2
scummvm-rg350-09bbb482a8ccdfb8e36128d40364900b99aa2a13.zip
ILLUSIONS: DUCKMAN: Implement opcodes 70/71 for pausing/unpausing during the menu
Also change some input functions to return uint istead of byte to allow bigger bitmasks.
Diffstat (limited to 'engines/illusions/threads/timerthread.cpp')
-rw-r--r--engines/illusions/threads/timerthread.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/illusions/threads/timerthread.cpp b/engines/illusions/threads/timerthread.cpp
index 417d113210..de1502d9f2 100644
--- a/engines/illusions/threads/timerthread.cpp
+++ b/engines/illusions/threads/timerthread.cpp
@@ -52,10 +52,18 @@ int TimerThread::onUpdate() {
}
void TimerThread::onSuspend() {
- _durationElapsed = getDurationElapsed(_startTime, _endTime);
+ onPause();
}
void TimerThread::onNotify() {
+ onUnpause();
+}
+
+void TimerThread::onPause() {
+ _durationElapsed = getDurationElapsed(_startTime, _endTime);
+}
+
+void TimerThread::onUnpause() {
uint32 currTime = getCurrentTime();
_startTime = currTime;
if (_duration <= _durationElapsed)
@@ -65,10 +73,6 @@ void TimerThread::onNotify() {
_durationElapsed = 0;
}
-void TimerThread::onPause() {
- onSuspend();
-}
-
void TimerThread::onResume() {
onNotify();
}