diff options
| author | hatal175 <hatal175@users.noreply.github.com> | 2023-10-01 00:24:19 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-30 14:24:19 -0700 |
| commit | 02e093fc7600761587028ac9e0e2bde43e9cacca (patch) | |
| tree | 3bb6a41f67278c98b6434f966f7aa691efbfe418 /include/JSystem/JMessage | |
| parent | 9fb99d923c50a8aca28493419143b2a34c6f0121 (diff) | |
JMessage work (#1951)
Diffstat (limited to 'include/JSystem/JMessage')
| -rw-r--r-- | include/JSystem/JMessage/data.h | 4 | ||||
| -rw-r--r-- | include/JSystem/JMessage/processor.h | 10 | ||||
| -rw-r--r-- | include/JSystem/JMessage/resource.h | 9 |
3 files changed, 17 insertions, 6 deletions
diff --git a/include/JSystem/JMessage/data.h b/include/JSystem/JMessage/data.h index 1b47416883..ab1532b8ef 100644 --- a/include/JSystem/JMessage/data.h +++ b/include/JSystem/JMessage/data.h @@ -43,8 +43,8 @@ struct data { TParse_TBlock_color(const void* data) : TParse_TBlock(data) {} }; - static u16 getTagCode(u32 tag) { return tag & 0xFFFF; } - static u8 getTagGroup(u32 tag) { return (tag >> 0x10) & 0xFF; } + static u32 getTagCode(u32 tag) { return tag & 0xFFFF; } + static u32 getTagGroup(u32 tag) { return (tag >> 0x10) & 0xFF; } static u32 ga4cSignature; diff --git a/include/JSystem/JMessage/processor.h b/include/JSystem/JMessage/processor.h index 4b7190ed8c..20678170a4 100644 --- a/include/JSystem/JMessage/processor.h +++ b/include/JSystem/JMessage/processor.h @@ -24,6 +24,8 @@ struct TReference { return pcResource_->getResource_groupID(groupID); } + TResourceContainer* getResourceContainer() const { return pcResource_; } + /* 0x4 */ TResourceContainer* pcResource_; }; @@ -192,6 +194,14 @@ struct TProcessor { return pResourceCache_ != NULL && groupID == pResourceCache_->getGroupID(); } + TResourceContainer* getResourceContainer() const { + if (pReference_ == NULL) { + return NULL; + } + + return pReference_->getResourceContainer(); + } + /* 0x04 */ const TReference* pReference_; /* 0x08 */ const TResource* pResourceCache_; /* 0x0C */ const char* pszCurrent_; diff --git a/include/JSystem/JMessage/resource.h b/include/JSystem/JMessage/resource.h index a2ebe79f38..61c2bb2fad 100644 --- a/include/JSystem/JMessage/resource.h +++ b/include/JSystem/JMessage/resource.h @@ -7,11 +7,11 @@ #include "JSystem/JStudio/JStudio/fvb-data.h" namespace JMessage { -struct TResource : public JGadget::TLinkListNode { +struct TResource { TResource() : field_0x8(NULL), field_0xc(NULL), field_0x10(NULL), field_0x14(0), field_0x18(NULL) {} - /* 802A8CDC */ void toMessageIndex_messageID(u32, u32, bool*) const; + /* 802A8CDC */ u16 toMessageIndex_messageID(u32, u32, bool*) const; bool isContained_messageIndex(u16 messageIndex) const { return messageIndex < getMessageEntryNumber(); @@ -46,7 +46,7 @@ struct TResource : public JGadget::TLinkListNode { void setData_header(const void* pData) { field_0x8.setRaw(pData); } - + JGadget::TLinkListNode ocObject_; /* 0x08 */ data::TParse_THeader field_0x8; /* 0x0C */ data::TParse_TBlock_info field_0xc; /* 0x10 */ char* field_0x10; @@ -81,7 +81,8 @@ struct TResourceContainer { TResource* getResource_groupID(u16 groupID) { return resContainer_.Get_groupID(groupID); } TResource* getResource_groupID(u16 groupID) const { return getResource_groupID(groupID); } - bool isEncodingSettable(u8 e) const { return mEncodingType == e || e == 0; } + bool isEncodingSettable(u8 e) const { return mEncodingType == e || mEncodingType == 0; } + const TCResource* getResourceContainer() const { return &resContainer_; } static JMessage::locale::parseCharacter_function sapfnParseCharacter_[5]; |
