[Scummvm-cvs-logs] SF.net SVN: scummvm:[53924] scummvm/trunk/engines/sword1
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Fri Oct 29 18:53:47 CEST 2010
Revision: 53924
http://scummvm.svn.sourceforge.net/scummvm/?rev=53924&view=rev
Author: lordhoto
Date: 2010-10-29 16:53:46 +0000 (Fri, 29 Oct 2010)
Log Message:
-----------
SWORD1: Switch to the new play time counting of the Engine class.
Modified Paths:
--------------
scummvm/trunk/engines/sword1/control.cpp
scummvm/trunk/engines/sword1/detection.cpp
scummvm/trunk/engines/sword1/sword1.cpp
scummvm/trunk/engines/sword1/sword1.h
Modified: scummvm/trunk/engines/sword1/control.cpp
===================================================================
--- scummvm/trunk/engines/sword1/control.cpp 2010-10-29 16:41:49 UTC (rev 53923)
+++ scummvm/trunk/engines/sword1/control.cpp 2010-10-29 16:53:46 UTC (rev 53924)
@@ -1118,8 +1118,7 @@
outf->writeUint32BE(saveDate);
outf->writeUint16BE(saveTime);
- uint32 currentTime = _system->getMillis() / 1000;
- outf->writeUint32BE(currentTime - SwordEngine::_systemVars.engineStartTime);
+ outf->writeUint32BE(g_engine->getTotalPlayTime() / 1000);
_objMan->saveLiveList(liveBuf);
for (cnt = 0; cnt < TOTAL_SECTIONS; cnt++)
@@ -1181,10 +1180,9 @@
inf->readUint16BE(); // save time
if (saveVersion < 2) { // Before version 2 we didn't had play time feature
- SwordEngine::_systemVars.engineStartTime = _system->getMillis() / 1000; // Start counting
+ g_engine->setTotalPlayTime(0);
} else {
- uint32 currentTime = _system->getMillis() / 1000;
- SwordEngine::_systemVars.engineStartTime = currentTime - inf->readUint32BE(); // Engine start time
+ g_engine->setTotalPlayTime(inf->readUint32BE() * 1000);
}
_restoreBuf = (uint8*)malloc(
Modified: scummvm/trunk/engines/sword1/detection.cpp
===================================================================
--- scummvm/trunk/engines/sword1/detection.cpp 2010-10-29 16:41:49 UTC (rev 53923)
+++ scummvm/trunk/engines/sword1/detection.cpp 2010-10-29 16:53:46 UTC (rev 53924)
@@ -309,12 +309,9 @@
desc.setSaveTime(hour, minutes);
if (versionSave > 1) {
- minutes = playTime / 60;
- hour = minutes / 60;
- minutes %= 60;
- desc.setPlayTime(hour, minutes);
+ desc.setPlayTime(playTime * 1000);
} else { //We have no playtime data
- desc.setPlayTime(0, 0);
+ desc.setPlayTime(0);
}
delete in;
Modified: scummvm/trunk/engines/sword1/sword1.cpp
===================================================================
--- scummvm/trunk/engines/sword1/sword1.cpp 2010-10-29 16:41:49 UTC (rev 53923)
+++ scummvm/trunk/engines/sword1/sword1.cpp 2010-10-29 16:53:46 UTC (rev 53924)
@@ -563,7 +563,7 @@
Common::Error SwordEngine::go() {
_control->checkForOldSaveGames();
- SwordEngine::_systemVars.engineStartTime = _system->getMillis() / 1000;
+ setTotalPlayTime(0);
uint16 startPos = ConfMan.getInt("boot_param");
_control->readSavegameDescriptions();
Modified: scummvm/trunk/engines/sword1/sword1.h
===================================================================
--- scummvm/trunk/engines/sword1/sword1.h 2010-10-29 16:41:49 UTC (rev 53923)
+++ scummvm/trunk/engines/sword1/sword1.h 2010-10-29 16:53:46 UTC (rev 53924)
@@ -74,7 +74,6 @@
uint8 showText;
uint8 language;
bool isDemo;
- uint32 engineStartTime; // Used for playtime
Common::Platform platform;
};
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