diff options
author | Johannes Schickel | 2010-10-27 22:37:51 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-27 22:37:51 +0000 |
commit | 2ad28b8cd53c363f12d920c746795e0d371dc9f9 (patch) | |
tree | f849131b939c148f7843a60dd8d68b36ffb5a772 /engines/scumm/saveload.cpp | |
parent | 8a08ca1f39a0dc5ad6003d8213fe8aec4acb7327 (diff) | |
download | scummvm-rg350-2ad28b8cd53c363f12d920c746795e0d371dc9f9.tar.gz scummvm-rg350-2ad28b8cd53c363f12d920c746795e0d371dc9f9.tar.bz2 scummvm-rg350-2ad28b8cd53c363f12d920c746795e0d371dc9f9.zip |
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
Diffstat (limited to 'engines/scumm/saveload.cpp')
-rw-r--r-- | engines/scumm/saveload.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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); |