QUEEN: Remove autosave code

This commit is contained in:
Paul Gilbert 2020-02-05 19:30:34 -08:00 committed by Paul Gilbert
parent d97949857f
commit 1c5cbbb186
2 changed files with 13 additions and 12 deletions

View File

@ -154,10 +154,6 @@ void QueenEngine::update(bool checkPlayerInput) {
_input->quickLoadReset(); _input->quickLoadReset();
loadGameState(SLOT_QUICKSAVE); loadGameState(SLOT_QUICKSAVE);
} }
if (shouldPerformAutoSave(_lastSaveTime)) {
saveGameState(SLOT_AUTOSAVE, "Autosave");
_lastSaveTime = _system->getMillis();
}
} }
if (!_input->cutawayRunning()) { if (!_input->cutawayRunning()) {
if (checkPlayerInput) { if (checkPlayerInput) {
@ -274,15 +270,20 @@ Common::InSaveFile *QueenEngine::readGameStateHeader(int slot, GameStateHeader *
return file; return file;
} }
void QueenEngine::makeGameStateName(int slot, char *buf) const { Common::String QueenEngine::getSaveStateName(int slot) const {
if (slot == SLOT_LISTPREFIX) { if (slot == SLOT_LISTPREFIX) {
strcpy(buf, "queen.s??"); return "queen.s??";
} else if (slot == SLOT_AUTOSAVE) { } else if (slot == SLOT_AUTOSAVE) {
strcpy(buf, "queen.asd"); slot = getAutosaveSlot();
} else {
assert(slot >= 0);
sprintf(buf, "queen.s%02d", slot);
} }
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 { int QueenEngine::getGameStateSlot(const char *filename) const {
@ -354,7 +355,6 @@ Common::Error QueenEngine::run() {
if (ConfMan.hasKey("save_slot") && canLoadOrSave()) { if (ConfMan.hasKey("save_slot") && canLoadOrSave()) {
loadGameState(ConfMan.getInt("save_slot")); loadGameState(ConfMan.getInt("save_slot"));
} }
_lastSaveTime = _lastUpdateTime = _system->getMillis();
while (!shouldQuit()) { while (!shouldQuit()) {
if (_logic->newRoom() > 0) { if (_logic->newRoom() > 0) {

View File

@ -98,6 +98,8 @@ public:
bool canSaveGameStateCurrently() override; bool canSaveGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override; Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
Common::Error loadGameState(int slot) 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; void makeGameStateName(int slot, char *buf) const;
int getGameStateSlot(const char *filename) const; int getGameStateSlot(const char *filename) const;
void findGameStateDescriptions(char descriptions[100][32]); void findGameStateDescriptions(char descriptions[100][32]);
@ -126,7 +128,6 @@ protected:
int _talkSpeed; int _talkSpeed;
bool _subtitles; bool _subtitles;
uint32 _lastSaveTime;
uint32 _lastUpdateTime; uint32 _lastUpdateTime;
bool _gameStarted; bool _gameStarted;