[Scummvm-cvs-logs] SF.net SVN: scummvm: [20782] scummvm/trunk/engines/scumm/he
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Mon Feb 20 05:25:03 CET 2006
Revision: 20782
Author: fingolfin
Date: 2006-02-20 05:24:19 -0800 (Mon, 20 Feb 2006)
ViewCVS: http://svn.sourceforge.net/scummvm?rev=20782&view=rev
Log Message:
-----------
Disable unchecked use of OSystem::setWindowCaption from SCUMM/HE scripts (this fixes crashes under Mac OS X with e.g. german puttrace)
Modified Paths:
--------------
scummvm/trunk/engines/scumm/he/script_v100he.cpp
scummvm/trunk/engines/scumm/he/script_v70he.cpp
scummvm/trunk/engines/scumm/he/script_v72he.cpp
Modified: scummvm/trunk/engines/scumm/he/script_v100he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v100he.cpp 2006-02-20 13:22:03 UTC (rev 20781)
+++ scummvm/trunk/engines/scumm/he/script_v100he.cpp 2006-02-20 13:24:19 UTC (rev 20782)
@@ -1665,7 +1665,19 @@
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);
Modified: scummvm/trunk/engines/scumm/he/script_v70he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v70he.cpp 2006-02-20 13:22:03 UTC (rev 20781)
+++ scummvm/trunk/engines/scumm/he/script_v70he.cpp 2006-02-20 13:24:19 UTC (rev 20782)
@@ -1102,7 +1102,19 @@
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);
Modified: scummvm/trunk/engines/scumm/he/script_v72he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/script_v72he.cpp 2006-02-20 13:22:03 UTC (rev 20781)
+++ scummvm/trunk/engines/scumm/he/script_v72he.cpp 2006-02-20 13:24:19 UTC (rev 20782)
@@ -2273,7 +2273,19 @@
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);
More information about the Scummvm-git-logs
mailing list