diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-10-11 09:42:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-11 09:42:19 +0200 |
commit | a5ea709edcb80e977c158359241502f842ad45b4 (patch) | |
tree | 05f850e59f0995fa98969279618b02719fb1bd1c /src/render | |
parent | Merge remote-tracking branch 'origin/master' into miami (diff) | |
parent | UnicodeMakeUpperCase move + arg fix (diff) | |
download | re3-a5ea709edcb80e977c158359241502f842ad45b4.tar re3-a5ea709edcb80e977c158359241502f842ad45b4.tar.gz re3-a5ea709edcb80e977c158359241502f842ad45b4.tar.bz2 re3-a5ea709edcb80e977c158359241502f842ad45b4.tar.lz re3-a5ea709edcb80e977c158359241502f842ad45b4.tar.xz re3-a5ea709edcb80e977c158359241502f842ad45b4.tar.zst re3-a5ea709edcb80e977c158359241502f842ad45b4.zip |
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/Font.cpp | 40 | ||||
-rw-r--r-- | src/render/Font.h | 6 |
2 files changed, 46 insertions, 0 deletions
diff --git a/src/render/Font.cpp b/src/render/Font.cpp index c0cc333a..8deac7bf 100644 --- a/src/render/Font.cpp +++ b/src/render/Font.cpp @@ -5,6 +5,46 @@ #include "Font.h" #include "Timer.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; +} + +void +UnicodeMakeUpperCase(wchar *dst, const wchar *src) //idk what to do with it, seems to be incorrect implementation by R* +{ + while (*src != '\0') { + if (*src < 'a' || *src > 'z') + *dst = *src; + else + *dst = *src - 32; + dst++; + src++; + } + *dst = '\0'; +} + CFontDetails CFont::Details; int16 CFont::NewLine; CSprite2d CFont::Sprite[MAX_FONTS]; diff --git a/src/render/Font.h b/src/render/Font.h index ca0ed7d0..47a39f73 100644 --- a/src/render/Font.h +++ b/src/render/Font.h @@ -1,5 +1,11 @@ #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); +void UnicodeMakeUpperCase(wchar *dst, const wchar *src); + struct CFontDetails { CRGBA color; |