summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-10-11 09:34:47 +0200
committerSergeanur <s.anureev@yandex.ua>2020-10-11 09:34:47 +0200
commit9dba2386bb90a4d2cd9c0f530a78bbf15aa17b7b (patch)
treeec7218e56bc1bfca1061d6cd45c1c897ecfb8e77 /src/render
parentMerge branch 'miami' into VC/TextFinish (diff)
parentSome unicode funcs belong to Font.cpp + small fix (diff)
downloadre3-9dba2386bb90a4d2cd9c0f530a78bbf15aa17b7b.tar
re3-9dba2386bb90a4d2cd9c0f530a78bbf15aa17b7b.tar.gz
re3-9dba2386bb90a4d2cd9c0f530a78bbf15aa17b7b.tar.bz2
re3-9dba2386bb90a4d2cd9c0f530a78bbf15aa17b7b.tar.lz
re3-9dba2386bb90a4d2cd9c0f530a78bbf15aa17b7b.tar.xz
re3-9dba2386bb90a4d2cd9c0f530a78bbf15aa17b7b.tar.zst
re3-9dba2386bb90a4d2cd9c0f530a78bbf15aa17b7b.zip
Diffstat (limited to '')
-rw-r--r--src/render/Font.cpp26
-rw-r--r--src/render/Font.h5
2 files changed, 31 insertions, 0 deletions
diff --git a/src/render/Font.cpp b/src/render/Font.cpp
index c0cc333a..7459c101 100644
--- a/src/render/Font.cpp
+++ b/src/render/Font.cpp
@@ -5,6 +5,32 @@
#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;
+}
+
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..f0ca9760 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;