Match most of d_msg_string_base (#2021)

This commit is contained in:
hatal175
2024-01-03 05:37:15 +02:00
committed by GitHub
parent be10df4760
commit d5d59471ea
17 changed files with 218 additions and 541 deletions
+3
View File
@@ -123,6 +123,9 @@ public:
return (J2DTextBoxHBinding)((mFlags >> 2) & 3);
}
JUtility::TColor getCharColor() { return mCharColor; }
JUtility::TColor getGradColor() { return mGradientColor; }
// private:
/* 0x0100 */ JUTFont* mFont;
/* 0x0104 */ JUtility::TColor mCharColor;
+29 -6
View File
@@ -2,6 +2,7 @@
#define LINKLIST_H
#include "dolphin/types.h"
#include "JSystem/JUtility/JUTAssert.h"
namespace JGadget {
struct TLinkListNode {
@@ -24,6 +25,7 @@ struct TNodeLinkList {
node = node->getNext();
return *this;
}
TLinkListNode* operator->() { return node; }
TLinkListNode* node;
};
@@ -55,8 +57,13 @@ struct TNodeLinkList {
}
iterator begin() {
iterator iter(ocObject_.mNext);
return iter;
return iterator(ocObject_.getNext());
}
u32 size() { return count; }
bool empty() { return size() == 0; }
iterator pop_front() {
return erase(begin());
}
/* 802DCA1C */ ~TNodeLinkList();
@@ -78,6 +85,12 @@ struct TLinkList : public TNodeLinkList {
struct iterator : TNodeLinkList::iterator {
iterator(TNodeLinkList::iterator iter) : TNodeLinkList::iterator(iter) {}
T& operator*() { return *operator->(); }
T* operator->() {
TLinkListNode* node = TNodeLinkList::iterator::operator->();
JUT_ASSERT(541, node != 0);
return Element_toValue(node);
}
};
struct const_iterator : TNodeLinkList::const_iterator {
@@ -86,7 +99,7 @@ struct TLinkList : public TNodeLinkList {
const T* operator->() const {
return Element_toValue(TNodeLinkList::const_iterator::operator->());
}
const T& operator*() const { return *operator->();}
const T& operator*() const { return *operator->(); }
const_iterator& operator++() {
TNodeLinkList::const_iterator::operator++();
return *this;
@@ -117,9 +130,7 @@ struct TLinkList : public TNodeLinkList {
}
TLinkList::iterator begin() {
TNodeLinkList::iterator node_iter = TNodeLinkList::begin();
TLinkList::iterator iter(node_iter);
return iter;
return iterator(TNodeLinkList::begin());
}
TLinkList::const_iterator begin() const {
@@ -130,6 +141,11 @@ struct TLinkList : public TNodeLinkList {
TLinkList::iterator iter(TLinkList::end());
this->Insert(iter, element);
}
T& front() {
JUT_ASSERT(642, !empty());
return *begin();
}
};
template<typename T, int I>
@@ -147,6 +163,13 @@ struct TLinkList_factory : public TLinkList<T, I> {
virtual ~TLinkList_factory() {}
virtual T* Do_create() = 0;
virtual void Do_destroy(T*) = 0;
void Clear_destroy() {
while (!empty()) {
T* item = &front();
pop_front();
Do_destroy(item);
}
}
};
template <typename T, int I>
+13
View File
@@ -39,6 +39,19 @@ struct TControl {
const char* getMessageText_begin() const { return pMessageText_begin_; }
void* getMessageEntry() const { return pEntry_; }
void setSequenceProcessor(TSequenceProcessor* processor) { pSequenceProcessor_ = processor; }
void setRenderingProcessor(TRenderingProcessor* processor) { pRenderingProcessor_ = processor; }
void resetResourceCache() {
if (pSequenceProcessor_ != NULL) {
pSequenceProcessor_->resetResourceCache();
}
if (pRenderingProcessor_ != NULL) {
pRenderingProcessor_->resetResourceCache();
}
pResourceCache_ = NULL;
}
/* 0x04 */ TSequenceProcessor* pSequenceProcessor_;
/* 0x08 */ TRenderingProcessor* pRenderingProcessor_;
+4
View File
@@ -25,6 +25,7 @@ struct TReference {
}
TResourceContainer* getResourceContainer() const { return pcResource_; }
void setResourceContainer(TResourceContainer* container) { pcResource_ = container; }
/* 0x4 */ TResourceContainer* pcResource_;
};
@@ -208,6 +209,9 @@ struct TProcessor {
return pReference_->getResourceContainer();
}
void setResourceCache(TResource* cache) { pResourceCache_ = cache; }
void resetResourceCache() { setResourceCache(NULL); }
/* 0x04 */ const TReference* pReference_;
/* 0x08 */ const TResource* pResourceCache_;
/* 0x0C */ const char* pszCurrent_;
+14
View File
@@ -56,6 +56,10 @@ struct TResource {
struct TResource_color {
TResource_color() : field_0x0(NULL), field_0x4(NULL) {}
void reset() {
field_0x0.setRaw(NULL);
field_0x4.setRaw(NULL);
}
/* 0x0 */ data::TParse_THeader field_0x0;
/* 0x4 */ data::TParse_TBlock_color field_0x4;
@@ -83,6 +87,16 @@ struct TResourceContainer {
bool isEncodingSettable(u8 e) const { return mEncodingType == e || mEncodingType == 0; }
const TCResource* getResourceContainer() const { return &resContainer_; }
void destroyResource() {
resContainer_.Clear_destroy();
}
void destroyResource_color() {
resColor_.reset();
}
void destroyResource_all() {
destroyResource();
destroyResource_color();
}
static JMessage::locale::parseCharacter_function sapfnParseCharacter_[5];
+9
View File
@@ -398,9 +398,16 @@ struct jmessage_string_tReference : public JMessage::TReference {
u8 getLineMax() { return mLineMax; }
u8 getNowPage() { return mNowPage; }
JUTFont* getFont() { return mpFont; }
s16 getLineCount() { return mLineCount; }
void setLineCount(s16 lineCount) { mLineCount = lineCount; }
void addLineCount() { mLineCount++; }
u8 isFlag(u8 flag) { return mFlags & flag; }
void setColor(u32 ccColor, u32 gcColor) {
mCCColor = ccColor;
mGCColor = gcColor;
}
void setNowPage(u8 nowPage) { mNowPage = nowPage; }
void setLineMax(u8 lineMax) { mLineMax = lineMax; }
/* 8022F94C */ virtual ~jmessage_string_tReference();
@@ -470,6 +477,8 @@ struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcesso
/* 80230D48 */ virtual void do_character(int);
/* 80231110 */ virtual bool do_tag(u32, void const*, u32);
char* getString() { return field_0x54; }
/* 0x038 */ jmessage_string_tReference* mpReference;
/* 0x03C */ f32 field_0x3c;
/* 0x040 */ f32 field_0x40;
+6 -6
View File
@@ -16,16 +16,16 @@ public:
/* 802493B4 */ dMsgStringBase_c();
/* 80249528 */ ~dMsgStringBase_c();
/* 80249700 */ void getResource();
/* 80249768 */ void getStringLocal(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, u8);
/* 802498D8 */ void getStringPageLocal(u32, u8, u8, J2DTextBox*, J2DTextBox*, JUTFont*,
/* 80249768 */ f32 getStringLocal(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, u8);
/* 802498D8 */ f32 getStringPageLocal(u32, u8, u8, J2DTextBox*, J2DTextBox*, JUTFont*,
COutFont_c*, u8);
/* 80249A48 */ void getPageMax(int);
/* 80249A70 */ void getMessageLocal(u32, char*);
/* 80249A48 */ u8 getPageMax(int);
/* 80249A70 */ f32 getMessageLocal(u32, char*);
/* 80249BB0 */ virtual f32 getString(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, u8);
/* 80249BD0 */ virtual void getStringPage(u32, u8, u8, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*,
/* 80249BD0 */ virtual f32 getStringPage(u32, u8, u8, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*,
u8);
/* 80249BF8 */ virtual void getMessage(u32, char*);
/* 80249BF8 */ virtual f32 getMessage(u32, char*);
/* 80249C18 */ virtual void resetStringLocal(J2DTextBox*);
/* 80249C1C */ virtual void drawOutFontLocal(J2DTextBox*, f32);
/* 80249BAC */ virtual void drawFontLocal(J2DTextBox*, u8, f32, f32, f32, f32, u32, u8);