AGI: Change a static var to member var AgiEngine::_lastTickTimer

svn-id: r50126
This commit is contained in:
Max Horn 2010-06-21 21:33:45 +00:00
parent e7da62763e
commit c7a9865a73
2 changed files with 6 additions and 5 deletions

View file

@ -272,20 +272,19 @@ void AgiEngine::processEvents() {
} }
void AgiEngine::pollTimer() { void AgiEngine::pollTimer() {
static uint32 m = 0;
uint32 dm; uint32 dm;
if (_tickTimer < m) if (_tickTimer < _lastTickTimer)
m = 0; _lastTickTimer = 0;
while ((dm = _tickTimer - m) < 5) { while ((dm = _tickTimer - _lastTickTimer) < 5) {
processEvents(); processEvents();
if (_console->isAttached()) if (_console->isAttached())
_console->onFrame(); _console->onFrame();
_system->delayMillis(10); _system->delayMillis(10);
_system->updateScreen(); _system->updateScreen();
} }
m = _tickTimer; _lastTickTimer = _tickTimer;
} }
void AgiEngine::agiTimerFunctionLow(void *refCon) { void AgiEngine::agiTimerFunctionLow(void *refCon) {
@ -543,6 +542,7 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas
_allowSynthetic = false; _allowSynthetic = false;
_tickTimer = 0; _tickTimer = 0;
_lastTickTimer = 0;
_intobj = NULL; _intobj = NULL;

View file

@ -816,6 +816,7 @@ public:
private: private:
uint32 _tickTimer; uint32 _tickTimer;
uint32 _lastTickTimer;
int _keyQueue[KEY_QUEUE_SIZE]; int _keyQueue[KEY_QUEUE_SIZE];
int _keyQueueStart; int _keyQueueStart;