More text implementations

Former-commit-id: 4b664aaf36
This commit is contained in:
2023-01-11 11:08:11 -08:00
parent 94dec52cae
commit 2bd5aa55f8
16 changed files with 160 additions and 31 deletions

View File

@@ -28,6 +28,8 @@ public:
bool HasLock() { return x4_lockHeld; }
const CObjectReference* GetRef() const { return x0_objRef; }
private:
CObjectReference* x0_objRef;
bool x4_lockHeld;

View File

@@ -6,12 +6,16 @@
class CBlockInstruction;
class CFontRenderState : private CSaveableState {
class CFontRenderState {
public:
void SetLineSpacing(float spacing) { CSaveableState::SetLineSpacing(spacing); }
void SetExtraLineSpace(int spacing) { CSaveableState::SetLineExtraSpace(spacing); }
void PushState();
void PopState();
const TToken<CRasterFont>& GetFont() { return x0_state.GetFont(); }
void SetLineSpacing(float spacing) { x0_state.SetLineSpacing(spacing); }
void SetExtraLineSpace(int spacing) { x0_state.SetLineExtraSpace(spacing); }
private:
CSaveableState x0_state;
CBlockInstruction* x88_curBlock;
CDrawStringOptions x8c_drawOpts;
int xd4_curX;

View File

@@ -0,0 +1,16 @@
#ifndef _CPOPSTATEINSTRUCTION
#define _CPOPSTATEINSTRUCTION
#include "Kyoto/Text/CInstruction.hpp"
class CPopStateInstruction : public CInstruction {
public:
CPopStateInstruction() {}
~CPopStateInstruction() {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
#endif // _CPOPSTATEINSTRUCTION

View File

@@ -0,0 +1,16 @@
#ifndef _CPUSHSTATEINSTRUCTION
#define _CPUSHSTATEINSTRUCTION
#include "Kyoto/Text/CInstruction.hpp"
class CPushStateInstruction : public CInstruction {
public:
CPushStateInstruction() {}
~CPushStateInstruction() {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
#endif // _CPUSHSTATEINSTRUCTION

View File

@@ -12,6 +12,8 @@ class CSaveableState {
public:
CSaveableState();
const TToken<CRasterFont>& GetFont() const { return *x48_font; }
bool IsFinishedLoading();
void SetLineSpacing(float spacing) { x74_lineSpacing = spacing; }

View File

@@ -0,0 +1,12 @@
#ifndef _CTEXTRENDERBUFFER
#define _CTEXTRENDERBUFFER
#include "Kyoto/TToken.hpp"
class CRasterFont;
class CTextRenderBuffer {
public:
void AddFontChange(const TToken< CRasterFont >& font);
};
#endif // _CTEXTRENDERBUFFER

View File

@@ -0,0 +1,13 @@
#ifndef _CWORDBREAKTABLES
#define _CWORDBREAKTABLES
#include <types.h>
class CWordBreakTables {
public:
static int GetBeginRank(wchar_t ch);
static int GetEndRank(wchar_t ch);
};
#endif // _CWORDBREAKTABLES