From d518b6b7235ed8abbecd6754ff503d5c1a72381c Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Fri, 1 Dec 2023 00:41:46 -0500 Subject: [PATCH] Document some details about obj_mtest --- include/d/actor/d_a_obj_mtest.h | 38 ++++++++++++++++++--------------- src/d/actor/d_a_obj_mtest.cpp | 28 ++++++++++++------------ 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/include/d/actor/d_a_obj_mtest.h b/include/d/actor/d_a_obj_mtest.h index 225af7798..8eaa5031b 100644 --- a/include/d/actor/d_a_obj_mtest.h +++ b/include/d/actor/d_a_obj_mtest.h @@ -10,35 +10,39 @@ namespace daObjMtest { class Act_c : public dBgS_MoveBgActor { public: enum Type { - Type_0 = 0, - Type_1 = 1, - Type_2 = 2, - Type_3 = 3, - Type_4 = 4, - Type_5 = 5, - Type_6 = 6, - Type_7 = 7, + Type_Mcube = 0, + Type_Mcyln = 1, + Type_Mcube10 = 2, + Type_Mcyln10 = 3, + Type_MwtrSB = 4, // Water splashes + Type_MygnSB = 5, + Type_Owater = 6, + Type_Astop = 7, Type_Max, }; enum Prm_e { + PRM_TYPE_W = 0x03, + PRM_TYPE_S = 0x00, + + PRM_SWSAVE_W = 0x08, + PRM_SWSAVE_S = 0x08, + PRM_ARG0_W = 0x04, PRM_ARG0_S = 0x10, PRM_ARG1_W = 0x04, PRM_ARG1_S = 0x18, - - PRM_SWSAVE_W = 0x08, - PRM_SWSAVE_S = 0x08, - - PRM_TYPE_W = 0x03, - PRM_TYPE_S = 0x00, }; - s32 prm_get_arg0() const { return daObj::PrmAbstract(this, PRM_ARG0_W, PRM_ARG0_S); } - s32 prm_get_arg1() const { return daObj::PrmAbstract(this, PRM_ARG1_W, PRM_ARG1_S); } - s32 prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_SWSAVE_W, PRM_SWSAVE_S); } s32 prm_get_type() const { return daObj::PrmAbstract(this, PRM_TYPE_W, PRM_TYPE_S); } + s32 prm_get_swSave() const { return daObj::PrmAbstract(this, PRM_SWSAVE_W, PRM_SWSAVE_S); } + // arg0 = 0 checks swSave and appears if set. arg0 = 1 checks swSave and appears if not set. + // Any other value for arg0 will cause it to appear unconditionally. + s32 prm_get_arg0() const { return daObj::PrmAbstract(this, PRM_ARG0_W, PRM_ARG0_S); } + // arg1 affects which DZB mesh to use. The meshes seem to be the same shape but have different properties. + // TODO: Look into these meshes more. + s32 prm_get_arg1() const { return daObj::PrmAbstract(this, PRM_ARG1_W, PRM_ARG1_S); } static char* M_arcname[]; static const dCcD_SrcCyl M_cyl_src; diff --git a/src/d/actor/d_a_obj_mtest.cpp b/src/d/actor/d_a_obj_mtest.cpp index e6857ebec..7072e5b51 100644 --- a/src/d/actor/d_a_obj_mtest.cpp +++ b/src/d/actor/d_a_obj_mtest.cpp @@ -59,6 +59,17 @@ enum ASTOP_RES_FILE_ID { // IDs and indexes are synced ASTOP_DZB_ASTOP00=0x7, }; +cXyz daObjMtest::Act_c::M_scl_mult[Type_Max] = { + cXyz(1.0f, 1.0f, 1.0f), + cXyz(1.0f, 0.5f, 1.0f), + cXyz(10.0f, 10.0f, 10.0f), + cXyz(10.0f, 5.0f, 10.0f), + cXyz(0.2f, 0.2f, 0.2f), + cXyz(0.2f, 0.2f, 0.2f), + cXyz(1.0f, 1.0f, 1.0f), + cXyz(40.0f, 1.0f, 40.0f), +}; + const dCcD_SrcCyl daObjMtest::Act_c::M_cyl_src = { // dCcD_SrcGObjInf { @@ -89,17 +100,6 @@ const dCcD_SrcCyl daObjMtest::Act_c::M_cyl_src = { }, }; -cXyz daObjMtest::Act_c::M_scl_mult[Type_Max] = { - cXyz(1.0f, 1.0f, 1.0f), - cXyz(1.0f, 0.5f, 1.0f), - cXyz(10.0f, 10.0f, 10.0f), - cXyz(10.0f, 5.0f, 10.0f), - cXyz(0.2f, 0.2f, 0.2f), - cXyz(0.2f, 0.2f, 0.2f), - cXyz(1.0f, 1.0f, 1.0f), - cXyz(40.0f, 1.0f, 40.0f), -}; - /* 000000EC-00000198 .text chk_appear__Q210daObjMtest5Act_cFv */ bool daObjMtest::Act_c::chk_appear() { s32 swSave = prm_get_swSave(); @@ -144,13 +144,13 @@ BOOL daObjMtest::Act_c::Create() { fopAcM_SetMtx(this, mMtx); init_mtx(); - if (M_type == 4 || M_type == 5) { + if (M_type == Type_MwtrSB || M_type == Type_MygnSB) { fopAcM_setCullSizeBox(this, -3000.0f, -10.0f, -3000.0f, 3000.0f, 10.0f, 3000.0f); - } else if (M_type != 6) { + } else if (M_type != Type_Owater) { fopAcM_setCullSizeBox(this, -51.0f, -1.0f, -51.0f, 51.0f, 101.0f, 51.0f); } - if (M_type == 7) { + if (M_type == Type_Astop) { fopAcM_OnStatus(this, fopAcStts_NOCULLEXEC_e); }