From b63c87e8a619d448724d8532408973d850547d59 Mon Sep 17 00:00:00 2001 From: aap Date: Sat, 1 Jun 2019 23:17:39 +0200 Subject: implemented splashes; fixed zones --- src/Text.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/Text.cpp') 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); -- cgit v1.2.3