DRACI: Switch to the new play time counting of the Engine class.

svn-id: r53925
This commit is contained in:
Johannes Schickel 2010-10-29 16:54:10 +00:00
parent a5c28de26b
commit 1ed0051fce
4 changed files with 4 additions and 11 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -107,7 +107,6 @@ public:
Common::RandomSource _rnd;
int32 _engineStartTime;
int32 _pauseStartTime;
};

View File

@ -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;
}