aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2006-02-20 13:24:19 +0000
committerMax Horn2006-02-20 13:24:19 +0000
commit011bcc04d24dbd44086b849e271d70cdd5255e0b (patch)
treec4c1ba60e984e4d981390eedc1c790082671cbef /engines
parent188cdf937d17c27ddd221178dcf9a0da7898b035 (diff)
downloadscummvm-rg350-011bcc04d24dbd44086b849e271d70cdd5255e0b.tar.gz
scummvm-rg350-011bcc04d24dbd44086b849e271d70cdd5255e0b.tar.bz2
scummvm-rg350-011bcc04d24dbd44086b849e271d70cdd5255e0b.zip
Disable unchecked use of OSystem::setWindowCaption from SCUMM/HE scripts (this fixes crashes under Mac OS X with e.g. german puttrace)
svn-id: r20782
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/he/script_v100he.cpp14
-rw-r--r--engines/scumm/he/script_v70he.cpp14
-rw-r--r--engines/scumm/he/script_v72he.cpp14
3 files changed, 39 insertions, 3 deletions
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index 414cbd62d3..28c7ecd77f 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -1665,7 +1665,19 @@ void ScummEngine_v100he::o100_setSystemMessage() {
switch (subOp) {
case 80: // Set Window Caption
- _system->setWindowCaption((const char *)name);
+ // TODO: The 'name' string can contain non-ASCII data. This can lead to
+ // problems, because (a) the encoding used for "name" is not clear,
+ // (b) OSystem::setWindowCaption only supports ASCII. As a result, odd
+ // behavior can occur, from strange wrong titles, up to crashes (happens
+ // under Mac OS X).
+ //
+ // Possible fixes/workarounds:
+ // - Simply stop using this. It's a rather unimportant "feature" anyway.
+ // - Try to translate the text to ASCII.
+ // - Refine OSystem to accept window captions that are non-ASCII, e.g.
+ // by enhancing all backends to deal with UTF-8 data. Of course, then
+ // one still would have to convert 'name' to the correct encoding.
+ //_system->setWindowCaption((const char *)name);
break;
case 131: // Set Version
debug(1,"o100_setSystemMessage: (%d) %s", subOp, name);
diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp
index e955f1267b..bd70845f67 100644
--- a/engines/scumm/he/script_v70he.cpp
+++ b/engines/scumm/he/script_v70he.cpp
@@ -1102,7 +1102,19 @@ void ScummEngine_v70he::o70_setSystemMessage() {
debug(1,"o70_setSystemMessage: (%d) %s", subOp, name);
break;
case 243: // Set Window Caption
- _system->setWindowCaption((const char *)name);
+ // TODO: The 'name' string can contain non-ASCII data. This can lead to
+ // problems, because (a) the encoding used for "name" is not clear,
+ // (b) OSystem::setWindowCaption only supports ASCII. As a result, odd
+ // behavior can occur, from strange wrong titles, up to crashes (happens
+ // under Mac OS X).
+ //
+ // Possible fixes/workarounds:
+ // - Simply stop using this. It's a rather unimportant "feature" anyway.
+ // - Try to translate the text to ASCII.
+ // - Refine OSystem to accept window captions that are non-ASCII, e.g.
+ // by enhancing all backends to deal with UTF-8 data. Of course, then
+ // one still would have to convert 'name' to the correct encoding.
+ //_system->setWindowCaption((const char *)name);
break;
default:
error("o70_setSystemMessage: default case %d", subOp);
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index a97ae843f1..605d490738 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -2273,7 +2273,19 @@ void ScummEngine_v72he::o72_setSystemMessage() {
debug(1,"o72_setSystemMessage: (%d) %s", subOp, name);
break;
case 243: // Set Window Caption
- _system->setWindowCaption((const char *)name);
+ // TODO: The 'name' string can contain non-ASCII data. This can lead to
+ // problems, because (a) the encoding used for "name" is not clear,
+ // (b) OSystem::setWindowCaption only supports ASCII. As a result, odd
+ // behavior can occur, from strange wrong titles, up to crashes (happens
+ // under Mac OS X).
+ //
+ // Possible fixes/workarounds:
+ // - Simply stop using this. It's a rather unimportant "feature" anyway.
+ // - Try to translate the text to ASCII.
+ // - Refine OSystem to accept window captions that are non-ASCII, e.g.
+ // by enhancing all backends to deal with UTF-8 data. Of course, then
+ // one still would have to convert 'name' to the correct encoding.
+ //_system->setWindowCaption((const char *)name);
break;
default:
error("o72_setSystemMessage: default case %d", subOp);