diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-06-18 01:11:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-17 22:11:53 -0700 |
| commit | 23cba4d117cc34f4fafce838eed8cef103fce79c (patch) | |
| tree | 8d1aeb54e8b34697797384b4c980c77d847683a2 /include/JSystem/JStudio | |
| parent | 5a13ca438a89c34d706432792d5257fcb2ad6b83 (diff) | |
getDemoIDData matched, fix up various inlines and template classes (#2489)
* Fix debug build
* getDemoIDData matched, fix up various inlines and template classes
* Remove nonmatching comments
Diffstat (limited to 'include/JSystem/JStudio')
| -rw-r--r-- | include/JSystem/JStudio/JStudio/object-id.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JStudio/JStudio/stb-data-parse.h | 13 | ||||
| -rw-r--r-- | include/JSystem/JStudio/JStudio/stb.h | 45 |
3 files changed, 35 insertions, 25 deletions
diff --git a/include/JSystem/JStudio/JStudio/object-id.h b/include/JSystem/JStudio/JStudio/object-id.h index bd8ebf7234..cd05ef494b 100644 --- a/include/JSystem/JStudio/JStudio/object-id.h +++ b/include/JSystem/JStudio/JStudio/object-id.h @@ -28,7 +28,7 @@ struct TObject_ID : public TIDData { struct TPRObject_ID_equal : public TIDData { TPRObject_ID_equal(const void* id, u32 id_size) : TIDData(id, id_size) {} - TPRObject_ID_equal(const TPRObject_ID_equal& other) : TIDData(other.mID, other.mID_size) {} + ~TPRObject_ID_equal() {} bool operator()(TObject_ID const& id) const { return TIDData::isEqual(id.getIDData(), *this); } }; diff --git a/include/JSystem/JStudio/JStudio/stb-data-parse.h b/include/JSystem/JStudio/JStudio/stb-data-parse.h index f8c5bd470f..57ba3378d8 100644 --- a/include/JSystem/JStudio/JStudio/stb-data-parse.h +++ b/include/JSystem/JStudio/JStudio/stb-data-parse.h @@ -65,16 +65,16 @@ public: /* 80289A08 */ void getData(TData*) const; }; -struct TParse_TParagraph_data : public TParseData_aligned<4> { +struct TParse_TParagraph_data : public TParseData { struct TData { /* 0x00 */ u8 status; - /* 0x04 */ u32 dataSize; - /* 0x08 */ u32 _8; - /* 0x0C */ const void* fileCount; - /* 0x10 */ const void* _10; + /* 0x04 */ u32 entrySize; + /* 0x08 */ u32 entryCount; + /* 0x0C */ const void* content; + /* 0x10 */ const void* next; }; - TParse_TParagraph_data(const void* content) : TParseData_aligned<4>(content) {} + TParse_TParagraph_data(const void* content) : TParseData(content) {} /* 80289A80 */ void getData(TData* pData) const; }; @@ -90,7 +90,6 @@ public: u16 get_flag() const { return get()->flag; } u16 get_IDSize() const { return get()->id_size; } - u32 get_type() const { return get()->type; } const void* get_ID() const { return get()->id; } }; diff --git a/include/JSystem/JStudio/JStudio/stb.h b/include/JSystem/JStudio/JStudio/stb.h index 6582961688..eae49feced 100644 --- a/include/JSystem/JStudio/JStudio/stb.h +++ b/include/JSystem/JStudio/JStudio/stb.h @@ -7,7 +7,7 @@ #include "dolphin/os.h" namespace JStudio { -struct TObject; +class TObject; namespace stb { class TControl; @@ -156,11 +156,10 @@ private: /* 0x54 */ s32 _54; }; -template <int T> +template <int S> struct TParseData : public data::TParse_TParagraph_data::TData { TParseData(const void* pContent) { - data::TParse_TParagraph_data data(pContent); - set(data); + set(data::TParse_TParagraph_data(pContent)); } TParseData() { @@ -171,45 +170,57 @@ struct TParseData : public data::TParse_TParagraph_data::TData { data.getData(this); } + void set(const void* pContent) { + set(data::TParse_TParagraph_data(pContent)); + } + bool isEnd() const { return status == 0; } bool empty() const { - return fileCount == NULL; + return content == NULL; } bool isValid() const { - return !empty() && status == 50; + return !empty() && status == S; } - const void* getContent() const { return fileCount; } + const void* getContent() const { return content; } - u32 size() const { return dataSize; } + u32 size() const { return entryCount; } }; -template <int T, class Iterator=JGadget::binary::TValueIterator_raw<u8> > -struct TParseData_fixed : public TParseData<T> { - TParseData_fixed(const void* pContent) : TParseData<T>(pContent) {} - TParseData_fixed() : TParseData<T>() {} +template <int S, class Iterator=JGadget::binary::TValueIterator_raw<u8> > +struct TParseData_fixed : public TParseData<S> { + TParseData_fixed(const void* pContent) : TParseData<S>(pContent) {} + TParseData_fixed() : TParseData<S>() {} const void* getNext() const { - return _10; + return this->next; } bool isValid() const { - return TParseData::isValid() && getNext() != NULL; + return TParseData<S>::isValid() && getNext() != NULL; } Iterator begin() const { - return Iterator(fileCount); + return Iterator(this->content); } Iterator end() const { - Iterator i(fileCount); - i += size(); + Iterator i(this->content); + i += this->size(); return i; } + + typename Iterator::ValueType front() const { + return *begin(); + } + + typename Iterator::ValueType back() const { + return *--end(); + } }; struct TParseData_string : public TParseData<0x60> { |
