2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 01:47:43 +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

@@ -7,6 +7,10 @@
namespace urde
{
void CInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
}
void CInstruction::GetAssets(std::vector<CToken>& assetsOut) const
{
}
@@ -21,6 +25,11 @@ void CColorInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf)
state.SetColor(x4_cType, x8_color);
}
void CColorInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
Invoke(state, buf);
}
void CColorOverrideInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
state.x64_colorOverrides[x4_overrideIdx] = true;
@@ -28,6 +37,11 @@ void CColorOverrideInstruction::Invoke(CFontRenderState& state, CTextRenderBuffe
state.x0_drawStrOpts.x4_colors[x4_overrideIdx] = convCol;
}
void CColorOverrideInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
Invoke(state, buf);
}
void CFontInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
buf->AddFontChange(x4_font);
@@ -35,6 +49,11 @@ void CFontInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) c
state.RefreshPalette();
}
void CFontInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
Invoke(state, buf);
}
void CFontInstruction::GetAssets(std::vector<CToken>& assetsOut) const
{
assetsOut.push_back(x4_font);
@@ -50,6 +69,11 @@ void CLineExtraSpaceInstruction::Invoke(CFontRenderState& state, CTextRenderBuff
state.x78_extraLineSpace = x4_extraSpace;
}
void CLineExtraSpaceInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
Invoke(state, buf);
}
void CLineInstruction::TestLargestFont(s32 monoW, s32 monoH, s32 baseline)
{
if (!x18_largestBaseline)
@@ -154,26 +178,52 @@ void CLineInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) c
state.xdc_currentLineInst = this;
}
void CLineInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
if (!state.xdc_currentLineInst)
Invoke(state, buf);
}
void CLineSpacingInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
state.x74_lineSpacing = x4_lineSpacing;
}
void CLineSpacingInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
Invoke(state, buf);
}
void CPopStateInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
state.PopState();
}
void CPopStateInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
Invoke(state, buf);
}
void CPushStateInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
state.PushState();
}
void CPushStateInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
Invoke(state, buf);
}
void CRemoveColorOverrideInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
state.x64_colorOverrides[x4_idx] = false;
}
void CRemoveColorOverrideInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
Invoke(state, buf);
}
void CImageInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
if (x4_image.IsLoaded() && x4_image.x4_texs.size())
@@ -193,6 +243,17 @@ void CImageInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf)
}
}
void CImageInstruction::GetAssets(std::vector<CToken>& assetsOut) const
{
for (const CToken& tok : x4_image.x4_texs)
assetsOut.push_back(tok);
}
size_t CImageInstruction::GetAssetCount() const
{
return x4_image.x4_texs.size();
}
void CTextInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
int xOut, yOut;
@@ -252,6 +313,11 @@ void CBlockInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf)
SetupPositionLTR(state);
}
void CBlockInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
Invoke(state, buf);
}
void CWordInstruction::InvokeLTR(CFontRenderState& state) const
{
CRasterFont* font = state.x48_font.GetObj();
@@ -291,4 +357,9 @@ void CWordInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) c
InvokeLTR(state);
}
void CWordInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const
{
state.x108_lineInitialized = false;
}
}