Index: scummvm/common/str.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/str.cpp,v
retrieving revision 1.5
diff -u -r1.5 str.cpp
--- scummvm/common/str.cpp	22 Sep 2002 03:53:52 -0000	1.5
+++ scummvm/common/str.cpp	22 Sep 2002 04:18:27 -0000
@@ -20,11 +20,11 @@
 
 #include "stdafx.h"
 #include "str.h"
-#include "util.h"
-

-#ifdef _MSC_VER

-#	pragma warning( disable : 4068 ) // unknown pragmas

-#endif

+
+#ifdef _MSC_VER
+#	pragma warning( disable : 4068 ) // unknown pragmas
+#endif
+
 
 namespace ScummVM {
 
@@ -32,7 +32,7 @@
 {
 	_refCount = new int(1);
 	if (str) {		
-		_capacity = _len = resStrLen(str);
+		_capacity = _len = strlen(str);
 		_str = (char *)calloc(1, _capacity+1);
 		memcpy(_str, str, _len+1);
 	} else {
@@ -46,7 +46,7 @@
 	printf("String::String(const ConstString &str)\n");
 	_refCount = new int(1);
 	if (str._str) {		
-		_capacity = _len = resStrLen(str._str);
+		_capacity = _len = strlen(str._str);
 		_str = (char *)calloc(1, _capacity+1);
 		memcpy(_str, str._str, _len+1);
 	} else {
@@ -82,7 +82,7 @@
 
 String& String::operator  =(const char* str)
 {	
-	int len = resStrLen(str);
+	int len = strlen(str);
 	if (len > 0) {
 		ensureCapacity(len, false);
 		
@@ -115,7 +115,7 @@
 
 String& String::operator +=(const char* str)
 {
-	int len = resStrLen(str);
+	int len = strlen(str);
 	if (len > 0) {
 		ensureCapacity(_len + len, true);
 
Index: scummvm/scumm/dialogs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
retrieving revision 1.3
diff -u -r1.3 dialogs.cpp
--- scummvm/scumm/dialogs.cpp	22 Sep 2002 03:53:52 -0000	1.3
+++ scummvm/scumm/dialogs.cpp	22 Sep 2002 04:18:28 -0000
@@ -29,11 +29,13 @@
 #include "gui/ListWidget.h"
 #include "common/config-file.h"
 
-

-#ifdef _MSC_VER

-#	pragma warning( disable : 4068 )

-#endif

-

+
+#ifdef _MSC_VER
+#	pragma warning( disable : 4068 )
+#endif
+
+
+
 
 struct ResString {
 	int num;
@@ -152,12 +154,13 @@
 	if (!str)
 		str = "Dummy!";
 	new StaticTextWidget(this, x, y, w, h, str, kTextAlignCenter);
+	delete (char*)str;
 }
 
 
 const char *ScummDialog::queryResString(int stringno)
 {
-	char *result;
+	char *result, *temp;
 	int string;
 
 	if (stringno == 0)
@@ -178,12 +181,114 @@
 
 	if (!result) {								// Gracelessly degrade to english :)
 		if (_scumm->_features & GF_AFTER_V6)
-			return string_map_table_v6[stringno - 1].string;
+			result = string_map_table_v6[stringno - 1].string;
 		else
-			return string_map_table_v5[stringno - 1].string;
+			result = string_map_table_v5[stringno - 1].string;
 	}
 
-	return result;
+	// Convert to a proper string (take care of FF codes)
+	int num = 0, nt = 0, value;
+	byte chr;
+	temp = new char[256];	// should be long enough for all dialog strings
+
+	while (chr = result[num++]) {		
+		if (chr == 0xFF) {
+			chr = result[num++];			
+			switch (chr) {
+			case 4: { // add value
+				value = _scumm->readVar(READ_LE_UINT16(result+num));
+				if (num < 0) {
+					temp[nt++] = '-';
+					value = -value;
+				}
+
+				int flag = 0;
+				int max = 10000;
+				do {
+					if (value >= max || flag) {
+						temp[nt++] = value / max + '0';
+						value %= max;
+						flag = 1;
+					}
+					max /= 10;
+					if (max == 1)
+						flag = 1;
+				} while (max);
+				num += 2;
+				break;
+			}
+
+			case 5: { //add verb
+				value = _scumm->readVar(READ_LE_UINT16(result+num));
+				int i;
+				if (!value)
+					break;
+				
+				for (i = 1; i < _scumm->_maxVerbs; i++) {
+					if (value == _scumm->_verbs[i].verbid && !_scumm->_verbs[i].type && !_scumm->_verbs[i].saveid) {
+						char* verb = (char*)_scumm->getResourceAddress(rtVerb, i);
+						if (verb) {
+							strcpy(temp+nt, verb);
+							nt += strlen(verb);
+						}
+						break;
+					}
+				}
+				num += 2;
+				break;
+			}
+
+			case 6: { // add object or actor name
+				value = _scumm->readVar(READ_LE_UINT16(result+num));
+				if (!value)
+					break;
+
+				char* name = (char*)_scumm->getObjOrActorName(value);
+				if (name) {
+					strcpy(temp+nt, name);
+					nt += strlen(name);
+				}
+				num += 2;
+				break;
+			}
+			case 7: { // add string
+				value = READ_LE_UINT16(result+num);
+				if (_scumm->_features & GF_AFTER_V6 || _scumm->_gameId == GID_INDY3_256)			
+					value = _scumm->readVar(value);
+
+				if (value) {
+					char *str = (char*)_scumm->getStringAddress(value);
+					if (str) {
+						strcpy(temp+nt, str);
+						nt += strlen(str);
+					}
+				}
+				num += 2;
+				break;
+			}
+				// Do these ever occur in the Gui?
+			case 9:
+			case 10:
+			case 12:
+			case 13:
+			case 14:				
+				num += 2;				
+			default:
+				warning("Ignoring unknown resource string of type %d", (int)chr);
+			}
+		} else {
+			if (chr != '@') {
+				temp[nt++] = chr;
+			}
+		}
+		
+		if (nt >= 255) {
+			warning("Truncating resource string");
+			temp[255] = 0;
+			break;
+		}
+	}
+	return temp;
 }
 
 const char *ScummDialog::queryCustomString(int stringno)
