Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
jstudio-object.h
Go to the documentation of this file.
1#ifndef JSTUDIO_OBJECT_H
2#define JSTUDIO_OBJECT_H
3
5#include "limits.h"
6#include "math.h"
7
8typedef struct _GXColor GXColor;
9
10namespace JStudio {
11namespace data {
13 UNK_0x1 = 0x1,
14 UNK_0x2 = 0x2,
15 UNK_0x3 = 0x3,
16 UNK_0x10 = 0x10,
17 UNK_0x12 = 0x12,
18 UNK_0x18 = 0x18,
19 UNK_0x19 = 0x19,
20 };
21};
22
23struct TAdaptor;
25 struct TOutput {
26 virtual void operator()(f32, JStudio::TAdaptor*) const = 0;
27 /* 80285E0C */ ~TOutput();
28 };
29
31 /* 80285F6C */ ~TOutput_none_();
32 /* 80285FCC */ void operator()(f32, JStudio::TAdaptor*) const;
33 };
34
35 /* 80285E54 */ void update(f64, JStudio::TAdaptor*);
36 /* 80285EB8 */ static void update_immediate_(JStudio::TVariableValue*, f64);
37 /* 80285ECC */ static void update_time_(JStudio::TVariableValue*, f64);
38 /* 80285F08 */ static void update_functionValue_(JStudio::TVariableValue*, f64);
39 /* 8028B568 */ TVariableValue();
40 //TVariableValue() : field_0x4(0), field_0x8(NULL), pOutput_((TOutput*)soOutput_none_) {}
41
42 void setValue_immediate(f32 value) {
44 field_0x4 = 0;
45 field_0xc.val = value;
46 }
47
50 }
51
52 void setValue_time(f32 value) {
54 field_0x4 = 0;
55 field_0xc.val = value;
56 }
57
63
64 f32 getValue() const { return mValue; }
65
66 template<typename T>
67 T getValue_clamp() const {
68 f32 val = mValue;
71 } else if (val >= std::numeric_limits<T>::max()) {
73 }
74 return val;
75 }
76 u8 getValue_uint8() const { return getValue_clamp<u8>(); }
77
85
89
90 static u8 soOutput_none_[4 + 4 /* padding */];
91
92 /* 0x00 */ f32 mValue;
93 /* 0x04 */ u32 field_0x4;
95 /* 0x0C */ union {
99 /* 0x10 */ TOutput* pOutput_;
100}; // Size: 0x14
101
103
104class TObject : public stb::TObject {
105public:
107 /* 80286734 */ void forward_value(u32);
108
109 /* 802866B0 */ virtual ~TObject() = 0;
110 /* 8028679C */ virtual void do_begin();
111 /* 802867D4 */ virtual void do_end();
112 virtual void do_paragraph(u32, void const*, u32) = 0;
113 /* 8028680C */ virtual void do_wait(u32);
114 /* 8028682C */ virtual void do_data(void const*, u32, void const*, u32);
115
118
119 inline void prepareAdaptor();
120
121 template<class T>
123 T* n = new T(param_0, param_1);
124
125 if (n == NULL) {
126 return NULL;
127 }
128
129 n->prepareAdaptor();
130
131 return n;
132 }
133
134 /* 0x34 */ TAdaptor* mpAdaptor;
135};
136
137struct TAdaptor {
151 /* 80285FD0 */ virtual ~TAdaptor() = 0;
152 /* 80286018 */ virtual void adaptor_do_prepare();
153 /* 8028601C */ virtual void adaptor_do_begin();
154 /* 80286020 */ virtual void adaptor_do_end();
155 /* 80286024 */ virtual void adaptor_do_update(u32);
156 /* 80286028 */ virtual void adaptor_do_data(void const*, u32, void const*, u32);
157
158 /* 8028602C */ void adaptor_setVariableValue(JStudio::TControl*, u32,
159 JStudio::data::TEOperationData, void const*, u32);
160 /* 802860CC */ void adaptor_setVariableValue_n(JStudio::TControl*, u32 const*, u32,
162 u32);
163 /* 802861C0 */ void
165 /* 80286204 */ void adaptor_setVariableValue_Vec(u32 const*, Vec const&);
166 /* 80286274 */ void adaptor_getVariableValue_Vec(Vec*, u32 const*) const;
167 /* 802862AC */ void adaptor_setVariableValue_GXColor(u32 const*, GXColor const&);
168 /* 8028638C */ void adaptor_getVariableValue_GXColor(GXColor*, u32 const*) const;
171 void const*, u32);
173 u32, void const*, u32);
175 void const*, u32);
177 u32, void const*, u32);
179 u32, void const*, u32);
180
183 }
184
188
192
196
197 const TObject* adaptor_getObject() { return pObject_; }
198
199 /* 0x4 */ const TObject* pObject_;
201 /* 0xC */ u32 u;
202};
203
205 if (mpAdaptor != NULL) {
208 }
209}
210
211struct TAdaptor_actor : public TAdaptor {
213 /* 802868B0 */ virtual ~TAdaptor_actor() = 0;
214 virtual void adaptor_do_PARENT(JStudio::data::TEOperationData, const void*, u32) = 0;
221 virtual void adaptor_do_SHAPE(JStudio::data::TEOperationData, const void*, u32) = 0;
226
227 /* 0x10 */ TVariableValue mValue[14];
228
230 static u32 const sauVariableValue_3_ROTATION_XYZ[3];
231 static u32 const sauVariableValue_3_SCALING_XYZ[3];
232}; // Size: 0x128
233
234struct TObject_actor : public TObject {
237
238 /* 802881A4 */ virtual ~TObject_actor();
239 /* 8028694C */ virtual void do_paragraph(u32, void const*, u32);
240};
241
244 /* 80286C9C */ virtual ~TAdaptor_ambientLight() = 0;
245
246 /* 0x10 */ TVariableValue mValue[4];
247
248 static u32 const sauVariableValue_3_COLOR_RGB[3];
249 static u32 const sauVariableValue_4_COLOR_RGBA[4];
250};
251
255
256 /* 80288144 */ virtual ~TObject_ambientLight();
257 /* 80286D38 */ virtual void do_paragraph(u32, void const*, u32);
258};
259
278
279struct TObject_camera : public TObject {
282
283 /* 802880E4 */ virtual ~TObject_camera();
284 /* 80286EB8 */ virtual void do_paragraph(u32, void const*, u32);
285};
286
287struct TAdaptor_fog : public TAdaptor {
289 /* 8028717C */ virtual ~TAdaptor_fog() = 0;
290
291 /* 0x10 */ TVariableValue mValue[6];
292
293 static u32 const sauVariableValue_3_COLOR_RGB[3];
294 static u32 const sauVariableValue_4_COLOR_RGBA[4];
296};
297
298struct TObject_fog : public TObject {
301
302 /* 80288084 */ virtual ~TObject_fog();
303 /* 80287218 */ virtual void do_paragraph(u32, void const*, u32);
304};
305
306struct TAdaptor_light : public TAdaptor {
308 /* 80287308 */ virtual ~TAdaptor_light() = 0;
309
310 /* 0x10 */ TVariableValue mValue[13];
311
312 static u32 const sauVariableValue_3_COLOR_RGB[3];
313 static u32 const sauVariableValue_4_COLOR_RGBA[4];
314 static u32 const sauVariableValue_3_POSITION_XYZ[3];
317};
318
319struct TObject_light : public TObject {
322
323 /* 80288024 */ virtual ~TObject_light();
324 /* 802873A4 */ virtual void do_paragraph(u32, void const*, u32);
325};
326
327struct TAdaptor_message : public TAdaptor {
329 /* 802875E0 */ virtual ~TAdaptor_message() = 0;
330};
331
332struct TObject_message : public TObject {
335
336 /* 80287FC4 */ virtual ~TObject_message();
337 /* 8028767C */ virtual void do_paragraph(u32, void const*, u32);
338};
339
342 /* 8028770C */ virtual ~TAdaptor_particle() = 0;
343
344 /* 0x10 */ TVariableValue mValue[20];
345
347 static u32 const sauVariableValue_3_ROTATION_XYZ[3];
348 static u32 const sauVariableValue_3_SCALING_XYZ[3];
349 static u32 const sauVariableValue_3_COLOR_RGB[3];
350 static u32 const sauVariableValue_4_COLOR_RGBA[4];
351 static u32 const sauVariableValue_3_COLOR1_RGB[3];
352 static u32 const sauVariableValue_4_COLOR1_RGBA[4];
353};
354
355struct TObject_particle : public TObject {
358
359 /* 80287F64 */ virtual ~TObject_particle();
360 /* 802877A8 */ virtual void do_paragraph(u32, void const*, u32);
361};
362
363struct TAdaptor_sound : public TAdaptor {
365 /* 80287B3C */ virtual ~TAdaptor_sound() = 0;
366
367 /* 0x10 */ TVariableValue mValue[13];
368
369 static u32 const sauVariableValue_3_POSITION_XYZ[3];
370}; // Size: 0x114
371
372struct TObject_sound : public TObject {
375
376 /* 80287F04 */ virtual ~TObject_sound();
377 /* 80287BD8 */ virtual void do_paragraph(u32, void const*, u32);
378};
379
380}; // namespace JStudio
381
382#endif /* JSTUDIO_OBJECT_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition jstudio-control.h:42
Definition functionvalue.h:19
Definition jstudio-object.h:104
TAdaptor * mpAdaptor
Definition jstudio-object.h:134
virtual void do_begin()
Definition jstudio-object.cpp:1593
TAdaptor * getAdaptor()
Definition jstudio-object.h:116
TControl * getControl() const
Definition jstudio-object.h:117
virtual void do_data(void const *, u32, void const *, u32)
Definition jstudio-object.cpp:1620
virtual void do_paragraph(u32, void const *, u32)=0
void forward_value(u32)
Definition jstudio-object.cpp:1583
void prepareAdaptor()
Definition jstudio-object.h:204
T * createFromAdaptor(const stb::data::TParse_TBlock_object &param_0, T *param_1)
Definition jstudio-object.h:122
virtual void do_end()
Definition jstudio-object.cpp:1607
virtual ~TObject()=0
Definition jstudio-object.cpp:1578
virtual void do_wait(u32)
Definition jstudio-object.cpp:1615
Definition stb.h:31
TControl * getControl() const
Definition stb.h:66
Definition stb-data-parse.h:82
Definition limits.h:38
static u16 data[4]
Definition d_vibration.cpp:114
n
Definition e_fmod.c:112
static const double T[]
Definition k_tan.c:106
TEOperationData
Definition jstudio-object.h:12
@ UNK_0x18
Definition jstudio-object.h:18
@ UNK_0x1
Definition jstudio-object.h:13
@ UNK_0x12
Definition jstudio-object.h:17
@ UNK_0x3
Definition jstudio-object.h:15
@ UNK_0x2
Definition jstudio-object.h:14
@ UNK_0x19
Definition jstudio-object.h:19
@ UNK_0x10
Definition jstudio-object.h:16
Definition functionvalue.cpp:318
void(TObject::* paragraphFunc)(u32, void const *, u32)
Definition jstudio-object.h:102
Definition jstudio-object.h:138
u32 field_0x0
Definition jstudio-object.h:142
TSetVariableValue_immediate(u32 param_1, f32 param_2)
Definition jstudio-object.h:140
f32 field_0x4
Definition jstudio-object.h:143
TSetVariableValue_immediate()
Definition jstudio-object.h:139
Definition jstudio-object.h:211
virtual ~TAdaptor_actor()=0
Definition jstudio-object.cpp:1637
TAdaptor_actor()
Definition jstudio-object.h:212
virtual void adaptor_do_TEXTURE_ANIMATION_MODE(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_RELATION_NODE(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_RELATION(JStudio::data::TEOperationData, const void *, u32)=0
TVariableValue mValue[14]
Definition jstudio-object.h:227
virtual void adaptor_do_PARENT_ENABLE(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_ANIMATION_MODE(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_SHAPE(JStudio::data::TEOperationData, const void *, u32)=0
static u32 const sauVariableValue_3_TRANSLATION_XYZ[3]
Definition jstudio-object.h:1656
virtual void adaptor_do_PARENT_FUNCTION(JStudio::data::TEOperationData, const void *, u32)=0
static u32 const sauVariableValue_3_SCALING_XYZ[3]
Definition jstudio-object.h:1715
virtual void adaptor_do_PARENT_NODE(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_PARENT(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_TEXTURE_ANIMATION(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_RELATION_ENABLE(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_ANIMATION(JStudio::data::TEOperationData, const void *, u32)=0
static u32 const sauVariableValue_3_ROTATION_XYZ[3]
Definition jstudio-object.h:1708
Definition jstudio-object.h:242
virtual ~TAdaptor_ambientLight()=0
Definition jstudio-object.cpp:1690
static u32 const sauVariableValue_3_COLOR_RGB[3]
Definition jstudio-object.h:1722
static u32 const sauVariableValue_4_COLOR_RGBA[4]
Definition jstudio-object.h:1729
TVariableValue mValue[4]
Definition jstudio-object.h:246
TAdaptor_ambientLight()
Definition jstudio-object.h:243
Definition jstudio-object.h:260
TVariableValue mValue[12]
Definition jstudio-object.h:272
virtual void adaptor_do_TARGET_PARENT(JStudio::data::TEOperationData, const void *, u32)=0
static u32 const sauVariableValue_3_POSITION_XYZ[3]
Definition jstudio-object.h:1761
virtual void adaptor_do_PARENT(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_PARENT_NODE(JStudio::data::TEOperationData, const void *, u32)=0
static u32 sauVariableValue_2_DISTANCE_NEAR_FAR[2]
Definition jstudio-object.h:1795
virtual void adaptor_do_TARGET_PARENT_NODE(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_TARGET_PARENT_ENABLE(JStudio::data::TEOperationData, const void *, u32)=0
static u32 const sauVariableValue_3_TARGET_POSITION_XYZ[3]
Definition jstudio-object.h:1768
TAdaptor_camera()
Definition jstudio-object.h:261
virtual ~TAdaptor_camera()=0
Definition jstudio-object.cpp:1744
virtual void adaptor_do_PARENT_ENABLE(JStudio::data::TEOperationData, const void *, u32)=0
virtual void adaptor_do_PARENT_FUNCTION(JStudio::data::TEOperationData, const void *, u32)=0
Definition jstudio-object.h:287
static u32 const sauVariableValue_4_COLOR_RGBA[4]
Definition jstudio-object.h:1830
static u32 const sauVariableValue_3_COLOR_RGB[3]
Definition jstudio-object.h:1823
virtual ~TAdaptor_fog()=0
Definition jstudio-object.cpp:1807
static u32 sauVariableValue_2_RANGE_BEGIN_END[2]
Definition jstudio-object.h:1837
TVariableValue mValue[6]
Definition jstudio-object.h:291
TAdaptor_fog()
Definition jstudio-object.h:288
Definition jstudio-object.h:306
TAdaptor_light()
Definition jstudio-object.h:307
static u32 const sauVariableValue_3_COLOR_RGB[3]
Definition jstudio-object.h:1966
static u32 sauVariableValue_2_DIRECTION_THETA_PHI[2]
Definition jstudio-object.h:1876
static u32 const sauVariableValue_3_TARGET_POSITION_XYZ[3]
Definition jstudio-object.h:1988
TVariableValue mValue[13]
Definition jstudio-object.h:310
static u32 const sauVariableValue_4_COLOR_RGBA[4]
Definition jstudio-object.h:1974
virtual ~TAdaptor_light()=0
Definition jstudio-object.cpp:1850
static u32 const sauVariableValue_3_POSITION_XYZ[3]
Definition jstudio-object.h:1981
Definition jstudio-object.h:327
TAdaptor_message()
Definition jstudio-object.h:328
virtual ~TAdaptor_message()=0
Definition jstudio-object.cpp:1887
Definition jstudio-object.h:340
TAdaptor_particle()
Definition jstudio-object.h:341
static u32 const sauVariableValue_3_TRANSLATION_XYZ[3]
Definition jstudio-object.h:1995
static u32 const sauVariableValue_3_ROTATION_XYZ[3]
Definition jstudio-object.h:2002
static u32 const sauVariableValue_3_COLOR_RGB[3]
Definition jstudio-object.h:2018
TVariableValue mValue[20]
Definition jstudio-object.h:344
virtual ~TAdaptor_particle()=0
Definition jstudio-object.cpp:1926
static u32 const sauVariableValue_4_COLOR1_RGBA[4]
Definition jstudio-object.h:2045
static u32 const sauVariableValue_4_COLOR_RGBA[4]
Definition jstudio-object.h:2026
static u32 const sauVariableValue_3_COLOR1_RGB[3]
Definition jstudio-object.h:2035
static u32 const sauVariableValue_3_SCALING_XYZ[3]
Definition jstudio-object.h:2009
Definition jstudio-object.h:363
TAdaptor_sound()
Definition jstudio-object.h:364
static u32 const sauVariableValue_3_POSITION_XYZ[3]
Definition jstudio-object.h:2053
virtual ~TAdaptor_sound()=0
Definition jstudio-object.cpp:1948
TVariableValue mValue[13]
Definition jstudio-object.h:367
Definition jstudio-object.h:137
virtual void adaptor_do_data(void const *, u32, void const *, u32)
Definition jstudio-object.cpp:1389
TAdaptor(TVariableValue *param_1, u32 param_2)
Definition jstudio-object.h:146
void adaptor_setVariableValue_GXColor(u32 const *, GXColor const &)
Definition jstudio-object.cpp:1495
virtual void adaptor_do_update(u32)
Definition jstudio-object.cpp:1383
void adaptor_setVariableValue_immediate(JStudio::TAdaptor::TSetVariableValue_immediate const *)
Definition jstudio-object.cpp:1467
void adaptor_setVariableValue_n(JStudio::TControl *, u32 const *, u32, JStudio::data::TEOperationData, void const *, u32)
Definition jstudio-object.cpp:1429
const TObject * adaptor_getObject()
Definition jstudio-object.h:197
const TVariableValue * adaptor_getVariableValue(u32 param_0) const
Definition jstudio-object.h:193
void adaptor_getVariableValue_GXColor(GXColor *, u32 const *) const
Definition jstudio-object.cpp:1506
TVariableValue * adaptor_referVariableValue(u32 param_0)
Definition jstudio-object.h:185
void adaptor_setVariableValue_Vec(u32 const *, Vec const &)
Definition jstudio-object.cpp:1478
virtual void adaptor_do_end()
Definition jstudio-object.cpp:1378
virtual void adaptor_do_prepare()
void adaptor_setVariableValue_immediate(u32 param_0, f32 param_1)
Definition jstudio-object.h:189
TVariableValue * pValue_
Definition jstudio-object.h:200
static void adaptor_setVariableValue_FVR_INDEX_(JStudio::TAdaptor *, JStudio::TControl *, u32, void const *, u32)
Definition jstudio-object.cpp:1570
const TObject * pObject_
Definition jstudio-object.h:199
static void adaptor_setVariableValue_IMMEDIATE_(JStudio::TAdaptor *, JStudio::TControl *, u32, void const *, u32)
Definition jstudio-object.cpp:1540
static void adaptor_setVariableValue_FVR_NAME_(JStudio::TAdaptor *, JStudio::TControl *, u32, void const *, u32)
Definition jstudio-object.cpp:1560
void adaptor_setObject_(const TObject *pObject)
Definition jstudio-object.h:181
static void adaptor_setVariableValue_TIME_(JStudio::TAdaptor *, JStudio::TControl *, u32, void const *, u32)
Definition jstudio-object.cpp:1550
virtual void adaptor_do_begin()
Definition jstudio-object.cpp:1373
void adaptor_getVariableValue_Vec(Vec *, u32 const *) const
Definition jstudio-object.cpp:1487
void(* setVarFunc)(JStudio::TAdaptor *, JStudio::TControl *, u32, void const *, u32)
Definition jstudio-object.h:145
virtual ~TAdaptor()=0
Definition jstudio-object.cpp:1364
u32 u
Definition jstudio-object.h:201
void adaptor_updateVariableValue(JStudio::TControl *, u32)
Definition jstudio-object.cpp:1516
static void adaptor_setVariableValue_VOID_(JStudio::TAdaptor *, JStudio::TControl *, u32, void const *, u32)
Definition jstudio-object.cpp:1530
void adaptor_setVariableValue(JStudio::TControl *, u32, JStudio::data::TEOperationData, void const *, u32)
Definition jstudio-object.cpp:1397
Definition jstudio-object.h:234
virtual void do_paragraph(u32, void const *, u32)
Definition jstudio-object.cpp:1684
Definition jstudio-object.h:252
virtual void do_paragraph(u32, void const *, u32)
Definition jstudio-object.cpp:1736
Definition jstudio-object.h:279
virtual void do_paragraph(u32, void const *, u32)
Definition jstudio-object.cpp:1801
Definition jstudio-object.h:298
virtual void do_paragraph(u32, void const *, u32)
Definition jstudio-object.cpp:1843
Definition jstudio-object.h:319
virtual void do_paragraph(u32, void const *, u32)
Definition jstudio-object.cpp:1882
Definition jstudio-object.h:332
virtual void do_paragraph(u32, void const *, u32)
Definition jstudio-object.cpp:1900
Definition jstudio-object.h:355
virtual void do_paragraph(u32, void const *, u32)
Definition jstudio-object.cpp:1941
Definition jstudio-object.h:372
virtual void do_paragraph(u32, void const *, u32)
Definition jstudio-object.cpp:2060
Definition jstudio-object.h:30
~TOutput_none_()
Definition jstudio-object.cpp:1352
void operator()(f32, JStudio::TAdaptor *) const
Definition jstudio-object.cpp:1358
Definition jstudio-object.h:25
virtual void operator()(f32, JStudio::TAdaptor *) const =0
~TOutput()
Definition jstudio-object.cpp:1312
Definition jstudio-object.h:24
TOutput * pOutput_
Definition jstudio-object.h:99
void forward(u32 param_0)
Definition jstudio-object.h:78
static void update_time_(JStudio::TVariableValue *, f64)
Definition jstudio-object.cpp:1339
void setOutput(TOutput *param_1)
Definition jstudio-object.h:86
u8 getValue_uint8() const
Definition jstudio-object.h:76
u32 field_0x4
Definition jstudio-object.h:93
static void update_immediate_(JStudio::TVariableValue *, f64)
Definition jstudio-object.cpp:1328
static u8 soOutput_none_[4+4]
Definition jstudio-object.h:90
void update(f64, JStudio::TAdaptor *)
Definition jstudio-object.cpp:1318
void setValue_none()
Definition jstudio-object.h:48
void setValue_immediate(f32 value)
Definition jstudio-object.h:42
f32 getValue() const
Definition jstudio-object.h:64
union JStudio::TVariableValue::@128 field_0xc
f32 val
Definition jstudio-object.h:97
TVariableValue()
Definition object-actor.cpp:717
f32 mValue
Definition jstudio-object.h:92
static void update_functionValue_(JStudio::TVariableValue *, f64)
Definition jstudio-object.cpp:1345
void setValue_functionValue(TFunctionValue *value)
Definition jstudio-object.h:58
T getValue_clamp() const
Definition jstudio-object.h:67
void setValue_time(f32 value)
Definition jstudio-object.h:52
void(* field_0x8)(TVariableValue *, double)
Definition jstudio-object.h:94
TFunctionValue * fv
Definition jstudio-object.h:96
Definition d_a_hozelda.cpp:18
Definition d_a_ep.cpp:68
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
double f64
Definition types.h:23
unsigned char u8
Definition types.h:8