diff options
author | Johannes Schickel | 2010-03-29 21:01:19 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-03-29 21:01:19 +0000 |
commit | db3f6be7774038d54f33d19acae96af283e6ced6 (patch) | |
tree | 4b34517a8e649fcec08726934fe07fe6560bf3da /engines/parallaction | |
parent | 4bac9e1b752e92318ff1d5497ec1d7aa0f2786be (diff) | |
download | scummvm-rg350-db3f6be7774038d54f33d19acae96af283e6ced6.tar.gz scummvm-rg350-db3f6be7774038d54f33d19acae96af283e6ced6.tar.bz2 scummvm-rg350-db3f6be7774038d54f33d19acae96af283e6ced6.zip |
Use ConfMan to query the gameid of the passed target instead of deducing from the target to the gameid. Along with it fix the removeSaveState implementation.
Note that this is untested! Someone with some parallaction game should test it
before it can be considered to backport it to branch-1-1-0.
svn-id: r48418
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/detection.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 9aae2d26c8..e8d44452ec 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -296,16 +296,7 @@ bool ParallactionMetaEngine::createInstance(OSystem *syst, Engine **engine, cons SaveStateList ParallactionMetaEngine::listSaves(const char *target) const { Common::SaveFileManager *saveFileMan = g_system->getSavefileManager(); - // HACK: Parallaction game saves are compatible across platforms and use the - // gameId as pattern. Butchering the target to get the gameId is probably not - // robust... - Common::String pattern(target); - if (pattern.hasPrefix("nippon")) { - pattern = "nippon.0??"; - } else { - pattern = "bra.0??"; - } - + Common::String pattern(ConfMan.getDomain(target)->getVal("gameid") + ".0??"); Common::StringArray filenames = saveFileMan->listSavefiles(pattern); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) @@ -330,11 +321,8 @@ SaveStateList ParallactionMetaEngine::listSaves(const char *target) const { int ParallactionMetaEngine::getMaximumSaveSlot() const { return 99; } void ParallactionMetaEngine::removeSaveState(const char *target, int slot) const { - char extension[6]; - snprintf(extension, sizeof(extension), ".0%02d", slot); - - Common::String filename = target; - filename += extension; + Common::String filename = ConfMan.getDomain(target)->getVal("gameid"); + filename += Common::String::printf(".0%02d", slot); g_system->getSavefileManager()->removeSavefile(filename); } |