[Scummvm-git-logs] scummvm master -> 31cd07e6ce41b7cfde5242c817621374f0fbaa22
bluegr
noreply at scummvm.org
Thu Sep 19 05:09:28 UTC 2024
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0b704202e1 SCUMM: Never show autosaves on original GUI
0b7129347a SCUMM: Revert "Explicitly disable autosaving when original GUI is active"
31cd07e6ce SCUMM: Revert silently denying autosaving with original GUI
Commit: 0b704202e187d85bbaa943c4a7d30ff34b212e7e
https://github.com/scummvm/scummvm/commit/0b704202e187d85bbaa943c4a7d30ff34b212e7e
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-09-19T08:09:25+03:00
Commit Message:
SCUMM: Never show autosaves on original GUI
...so users can't overwrite them.
This commit includes a small self-correction routine,
which moves all savegames down a slot, if the savestate
at slot 0 is non-empty and is not an autosave.
Now we instate a convention: on the original menus we
don't show the autosaves, ever. If an user wants to
use an autosave they will have to use the GMM.
Why? Because games with script based menus (v0-3, v8)
already exhibit this behavior, and I want consistency across
all SCUMM versions.
Naturally this commit excludes all HE games, since they
can't use anything other than the GMM, to save and load.
Changed paths:
engines/scumm/gfx_gui.cpp
engines/scumm/scumm.cpp
diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
index 3c416208d32..561f5760564 100644
--- a/engines/scumm/gfx_gui.cpp
+++ b/engines/scumm/gfx_gui.cpp
@@ -2220,18 +2220,18 @@ void ScummEngine::fillSavegameLabels() {
_savegameNames.clear();
- for (int i = 0; i < 9; i++) {
+ for (int i = GUI_CTRL_FIRST_SG; i <= GUI_CTRL_LAST_SG; i++) {
curSaveSlot = i + (isLoomVga ? _firstSaveStateOfList : _curDisplayedSaveSlotPage * 9);
- if (_game.version > 4 || (_game.version == 4 && _game.id == GID_LOOM)) {
+ if (_game.version > 4 || isLoomVga) {
if (availSaves[curSaveSlot]) {
if (getSavegameName(curSaveSlot, name)) {
- _savegameNames.push_back(Common::String::format("%2d. %s", curSaveSlot + 1, name.c_str()));
+ _savegameNames.push_back(Common::String::format("%2d. %s", curSaveSlot, name.c_str()));
} else {
// The original printed "WARNING... old savegame", but we do support old savegames :-)
- _savegameNames.push_back(Common::String::format("%2d. WARNING: wrong save version", curSaveSlot + 1));
+ _savegameNames.push_back(Common::String::format("%2d. WARNING: wrong save version", curSaveSlot));
}
} else {
- _savegameNames.push_back(Common::String::format("%2d. ", curSaveSlot + 1));
+ _savegameNames.push_back(Common::String::format("%2d. ", curSaveSlot));
}
} else {
if (availSaves[curSaveSlot]) {
@@ -2853,7 +2853,7 @@ bool ScummEngine::executeMainMenuOperation(int op, int mouseX, int mouseY, bool
// Temporarily restore the shake effect to save it...
setShake(_shakeTempSavedState);
- if (saveState(curSlot - 1, false, dummyString)) {
+ if (saveState(curSlot, false, dummyString)) {
setShake(0);
saveCursorPreMenu();
_saveScriptParam = GAME_PROPER_SAVE;
@@ -2915,7 +2915,7 @@ bool ScummEngine::executeMainMenuOperation(int op, int mouseX, int mouseY, bool
}
curSlot = _mainMenuSavegameLabel + (isLoomVga ? _firstSaveStateOfList : _curDisplayedSaveSlotPage * 9);
- if (loadState(curSlot - 1, false)) {
+ if (loadState(curSlot, false)) {
hasLoadedState = true;
#ifdef ENABLE_SCUMM_7_8
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 3f4171ace9a..11b473871f7 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2430,6 +2430,34 @@ Common::Error ScummEngine::go() {
_saveLoadFlag = 0;
}
+ // In ScummVM 2.7.0, original GUI support was added.
+ // Unfortunately it came with an issue: in v4-7 games users could
+ // overwrite autosaves (slot 0). Why? Because I forgot about autosaves :-)
+ //
+ // To amend this from 2.9.0 onwards we check for savegames which are on slot 0
+ // and are not autosaves (the heuristic is not optimal, but it will have to do),
+ // and performs a mass rename. Unless the user has used all 99 slots, in which case
+ // we just bail because there's no easy way to fix that...
+ if (_game.heversion == 0) {
+ SaveStateDescriptor desc = getMetaEngine()->querySaveMetaInfos(_targetName.c_str(), 0);
+ if (desc.isValid() && !desc.isAutosave()) {
+ SaveStateList list = getMetaEngine()->listSaves(_targetName.c_str());
+ SaveStateDescriptor lastSave = list.back();
+ int lastSaveSlot = lastSave.getSaveSlot();
+
+ if (lastSaveSlot < 99) {
+ debug("Save at slot 0 is not autosave, self correcting...");
+
+ for (int i = lastSaveSlot; i >= 0; i--) {
+ Common::String save1 = makeSavegameName(i, false);
+ Common::String save2 = makeSavegameName(i + 1, false);
+ debug("Renaming %s to %s", save1.c_str(), save2.c_str());
+ getSaveFileManager()->renameSavefile(save1, save2);
+ }
+ }
+ }
+ }
+
while (!shouldQuit()) {
// Determine how long to wait before the next loop iteration should start
int delta = (VAR_TIMER_NEXT != 0xFF) ? VAR(VAR_TIMER_NEXT) : 4;
Commit: 0b7129347a1297ef4c703e16733b78fd70fdef38
https://github.com/scummvm/scummvm/commit/0b7129347a1297ef4c703e16733b78fd70fdef38
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-09-19T08:09:25+03:00
Commit Message:
SCUMM: Revert "Explicitly disable autosaving when original GUI is active"
This reinstates autosaving when original GUI is active,
now that it won't collide with saves made from the original menu.
Changed paths:
engines/scumm/metaengine.cpp
engines/scumm/saveload.cpp
engines/scumm/scumm.h
diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 06cbe8aea56..c86fc234799 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -724,8 +724,7 @@ static const ExtraGuiOption audioOverride {
static const ExtraGuiOption enableOriginalGUI = {
_s("Enable the original GUI and Menu"),
_s("Allow the game to use the in-engine graphical interface and the original save/load menu. \
- Use it together with the \"Ask for confirmation on exit\" for a more complete experience. \
- Autosaving is disabled when this mode is active."),
+ Use it together with the \"Ask for confirmation on exit\" for a more complete experience."),
"original_gui",
true,
0,
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 0b9f01d9530..8f47c2ce11f 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -219,9 +219,6 @@ bool ScummEngine::canSaveGameStateCurrently(Common::U32String *msg) {
return (VAR_MAINMENU_KEY == 0xFF || (VAR(VAR_MAINMENU_KEY) != 0 && _currentRoom != 0)) && !isOriginalMenuActive;
}
-bool ScummEngine::canSaveAutosaveCurrently() {
- return !isUsingOriginalGUI();
-}
void ScummEngine::requestSave(int slot, const Common::String &name) {
_saveLoadSlot = slot;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index c249740d960..07102738913 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -594,7 +594,6 @@ public:
bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
- bool canSaveAutosaveCurrently() override;
void pauseEngineIntern(bool pause) override;
Commit: 31cd07e6ce41b7cfde5242c817621374f0fbaa22
https://github.com/scummvm/scummvm/commit/31cd07e6ce41b7cfde5242c817621374f0fbaa22
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-09-19T08:09:25+03:00
Commit Message:
SCUMM: Revert silently denying autosaving with original GUI
Changed paths:
engines/scumm/saveload.cpp
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 8f47c2ce11f..213f97df416 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -139,10 +139,6 @@ bool ScummEngine::canLoadGameStateCurrently(Common::U32String *msg) {
}
Common::Error ScummEngine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
- // Disable autosaving if the original GUI is in place
- if (isAutosave && isUsingOriginalGUI())
- return Common::kNoError;
-
requestSave(slot, desc);
return Common::kNoError;
}
More information about the Scummvm-git-logs
mailing list