Skip to content

Commit

Permalink
COMPOSER: Remove autosave code
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Feb 16, 2020
1 parent 128bd50 commit b1197cf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
4 changes: 1 addition & 3 deletions engines/composer/composer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ Common::Error ComposerEngine::run() {
else
warning("FPS in book.ini is zero. Defaulting to 8...");
uint32 lastDrawTime = 0;
_lastSaveTime = _system->getMillis();

bool loadFromLauncher = ConfMan.hasKey("save_slot");

Expand Down Expand Up @@ -179,8 +178,7 @@ Common::Error ComposerEngine::run() {
loadGameState(ConfMan.getInt("save_slot"));
loadFromLauncher = false;
}
if (shouldPerformAutoSave(_lastSaveTime))
saveGameState(0, "Autosave");

while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_LBUTTONDOWN:
Expand Down
2 changes: 1 addition & 1 deletion engines/composer/composer.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class ComposerEngine : public Engine {
Audio::QueuingAudioStream *_audioStream;
uint16 _currSoundPriority;

uint32 _currentTime, _lastTime, _timeDelta, _lastSaveTime;
uint32 _currentTime, _lastTime, _timeDelta;

bool _needsUpdate;
Common::Array<Common::Rect> _dirtyRects;
Expand Down
5 changes: 0 additions & 5 deletions engines/composer/saveload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,12 @@ Common::Error ComposerEngine::loadGameState(int slot) {
if (!_mixer->isSoundHandleActive(_soundHandle))
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, _audioStream);


// Reset autosave duration on load
_lastSaveTime = _system->getMillis();

return Common::kNoError;
}

Common::Error ComposerEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
Common::String filename = makeSaveGameName(slot);
Common::OutSaveFile *out;
_lastSaveTime = _system->getMillis();
if (!(out = _saveFileMan->openForSaving(filename)))
return Common::kWritingFailed;

Expand Down

0 comments on commit b1197cf

Please sign in to comment.