3#include <basis/seadAssert.h>
4#include <basis/seadTypes.h>
10template <
typename _DataType>
34 if (ref().mSigWord !=
DataType::cSignature)
36 const char* signature = ptr()->mSignature;
38 signature[0], signature[1],
39 signature[2], signature[3]);
42 if (ref().mVersion !=
DataType::cVersion)
76#define AGL_RES_COMMON(class_name)
79 : ResCommon<typename class_name::DataType>()
83 class_name(const void* data)
84 : ResCommon<typename class_name::DataType>(data)
88#define AGL_RES_FILE_HEADER()
90 bool modifyEndian() const
92 return ref().mEndian & DataType::cEndianCheckBit;
95 bool isEndianResolved() const
97 return !modifyEndian();
100 void setEndianResolved()
102 ref().mEndian = 1
- ref().mEndian;
105template <
typename DataType>
115template <
typename Type>
138 return lhs.mIndex == rhs.mIndex;
143 return lhs.mIndex != rhs.mIndex;
149 mElem = (ElemDataType*)((uintptr_t)mElem + Type(mElem).ref().mSize);
173 return lhs.mIndex == rhs.mIndex;
178 return lhs.mIndex != rhs.mIndex;
184 mElem = (
const ElemDataType*)((uintptr_t)mElem + Type(mElem).ref().mSize);
209 return Base::ref().mNum;
214 SEAD_ASSERT(0 <= n && n <=
static_cast<
int >(
this->getNum() ));
219 while (itr != itr_end)
229 for (
iterator it = begin(), it_end = end(); it != it_end; ++it)
234#define AGL_RES_ARRAY(class_name)
237 : ResArray<class_name::ElemType>()
241 class_name(const void* data)
242 : ResArray<class_name::ElemType>(data)
#define AGL_RES_COMMON(class_name)
Definition aglResCommon.h:76
Definition aglResCommon.h:163
s32 mIndex
Definition aglResCommon.h:193
const ElemDataType * operator->() const
Definition aglResCommon.h:189
s32 getIndex() const
Definition aglResCommon.h:190
const ElemDataType & operator*() const
Definition aglResCommon.h:188
constIterator & operator++()
Definition aglResCommon.h:181
friend bool operator!=(const constIterator &lhs, const constIterator &rhs)
Definition aglResCommon.h:176
constIterator(s32 index, const ElemDataType *elem)
Definition aglResCommon.h:165
const ElemDataType * mElem
Definition aglResCommon.h:194
friend bool operator==(const constIterator &lhs, const constIterator &rhs)
Definition aglResCommon.h:171
Definition aglResCommon.h:128
iterator & operator++()
Definition aglResCommon.h:146
iterator(s32 index, ElemDataType *elem)
Definition aglResCommon.h:130
ElemDataType * operator->() const
Definition aglResCommon.h:154
friend bool operator==(const iterator &lhs, const iterator &rhs)
Definition aglResCommon.h:136
s32 mIndex
Definition aglResCommon.h:158
friend bool operator!=(const iterator &lhs, const iterator &rhs)
Definition aglResCommon.h:141
s32 getIndex() const
Definition aglResCommon.h:155
ElemDataType & operator*() const
Definition aglResCommon.h:153
ElemDataType * mElem
Definition aglResCommon.h:159
Definition aglResCommon.h:117
u32 getNum() const
Definition aglResCommon.h:207
constIterator constEnd() const
Definition aglResCommon.h:204
constIterator begin() const
Definition aglResCommon.h:199
constIterator end() const
Definition aglResCommon.h:203
iterator begin()
Definition aglResCommon.h:198
iterator end()
Definition aglResCommon.h:202
constIterator constBegin() const
Definition aglResCommon.h:200
ResCommon< DataType > Base
Definition aglResCommon.h:124
Type::DataType ElemDataType
Definition aglResCommon.h:122
Type ElemType
Definition aglResCommon.h:121
void modifyEndianArray(bool is_le)
Definition aglResCommon.h:225
ResArray< Type >::DataType DataType
Definition aglResCommon.h:123
ElemType get(s32 n) const
Definition aglResCommon.h:212
Definition aglResCommon.h:12
const DataType * mpData
Definition aglResCommon.h:73
DataType * ptr()
Definition aglResCommon.h:50
ResCommon()
Definition aglResCommon.h:17
ResCommon(const void *data)
Definition aglResCommon.h:22
DataType & ref()
Definition aglResCommon.h:60
bool isValid() const
Definition aglResCommon.h:27
const DataType & ref() const
Definition aglResCommon.h:66
const DataType * ptr() const
Definition aglResCommon.h:55
_DataType DataType
Definition aglResCommon.h:14
void verify() const
Definition aglResCommon.h:32
Definition aglDisplayList.cpp:5
void ModifyEndianU32(bool is_le, void *p_data, size_t size)
Definition aglResCommon.cpp:7
#define SEAD_ASSERT(condition)
Definition seadAssert.h:24
#define SEAD_ASSERT_MSG(condition, format,...)
Definition seadAssert.h:33
Definition aglResCommon.h:107
u32 mSize
Definition aglResCommon.h:108
DataType ElemType
Definition aglResCommon.h:112
u32 mNum
Definition aglResCommon.h:109