diff options
author | aap <aap@papnet.eu> | 2019-06-28 22:23:55 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-06-28 22:23:55 +0200 |
commit | 38a7b74b1a10ec64b0ebac060cac92786081f3e0 (patch) | |
tree | cfa2f9a7bd82c20decb84f12dcd1fd99b6b7bf3c /src/Text.cpp | |
parent | fixed CFileMgr, the craziest bug i ever had (diff) | |
download | re3-38a7b74b1a10ec64b0ebac060cac92786081f3e0.tar re3-38a7b74b1a10ec64b0ebac060cac92786081f3e0.tar.gz re3-38a7b74b1a10ec64b0ebac060cac92786081f3e0.tar.bz2 re3-38a7b74b1a10ec64b0ebac060cac92786081f3e0.tar.lz re3-38a7b74b1a10ec64b0ebac060cac92786081f3e0.tar.xz re3-38a7b74b1a10ec64b0ebac060cac92786081f3e0.tar.zst re3-38a7b74b1a10ec64b0ebac060cac92786081f3e0.zip |
Diffstat (limited to 'src/Text.cpp')
-rw-r--r-- | src/Text.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/Text.cpp b/src/Text.cpp index eeb46253..d7d63467 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -15,7 +15,7 @@ CText::CText(void) keyArray.numEntries = 0; data.chars = nil; data.numChars = 0; - unknown = 101; // What's this? version number? + encoding = 101; memset(WideErrorString, 0, sizeof(WideErrorString)); } @@ -96,6 +96,25 @@ CText::Get(const char *key) return keyArray.Search(key); } +wchar +CText::GetUpperCase(wchar c) +{ + // TODO: do this depending on encoding + if(islower(c)) + return toupper(c); + return c; +} + +void +CText::UpperCase(wchar *s) +{ + while(*s){ + *s = GetUpperCase(*s); + s++; + } +} + + void CKeyArray::Load(uint32 length, uint8 *data, int *offset) { @@ -186,9 +205,15 @@ CData::Unload(void) } void -AsciiToUnicode(const char *cs, uint16 *ws) +AsciiToUnicode(const char *src, uint16 *dst) +{ + while((*dst++ = *src++) != '\0'); +} + +void +TextCopy(wchar *dst, const wchar *src) { - while((*ws++ = *cs++) != '\0'); + while((*dst++ = *src++) != '\0'); } STARTPATCHES |