aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-07-09 13:18:37 +0530
committerEugene Sandulenko2019-09-03 17:17:15 +0200
commitd5a32a2b4e735e9156120cab521319fea2b5024b (patch)
treeb88047979d7b7cb38ffd12332e524ab4ec2b0b1a
parent963043f3b27e11dbe5524673bfd5e0e720ecf0ff (diff)
downloadscummvm-rg350-d5a32a2b4e735e9156120cab521319fea2b5024b.tar.gz
scummvm-rg350-d5a32a2b4e735e9156120cab521319fea2b5024b.tar.bz2
scummvm-rg350-d5a32a2b4e735e9156120cab521319fea2b5024b.zip
HDB: Add missing time code
-rw-r--r--engines/hdb/hdb.cpp8
-rw-r--r--engines/hdb/hdb.h8
2 files changed, 13 insertions, 3 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index 376c3a7352..8fb091c111 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -60,6 +60,8 @@ HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst
_lastMapname[0] = _lastLuaName[0] = 0;
_inMapName[0] = 0;
+ _timePlayed = _timeSlice = _prevTimeSlice = _timeSeconds = _tiempo = 0;
+
_monkeystone7 = STARS_MONKEYSTONE_7_FAKE;
_monkeystone14 = STARS_MONKEYSTONE_14_FAKE;
_monkeystone21 = STARS_MONKEYSTONE_21_FAKE;
@@ -250,6 +252,9 @@ bool HDBGame::startMap(const char *name) {
}
void HDBGame::paint() {
+
+ _tiempo = g_system->getMillis();
+
switch (_gameState) {
case GAME_TITLE:
debug(9, "STUB: MENU::DrawTitle required");
@@ -866,6 +871,9 @@ Common::Error HDBGame::run() {
saveGameState(_saveInfo.slot);
_saveInfo.active = false;
}
+
+ // calculate time spent ONLY in the game...
+ _timePlayed += g_system->getMillis() - _tiempo;
}
// Update Timer that's NOT used for in-game Timing
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index 260ca4adcb..2b41c7f3ab 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -202,15 +202,15 @@ public:
_timePlayed = _timeSeconds = 0;
}
- uint16 getTime() {
+ uint32 getTime() {
return _timePlayed / 1000;
}
- uint16 getTimeSlice() {
+ uint32 getTimeSlice() {
return _timeSlice;
}
- uint16 getTimeSliceDelta() {
+ uint32 getTimeSliceDelta() {
return _timeSlice - _prevTimeSlice;
}
@@ -244,6 +244,8 @@ private:
uint32 _timeSlice, _prevTimeSlice;
uint32 _timeSeconds;
+ uint32 _tiempo;
+
Console *_console;
// Game Variables