From fd9c46831df3bcd09bc6f85d5e41c2beb3f7c024 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sun, 31 Jan 2016 20:53:36 +0100 Subject: AGI: remove timer hack, implement in game timer in game timer is now updated, when scripts read in game timer VM variables and during main loop. ScummVM total play time feature is used for it. Game cycle syncing is done at the same time. --- engines/agi/agi.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'engines/agi/agi.h') diff --git a/engines/agi/agi.h b/engines/agi/agi.h index 4c7580dadb..7e1505f8f7 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -653,7 +653,6 @@ public: GfxMgr *_gfx; Common::RenderMode _renderMode; - volatile uint32 _clockCount; AgiDebug _debug; AgiGame _game; Common::RandomSource *_rnd; @@ -824,12 +823,13 @@ public: byte getVar(int16 varNr); void setVar(int16 varNr, byte newValue); + +public: void decrypt(uint8 *mem, int len); void releaseSprites(); int mainCycle(bool onlyCheckForEvents = false); int viewPictures(); int runGame(); - void updateTimer(); int getAppDir(char *appDir, unsigned int size); int setupV2Game(int ver); @@ -950,14 +950,23 @@ public: public: void redrawScreen(); + void inGameTimerReset(uint32 newPlayTime = 0); + void inGameTimerPause(); + void inGameTimerResume(); + uint32 inGameTimerGet(); + + void inGameTimerUpdate(); + +private: + uint32 _lastUsedPlayTimeInCycles; // 20 per second + uint32 _lastUsedPlayTimeInSeconds; // actual seconds + uint32 _passedPlayTimeCycles; // increased by 1 every time we passed a cycle + private: AgiCommand _agiCommands[183]; AgiCommand _agiCondCommands[256]; void setupOpcodes(); - -public: - int _timerHack; // Workaround for timer loop in MH1 logic 153 }; } // End of namespace Agi -- cgit v1.2.3