summaryrefslogtreecommitdiffstats
path: root/src/render/Font.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/Font.h')
-rw-r--r--src/render/Font.h49
1 files changed, 40 insertions, 9 deletions
diff --git a/src/render/Font.h b/src/render/Font.h
index ef04ef28..ca0ed7d0 100644
--- a/src/render/Font.h
+++ b/src/render/Font.h
@@ -14,27 +14,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_STANDARD,
- FONT_PAGER,
FONT_HEADING,
#ifdef MORE_LANGUAGES
FONT_JAPANESE,
#endif
- MAX_FONTS
+ MAX_FONTS = FONT_HEADING
};
enum {
@@ -65,12 +92,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);
@@ -82,8 +110,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);
@@ -92,11 +121,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; }
@@ -155,14 +186,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);