From 2892dd467a0e21827411d7966ebf9f1c377f55e2 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 5 Apr 2025 18:19:37 +0200 Subject: [PATCH] Progress --- config/SOUE01/symbols.txt | 24 ++--- configure.py | 1 + include/d/d_message.h | 4 +- include/d/d_tag_processor.h | 41 +++++--- include/d/d_textunk.h | 24 +++++ include/d/d_textwindow_unk.h | 51 +++++++--- include/d/lyt/msg_window/d_lyt_msg_window.h | 3 + .../lyt/msg_window/d_lyt_msg_window_common.h | 2 + include/toBeSorted/lyt_related_floats.h | 11 +++ include/toBeSorted/other_sound_stuff.h | 9 ++ src/d/d_tag_processor.cpp | 82 ++++++++-------- src/d/d_textwindow_unk.cpp | 97 +++++++++++++++++++ src/d/lyt/d_textbox.cpp | 6 +- src/d/lyt/msg_window/d_lyt_msg_window.cpp | 8 +- .../lyt/msg_window/d_lyt_msg_window_sword.cpp | 21 ++-- 15 files changed, 282 insertions(+), 102 deletions(-) create mode 100644 include/toBeSorted/lyt_related_floats.h create mode 100644 include/toBeSorted/other_sound_stuff.h create mode 100644 src/d/d_textwindow_unk.cpp diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index bc9f48a8..72e238f4 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -3891,20 +3891,20 @@ __ct__13TextWindowUnkFP15dTagProcessor_c = .text:0x800B20E0; // type:function si fn_800B2130__13TextWindowUnkFPCcP10dTextBox_cPvb = .text:0x800B2130; // type:function size:0x370 textAdvancingRelated__13TextWindowUnkFbb = .text:0x800B24A0; // type:function size:0x5FC fn_800B2AA0__13TextWindowUnkFv = .text:0x800B2AA0; // type:function size:0x80 -somethingWithTextboxEndState = .text:0x800B2B20; // type:function size:0x48 +checkLastLineReached__13TextWindowUnkFv = .text:0x800B2B20; // type:function size:0x48 checkEndReached__13TextWindowUnkCFv = .text:0x800B2B70; // type:function size:0x1C -checkLastLineReachedMaybe__13TextWindowUnkCFv = .text:0x800B2B90; // type:function size:0xD8 +reset__13TextWindowUnkFv = .text:0x800B2B90; // type:function size:0xD8 fn_800B2C70 = .text:0x800B2C70; // type:function size:0x340 fn_800B2FB0 = .text:0x800B2FB0; // type:function size:0x324 build__20MsgWindowBlurRelatedFv = .text:0x800B32E0; // type:function size:0x84 -drawTextBlur__20MsgWindowBlurRelatedFP13dLytTextLightQ34nw4r4math4VEC2Uc = .text:0x800B3370; // type:function size:0x138 -fn_800B34B0 = .text:0x800B34B0; // type:function size:0x40 +drawTextBlur__20MsgWindowBlurRelatedFP13dLytTextLight8LytVec2fUc = .text:0x800B3370; // type:function size:0x138 +__dt__13TextWindowUnkFv = .text:0x800B34B0; // type:function size:0x40 fn_800B34F0 = .text:0x800B34F0; // type:function size:0xD0 __ct__15dTagProcessor_cFv = .text:0x800B35C0; // type:function size:0x260 __dt__15dTagProcessor_cFv = .text:0x800B3820; // type:function size:0x58 format__15dTagProcessor_cFP10dTextBox_cPCwPwUlPUlPve = .text:0x800B3880; // type:function size:0x8C formatV__15dTagProcessor_cFP10dTextBox_cPCwPwUlPUlPvP16__va_list_struct = .text:0x800B3910; // type:function size:0x980 -fn_800B4290 = .text:0x800B4290; // type:function size:0x5AC +fn_800B4290__15dTagProcessor_cFP10dTextBox_cPCwPwlPUsP21dLytMsgWindowCharData = .text:0x800B4290; // type:function size:0x5AC Process__15dTagProcessor_cFUsPQ34nw4r2ut15PrintContext = .text:0x800B4840; // type:function size:0x10 CalcRect__15dTagProcessor_cFPQ34nw4r2ut4RectUsPQ34nw4r2ut15PrintContext = .text:0x800B4850; // type:function size:0x4 ProcessTags__15dTagProcessor_cFPQ34nw4r2ut4RectUsPQ34nw4r2ut15PrintContext = .text:0x800B4860; // type:function size:0x78C @@ -3955,8 +3955,8 @@ process0xFCommand__15dTagProcessor_cFwPCwPl = .text:0x800B88D0; // type:function tick0x830__15dTagProcessor_cFv = .text:0x800B88E0; // type:function size:0x30 resetSomething__15dTagProcessor_cFv = .text:0x800B8910; // type:function size:0x1C tickPauseFrame__15dTagProcessor_cFv = .text:0x800B8930; // type:function size:0x30 -resetSomeFloats__15dTagProcessor_cFv = .text:0x800B8960; // type:function size:0xD8 -getFloat__15dTagProcessor_cFl = .text:0x800B8A40; // type:function size:0x10 +resetLineData__15dTagProcessor_cFv = .text:0x800B8960; // type:function size:0xD8 +getLineWidth__15dTagProcessor_cFl = .text:0x800B8A40; // type:function size:0x10 setNumericArg0__15dTagProcessor_cFl = .text:0x800B8A50; // type:function size:0xC setNumericArgs__15dTagProcessor_cFPCll = .text:0x800B8A60; // type:function size:0xDC fn_800B8B40 = .text:0x800B8B40; // type:function size:0x4C @@ -6828,7 +6828,7 @@ isOutputtingText__15dLytMsgWindow_cCFv = .text:0x801172C0; // type:function size fn_80117310 = .text:0x80117310; // type:function size:0x4C fn_80117360 = .text:0x80117360; // type:function size:0x14 fn_80117380 = .text:0x80117380; // type:function size:0xC -fn_80117390 = .text:0x80117390; // type:function size:0x54 +fn_80117390__15dLytMsgWindow_cCFb = .text:0x80117390; // type:function size:0x54 setCurrentEntrypointName__15dLytMsgWindow_cFPCc = .text:0x801173F0; // type:function size:0xB4 setCurrentFlowFilename__15dLytMsgWindow_cFPCc = .text:0x801174B0; // type:function size:0xB4 LytMsgWindow__setNumericArg0 = .text:0x80117570; // type:function size:0x8 @@ -7129,8 +7129,8 @@ draw__13dLytTextSwordFPCwScRC7mVec3_cf = .text:0x80120C60; // type:function size fn_80120DB0__13dLytTextSwordCFv = .text:0x80120DB0; // type:function size:0xC build__13dLytTextLightFPQ23d2d10ResAccIf_cQ213dLytTextLight9ETextType = .text:0x80120DC0; // type:function size:0x104 remove__13dLytTextLightFv = .text:0x80120ED0; // type:function size:0x28 -fn_80120F00 = .text:0x80120F00; // type:function size:0x14C -fn_80121050 = .text:0x80121050; // type:function size:0xC +draw2__13dLytTextLightFScRC7mVec3_cUcf = .text:0x80120F00; // type:function size:0x14C +fn_80121050__13dLytTextLightCFv = .text:0x80121050; // type:function size:0xC vt_0x40__20dLytMsgWindowSubtypeCFv = .text:0x80121060; // type:function size:0x8 LytMsgWindowTalk__initialize = .text:0x80121070; // type:function size:0x2F8 fn_80121370 = .text:0x80121370; // type:function size:0xE0 @@ -10928,7 +10928,7 @@ getMsbtNumberByIndex__10dMessage_cFl = .text:0x801B29A0; // type:function size:0 getMsbfNumberByIndex__10dMessage_cFl = .text:0x801B29D0; // type:function size:0x24 fn_801B2A00 = .text:0x801B2A00; // type:function size:0x14 getTextIndexForLabel__10dMessage_cFPCc = .text:0x801B2A20; // type:function size:0x4C -fn_801B2A70 = .text:0x801B2A70; // type:function size:0xC +getMsbtIndexForLabel__10dMessage_cFPCc = .text:0x801B2A70; // type:function size:0xC getMsbtIndexForLabelInternal__10dMessage_cFPCc = .text:0x801B2A80; // type:function size:0xA4 getMsbtInfoForIndex__10dMessage_cFl = .text:0x801B2B30; // type:function size:0xC getMsbtInfoForIndexInternal__10dMessage_cFl = .text:0x801B2B40; // type:function size:0x38 @@ -31002,7 +31002,7 @@ __vt__10dTextBox_c = .data:0x80510798; // type:object size:0x84 __vt__9dWindow_c = .data:0x80510820; // type:object size:0x8C scope:weak __vt__Q23d2d10ResAccIf_c = .data:0x805108B0; // type:object size:0x18 __vt__12UnkTextThing = .data:0x805108C8; // type:object size:0xC scope:weak -lbl_805108D8 = .data:0x805108D8; // type:object size:0x10 +__vt__13TextWindowUnk = .data:0x805108D8; // type:object size:0x10 lbl_805108E8 = .data:0x805108E8; // type:object size:0x10 lbl_805108F8 = .data:0x805108F8; // type:object size:0x14 data:string jumptable_8051090C = .data:0x8051090C; // type:object size:0x80 scope:local diff --git a/configure.py b/configure.py index 0ae0a939..6d342258 100644 --- a/configure.py +++ b/configure.py @@ -382,6 +382,7 @@ config.libs = [ Object(NonMatching, "d/lyt/d_textbox.cpp"), Object(Matching, "d/lyt/d_window.cpp"), Object(Matching, "d/d_textunk.cpp"), + Object(NonMatching, "d/d_textwindow_unk.cpp"), Object(NonMatching, "d/d_tag_processor.cpp"), Object(NonMatching, "d/lyt/meter/d_lyt_meter.cpp"), Object(NonMatching, "d/lyt/meter/d_lyt_meter_unk.cpp"), diff --git a/include/d/d_message.h b/include/d/d_message.h index 527ab61c..eaab2918 100644 --- a/include/d/d_message.h +++ b/include/d/d_message.h @@ -47,6 +47,9 @@ public: static bool isValidTextLabel(const char *name); static void loadTextByLabel(const char *label, dTagProcessor_c *tagProcessor, bool, u32, u32); + static s32 getMsbtIndexForLabel(const char *name); + static const char *getMsbtFileName(s32 index); + static const wchar_t *getTextMessageByLabel(const char *label, bool global, wchar_t *dstBuf, u32 maxLen); static const wchar_t * getTextMessageByLabel(const char *label, dTagProcessor_c *pTagProcessor, bool global, wchar_t *dstBuf, u32 maxLen); @@ -65,7 +68,6 @@ private: bool checkIsValidTextLabel(const char *name); static void setZevFromMsbArc(); - static const char *getMsbtFileName(s32 index); static s32 getMsbtNumberByIndex(s32 index); static const char *getMsbfFileName(s32 index); static s32 getMsbfNumberByIndex(s32 index); diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index eea3e08f..f4195865 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -5,6 +5,13 @@ #include "nw4r/ut/ut_TagProcessorBase.h" #include "nw4r/ut/ut_TextWriterBase.h" +struct dLytMsgWindowCharData; + +struct LineData { + f32 mLineWidths[0x32]; + u32 mNumLines; +}; + // inofficial name // size: 0xEF4 class dTagProcessor_c : public nw4r::ut::TagProcessorBase { @@ -12,8 +19,7 @@ public: dTagProcessor_c(); virtual ~dTagProcessor_c(); - void - format(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen, void *unk, ...); + void format(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen, void *unk, ...); void formatV(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen, void *unk, va_list list); @@ -62,11 +68,14 @@ public: char fn_800B7880(u32); void fn_800B70D0(nw4r::ut::TextWriterBase *, nw4r::ut::PrintContext *ctx, u16 c, s32); + void + fn_800B4290(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, s32, u16 *, dLytMsgWindowCharData *charData); + void resetSomething(); - void resetSomeFloats(); + void resetLineData(); void setNumericArg0(s32 arg); void setNumericArgs(const s32 *args, s32 numArgs); - f32 getFloat(s32 i); + f32 getLineWidth(s32 i); s32 tickPauseFrame(); s32 tick0x830(); void execute(); @@ -76,11 +85,11 @@ public: } s32 getNumLinesMaybe() const { - return mCommandInsert; + return mLineData.mNumLines; } u8 getMsgWindowSubtype() const { - return field_0x90C; + return mMsgWindowSubtype; } u8 getField_0x90D() const { @@ -91,6 +100,10 @@ public: return field_0x90E; } + s32 getField_0x824() const { + return field_0x824; + } + s32 getField_0x828() const { return field_0x828; } @@ -104,7 +117,7 @@ public: } void setMsgWindowSubtype(u8 type) { - field_0x90C = type; + mMsgWindowSubtype = type; } void setField_0x828(s32 val) { @@ -115,7 +128,6 @@ public: field_0x82C = val; } - void setField_0x90D(u8 val) { field_0x90D = val; } @@ -124,6 +136,10 @@ public: field_0x90E = val; } + void setField_0xEE0(u8 val) { + field_0xEE0 = val; + } + void setField_0xEE1(u8 val) { field_0xEE1 = val; } @@ -140,6 +156,10 @@ public: return field_0x008[idx]; } + LineData getLineData() const { + return mLineData; + } + private: /* 0x004 */ dTextBox_c *field_0x004; /* 0x008 */ wchar_t field_0x008[4][256]; @@ -189,12 +209,11 @@ private: /* 0x900 */ s32 field_0x900; /* 0x904 */ f32 field_0x904; /* 0x908 */ f32 field_0x908; - /* 0x90C */ u8 field_0x90C; + /* 0x90C */ u8 mMsgWindowSubtype; /* 0x90D */ u8 field_0x90D; /* 0x90E */ u8 field_0x90E; /* 0x90F */ u8 field_0x90F[4]; - /* 0x914 */ f32 field_0x914[0x32]; // Maybe width for each individual line - /* 0x9DC */ s32 mCommandInsert; // Maybe number of lines + /* 0x914 */ LineData mLineData; /* 0x9E0 */ wchar_t mStringArgs[8][64]; /* 0xDE0 */ u8 field_0xDE0[0xEE0 - 0xDE0]; /* 0xEE0 */ u8 field_0xEE0; diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h index d3f7240e..bc820fd7 100644 --- a/include/d/d_textunk.h +++ b/include/d/d_textunk.h @@ -137,6 +137,30 @@ public: return field_buf2[index]; } + const char *getStr1() const { + return field_0x004; + } + + const char *getStr2() const { + return field_0x084; + } + + const char *getStr3() const { + return field_0x104; + } + + void setStr1(const char *s) { + field_0x004 = s; + } + + void setStr2(const char *s) { + field_0x084 = s; + } + + void setStr3(const char *s) { + field_0x104 = s; + } + private: static UnkTextThing *sInstance; diff --git a/include/d/d_textwindow_unk.h b/include/d/d_textwindow_unk.h index 0eb68014..f7143fb4 100644 --- a/include/d/d_textwindow_unk.h +++ b/include/d/d_textwindow_unk.h @@ -4,8 +4,27 @@ #include "d/d_tag_processor.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "sized_string.h" #include "toBeSorted/lyt_vec2f.h" +struct dLytMsgWindowCharData { + /* 0x00 */ f32 posX; + /* 0x04 */ f32 posY; + /* 0x08 */ f32 field_0x08; + /* 0x0C */ s16 field_0x0C; + /* 0x0E */ wchar_t character; + /* 0x10 */ s8 displayTimerMaybe; + + void reset() { + posX = 0.0f; + posY = 0.0f; + field_0x08 = dTagProcessor_c::fn_800B8040(0, 0); + character = L'\0'; + field_0x0C = 1023; + displayTimerMaybe = -1; + } +}; + // Size 0x1554 // Probably responsible for emitting characters // one by one in the text boxes @@ -14,7 +33,7 @@ public: TextWindowUnk(dTagProcessor_c *tagProcessor); virtual ~TextWindowUnk() {} - void fn_800B2130(const char *, dTextBox_c *, void *, bool); + bool fn_800B2130(const char *, dTextBox_c *, dLytMsgWindowCharData *data, bool); void fn_800B2AA0(); void textAdvancingRelated(bool, bool); @@ -31,26 +50,29 @@ public: } bool checkEndReached() const; - bool checkLastLineReachedMaybe() const; + bool checkLastLineReached(); + bool reset(); private: /* 0x0004 */ dTagProcessor_c *mpTagProcessor; /* 0x0008 */ wchar_t mRawTextBuffer[1023]; /* 0x0806 */ wchar_t mProcessedTextBuffer[1023]; - /* 0x1004 */ wchar_t mUnkBuffer[571]; // ??? + /* 0x1004 */ wchar_t mUnkBuffer[511]; // ??? + /* 0x1402 */ SizedString<64> field_0x1402; + /* 0x1442 */ u8 _0x1442[0x144C - 0x1442]; + + /* 0x144C */ s32 mRawTextPos; + /* 0x1450 */ s32 mRawTextEndPos; + /* 0x1454 */ s32 mCurrentLine; + /* 0x1458 */ s32 field_0x1458; + /* 0x145C */ u8 _0x145C[0x1478 - 0x145C]; + /* 0x1478 */ u16 field_0x1478; /* 0x147A */ u16 field_0x147A; /* 0x147C */ u16 field_0x147C; - /* 0x147E */ u8 _0x147E[0x1550 - 0x147E]; - /* 0x1550 */ void *field_0x1550; -}; - -struct dLytMsgWindowCharData { - /* 0x00 */ f32 posX; - /* 0x04 */ f32 posY; - /* 0x08 */ f32 field_0x08; - /* 0x0C */ s16 field_0x0C; - /* 0x0E */ wchar_t character; - /* 0x10 */ s8 displayTimerMaybe; + /* 0x147E */ u8 _0x147E[0x1480 - 0x147E]; + /* 0x1480 */ dTextBox_c *mpTextBox; + /* 0x1484 */ LineData mLineWidths; + /* 0x1550 */ dLytMsgWindowCharData *mpCharacterData; }; class MsgWindowBlurRelated { @@ -61,6 +83,7 @@ public: void build(); void remove(); void drawTextBlur(dLytTextLight *thing, LytVec2f size, u8 alpha); + void reset(); dLytMsgWindowCharData *getCharData() { return mData; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h index b3130433..ad6be3c2 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -10,6 +10,7 @@ #include "s/s_State.hpp" #include "sized_string.h" +// Forward declarations required for vtable order class dLytMsgWindowTalk_c; class dLytMsgWindowLink_c; class dLytMsgWindowGet_c; @@ -47,6 +48,8 @@ public: return mNameCopy; } + const char *fn_80117390(bool) const; + private: bool setTextToDisplay(const wchar_t *text); void createSubMsgManager(u8 type); diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index 7c04d57b..ce24b9eb 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -75,7 +75,9 @@ public: bool build(d2d::ResAccIf_c *pResAcc, ETextType type); bool remove(); void draw(const wchar_t *str, s8, const mVec3_c &, f32); + void draw2(s8, const mVec3_c &, u8, f32); f32 fn_80120DB0() const; + f32 fn_80121050() const; private: /* 0x04 */ d2d::LytBase_c mLyt; diff --git a/include/toBeSorted/lyt_related_floats.h b/include/toBeSorted/lyt_related_floats.h new file mode 100644 index 00000000..17f92f6a --- /dev/null +++ b/include/toBeSorted/lyt_related_floats.h @@ -0,0 +1,11 @@ +#ifndef LYT_RELATED_FLOATS_H +#define LYT_RELATED_FLOATS_H + +#include "common.h" + +extern "C" f32 lbl_805751A4; +inline f32 get_805751A4() { + return lbl_805751A4; +} + +#endif diff --git a/include/toBeSorted/other_sound_stuff.h b/include/toBeSorted/other_sound_stuff.h new file mode 100644 index 00000000..de8d083e --- /dev/null +++ b/include/toBeSorted/other_sound_stuff.h @@ -0,0 +1,9 @@ +#ifndef OTHER_SOUND_STUFF_H +#define OTHER_SOUND_STUFF_H + +#include "common.h" + +extern "C" void *lbl_80575DE0; +extern "C" void fn_803996B0(void *, const char *msgLabelName, u16, s32); + +#endif diff --git a/src/d/d_tag_processor.cpp b/src/d/d_tag_processor.cpp index 10a769fb..af13af38 100644 --- a/src/d/d_tag_processor.cpp +++ b/src/d/d_tag_processor.cpp @@ -164,7 +164,7 @@ dTagProcessor_c::dTagProcessor_c() { field_0x890 = 0; field_0x8FC = -1; field_0x900 = -1; - resetSomeFloats(); + resetLineData(); field_0x81C = 0; field_0x820 = 0; setNumericArg0(0); @@ -200,7 +200,7 @@ dTagProcessor_c::dTagProcessor_c() { field_0xEE3 = 0; field_0xEE4 = 0; field_0x004 = nullptr; - field_0x90C = 0x24; + mMsgWindowSubtype = 0x24; field_0x90D = 4; field_0xEF0 = 0; field_0xEF1 = 0; @@ -232,11 +232,11 @@ void dTagProcessor_c::formatV( // FPR regswap between float1 and float2 f32 float1, float2; - float2 = float1 = fn_800B8040(0, field_0x90C); + float2 = float1 = fn_800B8040(0, mMsgWindowSubtype); if (textBox != nullptr) { float1 *= textBox->getMyScale(); - resetSomeFloats(); + resetLineData(); textBox->set0x1F8(0); } @@ -250,7 +250,7 @@ void dTagProcessor_c::formatV( dest[1] = x.us[1]; dest[2] = x.us[2]; dest[3] = x.us[3]; - dest[4] = mCommandInsert; + dest[4] = mLineData.mNumLines; } StackThing yTmp; @@ -260,7 +260,7 @@ void dTagProcessor_c::formatV( wchar_t c = *src; if (c == nullptr) { if (textBox != nullptr) { - mCommandInsert++; + mLineData.mNumLines++; } *writePtr = '\0'; goto end; @@ -353,7 +353,7 @@ void dTagProcessor_c::formatV( } break; case 0x10008: if (textBox != nullptr) { - float1 = fn_800B8040(((u8 *)endPtr)[0], field_0x90C); + float1 = fn_800B8040(((u8 *)endPtr)[0], mMsgWindowSubtype); float1 *= textBox->getMyScale(); } writePtr = writeTextNormal(src, writePtr, &local_b4, cmdLen, state4); @@ -420,10 +420,10 @@ void dTagProcessor_c::formatV( *writePtr = c; src++; writePtr++; - mCommandInsert++; - s32 i10 = getMaxNumLines(field_0x90C); - if (mCommandInsert % i10 == 0) { - float1 = fn_800B8040(0, field_0x90C); + mLineData.mNumLines++; + s32 i10 = getMaxNumLines(mMsgWindowSubtype); + if (mLineData.mNumLines % i10 == 0) { + float1 = fn_800B8040(0, mMsgWindowSubtype); float1 *= textBox->getMyScale(); } if (textBox != nullptr) { @@ -432,12 +432,13 @@ void dTagProcessor_c::formatV( writePtr[1] = buf[1]; writePtr[2] = buf[2]; writePtr[3] = buf[3]; - writePtr[4] = mCommandInsert; + writePtr[4] = mLineData.mNumLines; writePtr += 5; } } else { const nw4r::ut::Font *fnt = textBox->GetFont(); - field_0x914[mCommandInsert] += float1 * fnt->GetCharWidth(*src) + textBox->GetCharSpace(); + mLineData.mLineWidths[mLineData.mNumLines] += + float1 * fnt->GetCharWidth(*src) + textBox->GetCharSpace(); writePtr = fn_800B5FD0(*src, writePtr, nullptr); src++; } @@ -633,16 +634,16 @@ nw4r::ut::Operation dTagProcessor_c::ProcessTags(nw4r::ut::Rect *rect, u16 ch, n } void dTagProcessor_c::fn_800B4FF0(nw4r::ut::Rect *rect, nw4r::ut::PrintContext *ctx, u8 cmdLen, wchar_t *ptr) { - if (field_0x90C != 22 && field_0x90C != 30 && field_0xEE0 != 0) { + if (mMsgWindowSubtype != 22 && mMsgWindowSubtype != 30 && field_0xEE0 != 0) { int arg = ptr[0]; nw4r::lyt::Size textBoxSize = field_0x004->GetSize(); nw4r::lyt::Size fontSize = field_0x004->GetFontSize(); - int i1 = getMaxNumLines(field_0x90C); - if (arg % i1 == 0 && field_0x90C != 31 && field_0x90C != 8) { + int i1 = getMaxNumLines(mMsgWindowSubtype); + if (arg % i1 == 0 && mMsgWindowSubtype != 31 && mMsgWindowSubtype != 8) { int u = 0; int v = 0; - for (int i = arg; i < arg + getMaxNumLines(field_0x90C) && i < 0x32; i++) { - f32 f6 = getFloat(i); + for (int i = arg; i < arg + getMaxNumLines(mMsgWindowSubtype) && i < 0x32; i++) { + f32 f6 = getLineWidth(i); if (f6 > 0.0f) { v++; if (u != 0) { @@ -659,7 +660,7 @@ void dTagProcessor_c::fn_800B4FF0(nw4r::ut::Rect *rect, nw4r::ut::PrintContext