diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-10-11 09:33:02 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-10-11 09:33:02 +0200 |
commit | e26e85deb8d18ed99f94a50fd819886673d35c6a (patch) | |
tree | 8ffdbd21e3c324eb57a00fa10c60798dc1811617 /src/render | |
parent | Merge pull request #745 from Tatsh/vscode (diff) | |
download | re3-e26e85deb8d18ed99f94a50fd819886673d35c6a.tar re3-e26e85deb8d18ed99f94a50fd819886673d35c6a.tar.gz re3-e26e85deb8d18ed99f94a50fd819886673d35c6a.tar.bz2 re3-e26e85deb8d18ed99f94a50fd819886673d35c6a.tar.lz re3-e26e85deb8d18ed99f94a50fd819886673d35c6a.tar.xz re3-e26e85deb8d18ed99f94a50fd819886673d35c6a.tar.zst re3-e26e85deb8d18ed99f94a50fd819886673d35c6a.zip |
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/Font.cpp | 26 | ||||
-rw-r--r-- | src/render/Font.h | 5 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/render/Font.cpp b/src/render/Font.cpp index 58e44a5b..d0b554dd 100644 --- a/src/render/Font.cpp +++ b/src/render/Font.cpp @@ -4,6 +4,32 @@ #include "TxdStore.h" #include "Font.h" +void +AsciiToUnicode(const char *src, wchar *dst) +{ + while((*dst++ = (unsigned char)*src++) != '\0'); +} + +void +UnicodeStrcat(wchar *dst, wchar *append) +{ + UnicodeStrcpy(&dst[UnicodeStrlen(dst)], append); +} + +void +UnicodeStrcpy(wchar *dst, const wchar *src) +{ + while((*dst++ = *src++) != '\0'); +} + +int +UnicodeStrlen(const wchar *str) +{ + int len; + for(len = 0; *str != '\0'; len++, str++); + return len; +} + CFontDetails CFont::Details; int16 CFont::NewLine; CSprite2d CFont::Sprite[MAX_FONTS]; diff --git a/src/render/Font.h b/src/render/Font.h index 48f5703d..51035601 100644 --- a/src/render/Font.h +++ b/src/render/Font.h @@ -1,5 +1,10 @@ #pragma once +void AsciiToUnicode(const char *src, wchar *dst); +void UnicodeStrcpy(wchar *dst, const wchar *src); +void UnicodeStrcat(wchar *dst, wchar *append); +int UnicodeStrlen(const wchar *str); + struct CFontDetails { CRGBA color; |