aboutsummaryrefslogtreecommitdiff
path: root/engines/cge/snail.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-01 18:18:44 +1000
committerPaul Gilbert2011-07-01 18:18:44 +1000
commit601bfbd6095a88b2f6b77d2dec16731fe4fbf687 (patch)
treee67b89416a6231a123df6f6e165060e3ce9a2339 /engines/cge/snail.cpp
parentc982298cbdf8220aa9a8151233e972f2c886c5fc (diff)
downloadscummvm-rg350-601bfbd6095a88b2f6b77d2dec16731fe4fbf687.tar.gz
scummvm-rg350-601bfbd6095a88b2f6b77d2dec16731fe4fbf687.tar.bz2
scummvm-rg350-601bfbd6095a88b2f6b77d2dec16731fe4fbf687.zip
CGE: Reimplemented game timer from using thread to using getMillis()
Diffstat (limited to 'engines/cge/snail.cpp')
-rw-r--r--engines/cge/snail.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp
index a10ab21658..6600b75245 100644
--- a/engines/cge/snail.cpp
+++ b/engines/cge/snail.cpp
@@ -425,7 +425,7 @@ const char *SNAIL::ComTxt[] = {
SNAIL::SNAIL(CGEEngine *vm, bool turbo)
: Turbo(turbo), Busy(false), TextDelay(false),
- Pause(0), TalkEnable(true),
+ _timerExpiry(0), TalkEnable(true),
Head(0), Tail(0), SNList(farnew(COM, 256)), _vm(vm) {
}
@@ -446,7 +446,7 @@ void SNAIL::AddCom(SNCOM com, int ref, int val, void *ptr) {
if (com == SNCLEAR) {
Tail = Head;
KillText();
- Pause = 0;
+ _timerExpiry = 0;
}
_enable();
}
@@ -469,7 +469,7 @@ void SNAIL::InsCom(SNCOM com, int ref, int val, void *ptr) {
if (com == SNCLEAR) {
Tail = Head;
KillText();
- Pause = 0;
+ _timerExpiry = 0;
}
_enable();
}
@@ -913,7 +913,7 @@ void SNAIL::RunCom(void) {
COM *snc = &SNList[Tail];
if (! Turbo) { // only for the slower one
- if (Pause)
+ if (_timerExpiry && (_timerExpiry > g_system->getMillis()))
break;
else {
if (TextDelay) {
@@ -930,7 +930,7 @@ void SNAIL::RunCom(void) {
case SNLABEL :
break;
case SNPAUSE :
- _heart->setXTimer(&Pause, snc->Val);
+ _timerExpiry = g_system->getMillis() + snc->Val * SNAIL_FRAME_DELAY;
if (Talk)
TextDelay = true;
break;
@@ -938,7 +938,7 @@ void SNAIL::RunCom(void) {
if (sprel) {
if (sprel->SeqTest(snc->Val) &&
(snc->Val >= 0 || sprel != Hero || Hero->_tracePtr < 0)) {
- _heart->setXTimer(&Pause, sprel->_time);
+ _timerExpiry = g_system->getMillis() + sprel->_time * SNAIL_FRAME_DELAY;
} else
goto xit;
}