summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-10-11 09:33:02 +0200
committerSergeanur <s.anureev@yandex.ua>2020-10-11 09:33:02 +0200
commite26e85deb8d18ed99f94a50fd819886673d35c6a (patch)
tree8ffdbd21e3c324eb57a00fa10c60798dc1811617
parentMerge pull request #745 from Tatsh/vscode (diff)
downloadre3-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
-rw-r--r--src/audio/DMAudio.cpp1
-rw-r--r--src/render/Font.cpp26
-rw-r--r--src/render/Font.h5
-rw-r--r--src/save/GenericGameStorage.cpp1
-rw-r--r--src/save/PCSave.cpp1
-rw-r--r--src/text/Text.cpp30
-rw-r--r--src/text/Text.h4
7 files changed, 36 insertions, 32 deletions
diff --git a/src/audio/DMAudio.cpp b/src/audio/DMAudio.cpp
index 9d278046..7174c23c 100644
--- a/src/audio/DMAudio.cpp
+++ b/src/audio/DMAudio.cpp
@@ -5,6 +5,7 @@
#include "AudioManager.h"
#include "AudioScriptObject.h"
#include "sampman.h"
+#include "Font.h"
#include "Text.h"
#include "crossplatform.h"
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;
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index 81bcb6b0..a7cafec8 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -11,6 +11,7 @@
#include "Clock.h"
#include "Date.h"
#include "FileMgr.h"
+#include "Font.h"
#include "Frontend.h"
#include "GameLogic.h"
#include "Gangs.h"
diff --git a/src/save/PCSave.cpp b/src/save/PCSave.cpp
index 3103c7ab..d8ede0d3 100644
--- a/src/save/PCSave.cpp
+++ b/src/save/PCSave.cpp
@@ -3,6 +3,7 @@
#include "crossplatform.h"
#include "FileMgr.h"
+#include "Font.h"
#ifdef MORE_LANGUAGES
#include "Game.h"
#endif
diff --git a/src/text/Text.cpp b/src/text/Text.cpp
index a4f2af7f..f3324fd7 100644
--- a/src/text/Text.cpp
+++ b/src/text/Text.cpp
@@ -278,12 +278,6 @@ CData::Unload(void)
numChars = 0;
}
-void
-AsciiToUnicode(const char *src, wchar *dst)
-{
- while((*dst++ = (unsigned char)*src++) != '\0');
-}
-
char*
UnicodeToAscii(wchar *src)
{
@@ -307,7 +301,7 @@ UnicodeToAsciiForSaveLoad(wchar *src)
{
static char aStr[256];
int len;
- for(len = 0; *src != '\0' && len < 256-1; len++, src++)
+ for(len = 0; *src != '\0' && len < 256; len++, src++)
if(*src < 256)
aStr[len] = *src;
else
@@ -321,7 +315,7 @@ UnicodeToAsciiForMemoryCard(wchar *src)
{
static char aStr[256];
int len;
- for(len = 0; *src != '\0' && len < 256-1; len++, src++)
+ for(len = 0; *src != '\0' && len < 256; len++, src++)
if(*src < 256)
aStr[len] = *src;
else
@@ -331,26 +325,6 @@ UnicodeToAsciiForMemoryCard(wchar *src)
}
void
-UnicodeStrcpy(wchar *dst, const wchar *src)
-{
- while((*dst++ = *src++) != '\0');
-}
-
-void
-UnicodeStrcat(wchar *dst, wchar *append)
-{
- UnicodeStrcpy(&dst[UnicodeStrlen(dst)], append);
-}
-
-int
-UnicodeStrlen(const wchar *str)
-{
- int len;
- for(len = 0; *str != '\0'; len++, str++);
- return len;
-}
-
-void
TextCopy(wchar *dst, const wchar *src)
{
while((*dst++ = *src++) != '\0');
diff --git a/src/text/Text.h b/src/text/Text.h
index 4be9b6e6..52c17e27 100644
--- a/src/text/Text.h
+++ b/src/text/Text.h
@@ -1,12 +1,8 @@
#pragma once
-void AsciiToUnicode(const char *src, wchar *dst);
char *UnicodeToAscii(wchar *src);
char *UnicodeToAsciiForSaveLoad(wchar *src);
char *UnicodeToAsciiForMemoryCard(wchar *src);
-void UnicodeStrcpy(wchar *dst, const wchar *src);
-void UnicodeStrcat(wchar *dst, wchar *append);
-int UnicodeStrlen(const wchar *str);
void TextCopy(wchar *dst, const wchar *src);
struct CKeyEntry