mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-20 19:21:46 +00:00
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:
parent
ab1c54a9ee
commit
dac9493069
@ -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
|
||||
|
@ -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; }
|
||||
|
@ -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
|
||||
|
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user