mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
ENGINES: Clarify configuration of autosave slot
Establishes the relationship between the autosave slot and the current autosave status.
This commit is contained in:
parent
1c91baab78
commit
95c542e713
@ -45,13 +45,19 @@ SaveStateDescriptor::SaveStateDescriptor(const MetaEngine *metaEngine, int slot,
|
||||
}
|
||||
|
||||
void SaveStateDescriptor::initSaveSlot(const MetaEngine *metaEngine) {
|
||||
// Do not allow auto-save slot to be deleted or overwritten.
|
||||
if (!metaEngine && g_engine)
|
||||
metaEngine = g_engine->getMetaEngine();
|
||||
const bool autosave =
|
||||
metaEngine && ConfMan.getInt("autosave_period") && _slot == metaEngine->getAutosaveSlot();
|
||||
_isWriteProtected = autosave;
|
||||
_isDeletable = !autosave;
|
||||
int autosaveSlot = metaEngine ? metaEngine->getAutosaveSlot() : -1;
|
||||
|
||||
if (autosaveSlot >= 0 && _slot == autosaveSlot) {
|
||||
const bool autosaveEnabled = ConfMan.getInt("autosave_period");
|
||||
// If autosaving enabled, do not allow autosave slot to be deleted or overwritten
|
||||
_isWriteProtected = autosaveEnabled;
|
||||
_isDeletable = !autosaveEnabled;
|
||||
} else {
|
||||
_isWriteProtected = false;
|
||||
_isDeletable = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
|
||||
|
Loading…
Reference in New Issue
Block a user