diff --git a/include/JSystem/J3DGraphAnimator/J3DModelData.h b/include/JSystem/J3DGraphAnimator/J3DModelData.h index 521a97f97..c6fa872a3 100644 --- a/include/JSystem/J3DGraphAnimator/J3DModelData.h +++ b/include/JSystem/J3DGraphAnimator/J3DModelData.h @@ -81,6 +81,7 @@ public: bool checkBBoardFlag() const { return mbHasBillboard == 1; } void entryTexMtxAnimator(J3DAnmTextureSRTKey* anm) { mMaterialTable.entryTexMtxAnimator(anm); } void entryTevRegAnimator(J3DAnmTevRegKey* anm) { mMaterialTable.entryTevRegAnimator(anm); } + void entryMatColorAnimator(J3DAnmColor* anm) { mMaterialTable.entryMatColorAnimator(anm); } void setTexMtxAnimator(J3DAnmTextureSRTKey* pAnm, J3DTexMtxAnm* pTexAnm, J3DTexMtxAnm* pDualAnmR) { mMaterialTable.setTexMtxAnimator(pAnm, pTexAnm, pDualAnmR); } @@ -102,7 +103,6 @@ public: } // TODO - void entryMatColorAnimator(J3DAnmColor*) {} void getBasicMtxCalc() {} void getBinary() {} void getRootNode() {} diff --git a/include/JSystem/J3DGraphBase/J3DMatBlock.h b/include/JSystem/J3DGraphBase/J3DMatBlock.h index cf44e26ea..5fea0a900 100644 --- a/include/JSystem/J3DGraphBase/J3DMatBlock.h +++ b/include/JSystem/J3DGraphBase/J3DMatBlock.h @@ -566,7 +566,7 @@ struct J3DZMode { J3DZMode() { mZModeID = j3dDefaultZModeID; } explicit J3DZMode(const J3DZModeInfo& info) { setZModeInfo(info); } - u8 getCompareEnaable() const { return j3dZModeTable[mZModeID * 3 + 0]; } + u8 getCompareEnable() const { return j3dZModeTable[mZModeID * 3 + 0]; } u8 getFunc() const { return j3dZModeTable[mZModeID * 3 + 1]; } u8 getUpdateEnable() const { return j3dZModeTable[mZModeID * 3 + 2]; } @@ -575,8 +575,8 @@ struct J3DZMode { mZModeID = calcZModeID(compareEn, info.mFunc, info.mUpdateEnable); } - void load() { - J3DGDSetZMode(getCompareEnaable(), GXCompare(getFunc()), getUpdateEnable()); + void load() const { + J3DGDSetZMode(getCompareEnable(), GXCompare(getFunc()), getUpdateEnable()); } void setCompareEnable(u8 i_compare) { diff --git a/include/JSystem/JKernel/JKRArchive.h b/include/JSystem/JKernel/JKRArchive.h index 1e374ec0a..cb583023b 100644 --- a/include/JSystem/JKernel/JKRArchive.h +++ b/include/JSystem/JKernel/JKRArchive.h @@ -225,4 +225,16 @@ inline void* JKRGetTypeResource(u32 tag, const char* name, JKRArchive* arc) { return JKRArchive::getGlbResource(tag, name, arc); } +inline u32 JKRReadIdxResource(void* buffer, u32 bufferSize, u32 index, JKRArchive* arc) { + return arc->readIdxResource(buffer, bufferSize, index); +} + +inline u32 JKRReadIdResource(void* buffer, u32 bufferSize, u16 id, JKRArchive* arc) { + return arc->readResource(buffer, bufferSize, id); +} + +inline u32 JKRReadResource(void* buffer, u32 bufferSize, u16 id, JKRArchive* arc) { + return arc->readResource(buffer, bufferSize, id); +} + #endif diff --git a/include/JSystem/JParticle/JPAParticle.h b/include/JSystem/JParticle/JPAParticle.h index d88702bdb..697c2b440 100644 --- a/include/JSystem/JParticle/JPAParticle.h +++ b/include/JSystem/JParticle/JPAParticle.h @@ -39,6 +39,7 @@ public: JPABaseParticle() : mLink(this), mCurFrame(0.0f) {} void setOffsetPosition(f32 x, f32 y, f32 z) { mGlobalPosition.set(x, y, z); } void setOffsetPosition(const JGeometry::TVec3& pos) { mGlobalPosition.set(pos); } + void getGlobalPosition(JGeometry::TVec3& out) const { out.set(mGlobalPosition); } bool checkStatus(u32 flag) { return mStatus & flag; } bool isInvisibleParticle() { return checkStatus(JPAPtclStts_Invisible); } @@ -50,7 +51,6 @@ public: void getAge() const {} void getDrawParamCPtr() {} void getDrawParamPPtr() {} - void getGlobalPosition(JGeometry::TVec3&) const {} void getHeight() {} void getLifeTime() const {} void getLocalPosition(JGeometry::TVec3&) const {} diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index 238fdfa47..a6016e218 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -5,6 +5,9 @@ #include "d/d_particle.h" #include "d/d_cc_d.h" +inline u8 dComIfGs_getSelectEquip(int i_no); +inline u8 dComIfGp_getMiniGameType(); + class daPy_mtxFollowEcallBack_c : public dPa_levelEcallBack { public: void execute(JPABaseEmitter*); @@ -433,9 +436,11 @@ public: bool checkArrowShoot() const { return checkResetFlg0(daPyRFlg0_ARROW_SHOOT); } bool checkGrabWear() const { return field_0x2b0 < 0.0f; } + bool checkNormalSwordEquip() const { + return dComIfGs_getSelectEquip(0) == SWORD || dComIfGp_getMiniGameType() == 2; + } void setFace(daPy_FACE face) { mFace = face; } - void checkNormalSwordEquip() const {} void checkMasterSwordEquip() const {} void checkFinalMasterSwordEquip() const {} void checkBowMiniGame() const {} diff --git a/include/d/actor/d_a_player_main.h b/include/d/actor/d_a_player_main.h index d526aec44..73d480847 100644 --- a/include/d/actor/d_a_player_main.h +++ b/include/d/actor/d_a_player_main.h @@ -124,10 +124,10 @@ public: /* 0x04 */ bool field_0x04; /* 0x05 */ bool field_0x05; - /* 0x08 */ u8 field_0x08[0x0C - 0x08]; + /* 0x08 */ f32 field_0x08; /* 0x0C */ f32 field_0x0C; /* 0x10 */ f32 field_0x10; - /* 0x14 */ u8 field_0x14[0x20 - 0x14]; + /* 0x14 */ cXyz field_0x14; /* 0x20 */ const csXyz* field_0x20; /* 0x24 */ JPABaseEmitter* mpEmitter; }; // Size: 0x28 @@ -232,7 +232,7 @@ public: void draw(); ~daPy_swBlur_c() {} - /* 0x010 */ ResTIMG* mpBlurTex; + /* 0x010 */ ResTIMG* mpTex; /* 0x014 */ int field_0x014; /* 0x018 */ int field_0x018; /* 0x01C */ int mBlurColorType; @@ -1546,7 +1546,7 @@ public: ModeFlg_CAUGHT = 0x10000000, ModeFlg_SUBJECT = 0x20000000, ModeFlg_40000000 = 0x40000000, - ModeFlg_BT = 0x80000000, + ModeFlg_PARRY = 0x80000000, }; typedef BOOL (daPy_lk_c::*ProcFunc)(); @@ -2315,7 +2315,7 @@ public: BOOL procFoodThrow(); BOOL procFoodSet_init(); BOOL procFoodSet(); - void setSwordModel(int); + void setSwordModel(BOOL); void setLightSaver(); BOOL checkDemoShieldNoDraw(); BOOL checkDemoSwordNoDraw(int); @@ -2597,16 +2597,16 @@ public: /* 0x2EC8 */ J3DAnmTextureSRTKey* mpGicer01Btk; /* 0x2ECC */ JKRSolidHeap* m2ECC; /* 0x2ED0 */ void* m_item_bck_buffer; - /* 0x2ED4 */ J3DAnmTextureSRTKey* mpHeldItemModelAnimTexEx; - /* 0x2ED8 */ J3DAnmTextureSRTKey* mpSwordAnimBTK; - /* 0x2EDC */ J3DAnmTevRegKey* mpHeldItemAnimBRK; + /* 0x2ED4 */ J3DAnmTextureSRTKey* mpHeldItemBtk; + /* 0x2ED8 */ J3DAnmTextureSRTKey* mpSwordBtk; + /* 0x2EDC */ J3DAnmTevRegKey* mpHeldItemBrk; /* 0x2EE0 */ J3DModel* mpBottleContentsModel; /* 0x2EE4 */ J3DModel* mpBottleCapModel; /* 0x2EE8 */ J3DModel* mpSwordModel1; /* 0x2EEC */ J3DModel* mpSwordTipStabModel; - /* 0x2EF0 */ J3DAnmColor* m2EF0; - /* 0x2EF4 */ J3DAnmTextureSRTKey* m2EF4; - /* 0x2EF8 */ J3DAnmTevRegKey* m2EF8; + /* 0x2EF0 */ J3DAnmColor* mpCutfBpk; + /* 0x2EF4 */ J3DAnmTextureSRTKey* mpCutfBtk; + /* 0x2EF8 */ J3DAnmTevRegKey* mpCutfBrk2EF8; /* 0x2EFC */ mDoExt_brkAnm m2EFC; /* 0x2F14 */ J3DModel* mpSuimenMunyaModel; /* 0x2F18 */ J3DAnmTextureSRTKey* mpSuimenMunyaBtk; diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index 0b81ab282..c33061be1 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -14,6 +14,12 @@ struct actor_method_class { /* 0x14 */ u8 field_0x14[0xC]; // Likely padding }; +// Unclear what this is. Only used by one actor (PLAYER) +struct actor_method_class2 { + /* 0x00 */ actor_method_class base; + /* 0x20 */ u32 field_0x20; +}; + enum fopAc_Status_e { // Note: The lowest 5 bits of the status field (& 0x1F) act as an index controlling the map icon type. fopAcStts_SHOWMAP_e = 0x00000020, @@ -123,6 +129,7 @@ enum dEvt_Command_e { enum dEvt_Condition_e { dEvtCnd_NONE_e = 0x0000, dEvtCnd_CANTALK_e = 0x0001, + dEvtCnd_UNK2_e = 0x0002, dEvtCnd_CANDOOR_e = 0x0004, dEvtCnd_CANGETITEM_e = 0x0008, dEvtCnd_CANTALKITEM_e = 0x0020, @@ -132,46 +139,59 @@ enum dEvt_Condition_e { // TODO: move to d_event.h class dEvt_info_c { public: + typedef s16 (*CallbackFunc)(void*, int); + dEvt_info_c(); virtual ~dEvt_info_c() {} void setEventName(char*); char* getEventName(); - void beforeProc(); - void setCommand(u16 command) { mCommand = command; } - void setMapToolId(u8 id) { mMapToolId = id; } - void setEventId(s16 id) { mEventId = id; } - void setCondition(u16 condition) { mCondition = condition; } - u16 getCondition() { return mCondition; } - //void setArchiveName(char* name) { mArchiveName = name; } - u8 getMapToolId() { return mMapToolId; } + void setToolId(u8 id) { mMapToolId = id; } s16 getEventId() { return mEventId; } - s16 getIdx() { return mIndex; } - void setIdx(u8 i_idx) { mIndex = i_idx; } - //char* getArchiveName() { return mArchiveName; } + void setEventId(s16 id) { mEventId = id; } + + u16 getCondition() { return mCondition; } + void setCondition(u16 condition) { mCondition = condition; } BOOL chkCondition(u16 condition) { return (mCondition & condition) == condition; } void onCondition(u16 cond) { mCondition |= cond; } - void offCondition(u16 cond) { mCondition &= ~cond; } - s16 runPhotoEventCB(void* ac, int flag) { - if (mpPhotoCB == NULL) - return -1; - return mpPhotoCB(ac, flag); - } + void beforeProc() { mCondition = dEvtCnd_NONE_e; } BOOL checkCommandTalk() { return mCommand == dEvtCmd_INTALK_e; } BOOL checkCommandItem() { return mCommand == dEvtCmd_INGETITEM_e; } BOOL checkCommandDoor() { return mCommand == dEvtCmd_INDOOR_e; } BOOL checkCommandDemoAccrpt() { return mCommand == dEvtCmd_INDEMO_e; } BOOL checkCommandCatch() { return mCommand == dEvtCmd_INCATCH_e; } + u16 getCommand() { return mCommand; } + void setCommand(u16 command) { mCommand = command; } + void setXyEventCB(CallbackFunc cb) { mpEventCB = cb; } + s16 runXyEventCB(void* ac, int flag) { + if (mpEventCB == NULL) + return -1; + return mpEventCB(ac, flag); + } + void setXyCheckCB(CallbackFunc cb) { mpCheckCB = cb; } + s16 runXyCheckCB(void* ac, int flag) { + if (mpCheckCB == NULL) + return -1; + return mpCheckCB(ac, flag); + } + void setPhotoEventCB(CallbackFunc cb) { mpPhotoCB = cb; } + s16 runPhotoEventCB(void* ac, int flag) { + if (mpPhotoCB == NULL) + return -1; + return mpPhotoCB(ac, flag); + } + +public: /* 0x04 */ u16 mCommand; /* 0x06 */ u16 mCondition; /* 0x08 */ s16 mEventId; /* 0x0A */ u8 mMapToolId; /* 0x0B */ s8 mIndex; - /* 0x0C */ s16 (*mpEventCB)(void*, int); - /* 0x10 */ s16 (*mpCheckCB)(void*, int); - /* 0x14 */ s16 (*mpPhotoCB)(void*, int); + /* 0x0C */ CallbackFunc mpEventCB; + /* 0x10 */ CallbackFunc mpCheckCB; + /* 0x14 */ CallbackFunc mpPhotoCB; }; // Size = 0x18 struct actor_place { diff --git a/src/d/actor/d_a_hookshot.cpp b/src/d/actor/d_a_hookshot.cpp index 053ba4236..f12184ab7 100644 --- a/src/d/actor/d_a_hookshot.cpp +++ b/src/d/actor/d_a_hookshot.cpp @@ -104,9 +104,11 @@ static u8 l_matDL[] ALIGN_DECL(32) = { 0x61, 0x94, ((u32)&l_chainS3TCTEX >> 0x05 >> 0x10), ((u32)&l_chainS3TCTEX >> 0x05 >> 0x08), ((u32)&l_chainS3TCTEX >> 0x05 >> 0x00), 0x61, 0x30, 0x00, (l_chainS3TCTEX__width >> 0x08), (l_chainS3TCTEX__width >> 0x00), 0x61, 0x31, 0x00, (l_chainS3TCTEX__height >> 0x08), (l_chainS3TCTEX__height >> 0x00), - 0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x80, 0x08, 0x30, 0x3C, 0xF3, 0xCF, 0x00, + 0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x80, + 0x08, 0x30, 0x3C, 0xF3, 0xCF, 0x00, 0x10, 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00, - 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x05, 0x43, 0x61, 0x28, 0x3C, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x05, 0x43, + 0x61, 0x28, 0x3C, 0x00, 0x00, 0x61, 0xC0, 0x08, 0x24, 0xAF, 0x61, 0xC1, 0x08, 0xFF, 0xF0, 0x61, 0x28, 0x3C, 0x00, 0x00, @@ -169,7 +171,7 @@ void daHookshot_shape::draw() { chain_pos += chain_offset; } - J3DShape::sOldVcdVatCmd = NULL; + J3DShape::resetVcdVatCache(); } /* 800F12C8-800F1324 .text draw__12daHookshot_cFv */ diff --git a/src/d/actor/d_a_nh.cpp b/src/d/actor/d_a_nh.cpp index 107f8073a..e3fe66733 100644 --- a/src/d/actor/d_a_nh.cpp +++ b/src/d/actor/d_a_nh.cpp @@ -209,7 +209,7 @@ BOOL daNh_c::checkBinCatch() { l_HIO.prm.field_0x10, l_HIO.prm.field_0x3c, 1 ); - mEvtInfo.onCondition(0x40); + mEvtInfo.onCondition(dEvtCnd_CANCATCH_e); return FALSE; } diff --git a/src/d/actor/d_a_npc_kamome.cpp b/src/d/actor/d_a_npc_kamome.cpp index 30fc5e904..4c6b0ed10 100644 --- a/src/d/actor/d_a_npc_kamome.cpp +++ b/src/d/actor/d_a_npc_kamome.cpp @@ -445,8 +445,8 @@ BOOL daNpc_kam_c::init() { mEventIdxs[i] = dComIfGp_evmng_getEventIdx(event_name_tbl[i], 0xFF); } - mEvtInfo.mpCheckCB = &daNpc_kam_XyCheckCB; - mEvtInfo.mpEventCB = &daNpc_kam_XyEventCB; + mEvtInfo.setXyCheckCB(daNpc_kam_XyCheckCB); + mEvtInfo.setXyEventCB(daNpc_kam_XyEventCB); return TRUE; } diff --git a/src/d/actor/d_a_obj_barrier.cpp b/src/d/actor/d_a_obj_barrier.cpp index f290b0acb..0b8f09d0c 100644 --- a/src/d/actor/d_a_obj_barrier.cpp +++ b/src/d/actor/d_a_obj_barrier.cpp @@ -257,7 +257,7 @@ void daObjBarrier_c::break_order_proc() { mBarrierProc = PROC_BREAK_END_WAIT; } else { fopAcM_orderOtherEventId(this, mEventID); - mEvtInfo.onCondition(2); + mEvtInfo.onCondition(dEvtCnd_UNK2_e); } } diff --git a/src/d/actor/d_a_obj_mknjd.cpp b/src/d/actor/d_a_obj_mknjd.cpp index b84cdf2aa..2959d4456 100644 --- a/src/d/actor/d_a_obj_mknjd.cpp +++ b/src/d/actor/d_a_obj_mknjd.cpp @@ -283,8 +283,8 @@ int daObjMknjD::Act_c::Create() { if (checkItemGet(mGiveItemNo, 1) == 0) { m043F = 8; - mEvtInfo.mpCheckCB = daObjMknjD_XyCheckCB; - mEvtInfo.mpEventCB = daObjMknjD_XyEventCB; + mEvtInfo.setXyCheckCB(daObjMknjD_XyCheckCB); + mEvtInfo.setXyEventCB(daObjMknjD_XyEventCB); } else { m043F = 0; @@ -710,7 +710,7 @@ int daObjMknjD::Act_c::Execute(Mtx** i_mtx) { switch (m043F) { case 0: - mEvtInfo.onCondition(1); + mEvtInfo.onCondition(dEvtCnd_CANTALK_e); if (mEvtInfo.checkCommandTalk()) { m0500 = 1; @@ -835,8 +835,8 @@ int daObjMknjD::Act_c::Execute(Mtx** i_mtx) { break; case 8: - mEvtInfo.onCondition(1); - mEvtInfo.onCondition(32); + mEvtInfo.onCondition(dEvtCnd_CANTALK_e); + mEvtInfo.onCondition(dEvtCnd_CANTALKITEM_e); if (mEvtInfo.checkCommandTalk()) { if (dComIfGp_event_chkTalkXY()) { diff --git a/src/d/actor/d_a_obj_paper.cpp b/src/d/actor/d_a_obj_paper.cpp index c00a13040..89c5f43d4 100644 --- a/src/d/actor/d_a_obj_paper.cpp +++ b/src/d/actor/d_a_obj_paper.cpp @@ -172,7 +172,7 @@ namespace daObjPaper { mode_talk0_init(); } else { - mEvtInfo.mCondition |= dEvtCnd_CANTALK_e; + mEvtInfo.onCondition(dEvtCnd_CANTALK_e); } } diff --git a/src/d/actor/d_a_obj_toripost.cpp b/src/d/actor/d_a_obj_toripost.cpp index 9a1c2dd42..bba5528af 100644 --- a/src/d/actor/d_a_obj_toripost.cpp +++ b/src/d/actor/d_a_obj_toripost.cpp @@ -525,8 +525,8 @@ void daObjTpost_c::eventOrder() { }; if(field_0x8F7 == 1 || field_0x8F7 == 2) { - mEvtInfo.onCondition(1); - mEvtInfo.onCondition(0x20); + mEvtInfo.onCondition(dEvtCnd_CANTALK_e); + mEvtInfo.onCondition(dEvtCnd_CANTALKITEM_e); if(field_0x8F7 == 1) { fopAcM_orderSpeakEvent(this); diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index 288b84710..20b07debf 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -29,73 +29,70 @@ #include "d/actor/d_a_boko.h" #include "SSystem/SComponent/c_counter.h" -#include "d/actor/d_a_player_main_data.inc" - -#include "d/actor/d_a_player_HIO.inc" - Vec dummy_3569; JGeometry::TVec3 l_hammer_splash_particle_scale(0.00002f, 0.00002f, 0.00002f); -GXColor l_freeze_fade_color = {0xFF, 0xFF, 0xFF, 0xFF}; - cXyz l_debug_keep_pos; csXyz l_debug_current_angle; csXyz l_debug_shape_angle; -u8 daPy_matAnm_c::m_maba_flg; -u8 daPy_matAnm_c::m_eye_move_flg; -u8 daPy_matAnm_c::m_maba_timer; -u8 daPy_matAnm_c::m_morf_frame; +#include "d/actor/d_a_player_main_data.inc" -s16 daPy_dmEcallBack_c::m_timer = 0; -u16 daPy_dmEcallBack_c::m_type = 3; +#include "d/actor/d_a_player_HIO.inc" -u8 right_dir_4883[0xC]; -u8 texObj_5157[0x20]; +static u8 l_sightDL[] ALIGN_DECL(32) = { + 0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x00, 0x00, 0x00, 0x00, 0xF3, 0xCF, 0x00, + 0x10, 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00, + 0x61, 0x28, 0x38, 0x03, 0xC0, + 0x61, 0xC0, 0x08, 0x42, 0x8F, + 0x61, 0xC1, 0x08, 0xE6, 0x70, + 0x61, 0x43, 0x00, 0x00, 0x01, + 0x61, 0x40, 0x00, 0x00, 0x06, + 0x61, 0x41, 0x00, 0x04, 0xAD, + 0x61, 0xF3, 0x64, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01, + 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x00, + 0x61, 0x00, 0x00, 0x00, 0x01, + 0x98, 0x00, 0x04, 0x01, 0x01, 0x00, 0x01, + 0x01, 0xFF, 0x01, 0x00, 0x00, 0x01, 0x01, 0xFF, 0x00, 0x01, 0x00, 0xFF, 0xFF, + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, +}; -daPy_waterDropPcallBack_c daPy_waterDropEcallBack_c::m_pcallback; +static Vec waterfall_ripple_scale_5702 = {0.75f, 0.75f, 0.75f}; +static Vec grass_scale_6038 = {1.5f, 1.5f, 1.5f}; +static Vec smoke_scale_6039 = {1.25f, 1.25f, 1.25f}; +static Vec eff_scale_24884 = {1.5f, 1.5f, 1.5f}; +static Quaternion norm_quat_25648 = {0.0f, 0.0f, 0.0f, 1.0f}; +static Vec top_vec_29499 = {0.0f, 70.0f, 0.0f}; -u8 normal_ripple_scale_5638[0xC]; -u8 small_ripple_scale_5641[0xC]; -u8 waterfall_splash_trans_5699[0xC]; -u8 run_splash_scale_6040[0xC]; -u8 run_grass_scale_6043[0xC]; -u8 heavy_emit_smoke_scale_6046[0xC]; -u8 heavy_dyn_smoke_scale_6049[0xC]; -u8 heavy_pat_smoke_scale_6052[0xC]; -u8 tail_scale_6508[0xC]; -u8 arm_flame_scale_6651[0xC]; -u8 _6785[0xC]; -u8 eff_scale0_6784[0xC]; -u8 _6789[0xC]; -u8 eff_scale2_6788[0xC]; -u8 direction_6792[0xC]; -u8 splash_scale_14445[0xC]; -u8 ripple_scale_14448[0xC]; -u8 _15293[0xC]; -u8 arm_pos_15292[0xC]; -u8 _15297[0xC]; -u8 armA_offset_15296[0xC]; -u8 dynamic_scale_16750[0xC]; -u8 particle_scale_16753[0xC]; -u8 _17480[0xC]; -u8 local_height_offset_17479[0xC]; -u8 eff_scale_18886[0xC]; -u8 eff_dscale_18889[0xC]; -u8 eff_pscale_18892[0xC]; -u8 smoke_kusa_particle_scale_21005[0xC]; -u8 emitter_scale_21008[0xC]; -u8 emitter_trans_21011[0xC]; -u8 d_scale_23162[0xC]; -u8 p_scale_23165[0xC]; -u8 emitter_trans_24824[0xC]; -u8 particle_scale_24827[0xC]; -u8 root_mtx_25647[0x30]; - -static mDoExt_offCupOnAupPacket l_offCupOnAupPacket1; -static mDoExt_offCupOnAupPacket l_offCupOnAupPacket2; -static mDoExt_onCupOffAupPacket l_onCupOffAupPacket1; -static mDoExt_onCupOffAupPacket l_onCupOffAupPacket2; +const u16 aura_emitter_joint_5412[] = { + 0x0007, 0x000B, + 0x0008, 0x000C, + 0x0021, 0x0026, + 0x0022, 0x0027, + 0x0000, 0x000F, +}; +const u16 aura_model_joint_5413[] = { + 0x0000, 0x000F, + 0x0008, 0x000C, + 0x0021, 0x0026, +}; +const Vec wave_offset_5635 = {0.0f, 18.0f, 0.0f}; +const Vec swim_offset_5636 = {0.0f, 30.0f, 0.0f}; +const Vec swim_side_offset_5637 = {0.0f, 0.0f, 30.0f}; +const u16 eff_joint_8128[] = { + 0x0007, 0x000B, + 0x001A, 0x000E, + 0x001E, +}; +const Vec ripple_scale_8193 = {0.75f, 0.75f, 0.75f}; +const Vec splash_scale_21927 = {0.3f, 0.3f, 0.3f}; +const Vec ripple_scale_21928 = {0.5f, 0.5f, 0.5f}; static void dummydatafunc(f32* temp, f64* temp2) { // temporary hack to improve diffs until sdata2 offsets are figured out @@ -147,85 +144,177 @@ static void dummydatafunc(f32* temp, f64* temp2) { *temp = 11.0f; *temp = 17.5f; *temp = 1000000000.0f; - OSReport("Adanmae"); - OSReport("d_a_player_dproc.inc"); - OSReport("0"); - OSReport("Halt"); - OSReport("Link"); - OSReport("DEFAULT_GETITEM"); - OSReport("GanonK"); - OSReport("GTower"); - OSReport("d_a_player_bow.inc"); - OSReport("d_a_player_hook.inc"); - OSReport("d_a_player_fan.inc"); - OSReport("d_a_player_hammer.inc"); - OSReport("Type"); - OSReport("Omori"); - OSReport("d_a_player_sword.inc"); - OSReport("M_DaiB"); - OSReport("Xboss2"); - OSReport("M_DragB"); - OSReport("Xboss0"); - OSReport("fall"); - OSReport("d_a_player_main.cpp"); - OSReport("(demo_mode < daPy_demo_c::DEMO_LAST_e) || (demo_mode == daPy_demo_c::DEMO_NEW_ANM0_e)"); - OSReport("Ojhous"); - OSReport("Orichh"); - OSReport("kinBOSS"); - OSReport("Xboss1"); - OSReport("ICE_FAILED"); - OSReport("pos"); - OSReport("angle"); - OSReport("prm0"); - OSReport("prm1"); - OSReport("stick"); - OSReport("face"); - OSReport("GanonM"); - OSReport("sea"); - OSReport("m_tex_anm_heap.m_buffer != 0"); - OSReport("m_texNoAnms != 0"); - OSReport("mat_anm != 0"); - OSReport("m_tex_scroll_heap.m_buffer != 0"); - OSReport("material_num == 2"); - OSReport("m_texMtxAnm != 0"); - OSReport("m_tex_eye_scroll[no] != 0"); - OSReport("tmtx != 0"); - OSReport("mtl->getMaterialAnm() != 0"); - OSReport("tmp_modelData != 0"); - OSReport("aura_p->getModel() != 0"); - OSReport("m_old_fdata != 0"); - OSReport("m_pbCalc[PART_UNDER_e] != 0"); - OSReport("m_pbCalc[PART_UPPER_e] != 0"); - OSReport("m_HIO != 0"); - OSReport("m_anm_heap_under[UNDER_MOVE0_e].m_buffer != 0"); - OSReport("m_sanm_buffer != 0"); - OSReport("m_item_bck_buffer != 0"); - OSReport("tmp_trans_bas != 0"); - OSReport("tmp_trans != 0"); - OSReport("tmp_tp != 0"); - OSReport("tmp_tk != 0"); - OSReport("*i_model != 0"); - OSReport("btk_anm != 0"); - OSReport("brk_anm != 0"); - OSReport("zoff_blend_cnt <= 4"); - OSReport("zoff_none_cnt <= 4"); - OSReport("zon_cnt <= 4"); - OSReport("zon_cnt == 4"); - OSReport("zoff_none_cnt == 4"); - OSReport("zoff_blend_cnt == 4"); - OSReport("dummy_data != 0"); - OSReport("Always"); - OSReport("tmp_tex != 0"); - OSReport("tmp_img != 0"); - OSReport("texture != 0"); - OSReport("textureName != 0"); - OSReport("linktexS3TC"); - OSReport("Pjavdou"); - OSReport("ShipD"); - OSReport("Siren"); - OSReport("data_size < l_sanm_buffer_size"); + OSReport("Adanmae"); + OSReport("d_a_player_dproc.inc"); + OSReport("0"); + OSReport("Halt"); + OSReport("Link"); + OSReport("DEFAULT_GETITEM"); + OSReport("GanonK"); + OSReport("GTower"); + OSReport("d_a_player_bow.inc"); + OSReport("d_a_player_hook.inc"); + OSReport("d_a_player_fan.inc"); + OSReport("d_a_player_hammer.inc"); + OSReport("Type"); + OSReport("Omori"); + OSReport("d_a_player_sword.inc"); + OSReport("M_DaiB"); + OSReport("Xboss2"); + OSReport("M_DragB"); + OSReport("Xboss0"); + OSReport("fall"); + OSReport("d_a_player_main.cpp"); + OSReport("(demo_mode < daPy_demo_c::DEMO_LAST_e) || (demo_mode == daPy_demo_c::DEMO_NEW_ANM0_e)"); + OSReport("Ojhous"); + OSReport("Orichh"); + OSReport("kinBOSS"); + OSReport("Xboss1"); + OSReport("ICE_FAILED"); + OSReport("pos"); + OSReport("angle"); + OSReport("prm0"); + OSReport("prm1"); + OSReport("stick"); + OSReport("face"); + OSReport("GanonM"); + OSReport("sea"); + OSReport("m_tex_anm_heap.m_buffer != 0"); + OSReport("m_texNoAnms != 0"); + OSReport("mat_anm != 0"); + OSReport("m_tex_scroll_heap.m_buffer != 0"); + OSReport("material_num == 2"); + OSReport("m_texMtxAnm != 0"); + OSReport("m_tex_eye_scroll[no] != 0"); + OSReport("tmtx != 0"); + OSReport("mtl->getMaterialAnm() != 0"); + OSReport("tmp_modelData != 0"); + OSReport("aura_p->getModel() != 0"); + OSReport("m_old_fdata != 0"); + OSReport("m_pbCalc[PART_UNDER_e] != 0"); + OSReport("m_pbCalc[PART_UPPER_e] != 0"); + OSReport("m_HIO != 0"); + OSReport("m_anm_heap_under[UNDER_MOVE0_e].m_buffer != 0"); + OSReport("m_sanm_buffer != 0"); + OSReport("m_item_bck_buffer != 0"); + OSReport("tmp_trans_bas != 0"); + OSReport("tmp_trans != 0"); + OSReport("tmp_tp != 0"); + OSReport("tmp_tk != 0"); + OSReport("*i_model != 0"); + OSReport("btk_anm != 0"); + OSReport("brk_anm != 0"); + OSReport("zoff_blend_cnt <= 4"); + OSReport("zoff_none_cnt <= 4"); + OSReport("zon_cnt <= 4"); + OSReport("zon_cnt == 4"); + OSReport("zoff_none_cnt == 4"); + OSReport("zoff_blend_cnt == 4"); + OSReport("dummy_data != 0"); + OSReport("Always"); + OSReport("tmp_tex != 0"); + OSReport("tmp_img != 0"); + OSReport("texture != 0"); + OSReport("textureName != 0"); + OSReport("linktexS3TC"); + OSReport("Pjavdou"); + OSReport("ShipD"); + OSReport("Siren"); + OSReport("data_size < l_sanm_buffer_size"); } +GXColor l_freeze_fade_color = {0xFF, 0xFF, 0xFF, 0xFF}; + +u8 daPy_matAnm_c::m_maba_flg; +u8 daPy_matAnm_c::m_eye_move_flg; +u8 daPy_matAnm_c::m_maba_timer; +u8 daPy_matAnm_c::m_morf_frame; + +#include "d/actor/d_a_player_particle.inc" + +#include "d/actor/d_a_player_dproc.inc" + +#include "d/actor/d_a_player_ladder.inc" + +#include "d/actor/d_a_player_hang.inc" + +#include "d/actor/d_a_player_climb.inc" + +#include "d/actor/d_a_player_whide.inc" + +#include "d/actor/d_a_player_crawl.inc" + +#include "d/actor/d_a_player_grab.inc" + +#include "d/actor/d_a_player_swim.inc" + +#include "d/actor/d_a_player_battle.inc" + +#include "d/actor/d_a_player_ship.inc" + +#include "d/actor/d_a_player_rope.inc" + +#include "d/actor/d_a_player_boomerang.inc" + +#include "d/actor/d_a_player_bow.inc" + +#include "d/actor/d_a_player_hook.inc" + +#include "d/actor/d_a_player_fan.inc" + +#include "d/actor/d_a_player_tact.inc" + +#include "d/actor/d_a_player_vomit.inc" + +#include "d/actor/d_a_player_hammer.inc" + +#include "d/actor/d_a_player_pushpull.inc" + +#include "d/actor/d_a_player_bottle.inc" + +#include "d/actor/d_a_player_weapon.inc" + +#include "d/actor/d_a_player_food.inc" + +#include "d/actor/d_a_player_sword.inc" + +u8 normal_ripple_scale_5638[0xC]; +u8 small_ripple_scale_5641[0xC]; +u8 waterfall_splash_trans_5699[0xC]; +u8 run_splash_scale_6040[0xC]; +u8 run_grass_scale_6043[0xC]; +u8 heavy_emit_smoke_scale_6046[0xC]; +u8 heavy_dyn_smoke_scale_6049[0xC]; +u8 heavy_pat_smoke_scale_6052[0xC]; +u8 tail_scale_6508[0xC]; +u8 arm_flame_scale_6651[0xC]; +u8 _6785[0xC]; +u8 eff_scale0_6784[0xC]; +u8 _6789[0xC]; +u8 eff_scale2_6788[0xC]; +u8 direction_6792[0xC]; +u8 splash_scale_14445[0xC]; +u8 ripple_scale_14448[0xC]; +u8 _15293[0xC]; +u8 arm_pos_15292[0xC]; +u8 _15297[0xC]; +u8 armA_offset_15296[0xC]; +u8 dynamic_scale_16750[0xC]; +u8 particle_scale_16753[0xC]; +u8 _17480[0xC]; +u8 local_height_offset_17479[0xC]; +u8 eff_scale_18886[0xC]; +u8 eff_dscale_18889[0xC]; +u8 eff_pscale_18892[0xC]; +u8 smoke_kusa_particle_scale_21005[0xC]; +u8 emitter_scale_21008[0xC]; +u8 emitter_trans_21011[0xC]; +u8 d_scale_23162[0xC]; +u8 p_scale_23165[0xC]; +u8 emitter_trans_24824[0xC]; +u8 particle_scale_24827[0xC]; +u8 root_mtx_25647[0x30]; + /* 80102E8C-80102EAC .text daPy_createHeap__FP10fopAc_ac_c */ static BOOL daPy_createHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); @@ -427,6 +516,11 @@ static BOOL daPy_jointCallback1(J3DNode* node, int param_1) { return TRUE; } +static mDoExt_offCupOnAupPacket l_offCupOnAupPacket1; +static mDoExt_offCupOnAupPacket l_offCupOnAupPacket2; +static mDoExt_onCupOffAupPacket l_onCupOffAupPacket1; +static mDoExt_onCupOffAupPacket l_onCupOffAupPacket2; + /* 801041B4-801041EC .text setAnimeHeap__9daPy_lk_cFP12JKRSolidHeap */ JKRHeap* daPy_lk_c::setAnimeHeap(JKRSolidHeap* animeHeap) { animeHeap->freeAll(); @@ -444,12 +538,12 @@ JKRHeap* daPy_lk_c::setItemHeap() { /* 80104240-80104280 .text setBlurPosResource__9daPy_lk_cFUs */ void daPy_lk_c::setBlurPosResource(u16 index) { - dComIfGp_getAnmArchive()->readIdxResource(mSwBlur.mpPosBuffer, 0x4800, index); + JKRReadIdxResource(mSwBlur.mpPosBuffer, 0x4800, index, dComIfGp_getAnmArchive()); } /* 80104280-80104364 .text getItemAnimeResource__9daPy_lk_cFUs */ J3DAnmTransform* daPy_lk_c::getItemAnimeResource(u16 index) { - dComIfGp_getAnmArchive()->readIdxResource(m_item_bck_buffer, 0x1000, index); + JKRReadIdxResource(m_item_bck_buffer, 0x1000, index, dComIfGp_getAnmArchive()); JKRHeap* oldHeap = setAnimeHeap(m2ECC); mDoExt_transAnmBas* bas = new mDoExt_transAnmBas(NULL); J3DAnmLoaderDataBase::setResource(bas, m_item_bck_buffer); @@ -460,7 +554,7 @@ J3DAnmTransform* daPy_lk_c::getItemAnimeResource(u16 index) { /* 80104364-801043F0 .text getAnimeResource__9daPy_lk_cFP14daPy_anmHeap_cUsUl */ J3DAnmTransform* daPy_lk_c::getAnimeResource(daPy_anmHeap_c* anmHeap, u16 index, u32 bufferSize) { J3DAnmTransform* bck; - dComIfGp_getAnmArchive()->readIdxResource(anmHeap->m_buffer, bufferSize, index); + JKRReadIdxResource(anmHeap->m_buffer, bufferSize, index, dComIfGp_getAnmArchive()); JKRHeap* oldHeap = setAnimeHeap(anmHeap->mpAnimeHeap); bck = static_cast(J3DAnmLoaderDataBase::load(anmHeap->m_buffer)); mDoExt_setCurrentHeap(oldHeap); @@ -506,9 +600,9 @@ void daPy_lk_c::setTextureAnimeResource(J3DAnmTexPattern* btp, int r31) { J3DAnmTexPattern* daPy_lk_c::loadTextureAnimeResource(u32 btpIdx, BOOL isDemo) { J3DAnmTexPattern* btp; if (isDemo) { - dComIfGp_getLkDemoAnmArchive()->readResource(m_tex_anm_heap.m_buffer, 0x1000, btpIdx); + JKRReadResource(m_tex_anm_heap.m_buffer, 0x1000, btpIdx, dComIfGp_getLkDemoAnmArchive()); } else { - dComIfGp_getAnmArchive()->readIdxResource(m_tex_anm_heap.m_buffer, 0x1000, btpIdx); + JKRReadIdxResource(m_tex_anm_heap.m_buffer, 0x1000, btpIdx, dComIfGp_getAnmArchive()); } JKRHeap* oldHeap = setAnimeHeap(m_tex_anm_heap.mpAnimeHeap); btp = static_cast(J3DAnmLoaderDataBase::load(m_tex_anm_heap.m_buffer)); @@ -631,9 +725,9 @@ void daPy_lk_c::setTextureScrollResource(J3DAnmTextureSRTKey* btk, int r31) { J3DAnmTextureSRTKey* daPy_lk_c::loadTextureScrollResource(u32 btkIdx, BOOL isDemo) { J3DAnmTextureSRTKey* btk; if (isDemo) { - dComIfGp_getLkDemoAnmArchive()->readResource(m_tex_scroll_heap.m_buffer, 0x800, btkIdx); + JKRReadResource(m_tex_scroll_heap.m_buffer, 0x800, btkIdx, dComIfGp_getLkDemoAnmArchive()); } else { - dComIfGp_getAnmArchive()->readIdxResource(m_tex_scroll_heap.m_buffer, 0x800, btkIdx); + JKRReadIdxResource(m_tex_scroll_heap.m_buffer, 0x800, btkIdx, dComIfGp_getAnmArchive()); } JKRHeap* oldHeap = setAnimeHeap(m_tex_scroll_heap.mpAnimeHeap); btk = static_cast(J3DAnmLoaderDataBase::load(m_tex_scroll_heap.m_buffer)); @@ -918,8 +1012,7 @@ BOOL daPy_lk_c::draw() { } else { hideHatAndBackle(link_root_joint->getMesh()); } - bool r4 = dComIfGs_getSelectEquip(0) == SWORD || dComIfGp_getMiniGameType() == 2; // TODO this may be an inline - if (!r4 && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_FF1_e || + if (!checkNormalSwordEquip() && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_FF1_e || checkCaughtShapeHide() || checkDemoShieldNoDraw()) { mpCLModelData->getJointNodePointer(0x0D)->getMesh()->getShape()->hide(); // cl_podA joint @@ -1165,6 +1258,8 @@ void daPy_lk_c::setNormalSpeedF(f32, f32, f32, f32) { /* 80108D80-8010959C .text posMoveFromFootPos__9daPy_lk_cFv */ void daPy_lk_c::posMoveFromFootPos() { /* Nonmatching */ + static const Vec rtoe_pos_offset = {-14.05f, 0.0f, 5.02f}; + static const Vec rheel_pos_offset = {-10.85f, 0.0f, -6.52f}; } /* 8010959C-80109E80 .text posMove__9daPy_lk_cFv */ @@ -1373,17 +1468,17 @@ void daPy_lk_c::deleteEquipItem(BOOL param_1) { mSwordAnim.changeBckOnly(NULL); } m2EAC = NULL; - mpHeldItemModelAnimTexEx = NULL; + mpHeldItemBtk = NULL; mpBottleContentsModel = NULL; mpBottleCapModel = NULL; - mpHeldItemAnimBRK = NULL; - mpSwordAnimBTK = NULL; + mpHeldItemBrk = NULL; + mpSwordBtk = NULL; mpSwordModel1 = NULL; m3454.end(); mpSwordTipStabModel = NULL; - m2EF8 = 0; - m2EF4 = 0; - m2EF0 = 0; + mpCutfBrk2EF8 = 0; + mpCutfBtk = 0; + mpCutfBpk = 0; offNoResetFlg1(daPyFlg1_UNK200000); } @@ -1420,7 +1515,7 @@ void daPy_lk_c::returnKeepItemData() { if (mHeldItemType == 0x10B) { mHeldItemType = 0x100; } else if (mHeldItemType == 0x103) { - setSwordModel(1); + setSwordModel(TRUE); } else { makeItemType(); } @@ -1926,6 +2021,7 @@ void daPy_lk_c::changeAutoJumpProc() { /* 80111424-80111A80 .text changeDemoProc__9daPy_lk_cFv */ void daPy_lk_c::changeDemoProc() { /* Nonmatching */ + static const Vec tact_scale = {2.5f, 2.5f, 2.5f}; } /* 80111A80-80111B80 .text changeDeadProc__9daPy_lk_cFv */ @@ -2814,6 +2910,8 @@ void daPy_lk_c::setCollision() { /* 8011EC0C-8011EEBC .text setAttentionPos__9daPy_lk_cFv */ void daPy_lk_c::setAttentionPos() { /* Nonmatching */ + static const Vec offset_39104 = {0.0f, 30.0f, 20.0f}; + static const Vec offset_39108 = {0.0f, 70.0f, 0.0f}; } /* 8011EEBC-8011EF94 .text setRoomInfo__9daPy_lk_cFv */ @@ -3058,6 +3156,14 @@ BOOL daPy_lk_c::checkRoofRestart() { /* 80121870-80122D30 .text execute__9daPy_lk_cFv */ BOOL daPy_lk_c::execute() { /* Nonmatching */ + static const Vec nsword_top = {45.0f, -31.0f, 0.0f}; + static const Vec msword_top = {57.0f, 48.0f, 0.0f}; + static const Vec boomerang_catch = {12.5f, 47.5f, 36.6f}; + static const Vec hookshot_root = {22.0f, 0.0f, 0.0f}; + static const Vec hammer_top = {160.0f, 70.0f, 0.0f}; + static const Vec hammer_root = {8.0f, 0.0f, 0.0f}; + static const Vec fan_top = {55.0f, 0.0f, 0.0f}; + static const Vec head_offset = {40.0f, 0.0f, 0.0f}; } /* 80122D30-80122D50 .text daPy_Execute__FP9daPy_lk_c */ @@ -3149,7 +3255,7 @@ void daPy_lk_c::initTextureAnime() { m_tex_anm_heap.m_buffer = new(0x20) u8[0x1000]; JUT_ASSERT(20869, m_tex_anm_heap.m_buffer != 0); - dComIfGp_getAnmArchive()->readIdxResource(m_tex_anm_heap.m_buffer, 0x1000, LKANM_BTP_TMABAA); + JKRReadIdxResource(m_tex_anm_heap.m_buffer, 0x1000, LKANM_BTP_TMABAA, dComIfGp_getAnmArchive()); J3DAnmTexPattern* btp = static_cast(J3DAnmLoaderDataBase::load(m_tex_anm_heap.m_buffer)); btp->searchUpdateMaterialID(mpCLModelData); u16 material_num = btp->getUpdateMaterialNum(); @@ -3196,7 +3302,7 @@ void daPy_lk_c::initTextureScroll() { m_tex_scroll_heap.m_buffer = new(0x20) u8[0x800]; JUT_ASSERT(20944, m_tex_scroll_heap.m_buffer != 0); - dComIfGp_getAnmArchive()->readIdxResource(m_tex_scroll_heap.m_buffer, 0x800, LKANM_BTK_TMABA); + JKRReadIdxResource(m_tex_scroll_heap.m_buffer, 0x800, LKANM_BTK_TMABA, dComIfGp_getAnmArchive()); J3DAnmTextureSRTKey* btk = static_cast(J3DAnmLoaderDataBase::load(m_tex_scroll_heap.m_buffer)); btk->searchUpdateMaterialID(mpCLModelData); u16 material_num = btk->getUpdateMaterialNum(); @@ -3442,7 +3548,7 @@ void daPy_lk_c::playerInit() { for (i = 0; i < 2; i++) { while (mat) { mat->setMaterialMode(1); - if (j3dZModeTable[mat->getZMode()->mZModeID].mCompareEnable == 0) { + if (mat->getZMode()->getCompareEnable() == 0) { if (mat->getBlend()->mBlendMode == 1) { mpZOffBlendShape[zoff_blend_cnt] = mat->getShape(); zoff_blend_cnt++; @@ -3578,7 +3684,7 @@ void daPy_lk_c::playerInit() { m3630 = fpcM_ERROR_PROCESS_ID_e; ResTIMG* blur_img = (ResTIMG*)dComIfG_getObjectRes(l_arcName, LINK_BTI_BLUR); - mSwBlur.mpBlurTex = blur_img; + mSwBlur.mpTex = blur_img; current.angle.z = 0; shape_angle.z = 0; @@ -3726,10 +3832,11 @@ int phase_3(daPy_lk_c* i_this) { } static s32 daPy_Create(fopAc_ac_c* i_this) { - static int (*l_method[3])(daPy_lk_c*) = { + static int (*l_method[4])(daPy_lk_c*) = { phase_1, phase_2, phase_3, + NULL, }; daPy_lk_c* player_link = (daPy_lk_c*)i_this; @@ -4034,55 +4141,7 @@ BOOL daPy_lk_c::getBokoFlamePos(cXyz* outPos) { return FALSE; } -#include "d/actor/d_a_player_particle.inc" - -#include "d/actor/d_a_player_dproc.inc" - -#include "d/actor/d_a_player_ladder.inc" - -#include "d/actor/d_a_player_hang.inc" - -#include "d/actor/d_a_player_climb.inc" - -#include "d/actor/d_a_player_whide.inc" - -#include "d/actor/d_a_player_crawl.inc" - -#include "d/actor/d_a_player_grab.inc" - -#include "d/actor/d_a_player_swim.inc" - -#include "d/actor/d_a_player_battle.inc" - -#include "d/actor/d_a_player_ship.inc" - -#include "d/actor/d_a_player_rope.inc" - -#include "d/actor/d_a_player_boomerang.inc" - -#include "d/actor/d_a_player_bow.inc" - -#include "d/actor/d_a_player_hook.inc" - -#include "d/actor/d_a_player_fan.inc" - -#include "d/actor/d_a_player_tact.inc" - -#include "d/actor/d_a_player_vomit.inc" - -#include "d/actor/d_a_player_hammer.inc" - -#include "d/actor/d_a_player_pushpull.inc" - -#include "d/actor/d_a_player_bottle.inc" - -#include "d/actor/d_a_player_weapon.inc" - -#include "d/actor/d_a_player_food.inc" - -#include "d/actor/d_a_player_sword.inc" - -actor_method_class l_daPy_Method = { +actor_method_class2 l_daPy_Method = { (process_method_func)daPy_Create, (process_method_func)daPy_Delete, (process_method_func)daPy_Execute, @@ -4101,7 +4160,7 @@ actor_process_profile_definition2 g_profile_PLAYER = { /* Parameters */ 0, /* Leaf SubMtd */ &g_fopAc_Method.base, /* Priority */ 0x0068, - /* Actor SubMtd */ &l_daPy_Method, + /* Actor SubMtd */ (actor_method_class*)&l_daPy_Method, /* Status */ fopAcStts_FREEZE_e, /* Group */ fopAc_PLAYER_e, /* CullType */ fopAc_CULLBOX_0_e, diff --git a/src/d/actor/d_a_player_main_data.inc b/src/d/actor/d_a_player_main_data.inc index 55950223c..3349f89fc 100644 --- a/src/d/actor/d_a_player_main_data.inc +++ b/src/d/actor/d_a_player_main_data.inc @@ -315,13 +315,13 @@ daPy_lk_c::ProcInitTableEntry daPy_lk_c::mProcInitTable[] = { /* 0x5A */ {&daPy_lk_c::procCutReverse, ModeFlg_00000400}, /* 0x5B */ {&daPy_lk_c::procJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000}, /* 0x5C */ {&daPy_lk_c::procJumpCutLand, ModeFlg_00000001 | ModeFlg_00000400 | ModeFlg_08000000}, - /* 0x5D */ {&daPy_lk_c::procBtJump, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_BT}, - /* 0x5E */ {&daPy_lk_c::procBtJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_BT}, - /* 0x5F */ {&daPy_lk_c::procBtSlide, ModeFlg_BT}, - /* 0x60 */ {&daPy_lk_c::procBtRoll, ModeFlg_00000400 | ModeFlg_00008000 | ModeFlg_BT}, - /* 0x61 */ {&daPy_lk_c::procBtRollCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_BT}, - /* 0x62 */ {&daPy_lk_c::procBtVerticalJump, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_BT}, - /* 0x63 */ {&daPy_lk_c::procBtVerticalJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_BT}, + /* 0x5D */ {&daPy_lk_c::procBtJump, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_PARRY}, + /* 0x5E */ {&daPy_lk_c::procBtJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_PARRY}, + /* 0x5F */ {&daPy_lk_c::procBtSlide, ModeFlg_PARRY}, + /* 0x60 */ {&daPy_lk_c::procBtRoll, ModeFlg_00000400 | ModeFlg_00008000 | ModeFlg_PARRY}, + /* 0x61 */ {&daPy_lk_c::procBtRollCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_PARRY}, + /* 0x62 */ {&daPy_lk_c::procBtVerticalJump, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_PARRY}, + /* 0x63 */ {&daPy_lk_c::procBtVerticalJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_PARRY}, /* 0x64 */ {&daPy_lk_c::procBtVerticalJumpLand, ModeFlg_00000400}, /* 0x65 */ {&daPy_lk_c::procGuardCrash, 0}, /* 0x66 */ {&daPy_lk_c::procDamage, ModeFlg_DAMAGE | ModeFlg_00000080 | ModeFlg_00000400}, diff --git a/src/d/actor/d_a_player_particle.inc b/src/d/actor/d_a_player_particle.inc index 6d72ccc9b..d2a242538 100644 --- a/src/d/actor/d_a_player_particle.inc +++ b/src/d/actor/d_a_player_particle.inc @@ -45,8 +45,56 @@ void daPy_swimTailEcallBack_c::remove() { } /* 8012910C-80129310 .text execute__24daPy_swimTailEcallBack_cFP14JPABaseEmitter */ -void daPy_swimTailEcallBack_c::execute(JPABaseEmitter*) { - /* Nonmatching */ +void daPy_swimTailEcallBack_c::execute(JPABaseEmitter* emitter) { + static JGeometry::TVec3 right_dir(-1.0f, 0.0f, 0.0f); + + GXColor ambColor; + GXColor difColor; + dKy_get_seacolor(&ambColor, &difColor); + emitter->setGlobalPrmColor(ambColor.r, ambColor.g, ambColor.b); + + if (field_0x04) { + s16 sp8 = emitter->getGlobalAlpha(); + cLib_chaseS(&sp8, 0, 0x14); + emitter->setGlobalAlpha(sp8); + if (sp8 == 0) { + emitter->becomeInvalidEmitter(); + emitter->setEmitterCallBackPtr(NULL); + mpEmitter = NULL; + return; + } + } + + if (field_0x20 != NULL) { + emitter->setGlobalTranslation(field_0x14.x, field_0x14.y, field_0x14.z); + JGeometry::TVec3 rot(0, 0, 0); + rot.y = field_0x20->y; + emitter->setGlobalRotation(rot); + }else { + JGeometry::TVec3 sp20; + emitter->getGlobalTranslation(sp20); + getMaxWaterY(&sp20); + emitter->setGlobalTranslation(sp20); + cLib_chaseF(&field_0x08, 0.0f, 0.08f); + } + + emitter->setDirectionalSpeed(1.0f + 12.0f * field_0x08); + + if (field_0x05) { + emitter->setDirection(right_dir); + } + + for (JSULink* link = emitter->mActiveParticles.getFirst(); link != NULL;) { + JSULink* nextLink = link->getNext(); + JPABaseParticle* particle = link->getObject(); + + JGeometry::TVec3 sp14; + particle->getGlobalPosition(sp14); + getMaxWaterY(&sp14); + particle->setOffsetPosition(sp14); + + link = nextLink; + } } /* 80129310-80129348 .text draw__24daPy_swimTailEcallBack_cFP14JPABaseEmitter */ @@ -78,7 +126,70 @@ void daPy_swBlur_c::copySwBlur(MtxP, int) { /* 80129A78-80129DD0 .text draw__13daPy_swBlur_cFv */ void daPy_swBlur_c::draw() { - /* Nonmatching */ + j3dSys.reinitGX(); + GXSetNumIndStages(0); + + static GXTexObj texObj; + u16 texWidth = 16; + u16 texHeight = 4; + GXTexFmt texFormat = GX_TF_I4; + GXInitTexObj(&texObj, (u8*)mpTex + mpTex->imageOffset, texWidth, texHeight, texFormat, GX_CLAMP, GX_CLAMP, GX_FALSE); + GXInitTexObjLOD(&texObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1); + GXLoadTexObj(&texObj, GX_TEXMAP0); + + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_S16, 8); + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_DIRECT); + GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); + GXSetNumChans(0); + + if (mBlurColorType == 0) { + // Normal color. + static GXColor n_color = {0xFF, 0xFF, 0xFF, 0x96}; + GXSetTevColor(GX_TEVREG0, n_color); + } else if (mBlurColorType == 1) { + // Elixir Soup color. + static GXColor y_color = {0xFF, 0xFF, 0x7B, 0x96}; + GXSetTevColor(GX_TEVREG0, y_color); + } else { + // Parrying color. + static GXColor g_color = {0x5A, 0xFF, 0x5A, 0x96}; + GXSetTevColor(GX_TEVREG0, g_color); + } + + GXSetNumTexGens(1); + GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); + GXSetNumTevStages(1); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0); + GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO); + GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXLoadPosMtxImm(j3dSys.getViewMtx(), GX_PNMTX0); + GXSetCurrentMtx(GX_PNMTX0); + GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET); + GXSetCullMode(GX_CULL_NONE); + GXSetZMode(GX_TRUE, GX_LEQUAL, GX_FALSE); + GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0); + + int r30 = 0xFF / ((field_0x014 >> 1) + 1); + s16 r29 = r30; + s16 r28 = 0x00; + GXBegin(GX_QUADS, GX_VTXFMT0, 4 + field_0x014*4); + for (int i = field_0x014; i >= 0; i--) { + GXPosition3f32(field_0x034[i].x, field_0x034[i].y, field_0x034[i].z); + GXTexCoord2s16(r29, 0x00); + GXPosition3f32(field_0x304[i].x, field_0x304[i].y, field_0x304[i].z); + GXTexCoord2s16(r29, 0xFF); + GXPosition3f32(field_0x304[i+1].x, field_0x304[i+1].y, field_0x304[i+1].z); + GXTexCoord2s16(r28, 0xFF); + GXPosition3f32(field_0x034[i+1].x, field_0x034[i+1].y, field_0x034[i+1].z); + GXTexCoord2s16(r28, 0x00); + r28 = r29; + r29 += r30; + } + J3DShape::resetVcdVatCache(); } /* 80129DD0-80129E9C .text execute__24daPy_fanSwingEcallBack_cFP14JPABaseEmitter */ @@ -110,6 +221,8 @@ void daPy_followEcallBack_c::end() { } } +daPy_waterDropPcallBack_c daPy_waterDropEcallBack_c::m_pcallback; + /* 80129FD4-8012A040 .text execute__25daPy_waterDropEcallBack_cFP14JPABaseEmitter */ void daPy_waterDropEcallBack_c::execute(JPABaseEmitter* emitter) { daPy_followEcallBack_c::execute(emitter); @@ -144,6 +257,9 @@ void daPy_mtxPosFollowEcallBack_c::execute(JPABaseEmitter*) { /* Nonmatching */ } +s16 daPy_dmEcallBack_c::m_timer = 0; +u16 daPy_dmEcallBack_c::m_type = 3; + /* 8012A160-8012A288 .text execute__18daPy_dmEcallBack_cFP14JPABaseEmitter */ void daPy_dmEcallBack_c::execute(JPABaseEmitter*) { /* Nonmatching */ diff --git a/src/d/actor/d_a_player_sword.inc b/src/d/actor/d_a_player_sword.inc index 38ae73538..8aa584e1a 100644 --- a/src/d/actor/d_a_player_sword.inc +++ b/src/d/actor/d_a_player_sword.inc @@ -11,10 +11,113 @@ */ #include "d/actor/d_a_player_main.h" +#include "JSystem/J3DGraphLoader/J3DAnmLoader.h" +#include "JSystem/JKernel/JKRSolidHeap.h" /* 80154B80-80154FBC .text setSwordModel__9daPy_lk_cFi */ -void daPy_lk_c::setSwordModel(int) { - /* Nonmatching */ +void daPy_lk_c::setSwordModel(BOOL r28) { + struct sword_model_tbl_s { + /* 0x00 */ u16 bladeModel; + /* 0x02 */ u16 glowModel; + /* 0x04 */ u16 glowBtk; + /* 0x06 */ u16 glowBrk; + /* 0x08 */ u16 tipStabModel; + /* 0x0A */ u16 tipStabBpk; + /* 0x0C */ u16 tipStabBtk; + /* 0x0E */ u16 tipStabBrk; + }; + static const sword_model_tbl_s sword_model_tbl[] = { + { + LINK_BDL_SWA, + LINK_BDL_YHSLS00, + LKANM_BTK_YHSLS00, + LKANM_BRK_YHSLS00, + LINK_BDL_CUTFH, + LKANM_BPK_CUTFH, + LKANM_BTK_CUTFH, + LKANM_BRK_CUTFH + }, + { + LINK_BDL_SWMS, + LINK_BDL_YMSLI00, + LKANM_BTK_YMSLI00, + LKANM_BRK_YMSLI00, + LINK_BDL_CUTFM, + LKANM_BPK_CUTFM, + LKANM_BTK_CUTFM, + LKANM_BRK_CUTFM + }, + }; + + u8* buffer; + + J3DAnmTransform* bck = checkNormalSwordEquip() ? getItemAnimeResource(LKANM_BCK_CUTAA) : getItemAnimeResource(LKANM_BCK_CUTAMS); + + mHeldItemType = 0x103; + JKRHeap* oldHeap = setItemHeap(); + + const sword_model_tbl_s& model_tbl = checkNormalSwordEquip() ? sword_model_tbl[0] : sword_model_tbl[1]; + J3DModelData* modelData = initModel(&mpHeldItemModel, model_tbl.bladeModel, 0x37221222); + BOOL ret = mSwordAnim.init(modelData, bck, false, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, false); + if (!ret) { JUT_ASSERT(86, 0); } + + if (!checkNormalSwordEquip()) { + buffer = new(0x20) u8[0x400]; + JKRReadIdxResource(buffer, 0x400, LKANM_BTK_TSWMS, dComIfGp_getAnmArchive()); + mpHeldItemBtk = static_cast(J3DAnmLoaderDataBase::load(buffer)); + mpHeldItemBtk->setFrame(0.0f); + mpHeldItemBtk->searchUpdateMaterialID(modelData); + modelData->entryTexMtxAnimator(mpHeldItemBtk); + } + + mSwBlur.mpPosBuffer = new(0x20) u8[0x4800]; + modelData = initModel(&mpSwordModel1, model_tbl.glowModel, 0x13000222); + + buffer = new(0x20) u8[0x400]; + JKRReadIdxResource(buffer, 0x400, model_tbl.glowBtk, dComIfGp_getAnmArchive()); + mpSwordBtk = static_cast(J3DAnmLoaderDataBase::load(buffer)); + mpSwordBtk->setFrame(0.0f); + mpSwordBtk->searchUpdateMaterialID(modelData); + modelData->entryTexMtxAnimator(mpSwordBtk); + + buffer = new(0x20) u8[0x400]; + JKRReadIdxResource(buffer, 0x400, model_tbl.glowBrk, dComIfGp_getAnmArchive()); + mpHeldItemBrk = static_cast(J3DAnmLoaderDataBase::load(buffer)); + mpHeldItemBrk->setFrame(0.0f); + mpHeldItemBrk->searchUpdateMaterialID(modelData); + modelData->entryTevRegAnimator(mpHeldItemBrk); + + modelData = initModel(&mpSwordTipStabModel, model_tbl.tipStabModel, 0x13000223); + + buffer = new(0x20) u8[0x400]; + JKRReadIdxResource(buffer, 0x400, model_tbl.tipStabBtk, dComIfGp_getAnmArchive()); + mpCutfBtk = static_cast(J3DAnmLoaderDataBase::load(buffer)); + mpCutfBtk->setFrame(0.0f); + mpCutfBtk->searchUpdateMaterialID(modelData); + modelData->entryTexMtxAnimator(mpCutfBtk); + + buffer = new(0x20) u8[0x400]; + JKRReadIdxResource(buffer, 0x400, model_tbl.tipStabBrk, dComIfGp_getAnmArchive()); + mpCutfBrk2EF8 = static_cast(J3DAnmLoaderDataBase::load(buffer)); + mpCutfBrk2EF8->setFrame(0.0f); + mpCutfBrk2EF8->searchUpdateMaterialID(modelData); + modelData->entryTevRegAnimator(mpCutfBrk2EF8); + + buffer = new(0x20) u8[0x400]; + JKRReadIdxResource(buffer, 0x400, model_tbl.tipStabBpk, dComIfGp_getAnmArchive()); + mpCutfBpk = static_cast(J3DAnmLoaderDataBase::load(buffer)); + mpCutfBpk->setFrame(0.0f); + mpCutfBpk->searchUpdateMaterialID(modelData); + modelData->entryMatColorAnimator(mpCutfBpk); + + mDoExt_setCurrentHeap(oldHeap); + mDoAud_bgmSetSwordUsing(1); + m355C = 0; + + if (r28) { + onNoResetFlg1(daPyFlg1_UNK200000); + mpSwordBtk->setFrame(mpSwordBtk->getFrameMax() - 0.001f); + } } /* 80154FBC-80155490 .text setLightSaver__9daPy_lk_cFv */ diff --git a/src/d/actor/d_a_player_tact.inc b/src/d/actor/d_a_player_tact.inc index 62f8edb21..c5d5a8700 100644 --- a/src/d/actor/d_a_player_tact.inc +++ b/src/d/actor/d_a_player_tact.inc @@ -40,10 +40,10 @@ void daPy_lk_c::setTactModel() { J3DModelData* modelData = initModel(&mpHeldItemModel, LINK_BDL_TAKT, 0x37221222); u8* buffer = new(0x20) u8[0x400]; dComIfGp_getAnmArchive()->readIdxResource(buffer, 0x400, LKANM_BRK_TTAKT); - mpHeldItemAnimBRK = (J3DAnmTevRegKey*)J3DAnmLoaderDataBase::load(buffer); - mpHeldItemAnimBRK->setFrame(0.0f); - mpHeldItemAnimBRK->searchUpdateMaterialID(modelData); - modelData->entryTevRegAnimator(mpHeldItemAnimBRK); + mpHeldItemBrk = (J3DAnmTevRegKey*)J3DAnmLoaderDataBase::load(buffer); + mpHeldItemBrk->setFrame(0.0f); + mpHeldItemBrk->searchUpdateMaterialID(modelData); + modelData->entryTevRegAnimator(mpHeldItemBrk); mDoExt_setCurrentHeap(oldHeap); } diff --git a/src/d/actor/d_a_swhit0.cpp b/src/d/actor/d_a_swhit0.cpp index 645cb80e6..8456f9f9d 100644 --- a/src/d/actor/d_a_swhit0.cpp +++ b/src/d/actor/d_a_swhit0.cpp @@ -249,7 +249,7 @@ s32 daSwhit0_c::actionOffWait() { mState = 2; fopAcM_orderOtherEventId(this, mEventIdx, getEvNo()); - mEvtInfo.onCondition(0x02); + mEvtInfo.onCondition(dEvtCnd_UNK2_e); break; default: @@ -279,7 +279,7 @@ s32 daSwhit0_c::actionToOnReady() { mState = 2; fopAcM_orderOtherEventId(this, mEventIdx, getEvNo()); - mEvtInfo.onCondition(0x02); + mEvtInfo.onCondition(dEvtCnd_UNK2_e); } return TRUE; @@ -295,7 +295,7 @@ s32 daSwhit0_c::actionToOnOrder() { } else { fopAcM_orderOtherEventId(this, mEventIdx, getEvNo()); - mEvtInfo.onCondition(0x02); + mEvtInfo.onCondition(dEvtCnd_UNK2_e); } return TRUE; diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp index 87a7024f8..caf4b2914 100644 --- a/src/d/actor/d_a_tag_msg.cpp +++ b/src/d/actor/d_a_tag_msg.cpp @@ -200,7 +200,7 @@ static BOOL daTag_Msg_actionHunt(daTag_Msg_c* a_this) { if (a_this->getType2() & 1) { fopAcM_orderSpeakEvent(a_this); } - a_this->mEvtInfo.mCondition |= dEvtCnd_CANTALK_e; + a_this->mEvtInfo.onCondition(dEvtCnd_CANTALK_e); } return TRUE; } diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index 119a3899d..46ff6cb55 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -1038,7 +1038,7 @@ BOOL daTbox_c::actionOpenWait() { } else { if (boxCheck()) { - mEvtInfo.onCondition(0x04); + mEvtInfo.onCondition(dEvtCnd_CANDOOR_e); if (getShapeType() == 0) { mEvtInfo.setEventName("DEFAULT_TREASURE_A"); @@ -1063,7 +1063,7 @@ BOOL daTbox_c::actionSwOnWait() { else { if (dComIfGs_isSwitch(getSwNo(), mRoomNo)) { fopAcM_orderOtherEvent2(this, "DEFAULT_TREASURE_APPEAR", 1); - mEvtInfo.mCondition |= 2; + mEvtInfo.onCondition(dEvtCnd_UNK2_e); } } @@ -1095,7 +1095,7 @@ BOOL daTbox_c::actionGenocide() { } else { fopAcM_orderOtherEvent2(this, "DEFAULT_TREASURE_APPEAR", 1); - mEvtInfo.mCondition |= 2; + mEvtInfo.onCondition(dEvtCnd_UNK2_e); dComIfGs_onSwitch(getSwNo(), mRoomNo); } diff --git a/src/d/d_attention.cpp b/src/d/d_attention.cpp index 3d0f2d62d..8b38898af 100644 --- a/src/d/d_attention.cpp +++ b/src/d/d_attention.cpp @@ -142,7 +142,7 @@ dAttList_c* dAttention_c::getActionBtnXYZ_local(int button) { dAttList_c* list = GetLockonList(0); if (list != NULL && list->getActor() != NULL && list->mType == 1 && LockonTruth() != 0) { fopAc_ac_c* actor = list->getActor(); - if ((actor->mEvtInfo.mCondition & dEvtCnd_CANTALKITEM_e) == dEvtCnd_CANTALKITEM_e) { + if (actor->mEvtInfo.chkCondition(dEvtCnd_CANTALKITEM_e)) { s16 rt; if (actor->mEvtInfo.mpCheckCB == NULL) rt = 1; @@ -161,7 +161,7 @@ dAttList_c* dAttention_c::getActionBtnXYZ_local(int button) { for (s32 i = 0; i < mActionNum; i++) { if (mActionList[i].mType == 3) { fopAc_ac_c* actor = mActionList[i].getActor(); - if ((actor->mEvtInfo.mCondition & dEvtCnd_CANTALKITEM_e) == dEvtCnd_CANTALKITEM_e) { + if (actor->mEvtInfo.chkCondition(dEvtCnd_CANTALKITEM_e)) { s16 rt; if (actor->mEvtInfo.mpCheckCB == NULL) rt = 1; diff --git a/src/d/d_event.cpp b/src/d/d_event.cpp index 465fd92e3..9b77cfffe 100644 --- a/src/d/d_event.cpp +++ b/src/d/d_event.cpp @@ -618,12 +618,12 @@ u8 dEvt_control_c::getTactFreeCStick(int which) { /* 80071624-80071658 .text __ct__11dEvt_info_cFv */ dEvt_info_c::dEvt_info_c() { - mCommand = 0; - mCondition = 0; + mCommand = dEvtCmd_NONE_e; + mCondition = dEvtCnd_NONE_e; mEventId = -1; - mMapToolId = 0xff; - mpEventCB = 0; - mpCheckCB = 0; + mMapToolId = -1; + mpEventCB = NULL; + mpCheckCB = NULL; } /* 80071658-800716AC .text setEventName__11dEvt_info_cFPc */ diff --git a/src/f_op/f_op_actor.cpp b/src/f_op/f_op_actor.cpp index 8b0bca6e6..318ab76a6 100644 --- a/src/f_op/f_op_actor.cpp +++ b/src/f_op/f_op_actor.cpp @@ -78,7 +78,7 @@ s32 fopAc_Execute(void* pProc) { CHECK_VEC3_RANGE(0x286, actor->current.pos); if (fopAcM_checkStatus(actor, fopAcStts_NOPAUSE_e) || (!dMenu_flag() && !dScnPly_ply_c::isPause())) { - actor->mEvtInfo.setCondition(dEvtCnd_NONE_e); + actor->mEvtInfo.beforeProc(); s32 moveApproval = dComIfGp_event_moveApproval(actor);