SCI: Disable ScummVM autosaves

This commit is contained in:
Filippos Karapetis 2022-06-14 01:44:24 +03:00
parent 88e6a58120
commit 8a113e5853
2 changed files with 29 additions and 0 deletions

View file

@ -280,6 +280,8 @@ public:
int getMaximumSaveSlot() const override; int getMaximumSaveSlot() const override;
void removeSaveState(const char *target, int slot) const override; void removeSaveState(const char *target, int slot) const override;
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override; SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override;
// Disable autosave (see mirrored method in sci.h for detailed explanation)
int getAutosaveSlot() const override { return -1; }
// A fallback detection method. This is not ideal as all detection lives in MetaEngine, but // A fallback detection method. This is not ideal as all detection lives in MetaEngine, but
// here fb detection has many engine dependencies. // here fb detection has many engine dependencies.

View file

@ -153,6 +153,33 @@ public:
uint32 getTickCount(); uint32 getTickCount();
void setTickCount(const uint32 ticks); void setTickCount(const uint32 ticks);
/**
* Disable support for ScummVM autosaves.
*
* A lot of SCI games already have an autosaving mechanism.
* Also, a lot of games have death screens when the player
* does something wrong, and autosaves could kick in when the
* death screen is shown, which makes them useless, since
* the player can only restore or restart.
*
* Another place where autosaves could kick in is during
* screens with internal loops, e.g. the inventory screen,
* where the autosave created would be invalid, as the internal
* loop isn't persisted in saved games.
*
* For now, we allow saving in places where the user has
* control via GuestAdditions::userHasControl(), but as
* mentioned above, these do not cover cases where the user
* does have control, but saving would either be useless (e.g.
* in death screens) or invalid saved would be created (e.g.
* while the inventory screen is open).
*
* In the future, if we are able to detect all death screens,
* all internal loops and generally all places where saving
* shouldn't be allowed, we could re-enable this feature.
*/
int getAutosaveSlot() const override { return -1; }
const SciGameId &getGameId() const { return _gameId; } const SciGameId &getGameId() const { return _gameId; }
const char *getGameIdStr() const; const char *getGameIdStr() const;
Common::Language getLanguage() const; Common::Language getLanguage() const;