1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 15:50:00 +00:00

Merge branch 'master' into VC/TextFinish

# Conflicts:
#	src/text/Text.cpp
This commit is contained in:
Sergeanur 2020-10-11 10:34:47 +03:00
commit 9dba2386bb
7 changed files with 35 additions and 31 deletions

View file

@ -5,6 +5,7 @@
#include "AudioManager.h" #include "AudioManager.h"
#include "AudioScriptObject.h" #include "AudioScriptObject.h"
#include "sampman.h" #include "sampman.h"
#include "Font.h"
#include "Text.h" #include "Text.h"
#include "crossplatform.h" #include "crossplatform.h"

View file

@ -5,6 +5,32 @@
#include "Font.h" #include "Font.h"
#include "Timer.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; CFontDetails CFont::Details;
int16 CFont::NewLine; int16 CFont::NewLine;
CSprite2d CFont::Sprite[MAX_FONTS]; CSprite2d CFont::Sprite[MAX_FONTS];

View file

@ -1,5 +1,10 @@
#pragma once #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 struct CFontDetails
{ {
CRGBA color; CRGBA color;

View file

@ -11,6 +11,7 @@
#include "Clock.h" #include "Clock.h"
#include "Date.h" #include "Date.h"
#include "FileMgr.h" #include "FileMgr.h"
#include "Font.h"
#include "Frontend.h" #include "Frontend.h"
#include "GameLogic.h" #include "GameLogic.h"
#include "Gangs.h" #include "Gangs.h"

View file

@ -3,6 +3,7 @@
#include "crossplatform.h" #include "crossplatform.h"
#include "FileMgr.h" #include "FileMgr.h"
#include "Font.h"
#ifdef MORE_LANGUAGES #ifdef MORE_LANGUAGES
#include "Game.h" #include "Game.h"
#endif #endif

View file

@ -431,7 +431,6 @@ CData::Unload(void)
numChars = 0; numChars = 0;
} }
void
CMissionTextOffsets::Load(size_t table_size, int file, size_t *offset, int) CMissionTextOffsets::Load(size_t table_size, int file, size_t *offset, int)
{ {
#if DUMB #if DUMB
@ -459,11 +458,6 @@ CMissionTextOffsets::Load(size_t table_size, int file, size_t *offset, int)
} }
void void
AsciiToUnicode(const char *src, wchar *dst)
{
while((*dst++ = (unsigned char)*src++) != '\0');
}
char* char*
UnicodeToAscii(wchar *src) UnicodeToAscii(wchar *src)
{ {
@ -522,7 +516,7 @@ UnicodeToAsciiForMemoryCard(wchar *src)
{ {
static char aStr[256]; static char aStr[256];
int len; int len;
for(len = 0; *src != '\0' && len < 256-1; len++, src++) for(len = 0; *src != '\0' && len < 256; len++, src++)
if(*src < 256) if(*src < 256)
aStr[len] = *src; aStr[len] = *src;
else else
@ -545,26 +539,6 @@ UnicodeMakeUpperCase(wchar *dst, wchar *src) //idk what to do with it, seems to
*dst = '\0'; *dst = '\0';
} }
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 void
TextCopy(wchar *dst, const wchar *src) TextCopy(wchar *dst, const wchar *src)
{ {

View file

@ -1,12 +1,8 @@
#pragma once #pragma once
void AsciiToUnicode(const char *src, wchar *dst);
char *UnicodeToAscii(wchar *src); char *UnicodeToAscii(wchar *src);
char *UnicodeToAsciiForSaveLoad(wchar *src); char *UnicodeToAsciiForSaveLoad(wchar *src);
char *UnicodeToAsciiForMemoryCard(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); void TextCopy(wchar *dst, const wchar *src);
void UnicodeMakeUpperCase(wchar *dst, wchar *src); void UnicodeMakeUpperCase(wchar *dst, wchar *src);