aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTravis Howell2006-09-02 05:49:59 +0000
committerTravis Howell2006-09-02 05:49:59 +0000
commite8e7ff4629f0eddbd45dec17110bff29b435f967 (patch)
tree7e3edd8b62fad9e4fc8e820380336039c60c5543 /engines/scumm
parent8cf8d040d8be9fe28d2c6da2ffdd2f79f2708ec1 (diff)
downloadscummvm-rg350-e8e7ff4629f0eddbd45dec17110bff29b435f967.tar.gz
scummvm-rg350-e8e7ff4629f0eddbd45dec17110bff29b435f967.tar.bz2
scummvm-rg350-e8e7ff4629f0eddbd45dec17110bff29b435f967.zip
Add DISABLE_HE check, around HE72+ specific version of convertMessageString()
svn-id: r23818
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/string.cpp94
1 files changed, 48 insertions, 46 deletions
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 862b88e059..e3930c49ab 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -792,52 +792,6 @@ void ScummEngine::drawString(int a, const byte *msg) {
_string[a].xpos = _charset->_str.right + 8; // Indy3: Fixes Grail Diary text positioning
}
-int ScummEngine_v72he::convertMessageToString(const byte *msg, byte *dst, int dstSize) {
- uint num = 0;
- byte chr;
- const byte *src;
- byte *end;
-
- assert(dst);
- end = dst + dstSize;
-
- if (msg == NULL) {
- debug(0, "Bad message in convertMessageToString, ignoring");
- return 0;
- }
-
- src = msg;
- num = 0;
-
- while (1) {
- chr = src[num++];
- if (_game.heversion >= 80 && src[num - 1] == '(' && (src[num] == 'p' || src[num] == 'P')) {
- // Filter out the following prefixes in subtitles
- // (pickup4)
- // (PU1)
- // (PU2)
- while (src[num++] != ')');
- continue;
- }
- if ((_game.features & GF_HE_LOCALIZED) && chr == '[') {
- while (src[num++] != ']');
- continue;
- }
-
- if (chr == 0)
- break;
-
- *dst++ = chr;
-
- // Check for a buffer overflow
- if (dst >= end)
- error("convertMessageToString: buffer overflow!");
- }
- *dst = 0;
-
- return dstSize - (end - dst);
-}
-
int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize) {
uint num = 0;
uint32 val;
@@ -942,6 +896,54 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
return dstSize - (end - dst);
}
+#ifndef DISABLE_HE
+int ScummEngine_v72he::convertMessageToString(const byte *msg, byte *dst, int dstSize) {
+ uint num = 0;
+ byte chr;
+ const byte *src;
+ byte *end;
+
+ assert(dst);
+ end = dst + dstSize;
+
+ if (msg == NULL) {
+ debug(0, "Bad message in convertMessageToString, ignoring");
+ return 0;
+ }
+
+ src = msg;
+ num = 0;
+
+ while (1) {
+ chr = src[num++];
+ if (_game.heversion >= 80 && src[num - 1] == '(' && (src[num] == 'p' || src[num] == 'P')) {
+ // Filter out the following prefixes in subtitles
+ // (pickup4)
+ // (PU1)
+ // (PU2)
+ while (src[num++] != ')');
+ continue;
+ }
+ if ((_game.features & GF_HE_LOCALIZED) && chr == '[') {
+ while (src[num++] != ']');
+ continue;
+ }
+
+ if (chr == 0)
+ break;
+
+ *dst++ = chr;
+
+ // Check for a buffer overflow
+ if (dst >= end)
+ error("convertMessageToString: buffer overflow!");
+ }
+ *dst = 0;
+
+ return dstSize - (end - dst);
+}
+#endif
+
int ScummEngine::convertIntMessage(byte *dst, int dstSize, int var) {
int num;