diff options
Diffstat (limited to 'src/render/Font.h')
-rw-r--r-- | src/render/Font.h | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/src/render/Font.h b/src/render/Font.h index 51035601..47a39f73 100644 --- a/src/render/Font.h +++ b/src/render/Font.h @@ -4,6 +4,7 @@ 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 { @@ -19,27 +20,54 @@ struct CFontDetails bool background; bool backgroundOnlyText; bool proportional; + bool bIsShadow; + bool bFlash; + bool bBold; float alphaFade; CRGBA backgroundColor; float wrapX; float centreSize; float rightJustifyWrap; int16 style; - int32 bank; + bool bFontHalfTexture; + uint32 bank; int16 dropShadowPosition; CRGBA dropColor; + bool bFlashState; + int nFlashTimer; + bool anonymous_23; + uint32 anonymous_25; +}; + +struct CFontRenderState +{ + uint32 anonymous_0; + float fTextPosX; + float fTextPosY; + float scaleX; + float scaleY; + CRGBA color; + float fExtraSpace; + float slant; + float slantRefX; + float slantRefY; + bool bIsShadow; + bool bFontHalfTexture; + bool proportional; + bool anonymous_14; + int16 style; }; class CSprite2d; enum { FONT_BANK, - FONT_PAGER, + FONT_STANDARD, FONT_HEADING, #ifdef MORE_LANGUAGES FONT_JAPANESE, #endif - MAX_FONTS + MAX_FONTS = FONT_HEADING }; enum { @@ -70,12 +98,13 @@ class CFont static uint8 LanguageSet; static int32 Slot; #else - static int16 Size[MAX_FONTS][193]; + static int16 Size[MAX_FONTS][210]; #endif static int16 NewLine; public: static CSprite2d Sprite[MAX_FONTS]; static CFontDetails Details; + static CFontRenderState RenderState; static void Initialise(void); static void Shutdown(void); @@ -87,8 +116,9 @@ public: #ifdef MORE_LANGUAGES static bool PrintString(float x, float y, wchar *start, wchar* &end, float spwidth, float japX); #else - static void PrintString(float x, float y, wchar *start, wchar *end, float spwidth); + static void PrintString(float x, float y, uint32, wchar *start, wchar *end, float spwidth); #endif + static void PrintStringFromBottom(float x, float y, wchar *str); static float GetCharacterWidth(wchar c); static float GetCharacterSize(wchar c); static float GetStringWidth(wchar *s, bool spaces = false); @@ -97,11 +127,13 @@ public: #endif static uint16 *GetNextSpace(wchar *s); #ifdef MORE_LANGUAGES - static uint16 *ParseToken(wchar *s, wchar*, bool japShit = false); + static uint16 *ParseToken(wchar *s, bool japShit = false); #else - static uint16 *ParseToken(wchar *s, wchar*); + static uint16 *ParseToken(wchar *s); + static uint16* ParseToken(wchar *s, CRGBA &color, bool &flash, bool &bold); #endif static void DrawFonts(void); + static void RenderFontBuffer(void); static uint16 character_code(uint8 c); static CFontDetails GetDetails() { return Details; } @@ -160,14 +192,14 @@ public: static void SetBackGroundOnlyTextOff(void) { Details.backgroundOnlyText = false; } static void SetPropOn(void) { Details.proportional = true; } static void SetPropOff(void) { Details.proportional = false; } - static void SetFontStyle(int16 style) { Details.style = style; } + static void SetFontStyle(int16 style); static void SetRightJustifyWrap(float wrap) { Details.rightJustifyWrap = wrap; } static void SetAlphaFade(float fade) { Details.alphaFade = fade; } static void SetDropShadowPosition(int16 pos) { Details.dropShadowPosition = pos; } static void SetBackgroundColor(CRGBA col); static void SetColor(CRGBA col); static void SetDropColor(CRGBA col); - + static wchar FindNewCharacter(wchar c); #ifdef MORE_LANGUAGES static void ReloadFonts(uint8 set); |