[Scummvm-cvs-logs] SF.net SVN: scummvm: [23818] scummvm/trunk/engines/scumm/string.cpp
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Sat Sep 2 07:50:04 CEST 2006
Revision: 23818
http://svn.sourceforge.net/scummvm/?rev=23818&view=rev
Author: kirben
Date: 2006-09-01 22:49:59 -0700 (Fri, 01 Sep 2006)
Log Message:
-----------
Add DISABLE_HE check, around HE72+ specific version of convertMessageString()
Modified Paths:
--------------
scummvm/trunk/engines/scumm/string.cpp
Modified: scummvm/trunk/engines/scumm/string.cpp
===================================================================
--- scummvm/trunk/engines/scumm/string.cpp 2006-09-01 12:20:08 UTC (rev 23817)
+++ scummvm/trunk/engines/scumm/string.cpp 2006-09-02 05:49:59 UTC (rev 23818)
@@ -792,52 +792,6 @@
_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 @@
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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list