Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
ctb.h
Go to the documentation of this file.
1#ifndef CTB_H
2#define CTB_H
3
8
9namespace JStudio {
10namespace ctb {
11struct TObject : public object::TObject_ID {
12 TObject(const void* id, u32 size, const void* param_2) : object::TObject_ID(id, size) {
14 JUT_ASSERT(82, pData_!=0);
15 }
16 /* 80280F18 */ virtual ~TObject() = 0;
17 virtual int getScheme() const = 0;
18 const void* getData() const { return pData_; }
19
20 /* 0x08 vtable */
22 /* 0x14 */ const void* pData_;
23};
24
25struct data {
34
36 TParse_THeader(const void* pContent) : JGadget::binary::TParseData_aligned<4>(pContent) {}
37 const THeaderData* get() const {
38 return (THeaderData*) getRaw();
39 }
40
41 const void* get_signature() const {
42 return &get()->signature;
43 }
44
46 return get()->blockNumber;
47 }
48
50 return get()->byteOrder;
51 }
52
53 u16 get_version() const {
54 return get()->version;
55 }
56
57 const void* getContent() const {
58 const THeaderData* header = (THeaderData*) getRaw();
59 return header->content;
60 }
61 };
62
69
71 TParse_TBlock(const void* pContent) : JGadget::binary::TParseData_aligned<4>(pContent) {}
72 const TBlockData* get() const {
73 return (const TBlockData*)getRaw();
74 }
75
76 u32 get_size() const {
77 return get()->size;
78 }
79
80 u16 get_scheme() const {
81 return get()->scheme;
82 }
83
84 u16 get_IDSize() const {
85 return get()->IDSize;
86 }
87
88 const void* getBlockEnd_() const {
89 return get()->field_0x8;
90 }
91
92 const void* get_ID() const {
93 const void* rv = NULL;
94 if (get_IDSize() != 0) {
95 rv = getBlockEnd_();
96 }
97 return rv;
98 }
99
100 const void* getContent() const {
101 return (const void*)((char*)getBlockEnd_() + JGadget::binary::align_roundUp((u16)get_IDSize(), 4));
102 }
103
105 return (TParse_TBlock*)((char*)getRaw() + get_size());
106 }
107 };
108
109 static const u32 ga4cSignature;
110};
111
112struct TObject_TxyzRy : public TObject {
114
115 /* 80281554 */ virtual ~TObject_TxyzRy();
116 /* 80280FBC */ virtual int getScheme() const;
117};
118
119struct TFactory {
121
122 /* 80281274 */ virtual ~TFactory();
123 /* 802812BC */ virtual TObject* create(JStudio::ctb::data::TParse_TBlock const&);
124 /* 80281320 */ virtual void destroy(JStudio::ctb::TObject*);
125};
126
127struct TControl {
128 /* 80280FC4 */ TControl();
129 /* 80280FF4 */ virtual ~TControl();
130 /* 80281060 */ void appendObject(JStudio::ctb::TObject*);
131 /* 802810AC */ void removeObject(JStudio::ctb::TObject*);
132 /* 802810DC */ void destroyObject(JStudio::ctb::TObject*);
133 /* 8028112C */ void destroyObject_all();
134 /* 80281190 */ JStudio::ctb::TObject* getObject(void const*, u32);
136
139
140 /* 0x4 */ TFactory* pFactory_;
142};
143
145 /* 8028135C */ TParse(JStudio::ctb::TControl*);
146 /* 8028137C */ virtual ~TParse();
147 /* 802813DC */ virtual bool parseHeader_next(void const**, u32*, u32);
148 /* 80281470 */ virtual bool parseBlock_next(void const**, u32*, u32);
149
151
152 /* 0x4 */ TControl* pControl_;
153};
154
155}; // namespace ctb
156}; // namespace JStudio
157
158#endif /* CTB_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
static SECTION_RODATA u8 const id[8]
Definition d_a_npc_bans.cpp:1309
u32 align_roundUp(u32 arg0, u32 uAlign)
Definition binary.h:16
Definition std-vector.cpp:14
Definition functionvalue.cpp:318
Definition linklist.h:7
TParseData_aligned(const void *pContent)
Definition binary.h:31
const void * getRaw() const
Definition binary.h:23
Definition ctb.h:127
void removeObject(JStudio::ctb::TObject *)
Definition ctb.cpp:149
void destroyObject(JStudio::ctb::TObject *)
Definition ctb.cpp:155
JGadget::TLinkList< TObject, -12 > mList
Definition ctb.h:141
void destroyObject_all()
Definition ctb.cpp:162
JStudio::ctb::TObject * getObject(void const *, u32)
Definition ctb.cpp:171
void appendObject(JStudio::ctb::TObject *)
Definition ctb.cpp:143
TControl()
Definition ctb.cpp:133
TFactory * getFactory()
Definition ctb.h:137
TFactory * pFactory_
Definition ctb.h:140
JStudio::ctb::TObject * getObject_index(u32)
Definition ctb.cpp:188
void setFactory(TFactory *factory)
Definition ctb.h:138
Definition ctb.h:119
virtual TObject * create(JStudio::ctb::data::TParse_TBlock const &)
Definition ctb.cpp:205
TFactory()
Definition ctb.h:120
virtual void destroy(JStudio::ctb::TObject *)
Definition ctb.cpp:216
Definition ctb.h:112
virtual int getScheme() const
Definition ctb.cpp:128
Definition ctb.h:11
const void * getData() const
Definition ctb.h:18
virtual ~TObject()=0
Definition ctb.cpp:117
TObject(const void *id, u32 size, const void *param_2)
Definition ctb.h:12
virtual int getScheme() const =0
JGadget::TLinkListNode ocObject_
Definition ctb.h:21
const void * pData_
Definition ctb.h:22
Definition ctb.h:144
virtual bool parseHeader_next(void const **, u32 *, u32)
Definition ctb.cpp:234
virtual bool parseBlock_next(void const **, u32 *, u32)
Definition ctb.cpp:257
TControl * getControl()
Definition ctb.h:150
TControl * pControl_
Definition ctb.h:152
u32 field_0x8[0]
Definition ctb.h:67
u32 size
Definition ctb.h:64
u16 scheme
Definition ctb.h:65
u16 IDSize
Definition ctb.h:66
u16 byteOrder
Definition ctb.h:28
u32 blockNumber
Definition ctb.h:31
u16 version
Definition ctb.h:29
u8 field_0x0[4]
Definition ctb.h:30
u8 content[0]
Definition ctb.h:32
u32 signature
Definition ctb.h:27
u16 get_IDSize() const
Definition ctb.h:84
u16 get_scheme() const
Definition ctb.h:80
TParse_TBlock(const void *pContent)
Definition ctb.h:71
const void * getBlockEnd_() const
Definition ctb.h:88
const TParse_TBlock * getNext()
Definition ctb.h:104
const void * getContent() const
Definition ctb.h:100
const TBlockData * get() const
Definition ctb.h:72
u32 get_size() const
Definition ctb.h:76
const void * get_ID() const
Definition ctb.h:92
const void * getContent() const
Definition ctb.h:57
u16 get_version() const
Definition ctb.h:53
const THeaderData * get() const
Definition ctb.h:37
u32 get_blockNumber() const
Definition ctb.h:45
const void * get_signature() const
Definition ctb.h:41
TParse_THeader(const void *pContent)
Definition ctb.h:36
u16 get_byteOrder() const
Definition ctb.h:49
Definition ctb.h:25
static const u32 ga4cSignature
Definition ctb.h:109
Definition object-id.h:27
TObject_ID(const void *id, u32 id_size)
Definition object-id.h:28
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
unsigned char u8
Definition types.h:8