aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2009-03-16 03:55:09 +0000
committerMax Horn2009-03-16 03:55:09 +0000
commitf233b89463352c99bda6186c43f8433bc2108bb0 (patch)
treef0d97853060c5abe894834ac7982ee4749b6e799 /engines/scumm
parent4bd84b7311da285f369605bce9d47b9e17bae530 (diff)
downloadscummvm-rg350-f233b89463352c99bda6186c43f8433bc2108bb0.tar.gz
scummvm-rg350-f233b89463352c99bda6186c43f8433bc2108bb0.tar.bz2
scummvm-rg350-f233b89463352c99bda6186c43f8433bc2108bb0.zip
SCUMM: Modified version of patch #2674880 (FOA: unique filename for IQ-points file)
svn-id: r39436
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/script_v5.cpp34
1 files changed, 22 insertions, 12 deletions
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index a50dde5271..b984f56ab0 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2059,15 +2059,20 @@ void ScummEngine_v5::o5_roomOps() {
case 13: // SO_SAVE_STRING
{
- Common::OutSaveFile *file;
- char filename[256], *s;
+ Common::String filename;
+ char chr;
a = getVarOrDirectByte(PARAM_1);
- s = filename;
- while ((*s++ = fetchScriptByte()))
- ;
+ while ((chr = fetchScriptByte()))
+ filename += chr;
- file = _saveFileMan->openForSaving(filename);
+ if (filename.hasPrefix("iq-")) {
+ filename = _targetName + ".iq";
+ } else {
+ error("SO_SAVE_STRING: Unsupported filename %s\n", filename.c_str());
+ }
+
+ Common::OutSaveFile *file = _saveFileMan->openForSaving(filename.c_str());
if (file != NULL) {
byte *ptr;
ptr = getResourceAddress(rtString, a);
@@ -2079,15 +2084,20 @@ void ScummEngine_v5::o5_roomOps() {
}
case 14: // SO_LOAD_STRING
{
- Common::InSaveFile *file;
- char filename[256], *s;
+ Common::String filename;
+ char chr;
a = getVarOrDirectByte(PARAM_1);
- s = filename;
- while ((*s++ = fetchScriptByte()))
- ;
+ while ((chr = fetchScriptByte()))
+ filename += chr;
+
+ if (filename.hasPrefix("iq-")) {
+ filename = _targetName + ".iq";
+ } else {
+ error("SO_SAVE_STRING: Unsupported filename %s\n", filename.c_str());
+ }
- file = _saveFileMan->openForLoading(filename);
+ Common::InSaveFile *file = _saveFileMan->openForLoading(filename.c_str());
if (file != NULL) {
byte *ptr;
int len = 256, cnt = 0;