From 2ad28b8cd53c363f12d920c746795e0d371dc9f9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 27 Oct 2010 22:37:51 +0000 Subject: ENGINE: Generalize SCUMM play time counting and move it into Engine. This implements Max's idea on -devel ("Re: [Scummvm-devel] ATTN Engine authors: Advanced engine features") from 27.10.2010 on 11:12PM CEST. Unlike the SCUMM implementation it stores the play time as ms instead of s. The SCUMM engine was adapted to use this instead to reduce code duplication. svn-id: r53892 --- engines/scumm/saveload.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/scumm/saveload.cpp') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 28ec6c182f..b9cb0ae10f 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -378,10 +378,10 @@ bool ScummEngine::loadState(int slot, bool compat) { return false; } - _engineStartTime = _system->getMillis() / 1000 - infos.playtime; + resetTotalPlayTime(infos.playtime * 1000); } else { // start time counting - _engineStartTime = _system->getMillis() / 1000; + resetTotalPlayTime(); } // Due to a bug in scummvm up to and including 0.3.0, save games could be saved @@ -797,7 +797,7 @@ void ScummEngine::saveInfos(Common::WriteStream* file) { // still save old format for older versions section.timeTValue = 0; - section.playtime = _system->getMillis() / 1000 - _engineStartTime; + section.playtime = getTotalPlayTime() / 1000; TimeDate curTime; _system->getTimeAndDate(curTime); -- cgit v1.2.3