Skip to content

Commit b338bc1

Browse files
committed
Fix JStudio not compiling on retail, add fake header
1 parent 70d5a30 commit b338bc1

File tree

2 files changed

+56
-33
lines changed

2 files changed

+56
-33
lines changed

include/JSystem/JStudio/JStudio_JStage/control.h

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
#include "JSystem/JStudio/JStudio/jstudio-object.h"
1111
#include "JSystem/JStudio/JStudio/jstudio-math.h"
1212

13+
#ifdef DEBUG
14+
namespace JStudio_JStage {
15+
template<class TAdaptor, class TStageObject>
16+
struct TVariableValueOutput_object_;
17+
}; // namespace JStudio_JStage
18+
#else
19+
#include "JSystem/JStudio/JStudio_JStage/tvariable_value_output_object.h"
20+
#endif
21+
1322
namespace JStudio_JStage {
1423
typedef JStudio::TObject* (*ObjCreateFuncT)(const JStudio::stb::data::TParse_TBlock_object&, JStage::TObject*, const JStage::TSystem*);
1524

@@ -41,10 +50,6 @@ struct TAdaptor_object_ {
4150
/* 0x4 */ JStage::TObject* pJSGObject_;
4251
};
4352

44-
45-
template<class TAdaptor, class TStageObject>
46-
struct TVariableValueOutput_object_;
47-
4853
struct TAdaptor_actor : public JStudio::TAdaptor_actor, public JStudio_JStage::TAdaptor_object_ {
4954
typedef JStudio::TObject_actor ObjectType;
5055
typedef TVariableValueOutput_object_<TAdaptor_actor, JStage::TActor> TVVOutputObject;
@@ -282,35 +287,6 @@ struct TAdaptor_light : public JStudio::TAdaptor_light, public TAdaptor_object_
282287
static TVVOutput_direction_ saoVVOutput_direction_[6];
283288
};
284289

285-
template<class TAdaptor, class TStageObject>
286-
struct TVariableValueOutput_object_ : public JStudio::TVariableValue::TOutput {
287-
typedef f32 (TStageObject::*GetFunc)() const;
288-
typedef void (TStageObject::*SetFunc)(f32);
289-
TVariableValueOutput_object_() : field_0x4(-1), field_0x8(NULL), field_0x14(NULL) {}
290-
TVariableValueOutput_object_(typename TAdaptor::TEVariableValue param_1,
291-
SetFunc param_2, GetFunc param_3) : field_0x4(param_1), field_0x8(param_2), field_0x14(param_3) {
292-
293-
}
294-
295-
virtual void operator()(f32 param_1, JStudio::TAdaptor* param_2) const {
296-
(((TAdaptor*)param_2)->get_pJSG_()->*field_0x8)(param_1);
297-
}
298-
virtual ~TVariableValueOutput_object_() {}
299-
300-
bool isEnd_() const { return field_0x4 == -1; }
301-
void adaptor_setOutput_(TAdaptor* adaptor) {
302-
adaptor->adaptor_referVariableValue(field_0x4)->setOutput(this);
303-
}
304-
void setVariableValue_(const TStageObject* pObj, TAdaptor* pAdaptor) const {
305-
f32 val = (pObj->*field_0x14)();
306-
pAdaptor->adaptor_setVariableValue_immediate(field_0x4, val);
307-
}
308-
309-
int field_0x4;
310-
SetFunc field_0x8;
311-
GetFunc field_0x14;
312-
};
313-
314290
/* 8028A1F8 */ bool
315291
transform_toGlobalFromLocal(f32 (*)[4],
316292
JStudio::TControl::TTransform_translation_rotation_scaling const&,
@@ -339,4 +315,8 @@ inline bool transform_toGlobalFromLocal(JStudio::TControl::TTransform_position*
339315
JStage::TObject const*, u32);
340316
}; // namespace JStudio_JStage
341317

318+
#ifdef DEBUG
319+
#include "JSystem/JStudio/JStudio_JStage/tvariable_value_output_object.h"
320+
#endif
321+
342322
#endif /* JSTUDIO_JSTAGE_CONTROL_H */
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#ifndef TVARIABLE_VALUE_OUTPUT_OBJECT_H
2+
#define TVARIABLE_VALUE_OUTPUT_OBJECT_H
3+
4+
#include "JSystem/JStudio/JStudio/jstudio-object.h"
5+
6+
// Fake header for JStudio_JStage/control.h. Due to compiler version differences, retail needs the
7+
// class definition of TVariableValueOutput_object_ to come before it's used, while debug needs it
8+
// to come after it's used. The include of this header is ifdefed to support both.
9+
10+
namespace JStudio_JStage {
11+
12+
template<class TAdaptor, class TStageObject>
13+
struct TVariableValueOutput_object_ : public JStudio::TVariableValue::TOutput {
14+
typedef f32 (TStageObject::*GetFunc)() const;
15+
typedef void (TStageObject::*SetFunc)(f32);
16+
TVariableValueOutput_object_() : field_0x4(-1), field_0x8(NULL), field_0x14(NULL) {}
17+
TVariableValueOutput_object_(typename TAdaptor::TEVariableValue param_1,
18+
SetFunc param_2, GetFunc param_3) : field_0x4(param_1), field_0x8(param_2), field_0x14(param_3) {
19+
20+
}
21+
22+
virtual void operator()(f32 param_1, JStudio::TAdaptor* param_2) const {
23+
(((TAdaptor*)param_2)->get_pJSG_()->*field_0x8)(param_1);
24+
}
25+
virtual ~TVariableValueOutput_object_() {}
26+
27+
bool isEnd_() const { return field_0x4 == -1; }
28+
void adaptor_setOutput_(TAdaptor* adaptor) {
29+
adaptor->adaptor_referVariableValue(field_0x4)->setOutput(this);
30+
}
31+
void setVariableValue_(const TStageObject* pObj, TAdaptor* pAdaptor) const {
32+
f32 val = (pObj->*field_0x14)();
33+
pAdaptor->adaptor_setVariableValue_immediate(field_0x4, val);
34+
}
35+
36+
int field_0x4;
37+
SetFunc field_0x8;
38+
GetFunc field_0x14;
39+
};
40+
41+
}; // namespace JStudio_JStage
42+
43+
#endif /* TVARIABLE_VALUE_OUTPUT_OBJECT_H */

0 commit comments

Comments
 (0)