SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
JMapInfo.hpp
1#pragma once
2
3#include <revolution.h>
4
5#define JMAP_VALUE_TYPE_LONG 0
6#define JMAP_VALUE_TYPE_STRING 1
7#define JMAP_VALUE_TYPE_FLOAT 2
8#define JMAP_VALUE_TYPE_LONG_2 3
9#define JMAP_VALUE_TYPE_SHORT 4
10#define JMAP_VALUE_TYPE_BYTE 5
11#define JMAP_VALUE_TYPE_STRING_PTR 6
12#define JMAP_VALUE_TYPE_NULL 7
13
14class JMapInfo;
15
17public:
18 inline JMapInfoIter() { }
19
20 inline JMapInfoIter(JMapInfo* pInfo, s32 val) {
21 mInfo = pInfo;
22 _4 = val;
23 }
24
25 template<typename T>
26 bool getValue(const char *, T *) const;
27
28 bool isValid() const;
29
30 bool operator==(const JMapInfoIter &) const;
31
32 JMapInfo* mInfo; // _0
33 s32 _4;
34};
35
36
37struct JMapItem {
38 u32 mHash; // _0
39 u32 mMask; // _4
40 u16 mOffsData; // _8
41 u8 mShift; // _A
42 u8 mType; // _B
43};
44
45struct JMapData {
46 s32 mNumEntries; // _0
47 s32 mNumFields; // _4
48 s32 mDataOffset; // _8
49 u32 mEntrySize; // _C
50 const JMapItem mItems; // _10
51};
52
53class JMapInfo {
54public:
55 JMapInfo();
56 ~JMapInfo();
57
58 bool attach(const void *);
59 void setName(const char *pName);
60 const char* getName() const;
61 s32 searchItemInfo(const char *pItem) const;
62 s32 getValueType(const char *) const;
63
64 template<typename T>
65 JMapInfoIter findElement(const char *, const char *, int) const;
66
67 template<typename T>
68 JMapInfoIter findElement(const char *, s32, int) const;
69 JMapInfoIter end() const;
70
71 template<typename T>
72 const bool getValue(int, const char *, T *) const;
73
74 bool getValueFast(int, int, const char **) const;
75 bool getValueFast(int, int, unsigned long *) const;
76 bool getValueFast(int, int, long *) const;
77
78 const JMapData* mData; // _0
79 const char* mName; // _4
80};