diff --git a/asm/Kyoto/Text/CLineExtraSpaceInstruction.s b/asm/Kyoto/Text/CLineExtraSpaceInstruction.s index 3b1ace3a..9d6d620c 100644 --- a/asm/Kyoto/Text/CLineExtraSpaceInstruction.s +++ b/asm/Kyoto/Text/CLineExtraSpaceInstruction.s @@ -3,8 +3,8 @@ .section .data .balign 8 -.global lbl_803ED610 -lbl_803ED610: +.global __vt__26CLineExtraSpaceInstruction +__vt__26CLineExtraSpaceInstruction: # ROM: 0x3EA610 .4byte 0 .4byte 0 @@ -25,8 +25,8 @@ __dt__26CLineExtraSpaceInstructionFv: /* 802FF818 002FC778 93 E1 00 0C */ stw r31, 0xc(r1) /* 802FF81C 002FC77C 7C 7F 1B 79 */ or. r31, r3, r3 /* 802FF820 002FC780 41 82 00 30 */ beq lbl_802FF850 -/* 802FF824 002FC784 3C 60 80 3F */ lis r3, lbl_803ED610@ha -/* 802FF828 002FC788 38 03 D6 10 */ addi r0, r3, lbl_803ED610@l +/* 802FF824 002FC784 3C 60 80 3F */ lis r3, __vt__26CLineExtraSpaceInstruction@ha +/* 802FF828 002FC788 38 03 D6 10 */ addi r0, r3, __vt__26CLineExtraSpaceInstruction@l /* 802FF82C 002FC78C 90 1F 00 00 */ stw r0, 0(r31) /* 802FF830 002FC790 41 82 00 10 */ beq lbl_802FF840 /* 802FF834 002FC794 3C 60 80 3E */ lis r3, __vt__12CInstruction@ha diff --git a/asm/Kyoto/Text/CTextExecuteBuffer.s b/asm/Kyoto/Text/CTextExecuteBuffer.s index b3818c01..7921000e 100644 --- a/asm/Kyoto/Text/CTextExecuteBuffer.s +++ b/asm/Kyoto/Text/CTextExecuteBuffer.s @@ -1634,10 +1634,10 @@ __ct__26CLineExtraSpaceInstructionFi: /* 803031DC 0030013C 7C 7F 1B 79 */ or. r31, r3, r3 /* 803031E0 00300140 41 82 00 20 */ beq lbl_80303200 /* 803031E4 00300144 3C 80 80 3E */ lis r4, __vt__12CInstruction@ha -/* 803031E8 00300148 3C 60 80 3F */ lis r3, lbl_803ED610@ha +/* 803031E8 00300148 3C 60 80 3F */ lis r3, __vt__26CLineExtraSpaceInstruction@ha /* 803031EC 0030014C 38 04 9A 6C */ addi r0, r4, __vt__12CInstruction@l /* 803031F0 00300150 90 1F 00 00 */ stw r0, 0(r31) -/* 803031F4 00300154 38 03 D6 10 */ addi r0, r3, lbl_803ED610@l +/* 803031F4 00300154 38 03 D6 10 */ addi r0, r3, __vt__26CLineExtraSpaceInstruction@l /* 803031F8 00300158 90 1F 00 00 */ stw r0, 0(r31) /* 803031FC 0030015C 93 DF 00 04 */ stw r30, 4(r31) lbl_80303200: diff --git a/configure.py b/configure.py index 248fe810..57c45d85 100755 --- a/configure.py +++ b/configure.py @@ -539,7 +539,7 @@ LIBS = [ ["Kyoto/Text/CDrawStringOptions", True], "Kyoto/Text/CFontInstruction", "Kyoto/Text/CFontRenderState", - "Kyoto/Text/CLineExtraSpaceInstruction", + ["Kyoto/Text/CLineExtraSpaceInstruction", True], "Kyoto/Text/CLineInstruction", ["Kyoto/Text/CLineSpacingInstruction", True], "Kyoto/Text/CPopStateInstruction", diff --git a/include/Kyoto/Text/CFontRenderState.hpp b/include/Kyoto/Text/CFontRenderState.hpp index bee39e89..3128132c 100644 --- a/include/Kyoto/Text/CFontRenderState.hpp +++ b/include/Kyoto/Text/CFontRenderState.hpp @@ -9,6 +9,7 @@ class CBlockInstruction; class CFontRenderState : private CSaveableState { public: void SetLineSpacing(float spacing) { CSaveableState::SetLineSpacing(spacing); } + void SetExtraLineSpace(int spacing) { CSaveableState::SetLineExtraSpace(spacing); } private: CBlockInstruction* x88_curBlock; diff --git a/include/Kyoto/Text/CLineExtraSpaceInstruction.hpp b/include/Kyoto/Text/CLineExtraSpaceInstruction.hpp new file mode 100644 index 00000000..3b146335 --- /dev/null +++ b/include/Kyoto/Text/CLineExtraSpaceInstruction.hpp @@ -0,0 +1,17 @@ +#ifndef _CLINEEXTRASPACINGINSTRUCTION +#define _CLINEEXTRASPACINGINSTRUCTION + +#include "Kyoto/Text/CInstruction.hpp" + +class CLineExtraSpaceInstruction : public CInstruction { +public: + CLineExtraSpaceInstruction(int spacing) : x4_spacing(spacing) {} + ~CLineExtraSpaceInstruction() {} + + void Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const; + void PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const; +private: + int x4_spacing; +}; + +#endif // _CLINEEXTRASPACINGINSTRUCTION diff --git a/include/Kyoto/Text/CSaveableState.hpp b/include/Kyoto/Text/CSaveableState.hpp index ee116ec4..9e7272f4 100644 --- a/include/Kyoto/Text/CSaveableState.hpp +++ b/include/Kyoto/Text/CSaveableState.hpp @@ -15,6 +15,7 @@ public: bool IsFinishedLoading(); void SetLineSpacing(float spacing) { x74_lineSpacing = spacing; } + void SetLineExtraSpace(int spacing) { x78_extraLineSpacing = spacing; } private: CDrawStringOptions x0_drawStringOptions; diff --git a/src/Kyoto/Text/CLineExtraSpaceInstruction.cpp b/src/Kyoto/Text/CLineExtraSpaceInstruction.cpp new file mode 100644 index 00000000..e2dd9d8d --- /dev/null +++ b/src/Kyoto/Text/CLineExtraSpaceInstruction.cpp @@ -0,0 +1,11 @@ +#include "Kyoto/Text/CLineExtraSpaceInstruction.hpp" + +#include "Kyoto/Text/CFontRenderState.hpp" + +void CLineExtraSpaceInstruction::Invoke(CFontRenderState& state, CTextRenderBuffer* buf) const { + state.SetExtraLineSpace(x4_spacing); +} + +void CLineExtraSpaceInstruction::PageInvoke(CFontRenderState& state, CTextRenderBuffer* buf) const { + Invoke(state, buf); +}