aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/agi.h
diff options
context:
space:
mode:
authorMartin Kiewitz2016-01-31 20:53:36 +0100
committerMartin Kiewitz2016-01-31 20:53:36 +0100
commitfd9c46831df3bcd09bc6f85d5e41c2beb3f7c024 (patch)
tree7e85bd08b17c976e78d628fe0da427726ba0ccf3 /engines/agi/agi.h
parent9acbe6f3f42a35becf3dcff04d758b3286c05c7e (diff)
downloadscummvm-rg350-fd9c46831df3bcd09bc6f85d5e41c2beb3f7c024.tar.gz
scummvm-rg350-fd9c46831df3bcd09bc6f85d5e41c2beb3f7c024.tar.bz2
scummvm-rg350-fd9c46831df3bcd09bc6f85d5e41c2beb3f7c024.zip
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.
Diffstat (limited to 'engines/agi/agi.h')
-rw-r--r--engines/agi/agi.h19
1 files changed, 14 insertions, 5 deletions
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