diff options
| author | Jcw87 <Jcw87@users.noreply.github.com> | 2026-02-13 15:08:10 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-13 15:08:10 -0800 |
| commit | 0b1cb89d695b07ceef78fd17f10c8e026dfbf0c9 (patch) | |
| tree | 728b636074ad03de371d92832d1a29b55ef4520d /include/d | |
| parent | 68f3531c2d3ee6cc90efe90a358cff1656ba275e (diff) | |
d_demo debug (#3098)
Diffstat (limited to 'include/d')
| -rw-r--r-- | include/d/d_demo.h | 203 |
1 files changed, 105 insertions, 98 deletions
diff --git a/include/d/d_demo.h b/include/d/d_demo.h index bbcb5d72b6..73c6f24e42 100644 --- a/include/d/d_demo.h +++ b/include/d/d_demo.h @@ -3,9 +3,9 @@ #include "m_Do/m_Do_ext.h" #include "m_Do/m_Do_mtx.h" +#include "JSystem/JStudio/JStudio_JStage/object.h" #include "JSystem/JStudio/JStudio_JAudio2/control.h" #include "JSystem/JStudio/JStudio_JParticle/object-particle.h" -#include "JSystem/JStudio/JStudio_JStage/object.h" #include "SSystem/SComponent/c_sxyz.h" #include "SSystem/SComponent/c_xyz.h" #include "Z2AudioLib/Z2SoundStarter.h" @@ -27,12 +27,16 @@ public: ~dDemo_object_c(); JStage::TObject* appendActor(fopAc_ac_c*); dDemo_actor_c* getActor(u8); - JStage::TObject* createCamera(); + dDemo_camera_c* createCamera(); + dDemo_camera_c* createEditorCamera(); dDemo_camera_c* getActiveCamera(); JStage::TObject* createAmbient(); JStage::TObject* appendLight(); JStage::TObject* createFog(); void remove(); + void removeEditorCamera(); + + dDemo_camera_c* getCamera() { return mpCamera; } /* 0x00 */ u8 mActorNum; /* 0x01 */ u8 mLightNum; @@ -41,6 +45,9 @@ public: /* 0x88 */ dDemo_ambient_c* mpAmbient; /* 0x8C */ dDemo_light_c* mpLights[8]; /* 0xAC */ dDemo_fog_c* mpFog; +#if DEBUG + /* 0xB0 */ dDemo_camera_c* mpEditorCamera; +#endif }; // TODO: made up, figure out what this is @@ -85,15 +92,15 @@ public: void setActor(fopAc_ac_c*); f32 getPrm_Morf(); int getDemoIDData(int* o_arg0, int* o_arg1, int* o_arg2, u16* o_resID, u8*); - + virtual ~dDemo_actor_c(); virtual void JSGSetData(u32, void const*, u32); virtual s32 JSGFindNodeID(char const* param_0) const { - JUT_ASSERT(0, mModel != NULL); + JUT_ASSERT(115, mModel != NULL); return mModel->getModelData()->getJointName()->getIndex(param_0); } virtual bool JSGGetNodeTransformation(u32 param_0, Mtx param_1) const { - JUT_ASSERT(0, mModel != NULL); + JUT_ASSERT(120, mModel != NULL); cMtx_copy(mModel->getAnmMtx((u16)param_0), param_1); return true; } @@ -113,10 +120,14 @@ public: return mTexAnmFrameMax; } virtual void JSGGetTranslation(Vec* o_trans) const { - *o_trans = mTrans; + o_trans->x = mTrans.x; + o_trans->y = mTrans.y; + o_trans->z = mTrans.z; } virtual void JSGGetScaling(Vec* o_scale) const { - *o_scale = mScale; + o_scale->x = mScale.x; + o_scale->y = mScale.y; + o_scale->z = mScale.z; } virtual void JSGGetRotation(Vec* param_0) const { param_0->x = S2DEG(mRotate.x); @@ -163,27 +174,78 @@ private: /* 0x68 */ u32 mBrkId; }; -class dDemo_system_c : public JStage::TSystem { +class dDemo_camera_c : public JStage::TCamera { public: - dDemo_system_c() { mpObject = NULL; } + enum Enable_e { + ENABLE_PROJ_NEAR_e = (1 << 0), + ENABLE_PROJ_FAR_e = (1 << 1), + ENABLE_PROJ_FOVY_e = (1 << 2), + ENABLE_PROJ_ASPECT_e = (1 << 3), + ENABLE_VIEW_POS_e = (1 << 4), + ENABLE_VIEW_UP_VEC_e = (1 << 5), + ENABLE_VIEW_TARG_POS_e = (1 << 6), + ENABLE_VIEW_ROLL_e = (1 << 7), + }; - virtual int JSGFindObject(JStage::TObject**, char const*, - JStage::TEObject) const; - virtual ~dDemo_system_c(); + dDemo_camera_c() : mFlags(0) {} - void setObject(dDemo_object_c* i_object) { mpObject = i_object; } + virtual f32 JSGGetProjectionNear() const; + virtual void JSGSetProjectionNear(f32); + virtual f32 JSGGetProjectionFar() const; + virtual void JSGSetProjectionFar(f32); + virtual f32 JSGGetProjectionFovy() const; + virtual void JSGSetProjectionFovy(f32); + virtual f32 JSGGetProjectionAspect() const; + virtual void JSGSetProjectionAspect(f32); + virtual void JSGGetViewPosition(Vec*) const; + virtual void JSGSetViewPosition(Vec const&); + virtual void JSGGetViewUpVector(Vec*) const; + virtual void JSGSetViewUpVector(Vec const&); + virtual void JSGGetViewTargetPosition(Vec*) const; + virtual void JSGSetViewTargetPosition(Vec const&); + virtual f32 JSGGetViewRoll() const; + virtual void JSGSetViewRoll(f32); + virtual ~dDemo_camera_c(); + + void onEnable(u8 flag) { mFlags |= flag; } + bool checkEnable(u8 flag) { return mFlags & flag; } + + cXyz& getTarget() { return mViewTargetVector; } + cXyz& getTrans() { return mViewPos; } + cXyz& getUp() { return mViewUpVector; } + f32 getFovy() { return mProjFovy; } + f32 getRoll() { return mViewRoll; } private: - /* 0x4 */ dDemo_object_c* mpObject; + /* 0x04 */ u8 mFlags; + /* 0x08 */ f32 mProjNear; + /* 0x0C */ f32 mProjFar; + /* 0x10 */ f32 mProjFovy; + /* 0x14 */ f32 mProjAspect; + /* 0x18 */ cXyz mViewPos; + /* 0x24 */ cXyz mViewUpVector; + /* 0x30 */ cXyz mViewTargetVector; + /* 0x3C */ f32 mViewRoll; }; -class dDemo_particle_c : public JStudio_JParticle::TCreateObject { +class dDemo_ambient_c : public JStage::TAmbientLight { public: - dDemo_particle_c(JPAEmitterManager* p_emitMgr, const JStage::TSystem* p_system) - : JStudio_JParticle::TCreateObject(p_emitMgr, p_system) {} + enum Enable_e { + ENABLE_COLOR_e = (1 << 0), + }; - virtual ~dDemo_particle_c(); - virtual JPABaseEmitter* emitter_create(u32); + dDemo_ambient_c() { + mFlags = 0; + } + + virtual void JSGSetColor(GXColor); + virtual ~dDemo_ambient_c(); + + void onEnable(u8 flag) { mFlags |= flag; } + +private: + /* 0x04 */ u8 mFlags; + /* 0x05 */ GXColor mColor; }; class dDemo_light_c : public JStage::TLight { @@ -197,9 +259,7 @@ public: ENABLE_DIRECTION_e = (1 << 5), }; - dDemo_light_c() { - mFlags = 0; - } + dDemo_light_c() : mFlags(0) {} virtual void JSGSetLightType(JStage::TELight); virtual void JSGSetPosition(Vec const&); @@ -247,97 +307,36 @@ public: private: /* 0x04 */ u8 mFlags; - /* 0x05 */ u8 mFogType; + /* 0x05 */ s8 mFogType; /* 0x08 */ f32 mStartZ; /* 0x0C */ f32 mEndZ; /* 0x10 */ GXColor mColor; }; -class dDemo_camera_c : public JStage::TCamera { +class dDemo_system_c : public JStage::TSystem { public: - enum Enable_e { - ENABLE_PROJ_NEAR_e = (1 << 0), - ENABLE_PROJ_FAR_e = (1 << 1), - ENABLE_PROJ_FOVY_e = (1 << 2), - ENABLE_PROJ_ASPECT_e = (1 << 3), - ENABLE_VIEW_POS_e = (1 << 4), - ENABLE_VIEW_UP_VEC_e = (1 << 5), - ENABLE_VIEW_TARG_POS_e = (1 << 6), - ENABLE_VIEW_ROLL_e = (1 << 7), - }; - - dDemo_camera_c() { - mFlags = 0; - } - - virtual f32 JSGGetProjectionNear() const; - virtual void JSGSetProjectionNear(f32); - virtual f32 JSGGetProjectionFar() const; - virtual void JSGSetProjectionFar(f32); - virtual f32 JSGGetProjectionFovy() const; - virtual void JSGSetProjectionFovy(f32); - virtual f32 JSGGetProjectionAspect() const; - virtual void JSGSetProjectionAspect(f32); - virtual void JSGGetViewPosition(Vec*) const; - virtual void JSGSetViewPosition(Vec const&); - virtual void JSGGetViewUpVector(Vec*) const; - virtual void JSGSetViewUpVector(Vec const&); - virtual void JSGGetViewTargetPosition(Vec*) const; - virtual void JSGSetViewTargetPosition(Vec const&); - virtual f32 JSGGetViewRoll() const; - virtual void JSGSetViewRoll(f32); - virtual ~dDemo_camera_c(); + dDemo_system_c() { mpObject = NULL; } - void onEnable(u8 flag) { mFlags |= flag; } - bool checkEnable(u8 flag) { return mFlags & flag; } + virtual int JSGFindObject(JStage::TObject**, char const*, + JStage::TEObject) const; + virtual ~dDemo_system_c(); - cXyz& getTarget() { return mViewTargetVector; } - cXyz& getTrans() { return mViewPos; } - cXyz& getUp() { return mViewUpVector; } - f32 getFovy() { return mProjFovy; } - f32 getRoll() { return mViewRoll; } + void setObject(dDemo_object_c* i_object) { mpObject = i_object; } private: - /* 0x04 */ u8 mFlags; - /* 0x08 */ f32 mProjNear; - /* 0x0C */ f32 mProjFar; - /* 0x10 */ f32 mProjFovy; - /* 0x14 */ f32 mProjAspect; - /* 0x18 */ cXyz mViewPos; - /* 0x24 */ cXyz mViewUpVector; - /* 0x30 */ cXyz mViewTargetVector; - /* 0x3C */ f32 mViewRoll; + /* 0x4 */ dDemo_object_c* mpObject; }; -class dDemo_ambient_c : public JStage::TAmbientLight { +class dDemo_particle_c : public JStudio_JParticle::TCreateObject { public: - enum Enable_e { - ENABLE_COLOR_e = (1 << 0), - }; - - dDemo_ambient_c() { - mFlags = 0; - } - - virtual void JSGSetColor(GXColor); - virtual ~dDemo_ambient_c(); - - void onEnable(u8 flag) { mFlags |= flag; } + dDemo_particle_c(JPAEmitterManager* p_emitMgr, const JStage::TSystem* p_system) + : JStudio_JParticle::TCreateObject(p_emitMgr, p_system) {} -private: - /* 0x04 */ u8 mFlags; - /* 0x05 */ GXColor mColor; + virtual ~dDemo_particle_c(); + virtual JPABaseEmitter* emitter_create(u32); }; namespace { -class jstudio_tCreateObject_message : public JStudio::TCreateObject { -public: - jstudio_tCreateObject_message() {} - - virtual ~jstudio_tCreateObject_message(); - virtual bool create(JStudio::TObject**, const JStudio::stb::data::TParse_TBlock_object&); -}; - class jstudio_tAdaptor_message : public JStudio::TAdaptor_message { public: typedef JStudio::TObject_message ObjectType; @@ -348,6 +347,14 @@ public: virtual void adaptor_do_MESSAGE(JStudio::data::TEOperationData, const void*, u32); }; +class jstudio_tCreateObject_message : public JStudio::TCreateObject { +public: + jstudio_tCreateObject_message() {} + + virtual ~jstudio_tCreateObject_message(); + virtual bool create(JStudio::TObject**, const JStudio::stb::data::TParse_TBlock_object&); +}; + }; // namespace int dDemo_setDemoData(fopAc_ac_c*, u8, mDoExt_McaMorf*, char const*, int, u16*, u32, s8); @@ -373,12 +380,12 @@ public: static s32 getMode() { return m_mode; } static u32 getFrame() { return m_frame; } static JStudio::stb::TControl* getControl() { return m_control; } - static bool isStatus(u32 status) { return m_status & status; } + static u32 isStatus(u32 status) { return m_status & status; } static void onStatus(u32 status) { m_status |= status; } static void offStatus(u32 status) { m_status &= ~status; } static void setBranchData(const u8* p_data) { m_branchData = p_data; } static s16 getBranchId() { return m_branchId; } - static s16 getBranchNum() { return m_branchNum; } + static u16 getBranchNum() { return m_branchNum; } static jmessage_tControl* getMesgControl() { return m_mesgControl; } static void setBranchNum(u16 num) { |
