aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/savegame.cfsml
diff options
context:
space:
mode:
authorAndre Heider2009-02-25 21:43:57 +0000
committerAndre Heider2009-02-25 21:43:57 +0000
commit9af7fba681fa1f0b48ec7c8d13305404b5f82efb (patch)
treed0674187220786687c4ac014c216ea898aa55ab2 /engines/sci/engine/savegame.cfsml
parent1786ecabbf567b60cf628d0235b52b5343c013ad (diff)
downloadscummvm-rg350-9af7fba681fa1f0b48ec7c8d13305404b5f82efb.tar.gz
scummvm-rg350-9af7fba681fa1f0b48ec7c8d13305404b5f82efb.tar.bz2
scummvm-rg350-9af7fba681fa1f0b48ec7c8d13305404b5f82efb.zip
reintroduce game_start_time (removed it in r38701), since the interpreter can be restarted and it can be retrieved via script function (eg. LSL3 about box)
svn-id: r38888
Diffstat (limited to 'engines/sci/engine/savegame.cfsml')
-rw-r--r--engines/sci/engine/savegame.cfsml3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/engine/savegame.cfsml b/engines/sci/engine/savegame.cfsml
index 42afd7626d..a03643fc8a 100644
--- a/engines/sci/engine/savegame.cfsml
+++ b/engines/sci/engine/savegame.cfsml
@@ -765,7 +765,7 @@ int gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savename
}
*/
// Calculate the time spent with this game
- s->game_time = g_system->getMillis() / 1000;
+ s->game_time = (g_system->getMillis() - s->game_start_time) / 1000;
%CFSMLWRITE SavegameMetadata meta INTO fh;
%CFSMLWRITE EngineState s INTO fh;
@@ -1108,6 +1108,7 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
// Time state:
retval->last_wait_time = g_system->getMillis();
+ retval->game_start_time = g_system->getMillis() - retval->game_time * 1000;
// static parser information:
retval->parser_rules = s->parser_rules;