diff options
Diffstat (limited to 'src/render/Font.h')
-rw-r--r-- | src/render/Font.h | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/src/render/Font.h b/src/render/Font.h index 7b67e310..d61ca6e7 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 { @@ -95,12 +123,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; #ifdef BUTTON_ICONS static int32 ButtonsSlot; @@ -125,8 +154,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); @@ -135,11 +165,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; } @@ -198,14 +230,15 @@ 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); + static void FilterOutTokensFromString(wchar*); #ifdef MORE_LANGUAGES static void ReloadFonts(uint8 set); |