summaryrefslogtreecommitdiffstats
path: root/src/Text.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-01 23:17:39 +0200
committeraap <aap@papnet.eu>2019-06-01 23:28:13 +0200
commitb63c87e8a619d448724d8532408973d850547d59 (patch)
treee75b7dfa53e02bd4feb33de0a90190279a8b5bab /src/Text.cpp
parentadded CPointLights (diff)
downloadre3-b63c87e8a619d448724d8532408973d850547d59.tar
re3-b63c87e8a619d448724d8532408973d850547d59.tar.gz
re3-b63c87e8a619d448724d8532408973d850547d59.tar.bz2
re3-b63c87e8a619d448724d8532408973d850547d59.tar.lz
re3-b63c87e8a619d448724d8532408973d850547d59.tar.xz
re3-b63c87e8a619d448724d8532408973d850547d59.tar.zst
re3-b63c87e8a619d448724d8532408973d850547d59.zip
Diffstat (limited to 'src/Text.cpp')
-rw-r--r--src/Text.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/Text.cpp b/src/Text.cpp
index 0281043d..eeb46253 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -5,7 +5,7 @@
#include "Messages.h"
#include "Text.h"
-static wchar_t WideErrorString[25];
+static wchar WideErrorString[25];
CText &TheText = *(CText*)0x941520;
@@ -90,7 +90,7 @@ CText::Unload(void)
keyArray.Unload();
}
-wchar_t*
+wchar*
CText::Get(const char *key)
{
return keyArray.Search(key);
@@ -119,11 +119,11 @@ CKeyArray::Unload(void)
}
void
-CKeyArray::Update(wchar_t *chars)
+CKeyArray::Update(wchar *chars)
{
int i;
for(i = 0; i < numEntries; i++)
- entries[i].value = (wchar_t*)((uint8*)chars + (uintptr)entries[i].value);
+ entries[i].value = (wchar*)((uint8*)chars + (uintptr)entries[i].value);
}
CKeyEntry*
@@ -146,7 +146,7 @@ CKeyArray::BinarySearch(const char *key, CKeyEntry *entries, int16 low, int16 hi
return nil;
}
-wchar_t*
+wchar*
CKeyArray::Search(const char *key)
{
CKeyEntry *found;
@@ -169,8 +169,8 @@ CData::Load(uint32 length, uint8 *data, int *offset)
uint32 i;
uint8 *rawbytes;
- numChars = length / sizeof(wchar_t);
- chars = new wchar_t[numChars];
+ numChars = length / sizeof(wchar);
+ chars = new wchar[numChars];
rawbytes = (uint8*)chars;
for(i = 0; i < length; i++)
@@ -185,6 +185,12 @@ CData::Unload(void)
numChars = 0;
}
+void
+AsciiToUnicode(const char *cs, uint16 *ws)
+{
+ while((*ws++ = *cs++) != '\0');
+}
+
STARTPATCHES
InjectHook(0x52C3C0, &CText::Load, PATCH_JUMP);
InjectHook(0x52C580, &CText::Unload, PATCH_JUMP);