Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config/GM8E01_00/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ OnMessage__13CSplashScreenFRC20CArchitectureMessageR18CArchitectureQueue = .text
__ct__13CSplashScreenFQ213CSplashScreen13ESplashScreen = .text:0x800291FC; // type:function size:0xE0 scope:global
fn_800292DC = .text:0x800292DC; // type:function size:0x9C
fn_80029378 = .text:0x80029378; // type:function size:0x94
fn_8002940C = .text:0x8002940C; // type:function size:0x70
ReleaseData__Q24rstl22rc_ptr<12CInstruction>Fv = .text:0x8002940C; // type:function size:0x70
PageInvoke__12CInstructionCFR16CFontRenderStateP17CTextRenderBuffer = .text:0x8002947C; // type:function size:0x4 scope:global
GetAssets__12CInstructionCFRQ24rstl42vector<6CToken,Q24rstl17rmemory_allocator> = .text:0x80029480; // type:function size:0x4 scope:global
GetAssetCount__12CInstructionCFv = .text:0x80029484; // type:function size:0x8 scope:global
Expand Down Expand Up @@ -13216,7 +13216,7 @@ PopState__16CFontRenderStateFv = .text:0x802FECF4; // type:function size:0x48 sc
__as__14CSaveableStateFRC14CSaveableState = .text:0x802FED3C; // type:function size:0x190 scope:global
__as__Q24rstl47vector<10CTextColor,Q24rstl17rmemory_allocator>FRCQ24rstl47vector<10CTextColor,Q24rstl17rmemory_allocator> = .text:0x802FEECC; // type:function size:0x10C
PushState__16CFontRenderStateFv = .text:0x802FEFD8; // type:function size:0x28 scope:global
push_front__Q24rstl49list<14CSaveableState,Q24rstl17rmemory_allocator>FRC14CSaveableState = .text:0x802FF000; // type:function size:0x28
push__Q24rstl82stack<14CSaveableState,Q24rstl49list<14CSaveableState,Q24rstl17rmemory_allocator>>FRC14CSaveableState = .text:0x802FF000; // type:function size:0x28
do_insert_before__Q24rstl49list<14CSaveableState,Q24rstl17rmemory_allocator>FPQ34rstl49list<14CSaveableState,Q24rstl17rmemory_allocator>4nodeRC14CSaveableState = .text:0x802FF028; // type:function size:0x70
create_node__Q24rstl49list<14CSaveableState,Q24rstl17rmemory_allocator>FPQ34rstl49list<14CSaveableState,Q24rstl17rmemory_allocator>4nodePQ34rstl49list<14CSaveableState,Q24rstl17rmemory_allocator>4nodeRC14CSaveableState = .text:0x802FF098; // type:function size:0x84
__ct__14CSaveableStateFRC14CSaveableState = .text:0x802FF11C; // type:function size:0x208
Expand Down Expand Up @@ -13295,7 +13295,7 @@ GetAssets__18CTextExecuteBufferFv = .text:0x803022B4; // type:function size:0x1B
AddString__18CTextExecuteBufferFPCwi = .text:0x80302470; // type:function size:0x170 scope:global
AddStringFragment__18CTextExecuteBufferFPCwi = .text:0x803025E0; // type:function size:0x80 scope:global
WrapOneLTR__18CTextExecuteBufferFPCwi = .text:0x80302660; // type:function size:0x2C8 scope:global
fn_80302928 = .text:0x80302928; // type:function size:0xC4
push_front__Q24rstl66list<Q24rstl24ncrc_ptr<12CInstruction>,Q24rstl17rmemory_allocator>FRCQ24rstl24ncrc_ptr<12CInstruction> = .text:0x80302928; // type:function size:0xC4
MoveWordLTR__18CTextExecuteBufferFv = .text:0x803029EC; // type:function size:0x1E0 scope:global
fn_80302BCC = .text:0x80302BCC; // type:function size:0xAC
StartNewLine__18CTextExecuteBufferFv = .text:0x80302C78; // type:function size:0x144 scope:global
Expand All @@ -13321,7 +13321,7 @@ __ct__18CTextExecuteBufferFv = .text:0x80303D78; // type:function size:0x8C scop
fn_80303E04 = .text:0x80303E04; // type:function size:0x44
fn_80303E48 = .text:0x80303E48; // type:function size:0x2C
fn_80303E74 = .text:0x80303E74; // type:function size:0x154
fn_80303FC8 = .text:0x80303FC8; // type:function size:0x9C
do_erase__Q24rstl66list<Q24rstl24ncrc_ptr<12CInstruction>,Q24rstl17rmemory_allocator>FPQ34rstl66list<Q24rstl24ncrc_ptr<12CInstruction>,Q24rstl17rmemory_allocator>4node = .text:0x80303FC8; // type:function size:0x9C
__dt__16CTextInstructionFv = .text:0x80304064; // type:function size:0x5C scope:weak
__ct__16CTextInstructionFPCwi = .text:0x803040C0; // type:function size:0xD4 scope:global
Invoke__16CTextInstructionCFR16CFontRenderStateP17CTextRenderBuffer = .text:0x80304194; // type:function size:0x100 scope:global
Expand Down
6 changes: 3 additions & 3 deletions config/GM8E01_01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ OnMessage__13CSplashScreenFRC20CArchitectureMessageR18CArchitectureQueue = .text
__ct__13CSplashScreenFQ213CSplashScreen13ESplashScreen = .text:0x80029278; // type:function size:0xE0 scope:global
fn_800292DC = .text:0x80029358; // type:function size:0x9C scope:global
fn_80029378 = .text:0x800293F4; // type:function size:0x94 scope:global
fn_8002940C = .text:0x80029488; // type:function size:0x70 scope:global
ReleaseData__Q24rstl22rc_ptr<12CInstruction>Fv = .text:0x80029488; // type:function size:0x70 scope:global
PageInvoke__12CInstructionCFR16CFontRenderStateP17CTextRenderBuffer = .text:0x800294F8; // type:function size:0x4 scope:global
GetAssets__12CInstructionCFRQ24rstl42vector<6CToken,Q24rstl17rmemory_allocator> = .text:0x800294FC; // type:function size:0x4 scope:global
GetAssetCount__12CInstructionCFv = .text:0x80029500; // type:function size:0x8 scope:global
Expand Down Expand Up @@ -13295,7 +13295,7 @@ GetAssets__18CTextExecuteBufferFv = .text:0x80302394; // type:function size:0x1B
AddString__18CTextExecuteBufferFPCwi = .text:0x80302550; // type:function size:0x170 scope:global
AddStringFragment__18CTextExecuteBufferFPCwi = .text:0x803026C0; // type:function size:0x80 scope:global
WrapOneLTR__18CTextExecuteBufferFPCwi = .text:0x80302740; // type:function size:0x2C8 scope:global
fn_80302928 = .text:0x80302A08; // type:function size:0xC4 scope:global
push_front__Q24rstl66list<Q24rstl24ncrc_ptr<12CInstruction>,Q24rstl17rmemory_allocator>FRCQ24rstl24ncrc_ptr<12CInstruction> = .text:0x80302A08; // type:function size:0xC4 scope:global
MoveWordLTR__18CTextExecuteBufferFv = .text:0x80302ACC; // type:function size:0x1E0 scope:global
fn_80302BCC = .text:0x80302CAC; // type:function size:0xAC scope:global
StartNewLine__18CTextExecuteBufferFv = .text:0x80302D58; // type:function size:0x144 scope:global
Expand All @@ -13321,7 +13321,7 @@ __ct__18CTextExecuteBufferFv = .text:0x80303E58; // type:function size:0x8C scop
fn_80303E04 = .text:0x80303EE4; // type:function size:0x44 scope:global
fn_80303E48 = .text:0x80303F28; // type:function size:0x2C scope:global
fn_80303E74 = .text:0x80303F54; // type:function size:0x154 scope:global
fn_80303FC8 = .text:0x803040A8; // type:function size:0x9C scope:global
do_erase__Q24rstl66list<Q24rstl24ncrc_ptr<12CInstruction>,Q24rstl17rmemory_allocator>FPQ34rstl66list<Q24rstl24ncrc_ptr<12CInstruction>,Q24rstl17rmemory_allocator>4node = .text:0x803040A8; // type:function size:0x9C scope:global
__dt__16CTextInstructionFv = .text:0x80304144; // type:function size:0x5C scope:weak
__ct__16CTextInstructionFPCwi = .text:0x803041A0; // type:function size:0xD4 scope:global
Invoke__16CTextInstructionCFR16CFontRenderStateP17CTextRenderBuffer = .text:0x80304274; // type:function size:0x100 scope:global
Expand Down
7 changes: 7 additions & 0 deletions include/Kyoto/Text/CLineInstruction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class CLineInstruction : public CInstruction {
int GetX() const { return mCurX; }
int GetY() const { return mCurY; }

EJustification GetJustification() const { return mJustification; }
void SetJustification(const EJustification justification) { mJustification = justification; }
EVerticalJustification GetVerticalJustification() const { return mVerticalJustification; }
void SetVerticalJustification(const EVerticalJustification justification) {
mVerticalJustification = justification;
}

private:
int mWordCount;
int mCurX;
Expand Down
3 changes: 3 additions & 0 deletions include/Kyoto/Text/CSaveableState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class CSaveableState {
int GetLineExtraSpacing() const { return x78_extraLineSpacing; }
void SetLineExtraSpace(int spacing) { x78_extraLineSpacing = spacing; }

EJustification GetJustification() const { return x80_just; }
EVerticalJustification GetVerticalJustification() const { return x84_vjust; }

// private:
CDrawStringOptions x0_drawStringOptions;
rstl::optional_object< TToken< CRasterFont > > x48_font;
Expand Down
23 changes: 21 additions & 2 deletions include/Kyoto/Text/CTextExecuteBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ class CBlockInstruction;
class CLineInstruction;
class CFontImageDef;

namespace rstl {
template < typename T, typename _Container = list< T > >
class stack {
public:
typename _Container::iterator top() { return container.begin(); }
typename _Container::const_iterator top() const { return container.begin(); }

void pop() { return container.pop_front(); }

void push(const T& item) { container.push_front(item); }

void clear() { container.clear(); }

private:
_Container container;
};
} // namespace rstl
class CTextExecuteBuffer {
typedef rstl::list< rstl::ncrc_ptr< CInstruction > > InstList;

Expand All @@ -31,6 +48,8 @@ class CTextExecuteBuffer {
void AddColorOverride(int idx, const CTextColor& color);
void AddString(const wchar_t* str, const int len);

void Clear();

private:
InstList x0_instructions;
CSaveableState x18_;
Expand All @@ -42,8 +61,8 @@ class CTextExecuteBuffer {
int xb4_curWordX;
int xb8_curWordY;
int xbc_spaceDistance;
bool xc0_imageBaseline;
rstl::list< CSaveableState > xc4_stateStack;
char xc0_imageBaseline;
rstl::stack< CSaveableState > xc4_stateStack;
};

#endif // _CTEXTEXECUTEBUFFER
2 changes: 1 addition & 1 deletion include/rstl/list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class list {
node* n;
x0_allocator.allocate(n, 1);
new (n) node(prev, next);
new(n->get_value()) T(val);
new (n->get_value()) T(val);
return n;
}

Expand Down
45 changes: 45 additions & 0 deletions src/Kyoto/Text/CTextExecuteBuffer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include "Kyoto/Text/CTextExecuteBuffer.hpp"

#include "Kyoto/Text/CLineInstruction.hpp"
#include "Kyoto/Text/CPopStateInstruction.hpp"
#include "Kyoto/Text/CPushStateInstruction.hpp"

CTextExecuteBuffer::CTextExecuteBuffer()
: xa0_curBlock(nullptr)
, xa4_curLine(nullptr)
, xa8_curWordIt(x0_instructions.end())
// , xac_curY(0)
// , xb0_curX(0)
, xb4_curWordX(0)
, xb8_curWordY(0)
, xbc_spaceDistance(0)
, xc0_imageBaseline(0) {}

void CTextExecuteBuffer::Clear() {
x0_instructions.clear();
x18_ = CSaveableState();
xa0_curBlock = nullptr;
xa4_curLine = nullptr;
xa8_curWordIt = x0_instructions.end();
xb4_curWordX = 0;
xb8_curWordY = 0;
xbc_spaceDistance = 0;
}

void CTextExecuteBuffer::AddPushState() {
const rstl::ncrc_ptr< CInstruction > newInst = rs_new CPushStateInstruction();
x0_instructions.push_front(newInst);
xc4_stateStack.push(x18_);
}

void CTextExecuteBuffer::AddPopState() {
const rstl::ncrc_ptr< CInstruction > newInst = rs_new CPopStateInstruction();
x0_instructions.push_front(newInst);
x18_ = *xc4_stateStack.top();
xc4_stateStack.pop();

if (xa4_curLine->GetX() == 0) {
xa4_curLine->SetJustification(x18_.GetJustification());
xa4_curLine->SetVerticalJustification(x18_.GetVerticalJustification());
}
}
Loading