mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-12 13:04:38 -04:00
Debug JStudio fix + match one retail func (#2378)
* Fix debug build * Minor fixes * Match daAlink_c::getDemoLookActor * Fix JStudio paths in ShieldD splits * Fix JStudio not compiling on debug * Fix JStudio not compiling on retail, add fake header
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
|
||||
namespace JStudio {
|
||||
|
||||
typedef f64 TValue;
|
||||
|
||||
typedef f64 (*ExtrapolateParameter)(f64, f64);
|
||||
|
||||
class TFunctionValue;
|
||||
|
||||
@@ -10,6 +10,15 @@
|
||||
#include "JSystem/JStudio/JStudio/jstudio-object.h"
|
||||
#include "JSystem/JStudio/JStudio/jstudio-math.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
namespace JStudio_JStage {
|
||||
template<class TAdaptor, class TStageObject>
|
||||
struct TVariableValueOutput_object_;
|
||||
}; // namespace JStudio_JStage
|
||||
#else
|
||||
#include "JSystem/JStudio/JStudio_JStage/tvariable_value_output_object.h"
|
||||
#endif
|
||||
|
||||
namespace JStudio_JStage {
|
||||
typedef JStudio::TObject* (*ObjCreateFuncT)(const JStudio::stb::data::TParse_TBlock_object&, JStage::TObject*, const JStage::TSystem*);
|
||||
|
||||
@@ -41,36 +50,6 @@ struct TAdaptor_object_ {
|
||||
/* 0x4 */ JStage::TObject* pJSGObject_;
|
||||
};
|
||||
|
||||
|
||||
template<class TAdaptor, class TStageObject>
|
||||
struct TVariableValueOutput_object_ : public JStudio::TVariableValue::TOutput {
|
||||
typedef f32 (TStageObject::*GetFunc)() const;
|
||||
typedef void (TStageObject::*SetFunc)(f32);
|
||||
TVariableValueOutput_object_() : field_0x4(-1), field_0x8(NULL), field_0x14(NULL) {}
|
||||
TVariableValueOutput_object_(typename TAdaptor::TEVariableValue param_1,
|
||||
SetFunc param_2, GetFunc param_3) : field_0x4(param_1), field_0x8(param_2), field_0x14(param_3) {
|
||||
|
||||
}
|
||||
|
||||
virtual void operator()(f32 param_1, JStudio::TAdaptor* param_2) const {
|
||||
(((TAdaptor*)param_2)->get_pJSG_()->*field_0x8)(param_1);
|
||||
}
|
||||
virtual ~TVariableValueOutput_object_() {}
|
||||
|
||||
bool isEnd_() { return field_0x4 == -1; }
|
||||
void adaptor_setOutput_(TAdaptor* adaptor) {
|
||||
adaptor->adaptor_referVariableValue(field_0x4)->setOutput(this);
|
||||
}
|
||||
void setVariableValue_(TStageObject* pObj, TAdaptor* pAdaptor) {
|
||||
f32 val = (pObj->*field_0x14)();
|
||||
pAdaptor->adaptor_setVariableValue_immediate(field_0x4, val);
|
||||
}
|
||||
|
||||
int field_0x4;
|
||||
SetFunc field_0x8;
|
||||
GetFunc field_0x14;
|
||||
};
|
||||
|
||||
struct TAdaptor_actor : public JStudio::TAdaptor_actor, public JStudio_JStage::TAdaptor_object_ {
|
||||
typedef JStudio::TObject_actor ObjectType;
|
||||
typedef TVariableValueOutput_object_<TAdaptor_actor, JStage::TActor> TVVOutputObject;
|
||||
@@ -108,12 +87,12 @@ struct TAdaptor_actor : public JStudio::TAdaptor_actor, public JStudio_JStage::T
|
||||
adaptor->adaptor_referVariableValue(mValueIndex)->setOutput(this);
|
||||
}
|
||||
|
||||
void setVariableValue_(JStage::TActor *param_1, JStudio::TAdaptor *param_2) {
|
||||
void setVariableValue_(const JStage::TActor *param_1, JStudio::TAdaptor *param_2) const {
|
||||
f32 val = (param_1->*mGetter)();
|
||||
param_2->adaptor_setVariableValue_immediate(mValueIndex, val);
|
||||
}
|
||||
|
||||
bool isEnd_() { return mValueIndex == -1; }
|
||||
bool isEnd_() const { return mValueIndex == -1; }
|
||||
|
||||
/* 0x04 */ int mValueIndex;
|
||||
/* 0x08 */ u32 field_0x8;
|
||||
@@ -158,10 +137,7 @@ struct TAdaptor_actor : public JStudio::TAdaptor_actor, public JStudio_JStage::T
|
||||
|
||||
JStage::TActor* get_pJSG_() { return (JStage::TActor*) pJSGObject_; }
|
||||
|
||||
// TODO: Why doesn't this line compile with MWCC version Wii/1.0?
|
||||
#if __MWERKS__ && __MWERKS__ < 0x4200
|
||||
static TVVOutputObject saoVVOutput_[2];
|
||||
#endif
|
||||
static TVVOutput_ANIMATION_FRAME_ saoVVOutput_ANIMATION_FRAME_[3];
|
||||
|
||||
/* 0x130 */ u32 field_0x130;
|
||||
@@ -224,10 +200,7 @@ struct TAdaptor_camera : public JStudio::TAdaptor_camera, public TAdaptor_object
|
||||
|
||||
JStage::TCamera* get_pJSG_() { return (JStage::TCamera*)pJSGObject_; }
|
||||
|
||||
// TODO: Why doesn't this line compile with MWCC version Wii/1.0?
|
||||
#if __MWERKS__ && __MWERKS__ < 0x4200
|
||||
static TVVOutput saoVVOutput_[5];
|
||||
#endif
|
||||
|
||||
/* 0x108 */ int field_0x108;
|
||||
/* 0x10C */ JStage::TObject* field_0x10c;
|
||||
@@ -255,10 +228,7 @@ struct TAdaptor_fog : public JStudio::TAdaptor_fog, public TAdaptor_object_ {
|
||||
|
||||
JStage::TFog* get_pJSG_() { return (JStage::TFog*)pJSGObject_; }
|
||||
|
||||
// TODO: Why doesn't this line compile with MWCC version Wii/1.0?
|
||||
#if __MWERKS__ && __MWERKS__ < 0x4200
|
||||
static TVariableValueOutput_object_<TAdaptor_fog, JStage::TFog> saoVVOutput_[3];
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TAdaptor_light : public JStudio::TAdaptor_light, public TAdaptor_object_ {
|
||||
@@ -294,7 +264,7 @@ struct TAdaptor_light : public JStudio::TAdaptor_light, public TAdaptor_object_
|
||||
adaptor->adaptor_referVariableValue(field_0x4)->setOutput(this);
|
||||
}
|
||||
|
||||
bool isEnd_() { return field_0x4 == -1; }
|
||||
bool isEnd_() const { return field_0x4 == -1; }
|
||||
|
||||
TEVariableValue field_0x4;
|
||||
TEDirection_ field_0x8;
|
||||
@@ -345,4 +315,8 @@ inline bool transform_toGlobalFromLocal(JStudio::TControl::TTransform_position*
|
||||
JStage::TObject const*, u32);
|
||||
}; // namespace JStudio_JStage
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "JSystem/JStudio/JStudio_JStage/tvariable_value_output_object.h"
|
||||
#endif
|
||||
|
||||
#endif /* JSTUDIO_JSTAGE_CONTROL_H */
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef TVARIABLE_VALUE_OUTPUT_OBJECT_H
|
||||
#define TVARIABLE_VALUE_OUTPUT_OBJECT_H
|
||||
|
||||
#include "JSystem/JStudio/JStudio/jstudio-object.h"
|
||||
|
||||
// Fake header for JStudio_JStage/control.h. Due to compiler version differences, retail needs the
|
||||
// class definition of TVariableValueOutput_object_ to come before it's used, while debug needs it
|
||||
// to come after it's used. The include of this header is ifdefed to support both.
|
||||
|
||||
namespace JStudio_JStage {
|
||||
|
||||
template<class TAdaptor, class TStageObject>
|
||||
struct TVariableValueOutput_object_ : public JStudio::TVariableValue::TOutput {
|
||||
typedef f32 (TStageObject::*GetFunc)() const;
|
||||
typedef void (TStageObject::*SetFunc)(f32);
|
||||
TVariableValueOutput_object_() : field_0x4(-1), field_0x8(NULL), field_0x14(NULL) {}
|
||||
TVariableValueOutput_object_(typename TAdaptor::TEVariableValue param_1,
|
||||
SetFunc param_2, GetFunc param_3) : field_0x4(param_1), field_0x8(param_2), field_0x14(param_3) {
|
||||
|
||||
}
|
||||
|
||||
virtual void operator()(f32 param_1, JStudio::TAdaptor* param_2) const {
|
||||
(((TAdaptor*)param_2)->get_pJSG_()->*field_0x8)(param_1);
|
||||
}
|
||||
virtual ~TVariableValueOutput_object_() {}
|
||||
|
||||
bool isEnd_() const { return field_0x4 == -1; }
|
||||
void adaptor_setOutput_(TAdaptor* adaptor) {
|
||||
adaptor->adaptor_referVariableValue(field_0x4)->setOutput(this);
|
||||
}
|
||||
void setVariableValue_(const TStageObject* pObj, TAdaptor* pAdaptor) const {
|
||||
f32 val = (pObj->*field_0x14)();
|
||||
pAdaptor->adaptor_setVariableValue_immediate(field_0x4, val);
|
||||
}
|
||||
|
||||
int field_0x4;
|
||||
SetFunc field_0x8;
|
||||
GetFunc field_0x14;
|
||||
};
|
||||
|
||||
}; // namespace JStudio_JStage
|
||||
|
||||
#endif /* TVARIABLE_VALUE_OUTPUT_OBJECT_H */
|
||||
@@ -3509,19 +3509,19 @@ inline void dComIfGp_event_setTalkPartner(fopAc_ac_c* i_actor) {
|
||||
}
|
||||
|
||||
inline fopAc_ac_c* dComIfGp_event_getTalkPartner() {
|
||||
return (fopAc_ac_c*)g_dComIfG_gameInfo.play.getEvent().getPtT();
|
||||
return g_dComIfG_gameInfo.play.getEvent().getPtT();
|
||||
}
|
||||
|
||||
inline fopAc_ac_c* dComIfGp_event_getItemPartner() {
|
||||
return (fopAc_ac_c*)g_dComIfG_gameInfo.play.getEvent().getPtI();
|
||||
return g_dComIfG_gameInfo.play.getEvent().getPtI();
|
||||
}
|
||||
|
||||
inline fopAc_ac_c* dComIfGp_event_getPt1() {
|
||||
return (fopAc_ac_c*)g_dComIfG_gameInfo.play.getEvent().getPt1();
|
||||
return g_dComIfG_gameInfo.play.getEvent().getPt1();
|
||||
}
|
||||
|
||||
inline fopAc_ac_c* dComIfGp_event_getPt2() {
|
||||
return (fopAc_ac_c*)g_dComIfG_gameInfo.play.getEvent().getPt2();
|
||||
return g_dComIfG_gameInfo.play.getEvent().getPt2();
|
||||
}
|
||||
|
||||
inline BOOL dComIfGp_event_runCheck() {
|
||||
|
||||
@@ -36,7 +36,7 @@ inline void cMtx_scale(Mtx m, f32 x, f32 y, f32 z) {
|
||||
MTXScale(m, x, y, z);
|
||||
}
|
||||
|
||||
inline void mDoMtx_multVec(Mtx m, const Vec* src, Vec* dst) {
|
||||
inline void mDoMtx_multVec(CMtxP m, const Vec* src, Vec* dst) {
|
||||
MTXMultVec(m, src, dst);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user