2023-01-08 02:31:19 +00:00
|
|
|
#ifndef _CFONTRENDERSTATE
|
|
|
|
#define _CFONTRENDERSTATE
|
|
|
|
|
|
|
|
#include "Kyoto/Text/CDrawStringOptions.hpp"
|
2023-01-11 23:17:26 +00:00
|
|
|
#include "Kyoto/Text/CSaveableState.hpp"
|
2023-01-11 20:06:08 +00:00
|
|
|
#include "Kyoto/Text/TextCommon.hpp"
|
2023-01-08 02:31:19 +00:00
|
|
|
|
|
|
|
class CBlockInstruction;
|
|
|
|
|
2023-01-11 19:08:11 +00:00
|
|
|
class CFontRenderState {
|
2023-01-08 02:31:19 +00:00
|
|
|
public:
|
2023-01-11 21:26:39 +00:00
|
|
|
uint ConvertToTextureSpace(const CTextColor& color) const;
|
2023-01-11 19:08:11 +00:00
|
|
|
void PushState();
|
|
|
|
void PopState();
|
2023-01-11 20:06:08 +00:00
|
|
|
void SetColor(EColorType type, const CTextColor& color);
|
2023-01-11 20:16:02 +00:00
|
|
|
void RefreshPalette();
|
2023-01-11 21:26:39 +00:00
|
|
|
CDrawStringOptions& GetOptions() { return x0_state.GetOptions(); }
|
2023-01-11 23:17:26 +00:00
|
|
|
const TToken< CRasterFont >& GetFont() { return x0_state.GetFont(); }
|
|
|
|
rstl::vector< CTextColor >& GetColors() { return x0_state.GetColors(); }
|
|
|
|
rstl::vector< bool >& GetOverride() { return x0_state.GetOverride(); }
|
2023-01-11 19:08:11 +00:00
|
|
|
void SetLineSpacing(float spacing) { x0_state.SetLineSpacing(spacing); }
|
|
|
|
void SetExtraLineSpace(int spacing) { x0_state.SetLineExtraSpace(spacing); }
|
2023-01-11 23:17:26 +00:00
|
|
|
void SetBlock(const CBlockInstruction* block) { x88_curBlock = const_cast<CBlockInstruction*>(block); }
|
|
|
|
void SetX(int x) { xd4_curX = x; }
|
|
|
|
int GetX() const { return xd4_curX; }
|
|
|
|
void SetY(int y) { xd8_curY = y; }
|
|
|
|
int GetY() const { return xd8_curY; }
|
2023-01-08 02:31:19 +00:00
|
|
|
private:
|
2023-01-11 19:08:11 +00:00
|
|
|
CSaveableState x0_state;
|
2023-01-08 02:31:19 +00:00
|
|
|
CBlockInstruction* x88_curBlock;
|
|
|
|
CDrawStringOptions x8c_drawOpts;
|
|
|
|
int xd4_curX;
|
|
|
|
int xd8_curY;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _CFONTRENDERSTATE
|