diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 2cdef5e35ac..9a03733e1b6 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -154,10 +154,6 @@ void QueenEngine::update(bool checkPlayerInput) { _input->quickLoadReset(); loadGameState(SLOT_QUICKSAVE); } - if (shouldPerformAutoSave(_lastSaveTime)) { - saveGameState(SLOT_AUTOSAVE, "Autosave"); - _lastSaveTime = _system->getMillis(); - } } if (!_input->cutawayRunning()) { if (checkPlayerInput) { @@ -274,15 +270,20 @@ Common::InSaveFile *QueenEngine::readGameStateHeader(int slot, GameStateHeader * return file; } -void QueenEngine::makeGameStateName(int slot, char *buf) const { +Common::String QueenEngine::getSaveStateName(int slot) const { if (slot == SLOT_LISTPREFIX) { - strcpy(buf, "queen.s??"); + return "queen.s??"; } else if (slot == SLOT_AUTOSAVE) { - strcpy(buf, "queen.asd"); - } else { - assert(slot >= 0); - sprintf(buf, "queen.s%02d", slot); + slot = getAutosaveSlot(); } + + assert(slot >= 0); + return Common::String::format("queen.s%02d", slot); +} + +void QueenEngine::makeGameStateName(int slot, char *buf) const { + Common::String name = getSaveStateName(slot); + strcpy(buf, name.c_str()); } int QueenEngine::getGameStateSlot(const char *filename) const { @@ -354,7 +355,6 @@ Common::Error QueenEngine::run() { if (ConfMan.hasKey("save_slot") && canLoadOrSave()) { loadGameState(ConfMan.getInt("save_slot")); } - _lastSaveTime = _lastUpdateTime = _system->getMillis(); while (!shouldQuit()) { if (_logic->newRoom() > 0) { diff --git a/engines/queen/queen.h b/engines/queen/queen.h index 6204e265582..7c6ddb20d3d 100644 --- a/engines/queen/queen.h +++ b/engines/queen/queen.h @@ -98,6 +98,8 @@ public: bool canSaveGameStateCurrently() override; Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override; Common::Error loadGameState(int slot) override; + virtual int getAutosaveSlot() const { return 99; } + virtual Common::String getSaveStateName(int slot) const override; void makeGameStateName(int slot, char *buf) const; int getGameStateSlot(const char *filename) const; void findGameStateDescriptions(char descriptions[100][32]); @@ -126,7 +128,6 @@ protected: int _talkSpeed; bool _subtitles; - uint32 _lastSaveTime; uint32 _lastUpdateTime; bool _gameStarted;