diff options
author | Johannes Schickel | 2016-02-25 21:47:34 +0100 |
---|---|---|
committer | Johannes Schickel | 2016-02-25 21:49:43 +0100 |
commit | 7b9b1b2f3a749822ff10c3de21f419667e6964c6 (patch) | |
tree | f19cdb181958f5d25a4442e8ad161182b25c2f52 | |
parent | d7bb90ba84615f9e261118abb13d88b316cb92d7 (diff) | |
download | scummvm-rg350-7b9b1b2f3a749822ff10c3de21f419667e6964c6.tar.gz scummvm-rg350-7b9b1b2f3a749822ff10c3de21f419667e6964c6.tar.bz2 scummvm-rg350-7b9b1b2f3a749822ff10c3de21f419667e6964c6.zip |
ZVISION: Remove gap handling from removeSaveState.
This removes the annoying behavior that removing a save state causes your
physical files to be renamed.
As discussed with RichieSams and wjp.
-rw-r--r-- | engines/zvision/detection.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/engines/zvision/detection.cpp b/engines/zvision/detection.cpp index 27ccbeb9a6..8b47590861 100644 --- a/engines/zvision/detection.cpp +++ b/engines/zvision/detection.cpp @@ -165,26 +165,7 @@ int ZVisionMetaEngine::getMaximumSaveSlot() const { void ZVisionMetaEngine::removeSaveState(const char *target, int slot) const { Common::SaveFileManager *saveFileMan = g_system->getSavefileManager(); - Common::String filename = Common::String::format("%s.%03u", target, slot); - - saveFileMan->removeSavefile(filename.c_str()); - - Common::StringArray filenames; - Common::String pattern = target; - pattern += ".###"; - filenames = saveFileMan->listSavefiles(pattern.c_str()); - Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) - - for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) { - // Obtain the last 3 digits of the filename, since they correspond to the save slot - int slotNum = atoi(file->c_str() + file->size() - 3); - - // Rename every slot greater than the deleted slot, - if (slotNum > slot) { - saveFileMan->renameSavefile(file->c_str(), filename.c_str()); - filename = Common::String::format("%s.%03u", target, ++slot); - } - } + saveFileMan->removeSavefile(Common::String::format("%s.%03u", target, slot)); } SaveStateDescriptor ZVisionMetaEngine::querySaveMetaInfos(const char *target, int slot) const { |