aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
authorJohannes Schickel2008-11-18 17:03:55 +0000
committerJohannes Schickel2008-11-18 17:03:55 +0000
commitd99ab163ccef6b0723c75a9c345075521e8043c4 (patch)
tree660be08719e1bb0c442b6d900bf62408c597e7f2 /engines/sword1
parent2463c550acfff7de77d3cda11cb2e57533c96c71 (diff)
downloadscummvm-rg350-d99ab163ccef6b0723c75a9c345075521e8043c4.tar.gz
scummvm-rg350-d99ab163ccef6b0723c75a9c345075521e8043c4.tar.bz2
scummvm-rg350-d99ab163ccef6b0723c75a9c345075521e8043c4.zip
Fixed meta engine related save functions (some where relying on "target.???" instead of "sword1.???").
svn-id: r35113
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/detection.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index 68f538a3d6..30f0ebcb2b 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -192,12 +192,10 @@ Common::Error SwordMetaEngine::createInstance(OSystem *syst, Engine **engine) co
SaveStateList SwordMetaEngine::listSaves(const char *target) const {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
- Common::String pattern = target;
- pattern += ".???";
SaveStateList saveList;
char saveName[40];
- Common::StringList filenames = saveFileMan->listSavefiles(pattern.c_str());
+ Common::StringList filenames = saveFileMan->listSavefiles("sword1.???");
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
int slotNum = 0;
@@ -222,18 +220,15 @@ SaveStateList SwordMetaEngine::listSaves(const char *target) const {
int SwordMetaEngine::getMaximumSaveSlot() const { return 999; }
void SwordMetaEngine::removeSaveState(const char *target, int slot) const {
- char extension[6];
- snprintf(extension, sizeof(extension), ".%03d", slot);
+ char fileName[12];
+ snprintf(fileName, 12, "sword1.%03d", slot);
- Common::String filename = target;
- filename += extension;
-
- g_system->getSavefileManager()->removeSavefile(filename.c_str());
+ g_system->getSavefileManager()->removeSavefile(fileName);
}
SaveStateDescriptor SwordMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
- static char fileName[40];
- sprintf(fileName, "sword1.%03d", slot);
+ char fileName[12];
+ snprintf(fileName, 12, "sword1.%03d", slot);
char name[40];
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fileName);