diff options
| author | LagoLunatic <LagoLunatic@users.noreply.github.com> | 2025-04-06 20:57:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-06 17:57:52 -0700 |
| commit | c0e111b081562c14f58b4d72b5473b577e671d45 (patch) | |
| tree | 8635d92524d280834236e7647f96d4ff6fe869a6 /include | |
| parent | 54dd7640969e1f414f9b1111f874f85171ab6987 (diff) | |
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
Diffstat (limited to 'include')
| -rw-r--r-- | include/JSystem/JStudio/JStudio/functionvalue.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JStudio/JStudio_JStage/control.h | 58 | ||||
| -rw-r--r-- | include/JSystem/JStudio/JStudio_JStage/tvariable_value_output_object.h | 43 | ||||
| -rw-r--r-- | include/d/d_com_inf_game.h | 8 | ||||
| -rw-r--r-- | include/m_Do/m_Do_mtx.h | 2 |
5 files changed, 66 insertions, 47 deletions
diff --git a/include/JSystem/JStudio/JStudio/functionvalue.h b/include/JSystem/JStudio/JStudio/functionvalue.h index ef163a27f6..c6833d4294 100644 --- a/include/JSystem/JStudio/JStudio/functionvalue.h +++ b/include/JSystem/JStudio/JStudio/functionvalue.h @@ -7,6 +7,8 @@ namespace JStudio { +typedef f64 TValue; + typedef f64 (*ExtrapolateParameter)(f64, f64); class TFunctionValue; diff --git a/include/JSystem/JStudio/JStudio_JStage/control.h b/include/JSystem/JStudio/JStudio_JStage/control.h index 6d2677090a..7ee1f52aa0 100644 --- a/include/JSystem/JStudio/JStudio_JStage/control.h +++ b/include/JSystem/JStudio/JStudio_JStage/control.h @@ -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 */ diff --git a/include/JSystem/JStudio/JStudio_JStage/tvariable_value_output_object.h b/include/JSystem/JStudio/JStudio_JStage/tvariable_value_output_object.h new file mode 100644 index 0000000000..38eabc9da5 --- /dev/null +++ b/include/JSystem/JStudio/JStudio_JStage/tvariable_value_output_object.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 */ diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 15a05f91c5..211eb27ece 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.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() { diff --git a/include/m_Do/m_Do_mtx.h b/include/m_Do/m_Do_mtx.h index e87c2fbebc..23f5aae3fa 100644 --- a/include/m_Do/m_Do_mtx.h +++ b/include/m_Do/m_Do_mtx.h @@ -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); } |
