diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/JSystem/JGadget/binary.h | 19 | ||||
| -rw-r--r-- | include/JSystem/JStudio/JStudio/stb.h | 23 | ||||
| -rw-r--r-- | include/d/actor/d_a_title.h | 2 | ||||
| -rw-r--r-- | include/d/d_demo.h | 2 |
4 files changed, 34 insertions, 12 deletions
diff --git a/include/JSystem/JGadget/binary.h b/include/JSystem/JGadget/binary.h index 26d29d1fbf..89df9d4745 100644 --- a/include/JSystem/JGadget/binary.h +++ b/include/JSystem/JGadget/binary.h @@ -62,6 +62,7 @@ struct TParse_header_block { template <typename T> struct TParseValue_raw_ { + typedef T ParseType; static T parse(const void* data) { return *(T*)data; } }; @@ -83,6 +84,24 @@ struct TParseValue : public Parser<T> { } }; +template<class Parser, int size> +struct TValueIterator { + TValueIterator(const void* begin) { + mBegin = begin; + } + + typename Parser::ParseType operator*() { + return *(typename Parser::ParseType*)mBegin; + } + + const void* mBegin; +}; + +template<typename T> +struct TValueIterator_raw : public TValueIterator<TParseValue_raw_<u8>, 1> { + TValueIterator_raw(const void* begin) : TValueIterator<TParseValue_raw_<u8>, 1>(begin) {} +}; + } // namespace binary } // namespace JGadget diff --git a/include/JSystem/JStudio/JStudio/stb.h b/include/JSystem/JStudio/JStudio/stb.h index fe32991cfe..ea299a709c 100644 --- a/include/JSystem/JStudio/JStudio/stb.h +++ b/include/JSystem/JStudio/JStudio/stb.h @@ -157,43 +157,44 @@ private: }; template <int T> -struct TParseData { +struct TParseData : public data::TParse_TParagraph_data::TData { TParseData(const void* pContent) { data::TParse_TParagraph_data data(pContent); set(data); } void set(const data::TParse_TParagraph_data& data) { - //data::TParse_TParagraph_data::TData* p = (data::TParse_TParagraph_data::TData*)this; - data.getData(m_data); + data.getData(this); } bool isEnd() const { - return m_data->_0 == 0; + return _0 == 0; } bool empty() const { - return m_data->_c == NULL; + return _c == NULL; } bool isValid() const { - return !empty() && m_data->_0 == 50; + return !empty() && _0 == 50; } - - data::TParse_TParagraph_data::TData* m_data; }; -template <int T> +template <int T, class Iterator=JGadget::binary::TValueIterator_raw<u8> > struct TParseData_fixed : public TParseData<T> { - TParseData_fixed(const void* pContent) : TParseData(pContent) {} + TParseData_fixed(const void* pContent) : TParseData<T>(pContent) {} const void* getNext() const { - return m_data->_c; + return fileCount; } bool isValid() const { return TParseData::isValid() && getNext() != NULL; } + + Iterator begin() { + return Iterator(fileCount); + } }; } // namespace stb diff --git a/include/d/actor/d_a_title.h b/include/d/actor/d_a_title.h index beca3f1215..1da6096702 100644 --- a/include/d/actor/d_a_title.h +++ b/include/d/actor/d_a_title.h @@ -77,7 +77,7 @@ class daTit_HIO_c { public: /* 80D66B0C */ daTit_HIO_c(); - /* 80D67A08 */ virtual ~daTit_HIO_c(); + /* 80D67A08 */ virtual ~daTit_HIO_c() {} /* 0x04 */ s8 field_0x4; /* 0x08 */ f32 mPSScaleX; diff --git a/include/d/d_demo.h b/include/d/d_demo.h index 2f838d0ef2..e334bcadca 100644 --- a/include/d/d_demo.h +++ b/include/d/d_demo.h @@ -42,6 +42,7 @@ public: class dDemo_prm_c { public: dDemo_prm_c() { mData = 0; } + u32 getData() { return mData; } /* 0x0 */ u32 field_0x0; /* 0x4 */ u32 mData; @@ -85,6 +86,7 @@ public: void setOldAnmId(u32 id) { mOldAnmId = id; } void setAnmFrameMax(f32 max) { mAnmFrameMax = max; } f32 getAnmFrame() { return mAnmFrame; } + dDemo_prm_c* getPrm() { return &mPrm; } private: /* 0x04 */ u16 mFlags; |
