2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 04:27:42 +00:00

GuiSys and FrontEnd work

This commit is contained in:
Jack Andersen
2016-12-30 14:51:51 -10:00
parent 20677700e0
commit db7c2aeaf2
20 changed files with 496 additions and 79 deletions

View File

@@ -17,6 +17,7 @@ class CInstruction
public:
virtual ~CInstruction() = default;
virtual void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const=0;
virtual void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
virtual void GetAssets(std::vector<CToken>& assetsOut) const;
virtual size_t GetAssetCount() const;
};
@@ -29,6 +30,7 @@ public:
CColorInstruction(EColorType tp, const CTextColor& color)
: x4_cType(tp), x8_color(color) {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
class CColorOverrideInstruction : public CInstruction
@@ -39,6 +41,7 @@ public:
CColorOverrideInstruction(int idx, const CTextColor& color)
: x4_overrideIdx(idx), x8_color(color) {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
class CFontInstruction : public CInstruction
@@ -47,6 +50,7 @@ class CFontInstruction : public CInstruction
public:
CFontInstruction(const TToken<CRasterFont>& font) : x4_font(font) {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void GetAssets(std::vector<CToken>& assetsOut) const;
size_t GetAssetCount() const;
};
@@ -57,6 +61,7 @@ class CLineExtraSpaceInstruction : public CInstruction
public:
CLineExtraSpaceInstruction(s32 extraSpace) : x4_extraSpace(extraSpace) {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
class CLineInstruction : public CInstruction
@@ -80,6 +85,7 @@ public:
void TestLargestFont(s32 monoW, s32 monoH, s32 baseline);
void InvokeLTR(CFontRenderState& state) const;
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
class CLineSpacingInstruction : public CInstruction
@@ -88,18 +94,21 @@ class CLineSpacingInstruction : public CInstruction
public:
CLineSpacingInstruction(float spacing) : x4_lineSpacing(spacing) {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
class CPopStateInstruction : public CInstruction
{
public:
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
class CPushStateInstruction : public CInstruction
{
public:
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
class CRemoveColorOverrideInstruction : public CInstruction
@@ -108,6 +117,7 @@ class CRemoveColorOverrideInstruction : public CInstruction
public:
CRemoveColorOverrideInstruction(int idx) : x4_idx(idx) {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
class CImageInstruction : public CInstruction
@@ -116,6 +126,8 @@ class CImageInstruction : public CInstruction
public:
CImageInstruction(const CFontImageDef& image) : x4_image(image) {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void GetAssets(std::vector<CToken>& assetsOut) const;
size_t GetAssetCount() const;
};
class CTextInstruction : public CInstruction
@@ -155,6 +167,7 @@ public:
void TestLargestFont(s32 monoW, s32 monoH, s32 baseline);
void SetupPositionLTR(CFontRenderState& state) const;
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
class CWordInstruction : public CInstruction
@@ -162,6 +175,7 @@ class CWordInstruction : public CInstruction
public:
void InvokeLTR(CFontRenderState& state) const;
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
};
}