summaryrefslogtreecommitdiffstats
path: root/src/text/Text.cpp
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2020-06-29 08:37:53 +0200
committerGitHub <noreply@github.com>2020-06-29 08:37:53 +0200
commit860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb (patch)
tree6a8f83b0d46e97b198f095b7624deecca75051e7 /src/text/Text.cpp
parentrestore Text.cpp (diff)
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.gz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.bz2
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.lz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.xz
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.tar.zst
re3-860f75d66ce51f2f5f3ea2b4b2b582f6d161a2bb.zip
Diffstat (limited to 'src/text/Text.cpp')
-rw-r--r--src/text/Text.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/text/Text.cpp b/src/text/Text.cpp
index 926ccd1c..c9e22a84 100644
--- a/src/text/Text.cpp
+++ b/src/text/Text.cpp
@@ -97,7 +97,11 @@ CText::Unload(void)
wchar*
CText::Get(const char *key)
{
+#ifdef FIX_BUGS
+ return keyArray.Search(key, data.chars);
+#else
return keyArray.Search(key);
+#endif
}
wchar UpperCaseTable[128] = {
@@ -196,9 +200,11 @@ CKeyArray::Unload(void)
void
CKeyArray::Update(wchar *chars)
{
+#ifndef FIX_BUGS
int i;
for(i = 0; i < numEntries; i++)
entries[i].value = (wchar*)((uint8*)chars + (uintptr)entries[i].value);
+#endif
}
CKeyEntry*
@@ -222,15 +228,25 @@ CKeyArray::BinarySearch(const char *key, CKeyEntry *entries, int16 low, int16 hi
}
wchar*
+#ifdef FIX_BUGS
+CKeyArray::Search(const char *key, wchar *data)
+#else
CKeyArray::Search(const char *key)
+#endif
{
CKeyEntry *found;
char errstr[25];
int i;
+#ifdef FIX_BUGS
+ found = BinarySearch(key, entries, 0, numEntries-1);
+ if(found)
+ return (wchar*)((uint8*)data + found->valueOffset);
+#else
found = BinarySearch(key, entries, 0, numEntries-1);
if(found)
return found->value;
+#endif
sprintf(errstr, "%s missing", key);
for(i = 0; i < 25; i++)
WideErrorString[i] = errstr[i];