From c7a9865a73eae69e73fb8a67bffbbe2286074a8c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 21 Jun 2010 21:33:45 +0000 Subject: AGI: Change a static var to member var AgiEngine::_lastTickTimer svn-id: r50126 --- engines/agi/agi.cpp | 10 +++++----- engines/agi/agi.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'engines/agi') diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 333b674379..6a359944e1 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -272,20 +272,19 @@ void AgiEngine::processEvents() { } void AgiEngine::pollTimer() { - static uint32 m = 0; uint32 dm; - if (_tickTimer < m) - m = 0; + if (_tickTimer < _lastTickTimer) + _lastTickTimer = 0; - while ((dm = _tickTimer - m) < 5) { + while ((dm = _tickTimer - _lastTickTimer) < 5) { processEvents(); if (_console->isAttached()) _console->onFrame(); _system->delayMillis(10); _system->updateScreen(); } - m = _tickTimer; + _lastTickTimer = _tickTimer; } void AgiEngine::agiTimerFunctionLow(void *refCon) { @@ -543,6 +542,7 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas _allowSynthetic = false; _tickTimer = 0; + _lastTickTimer = 0; _intobj = NULL; diff --git a/engines/agi/agi.h b/engines/agi/agi.h index a67775cec6..301ffa1b6c 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -816,6 +816,7 @@ public: private: uint32 _tickTimer; + uint32 _lastTickTimer; int _keyQueue[KEY_QUEUE_SIZE]; int _keyQueueStart; -- cgit v1.2.3