mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-25 06:06:06 +00:00
Some unicode funcs belong to Font.cpp + small fix
This commit is contained in:
parent
70ae4b192b
commit
e26e85deb8
7 changed files with 36 additions and 32 deletions
|
@ -5,6 +5,7 @@
|
|||
#include "AudioManager.h"
|
||||
#include "AudioScriptObject.h"
|
||||
#include "sampman.h"
|
||||
#include "Font.h"
|
||||
#include "Text.h"
|
||||
#include "crossplatform.h"
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "crossplatform.h"
|
||||
|
||||
#include "FileMgr.h"
|
||||
#include "Font.h"
|
||||
#ifdef MORE_LANGUAGES
|
||||
#include "Game.h"
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
@ -330,26 +324,6 @@ UnicodeToAsciiForMemoryCard(wchar *src)
|
|||
return aStr;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue