diff options
author | Travis Howell | 2005-01-31 00:16:11 +0000 |
---|---|---|
committer | Travis Howell | 2005-01-31 00:16:11 +0000 |
commit | 09d0d6c26d311e7fc2620ad5d978d9b64c3bd612 (patch) | |
tree | bf2f91b9994fbf8f153d2602fef3fc2a24348f6d /scumm | |
parent | a21f5b50d3b3dd11c9c3ac0b47dc56e7874eede3 (diff) | |
download | scummvm-rg350-09d0d6c26d311e7fc2620ad5d978d9b64c3bd612.tar.gz scummvm-rg350-09d0d6c26d311e7fc2620ad5d978d9b64c3bd612.tar.bz2 scummvm-rg350-09d0d6c26d311e7fc2620ad5d978d9b64c3bd612.zip |
Changes for Macintosh filenames.
svn-id: r16711
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/script_v72he.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 051c4342ca..6894abc0d8 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -1526,38 +1526,32 @@ void ScummEngine_v72he::o72_jumpToScript() { } void ScummEngine_v72he::o72_openFile() { - int mode, slot, l, r; + int mode, slot, l; byte filename[256]; mode = pop(); copyScriptString(filename); + debug(0,"Original filename %s", filename); + // HACK Correct incorrect filenames if (!strcmp((char *)filename,".he3")) { memset(filename, 0, sizeof(filename)); sprintf((char *)filename, "%s.he3", _gameName.c_str()); + debug(0,"New filename %s", filename); + } else if (!strcmp((char *)filename,".he7")) { memset(filename, 0, sizeof(filename)); sprintf((char *)filename, "%s.he7", _gameName.c_str()); + debug(0,"New filename %s", filename); + } else if (!strcmp((char *)filename,".HE9")) { memset(filename, 0, sizeof(filename)); sprintf((char *)filename, "%s.he9", _gameName.c_str()); - } - - if (_heMacFileNameIndex > 0) { - char buf1[128]; + debug(0,"New filename %s", filename); - generateMacFileName((char *)filename, buf1, 128, 0, _heMacFileNameIndex); - strcpy((char *)filename, buf1); } - for (r = strlen((char*)filename); r != 0; r--) { - if (filename[r - 1] == '\\') - break; - } - - debug(0,"Filename %s", filename + r); - // HACK: Convert paths if (filename[0] == ':') { int len = resStrLen(filename); @@ -1571,7 +1565,7 @@ void ScummEngine_v72he::o72_openFile() { i++; j++; } - debug(0,"Converted Filename %s", filename + r); + debug(0,"Converted filename to %s", filename); } slot = -1; @@ -1584,9 +1578,9 @@ void ScummEngine_v72he::o72_openFile() { if (slot != -1) { if (mode == 1) - _hFileTable[slot].open((char*)filename + r, File::kFileReadMode); + _hFileTable[slot].open((char*)filename, File::kFileReadMode); else if (mode == 2) - _hFileTable[slot].open((char*)filename + r, File::kFileWriteMode); + _hFileTable[slot].open((char*)filename, File::kFileWriteMode); else error("o72_openFile(): wrong open file mode %d", mode); |