[Scummvm-cvs-logs] SF.net SVN: scummvm:[38888] scummvm/trunk/engines/sci
dhewg at users.sourceforge.net
dhewg at users.sourceforge.net
Wed Feb 25 22:43:57 CET 2009
Revision: 38888
http://scummvm.svn.sourceforge.net/scummvm/?rev=38888&view=rev
Author: dhewg
Date: 2009-02-25 21:43:57 +0000 (Wed, 25 Feb 2009)
Log Message:
-----------
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)
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/game.cpp
scummvm/trunk/engines/sci/engine/kernel.cpp
scummvm/trunk/engines/sci/engine/savegame.cfsml
scummvm/trunk/engines/sci/engine/savegame.cpp
scummvm/trunk/engines/sci/include/engine.h
Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp 2009-02-25 20:40:05 UTC (rev 38887)
+++ scummvm/trunk/engines/sci/engine/game.cpp 2009-02-25 21:43:57 UTC (rev 38888)
@@ -764,7 +764,8 @@
sys_string_acquire(s->sys_strings, SYS_STRING_PARSER_BASE, "parser-base", MAX_PARSER_BASE);
s->parser_base = make_reg(s->sys_strings_segment, SYS_STRING_PARSER_BASE);
- s->last_wait_time = g_system->getMillis();
+ s->game_start_time = g_system->getMillis();
+ s->last_wait_time = s->game_start_time;
s->debug_mode = 0x0; // Disable all debugging
s->onscreen_console = 0; // No onscreen console unless explicitly requested
Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp 2009-02-25 20:40:05 UTC (rev 38887)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp 2009-02-25 21:43:57 UTC (rev 38888)
@@ -497,7 +497,7 @@
#endif
g_system->getTimeAndDate(loc_time);
- start_time = g_system->getMillis();
+ start_time = g_system->getMillis() - s->game_start_time;
if (s->version < SCI_VERSION_FTU_NEW_GETTIME) { // Use old semantics
if (argc) { // Get seconds since last am/pm switch
Modified: scummvm/trunk/engines/sci/engine/savegame.cfsml
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cfsml 2009-02-25 20:40:05 UTC (rev 38887)
+++ scummvm/trunk/engines/sci/engine/savegame.cfsml 2009-02-25 21:43:57 UTC (rev 38888)
@@ -765,7 +765,7 @@
}
*/
// 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 @@
// 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;
Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp 2009-02-25 20:40:05 UTC (rev 38887)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp 2009-02-25 21:43:57 UTC (rev 38888)
@@ -4819,7 +4819,7 @@
}
*/
// 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;
#line 818 "engines/sci/engine/savegame.cfsml"
// Auto-generated CFSML data writer code
@@ -5236,6 +5236,7 @@
// 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;
@@ -5318,7 +5319,7 @@
}
}
// End of auto-generated CFSML data reader code
-#line 1162 "engines/sci/engine/savegame.cfsml"
+#line 1163 "engines/sci/engine/savegame.cfsml"
if (read_eof)
return false;
Modified: scummvm/trunk/engines/sci/include/engine.h
===================================================================
--- scummvm/trunk/engines/sci/include/engine.h 2009-02-25 20:40:05 UTC (rev 38887)
+++ scummvm/trunk/engines/sci/include/engine.h 2009-02-25 21:43:57 UTC (rev 38888)
@@ -174,6 +174,7 @@
int pics_nr;
drawn_pic_t *pics;
+ uint32 game_start_time; /* The time at which the interpreter was started */
uint32 last_wait_time; /* The last time the game invoked Wait() */
byte version_lock_flag; /* Set to 1 to disable any autodetection mechanisms */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list