aboutsummaryrefslogtreecommitdiff
path: root/engines/touche
diff options
context:
space:
mode:
authorMax Horn2007-09-18 20:02:04 +0000
committerMax Horn2007-09-18 20:02:04 +0000
commitc3d3aebe87d16d4fc3b7ac8581b99fb97241c9ac (patch)
tree17b2ba9f45743d2cf8f8e5faa6c9511e213f15f3 /engines/touche
parent5c08cb1bcf84828cc93114fadbc89dd6f9909d06 (diff)
parent1dc13a641dd82825334e81bb3eb3b4ebd69d2552 (diff)
downloadscummvm-rg350-c3d3aebe87d16d4fc3b7ac8581b99fb97241c9ac.tar.gz
scummvm-rg350-c3d3aebe87d16d4fc3b7ac8581b99fb97241c9ac.tar.bz2
scummvm-rg350-c3d3aebe87d16d4fc3b7ac8581b99fb97241c9ac.zip
Patch #1768757: Merge fsnode-gsoc into trunk (MAJOR change, will break compilation on some ports)
svn-id: r28944
Diffstat (limited to 'engines/touche')
-rw-r--r--engines/touche/saveload.cpp2
-rw-r--r--engines/touche/ui.cpp26
2 files changed, 26 insertions, 2 deletions
diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp
index fb82e68944..5ff749fa68 100644
--- a/engines/touche/saveload.cpp
+++ b/engines/touche/saveload.cpp
@@ -400,7 +400,7 @@ void ToucheEngine::readGameStateDescription(int num, char *description, int len)
void ToucheEngine::generateGameStateFileName(int num, char *dst, int len, bool prefixOnly) const {
if (prefixOnly) {
- snprintf(dst, len, "%s.", _targetName.c_str());
+ snprintf(dst, len, "%s.*", _targetName.c_str());
} else {
snprintf(dst, len, "%s.%d", _targetName.c_str(), num);
}
diff --git a/engines/touche/ui.cpp b/engines/touche/ui.cpp
index 15dc64aaf2..4d7100d4d0 100644
--- a/engines/touche/ui.cpp
+++ b/engines/touche/ui.cpp
@@ -370,9 +370,33 @@ void ToucheEngine::handleOptions(int forceDisplay) {
setupMenu(menuData.mode, &menuData);
curMode = menuData.mode;
if (menuData.mode == kMenuLoadStateMode || menuData.mode == kMenuSaveStateMode) {
+ assert(menuData.saveLoadMarks);
+
char gameStateFileName[16];
generateGameStateFileName(999, gameStateFileName, 15, true);
- _saveFileMan->listSavefiles(gameStateFileName, menuData.saveLoadMarks, 100);
+ char slot[2];
+ int slotNum;
+ Common::StringList filenames;
+
+ memset(menuData.saveLoadMarks, false, 100 * sizeof(bool)); //assume no savegames for this title
+ filenames = _saveFileMan->listSavefiles(gameStateFileName);
+
+ for(Common::StringList::const_iterator file = filenames.begin(); file != filenames.end(); file++){
+ //Obtain the last 1 or 2 digits of the filename, since they correspond to the save slot
+ //This engine can save games either with one or two digits, hence the additional if statement
+ slot[0] = file->c_str()[file->size()-2];
+ slot[1] = file->c_str()[file->size()-1];
+
+ if(!atoi(&slot[0])){
+ slotNum = atoi(&slot[1]);
+ } else {
+ slotNum = atoi(slot);
+ }
+
+ if(slotNum >= 0 && slotNum < 100)
+ menuData.saveLoadMarks[slotNum] = true; //mark this slot as valid
+ }
+
for (int i = 0; i < 100; ++i) {
menuData.saveLoadDescriptionsTable[i][0] = 0;
if (menuData.saveLoadMarks[i]) {