ENGINE: Rename resetTotalPlayTime to setTotalPlayTime.

I also extended the comment for it to show two possible use cases.

svn-id: r53895
This commit is contained in:
Johannes Schickel 2010-10-27 22:52:02 +00:00
parent ab1c54a9ee
commit dac9493069
4 changed files with 10 additions and 6 deletions

View File

@ -410,7 +410,7 @@ uint32 Engine::getTotalPlayTime() const {
return _pauseStartTime - _engineStartTime;
}
void Engine::resetTotalPlayTime(uint32 time) {
void Engine::setTotalPlayTime(uint32 time) {
const uint32 currentTime = _system->getMillis();
// We need to reset the pause start time here in case the engine is already

View File

@ -253,11 +253,15 @@ public:
uint32 getTotalPlayTime() const;
/**
* Reset the game time counter to the specified time.
* Set the game time counter to the specified time.
*
* This can be used to set the play time counter after loading a savegame
* for example. Another use case is in case the engine wants to exclude
* time from the counter the user spent in original engine dialogs.
*
* @param time Play time to set up in ms.
*/
void resetTotalPlayTime(uint32 time = 0);
void setTotalPlayTime(uint32 time = 0);
inline Common::TimerManager *getTimerManager() { return _timer; }
inline Common::EventManager *getEventManager() { return _eventMan; }

View File

@ -378,10 +378,10 @@ bool ScummEngine::loadState(int slot, bool compat) {
return false;
}
resetTotalPlayTime(infos.playtime * 1000);
setTotalPlayTime(infos.playtime * 1000);
} else {
// start time counting
resetTotalPlayTime();
setTotalPlayTime();
}
// Due to a bug in scummvm up to and including 0.3.0, save games could be saved

View File

@ -1927,7 +1927,7 @@ int ScummEngine::getTalkSpeed() {
#pragma mark -
Common::Error ScummEngine::go() {
resetTotalPlayTime();
setTotalPlayTime();
// If requested, load a save game instead of running the boot script
if (_saveLoadFlag != 2 || !loadState(_saveLoadSlot, _saveTemporaryState)) {