Match and link CColorInstruction

This commit is contained in:
Phillip Stephens 2023-01-11 12:06:08 -08:00
parent d72c176ac7
commit e0d723eaeb
7 changed files with 50 additions and 7 deletions

View File

@ -3,8 +3,8 @@
.section .data
.balign 8
.global lbl_803ED5B0
lbl_803ED5B0:
.global __vt__17CColorInstruction
__vt__17CColorInstruction:
# ROM: 0x3EA5B0
.4byte 0
.4byte 0
@ -25,8 +25,8 @@ __dt__17CColorInstructionFv:
/* 802FE840 002FB7A0 93 E1 00 0C */ stw r31, 0xc(r1)
/* 802FE844 002FB7A4 7C 7F 1B 79 */ or. r31, r3, r3
/* 802FE848 002FB7A8 41 82 00 30 */ beq lbl_802FE878
/* 802FE84C 002FB7AC 3C 60 80 3F */ lis r3, lbl_803ED5B0@ha
/* 802FE850 002FB7B0 38 03 D5 B0 */ addi r0, r3, lbl_803ED5B0@l
/* 802FE84C 002FB7AC 3C 60 80 3F */ lis r3, __vt__17CColorInstruction@ha
/* 802FE850 002FB7B0 38 03 D5 B0 */ addi r0, r3, __vt__17CColorInstruction@l
/* 802FE854 002FB7B4 90 1F 00 00 */ stw r0, 0(r31)
/* 802FE858 002FB7B8 41 82 00 10 */ beq lbl_802FE868
/* 802FE85C 002FB7BC 3C 60 80 3E */ lis r3, __vt__12CInstruction@ha

View File

@ -1856,10 +1856,10 @@ __ct__17CColorInstructionFiRC6CColor:
/* 80303504 00300464 7C 7F 1B 79 */ or. r31, r3, r3
/* 80303508 00300468 41 82 00 40 */ beq lbl_80303548
/* 8030350C 0030046C 3C 80 80 3E */ lis r4, __vt__12CInstruction@ha
/* 80303510 00300470 3C 60 80 3F */ lis r3, lbl_803ED5B0@ha
/* 80303510 00300470 3C 60 80 3F */ lis r3, __vt__17CColorInstruction@ha
/* 80303514 00300474 38 04 9A 6C */ addi r0, r4, __vt__12CInstruction@l
/* 80303518 00300478 90 1F 00 00 */ stw r0, 0(r31)
/* 8030351C 0030047C 38 03 D5 B0 */ addi r0, r3, lbl_803ED5B0@l
/* 8030351C 0030047C 38 03 D5 B0 */ addi r0, r3, __vt__17CColorInstruction@l
/* 80303520 00300480 90 1F 00 00 */ stw r0, 0(r31)
/* 80303524 00300484 93 BF 00 04 */ stw r29, 4(r31)
/* 80303528 00300488 88 1E 00 00 */ lbz r0, 0(r30)

View File

@ -534,7 +534,7 @@ LIBS = [
"Kyoto/Animation/IAnimReader",
"Kyoto/Animation/CAllFormatsAnimSource",
"Kyoto/CDvdRequest",
"Kyoto/Text/CColorInstruction",
["Kyoto/Text/CColorInstruction", True],
"Kyoto/Text/CColorOverrideInstruction",
["Kyoto/Text/CDrawStringOptions", True],
"Kyoto/Text/CFontInstruction",

View File

@ -0,0 +1,21 @@
#ifndef _CCOLORINSTRUCTION
#define _CCOLORINSTRUCTION
#include "Kyoto/Text/CInstruction.hpp"
#include "Kyoto/Text/CTextColor.hpp"
#include "Kyoto/Text/TextCommon.hpp"
class CColorInstruction : CInstruction {
public:
CColorInstruction(EColorType type, const CTextColor& color) : x4_type(type), x8_color(color) {}
void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const;
private:
EColorType x4_type;
CTextColor x8_color;
};
#endif // _CCOLORINSTRUCTION

View File

@ -3,6 +3,7 @@
#include "Kyoto/Text/CSaveableState.hpp"
#include "Kyoto/Text/CDrawStringOptions.hpp"
#include "Kyoto/Text/TextCommon.hpp"
class CBlockInstruction;
@ -10,6 +11,7 @@ class CFontRenderState {
public:
void PushState();
void PopState();
void SetColor(EColorType type, const CTextColor& color);
const TToken<CRasterFont>& GetFont() { return x0_state.GetFont(); }
void SetLineSpacing(float spacing) { x0_state.SetLineSpacing(spacing); }
void SetExtraLineSpace(int spacing) { x0_state.SetLineExtraSpace(spacing); }

View File

@ -0,0 +1,9 @@
#ifndef _TEXTCOMMON
#define _TEXTCOMMON
enum EColorType {
};
#endif // _TEXTCOMMON

View File

@ -0,0 +1,11 @@
#include "Kyoto/Text/CColorInstruction.hpp"
#include "Kyoto/Text/CFontRenderState.hpp"
void CColorInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const {
state.SetColor(x4_type, x8_color);
}
void CColorInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const {
Invoke(state, buf);
}