aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/logic
diff options
context:
space:
mode:
authorMatthew Hoops2013-07-15 22:52:03 -0400
committerMatthew Hoops2013-10-05 15:45:36 -0400
commit3bfd42220533a3f2cd19e8f8a726ecc48ee97625 (patch)
treeabf18fc030d69183fe98a854b77bcac386bcac01 /engines/scumm/he/logic
parent3f65a02ced741979ede333539bac67ead9dbc368 (diff)
downloadscummvm-rg350-3bfd42220533a3f2cd19e8f8a726ecc48ee97625.tar.gz
scummvm-rg350-3bfd42220533a3f2cd19e8f8a726ecc48ee97625.tar.bz2
scummvm-rg350-3bfd42220533a3f2cd19e8f8a726ecc48ee97625.zip
SCUMM: Make all HE saves prepend the target name
This makes HE follow the ScummVM convention of using the target name everywhere. It also fixes having more than one team in both soccer and football. Loading old saves will still work and they will be tried if the newer save names are not found.
Diffstat (limited to 'engines/scumm/he/logic')
-rw-r--r--engines/scumm/he/logic/football.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/engines/scumm/he/logic/football.cpp b/engines/scumm/he/logic/football.cpp
index ea990ca86b..215fdf0179 100644
--- a/engines/scumm/he/logic/football.cpp
+++ b/engines/scumm/he/logic/football.cpp
@@ -449,25 +449,26 @@ int LogicHEfootball2002::initScreenTranslations() {
int LogicHEfootball2002::getPlaybookFiles(int32 *args) {
// Get the pattern and then skip over the directory prefix ("*\" or "*:")
- Common::String pattern = (const char *)_vm->getStringAddress(args[0] & ~0x33539000) + 2;
+ // Also prepend the target name
+ Common::String targetName = _vm->getTargetName();
+ Common::String basePattern = ((const char *)_vm->getStringAddress(args[0] & ~0x33539000) + 2);
+ Common::String pattern = targetName + '-' + basePattern;
// Prepare a buffer to hold the file names
- char buffer[1000];
- buffer[0] = 0;
+ Common::String output;
// Get the list of file names that match the pattern and iterate over it
Common::StringArray fileList = _vm->getSaveFileManager()->listSavefiles(pattern);
- for (uint32 i = 0; i < fileList.size() && strlen(buffer) < 970; i++) {
+ for (uint32 i = 0; i < fileList.size(); i++) {
// Isolate the base part of the filename and concatenate it to our buffer
- Common::String fileName = Common::String(fileList[i].c_str(), fileList[i].size() - (pattern.size() - 1));
- strcat(buffer, fileName.c_str());
- strcat(buffer, ">"); // names separated by '>'
+ Common::String fileName(fileList[i].c_str() + targetName.size() + 1, fileList[i].size() - (basePattern.size() - 1) - (targetName.size() + 1));
+ output += fileName + '>'; // names separated by '>'
}
// Now store the result in an array
- int array = _vm->setupStringArray(strlen(buffer));
- strcpy((char *)_vm->getStringAddress(array), buffer);
+ int array = _vm->setupStringArray(output.size());
+ strcpy((char *)_vm->getStringAddress(array), output.c_str());
// And store the array index in variable 108
writeScummVar(108, array);