diff options
author | johndoe123 | 2015-11-19 17:40:13 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 09bbb482a8ccdfb8e36128d40364900b99aa2a13 (patch) | |
tree | 45aba751e4c2fc6826c3e9db26ee4bee28e0da9d /engines/illusions/threads | |
parent | 601c6f408210344c73dcf4f3bab34b493132387a (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/illusions/threads/talkthread_duckman.cpp | 27 | ||||
-rw-r--r-- | engines/illusions/threads/talkthread_duckman.h | 1 | ||||
-rw-r--r-- | engines/illusions/threads/timerthread.cpp | 14 | ||||
-rw-r--r-- | engines/illusions/threads/timerthread.h | 1 |
4 files changed, 38 insertions, 5 deletions
diff --git a/engines/illusions/threads/talkthread_duckman.cpp b/engines/illusions/threads/talkthread_duckman.cpp index 9b7ca4eefd..5511fc523e 100644 --- a/engines/illusions/threads/talkthread_duckman.cpp +++ b/engines/illusions/threads/talkthread_duckman.cpp @@ -210,6 +210,33 @@ void TalkThread_Duckman::onNotify() { } void TalkThread_Duckman::onPause() { + if (_status == 5) { + if (!(_flags & 4)) { + // TODO audvocPauseVoice(); + } + if (!(_flags & 8)) + _textDurationElapsed = getDurationElapsed(_textStartTime, _textEndTime); + } +} + +void TalkThread_Duckman::onUnpause() { + if (_status == 3) { + TalkEntry *talkEntry = getTalkResourceEntry(_talkId); + if (!_vm->isSoundActive()) + _vm->_soundMan->cueVoice((char*)talkEntry->_voiceName); + } else if (_status == 5) { + if (!(_flags & 4)) { + // TODO audvocUnpauseVoice(); + } + if (!(_flags & 8)) { + _textStartTime = getCurrentTime(); + if (_textDuration <= _textDurationElapsed) + _textEndTime = _textStartTime; + else + _textEndTime = _textStartTime + _textDuration - _textDurationElapsed; + _textDurationElapsed = 0; + } + } } void TalkThread_Duckman::onResume() { diff --git a/engines/illusions/threads/talkthread_duckman.h b/engines/illusions/threads/talkthread_duckman.h index b729ad2d8f..6f4758dc33 100644 --- a/engines/illusions/threads/talkthread_duckman.h +++ b/engines/illusions/threads/talkthread_duckman.h @@ -44,6 +44,7 @@ public: virtual void onSuspend(); virtual void onNotify(); virtual void onPause(); + virtual void onUnpause(); virtual void onResume(); virtual void onTerminated(); virtual void onKill(); 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(); } diff --git a/engines/illusions/threads/timerthread.h b/engines/illusions/threads/timerthread.h index d283dc40ba..7e1b61319b 100644 --- a/engines/illusions/threads/timerthread.h +++ b/engines/illusions/threads/timerthread.h @@ -37,6 +37,7 @@ public: virtual void onSuspend(); virtual void onNotify(); virtual void onPause(); + virtual void onUnpause(); virtual void onResume(); virtual void onTerminated(); public: |