aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorJohannes Schickel2010-10-29 16:54:10 +0000
committerJohannes Schickel2010-10-29 16:54:10 +0000
commit1ed0051fcee19bca86cb352b077967a819dc5b46 (patch)
tree8ea6ce95af36d89c573734b3bd0ccb6eeb4db11c /engines/draci
parenta5c28de26b8e98b424f03aa957c947cec969cfe5 (diff)
downloadscummvm-rg350-1ed0051fcee19bca86cb352b077967a819dc5b46.tar.gz
scummvm-rg350-1ed0051fcee19bca86cb352b077967a819dc5b46.tar.bz2
scummvm-rg350-1ed0051fcee19bca86cb352b077967a819dc5b46.zip
DRACI: Switch to the new play time counting of the Engine class.
svn-id: r53925
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/detection.cpp5
-rw-r--r--engines/draci/draci.cpp5
-rw-r--r--engines/draci/draci.h1
-rw-r--r--engines/draci/saveload.cpp4
4 files changed, 4 insertions, 11 deletions
diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp
index 07a9928cfa..ce426740fa 100644
--- a/engines/draci/detection.cpp
+++ b/engines/draci/detection.cpp
@@ -202,10 +202,7 @@ SaveStateDescriptor DraciMetaEngine::querySaveMetaInfos(const char *target, int
int minutes = header.time & 0xFF;
desc.setSaveTime(hour, minutes);
- minutes = header.playtime / 60;
- hour = minutes / 60;
- minutes %= 60;
- desc.setPlayTime(hour, minutes);
+ desc.setPlayTime(header.playtime * 1000);
return desc;
}
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 814159dbbb..7a7d7b8372 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -403,7 +403,7 @@ DraciEngine::~DraciEngine() {
Common::Error DraciEngine::run() {
init();
- _engineStartTime = _system->getMillis() / 1000;
+ setTotalPlayTime(0);
_game->init();
// Load game from specified slot, if any
@@ -418,8 +418,6 @@ Common::Error DraciEngine::run() {
void DraciEngine::pauseEngineIntern(bool pause) {
Engine::pauseEngineIntern(pause);
if (pause) {
- // Record start of the pause, so that we can later
- // adjust _engineStartTime accordingly.
_pauseStartTime = _system->getMillis();
_anims->pauseAnimations();
@@ -434,7 +432,6 @@ void DraciEngine::pauseEngineIntern(bool pause) {
// Adjust engine start time
const int delta = _system->getMillis() - _pauseStartTime;
- _engineStartTime += delta / 1000;
_game->shiftSpeechAndFadeTick(delta);
_pauseStartTime = 0;
}
diff --git a/engines/draci/draci.h b/engines/draci/draci.h
index 597269f025..f2cc2ce2e7 100644
--- a/engines/draci/draci.h
+++ b/engines/draci/draci.h
@@ -107,7 +107,6 @@ public:
Common::RandomSource _rnd;
- int32 _engineStartTime;
int32 _pauseStartTime;
};
diff --git a/engines/draci/saveload.cpp b/engines/draci/saveload.cpp
index 856e6da832..32e852d9a6 100644
--- a/engines/draci/saveload.cpp
+++ b/engines/draci/saveload.cpp
@@ -103,7 +103,7 @@ Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName,
header.saveName = saveName;
header.date = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
header.time = ((curTime.tm_hour & 0xFF) << 8) | ((curTime.tm_min) & 0xFF);
- header.playtime = vm._system->getMillis() / 1000 - vm._engineStartTime;
+ header.playtime = vm.getTotalPlayTime() / 1000;
writeSavegameHeader(f, header);
if (f->err()) {
@@ -157,7 +157,7 @@ Common::Error loadSavegameData(int saveGameIdx, DraciEngine *vm) {
vm->_game->inventoryReload();
- vm->_engineStartTime = vm->_system->getMillis() / 1000 - header.playtime;
+ vm->setTotalPlayTime(header.playtime * 1000);
return Common::kNoError;
}