From 1d1c15650d0e05bd996a5baceeee2661e7580786 Mon Sep 17 00:00:00 2001 From: WilliamArnett Date: Mon, 26 May 2025 04:23:16 -0500 Subject: [PATCH] Revert "Merge branch 'main' into d_a_npc_km1" This reverts commit 9ebc35f76b5aaf96a2f961edac93564ece195381, reversing changes made to b8807b2f504fe469d52d83fc14aaca2c8c7da0d2. --- configure.py | 6 +- include/d/actor/d_a_am.h | 3 - include/d/actor/d_a_npc_photo.h | 130 +- include/d/actor/d_a_player_main.h | 48 +- include/d/actor/d_a_tag_photo.h | 7 +- include/d/d_bg_s_acch.h | 2 +- include/d/d_com_inf_game.h | 8 - include/d/d_drawlist.h | 4 - include/d/d_picture_box.h | 2 +- include/f_op/f_op_actor_mng.h | 5 +- src/d/actor/d_a_am.cpp | 72 +- src/d/actor/d_a_am2.cpp | 3 +- src/d/actor/d_a_npc_md.cpp | 4 - src/d/actor/d_a_npc_photo.cpp | 2148 ++--------------------------- src/d/actor/d_a_obj_figure.cpp | 851 +++++++++--- src/d/actor/d_a_player_dproc.inc | 2 - src/d/actor/d_a_player_main.cpp | 144 +- src/d/actor/d_a_player_sword.inc | 19 +- src/d/d_bg_s_acch.cpp | 42 +- src/d/d_drawlist.cpp | 11 +- 20 files changed, 915 insertions(+), 2596 deletions(-) diff --git a/configure.py b/configure.py index e5939259f..c2b59b7b7 100755 --- a/configure.py +++ b/configure.py @@ -494,7 +494,7 @@ config.libs = [ Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_attention.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_att_dist.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s.cpp"), - Object(Matching, "d/d_bg_s_acch.cpp"), + Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_acch.cpp"), Object(Matching, "d/d_bg_s_func.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_lin_chk.cpp"), Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_bg_s_movebg_actor.cpp"), @@ -1460,7 +1460,7 @@ config.libs = [ ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_wbird"), ActorRel(NonMatching, "d_a_ykgr"), ActorRel(Matching, "d_a_alldie"), - ActorRel(Matching, "d_a_am", extra_cflags=['-pragma "nosyminline on"']), + ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_am", extra_cflags=['-pragma "nosyminline on"']), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_am2", extra_cflags=["-sym off"]), ActorRel(NonMatching, "d_a_amiprop"), ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_arrow_iceeff", extra_cflags=['-pragma "nosyminline on"']), @@ -1619,7 +1619,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_npc_p2"), ActorRel(NonMatching, "d_a_npc_people", extra_cflags=['-pragma "nosyminline on"']), # regalloc, weak func order ActorRel(NonMatching, "d_a_npc_pf1"), - ActorRel(Equivalent, "d_a_npc_photo", extra_cflags=['-pragma "nosyminline on"']), + ActorRel(NonMatching, "d_a_npc_photo"), ActorRel(NonMatching, "d_a_npc_pm1"), ActorRel(Equivalent, "d_a_npc_roten", extra_cflags=['-pragma "nosyminline on"']), # weak func order ActorRel(NonMatching, "d_a_npc_rsh1"), diff --git a/include/d/actor/d_a_am.h b/include/d/actor/d_a_am.h index 54078ab84..484350a6f 100644 --- a/include/d/actor/d_a_am.h +++ b/include/d/actor/d_a_am.h @@ -39,9 +39,6 @@ public: /* 0x0324 */ cXyz mSpawnPos; /* 0x0330 */ csXyz mEyeRot; /* 0x0336 */ csXyz mTargetEyeRot; -#if VERSION == VERSION_DEMO - /* 0x033C */ JPABaseEmitter* m033C_demo; -#endif /* 0x033C */ JPABaseEmitter* m033C; /* 0x0340 */ JPABaseEmitter* m0340; /* 0x0344 */ dPa_smokeEcallBack mSmokeCbs[4]; diff --git a/include/d/actor/d_a_npc_photo.h b/include/d/actor/d_a_npc_photo.h index 50de06ede..56d71ec02 100644 --- a/include/d/actor/d_a_npc_photo.h +++ b/include/d/actor/d_a_npc_photo.h @@ -3,25 +3,14 @@ #include "f_op/f_op_actor.h" #include "d/d_cc_d.h" -#include "d/d_npc.h" struct sPhotoAnmDat { - /* 0x00 */ u8 field_0x00; - /* 0x01 */ u8 field_0x01; - /* 0x02 */ u8 field_0x02; + }; -class daNpcPhoto_c : public fopNpc_npc_c { +class daNpcPhoto_c : public fopAc_ac_c { public: - enum Prm_e { - PRM_RAIL_ID_W = 0x8, - PRM_RAIL_ID_S = 0x10, - - PRM_ARG0_W = 0x8, - PRM_ARG0_S = 0x0, - }; - - request_of_phase_process_class* getPhaseP() { return &mPhs1; } + void getPhaseP() {} void incMsgTbl() {} void isDate() {} void nullMsgTbl() {} @@ -31,12 +20,12 @@ public: daNpcPhoto_c(); cPhs_State _create(); - BOOL createHeap(); - cPhs_State createInit(); + void createHeap(); + void createInit(); bool _delete(); bool _draw(); bool _execute(); - bool executeCommon(); + void executeCommon(); void executeSetMode(unsigned char); void executeWait(); void executeTalk(); @@ -47,109 +36,46 @@ public: void eventMove(); void privateCut(); void eventMesSetInit(int); - bool eventMesSet(); + void eventMesSet(); void eventSeSetInit(int); void eventPosSetInit(); void eventGetItemInit(); - bool eventGetItem(); + void eventGetItem(); void eventSetAngleInit(); void eventSetEyeInit(); - bool eventSetEye(); + void eventSetEye(); void eventTurnToPlayerInit(); - bool eventTurnToPlayer(); + void eventTurnToPlayer(); void eventClrHanmeInit(); void eventGetPhotoInit(); - bool eventGetPhoto(); + void eventGetPhoto(); void eventMesSetUbInit(int); - bool eventMesSetUb(); - bool eventLookUb(); - u16 talk2(int); + void eventMesSetUb(); + void eventLookUb(); + void talk2(int); void setMsgCamera(); - u16 next_msgStatus(u32*); - u32 getMsg(); - void setMessage(u32); + void next_msgStatus(unsigned long*); + void getMsg(); + void setMessage(unsigned long); void setAnmFromMsgTag(); - u8 getPrmRailID(); - u8 getPrmArg0(); + void getPrmRailID(); + void getPrmArg0(); void setMtx(); void chkAttention(); void lookBack(); - BOOL initTexPatternAnm(bool, int); + void initTexPatternAnm(bool, int); void playTexPatternAnm(); void playAnm(); - void setAnm(u8, int, f32); - bool setAnmTbl(sPhotoAnmDat*); - s16 XyCheckCB(int); - s16 XyEventCB(int); - BOOL isPhotoOk(); - BOOL isPhotoDxOk(); + void setAnm(unsigned char, int, float); + void setAnmTbl(sPhotoAnmDat*); + void XyCheckCB(int); + void XyEventCB(int); + void isPhotoOk(); + void isPhotoDxOk(); void setCollision(dCcD_Cyl*, cXyz, float, float); - static const char m_arcname[4]; - public: - typedef void(daNpcPhoto_c::*MoveFunc_t)(); - - /* 0x6C4 */ request_of_phase_process_class mPhs1; - /* 0x6CC */ request_of_phase_process_class mPhs2; - /* 0x6D4 */ J3DAnmTexPattern* m_head_tex_pattern; - /* 0x6D8 */ mDoExt_btpAnm mBtpAnm; - /* 0x6EC */ u32 mShadowId; - /* 0x6F0 */ dNpc_PathRun_c mPathRun; - /* 0x6F8 */ dCcD_Cyl field_0x6F8[2]; - /* 0x958 */ cXyz field_0x958; - /* 0x964 */ cXyz mLookAtPos; - /* 0x970 */ cXyz mEyePos; - /* 0x97C */ sPhotoAnmDat* mpAnmDat; - /* 0x980 */ u32* field_0x980; - /* 0x984 */ f32 field_0x984; - /* 0x988 */ f32 field_0x988; - /* 0x98C */ f32 field_0x98C; - /* 0x990 */ int mMsgNno; - /* 0x994 */ bool field_0x994; - /* 0x996 */ s16 mPhotoLinkBackEventIdx; - /* 0x998 */ s16 mPhotoGetItemEventIdx; - /* 0x99A */ s16 mPhotoGetItem2EventIdx; - /* 0x99C */ s16 mPhotoGetPhotoEventIdx; - /* 0x99E */ s16 mPhotoGalleryEventIdx; - /* 0x9A0 */ s16 mPhotoCounterTalk0EventIdx; - /* 0x9A2 */ s16 mPhotoCounterTalk1EventIdx; - /* 0x9A4 */ s16 mPhotoDateUB4EventIdx; - /* 0x9A6 */ s16 field_0x9A6; - /* 0x9A8 */ s16 field_0x9A8; - /* 0x9AA */ u8 field_0x9AA[0x9AC - 0x9AA]; - /* 0x9AC */ s16 field_0x9AC; - /* 0x9AE */ s16 field_0x9AE; - /* 0x9B0 */ s16 field_0x9B0; - /* 0x9B2 */ s16 field_0x9B2; - /* 0x9B4 */ s16 mTimer; - /* 0x9B6 */ s16 field_0x9B6; - /* 0x9B8 */ s16 field_0x9B8; - /* 0x9BA */ s16 field_0x9BA; - /* 0x9BC */ bool field_0x9BC; - /* 0x9BD */ bool field_0x9BD; - /* 0x9BE */ u8 field_0x9BE; - /* 0x9BF */ u8 mFrame; - /* 0x9C0 */ u8 field_0x9C0; - /* 0x9C1 */ u8 field_0x9C1; - /* 0x9C2 */ bool field_0x9C2; - /* 0x9C3 */ u8 field_0x9C3; - /* 0x9C4 */ u8 field_0x9C4[0x9C5 - 0x9C4]; - /* 0x9C5 */ u8 mItemNo; - /* 0x9C6 */ u8 field_0x9C6; - /* 0x9C7 */ bool field_0x9C7; - /* 0x9C8 */ u8 field_0x9C8; - /* 0x9C9 */ u8 field_0x9C9; - /* 0x9CA */ s8 field_0x9CA; - /* 0x9CB */ s8 mActIdx; - /* 0x9CC */ bool field_0x9CC; - /* 0x9CD */ bool field_0x9CD; - /* 0x9D0 */ u8* field_0x9D0; - /* 0x9D4 */ bool field_0x9D4; - /* 0x9D5 */ u8 field_0x9D5; - /* 0x9D6 */ s8 field_0x9D6; - /* 0x9D7 */ bool field_0x9D7; - /* 0x9D8 */ bool field_0x9D8; -}; // Size: 0x9DC + /* Place member variables here */ +}; #endif /* D_A_NPC_PHOTO_H */ diff --git a/include/d/actor/d_a_player_main.h b/include/d/actor/d_a_player_main.h index 757d2700c..59a10809c 100644 --- a/include/d/actor/d_a_player_main.h +++ b/include/d/actor/d_a_player_main.h @@ -209,7 +209,7 @@ public: ~daPy_dmEcallBack_c() {} daPy_dmEcallBack_c() {} - static s16 getTimer() { return m_timer; } + static int getTimer() { return m_timer; } static void setTimer(s16 timer) { m_timer = timer; } static void decTimer() { m_timer--; } @@ -1237,9 +1237,7 @@ public: BOOL dProcOpenTreasure_init(); BOOL dProcOpenTreasure(); void setGetItemSound(u16, int); -#if VERSION > VERSION_DEMO BOOL setGetDemo(); -#endif BOOL dProcGetItem_init(); BOOL dProcGetItem(); BOOL dProcUnequip_init(); @@ -1679,12 +1677,8 @@ public: BOOL procFoodSet(); void setSwordModel(BOOL); void setLightSaver(); -#if VERSION == VERSION_DEMO - BOOL checkLastDemoSwordNoDraw(int); -#else BOOL checkDemoShieldNoDraw(); BOOL checkDemoSwordNoDraw(BOOL); -#endif BOOL checkChanceMode(); BOOL checkCutRollChange() const; int getSwordBlurColor(); @@ -1737,32 +1731,32 @@ public: J3DAnmTextureSRTKey* getIceArrowBtk() { return mpIceArrowBtk; } J3DAnmTextureSRTKey* getLightArrowBtk() { return mpLightArrowBtk; } - BOOL checkUpperAnime(u16 i_idx) const { return m_anm_heap_upper[UPPER_MOVE2_e].mIdx == i_idx; } - BOOL checkNoUpperAnime() const { return m_anm_heap_upper[UPPER_MOVE2_e].mIdx == 0xFFFF; } + bool checkUpperAnime(u16 i_idx) const { return m_anm_heap_upper[UPPER_MOVE2_e].mIdx == i_idx; } + bool checkNoUpperAnime() const { return m_anm_heap_upper[UPPER_MOVE2_e].mIdx == 0xFFFF; } - BOOL checkGrabAnime() const { return checkGrabAnimeLight() || checkGrabAnimeHeavy(); }; - BOOL checkGrabAnimeLight() const { return checkUpperAnime(LKANM_BCK_GRABWAIT); }; - BOOL checkGrabAnimeHeavy() const { return checkUpperAnime(LKANM_BCK_GRABWAITB); }; - BOOL checkBoomerangCatchAnime() const { return checkUpperAnime(LKANM_BCK_BOOMCATCH); }; - BOOL checkBoomerangThrowAnime() const { return checkUpperAnime(LKANM_BCK_BOOMTHROW); }; - BOOL checkBoomerangReadyAnime() const { return checkUpperAnime(LKANM_BCK_BOOMWAIT); }; - BOOL checkHookshotReadyAnime() const { return checkUpperAnime(LKANM_BCK_HOOKSHOTWAIT); } - BOOL checkDashDamageAnime() const { return checkUpperAnime(LKANM_BCK_DAMDASH); } - BOOL checkBowReloadAnime() const { return checkUpperAnime(LKANM_BCK_ARROWRELORD); } - BOOL checkBowShootAnime() const { return checkUpperAnime(LKANM_BCK_ARROWSHOOT); } - BOOL checkBowWaitAnime() const { return checkUpperAnime(LKANM_BCK_BOWWAIT); } - BOOL checkGuardSlip() const { + bool checkGrabAnime() const { return checkGrabAnimeLight() || checkGrabAnimeHeavy(); }; + bool checkGrabAnimeLight() const { return checkUpperAnime(LKANM_BCK_GRABWAIT); }; + bool checkGrabAnimeHeavy() const { return checkUpperAnime(LKANM_BCK_GRABWAITB); }; + bool checkBoomerangCatchAnime() const { return checkUpperAnime(LKANM_BCK_BOOMCATCH); }; + bool checkBoomerangThrowAnime() const { return checkUpperAnime(LKANM_BCK_BOOMTHROW); }; + bool checkBoomerangReadyAnime() const { return checkUpperAnime(LKANM_BCK_BOOMWAIT); }; + bool checkHookshotReadyAnime() const { return checkUpperAnime(LKANM_BCK_HOOKSHOTWAIT); } + bool checkDashDamageAnime() const { return checkUpperAnime(LKANM_BCK_DAMDASH); } + bool checkBowReloadAnime() const { return checkUpperAnime(LKANM_BCK_ARROWRELORD); } + bool checkBowShootAnime() const { return checkUpperAnime(LKANM_BCK_ARROWSHOOT); } + bool checkBowWaitAnime() const { return checkUpperAnime(LKANM_BCK_BOWWAIT); } + bool checkGuardSlip() const { return mCurProc == daPyProc_GUARD_SLIP_e || mCurProc == daPyProc_CROUCH_DEFENSE_SLIP_e; } - BOOL checkUpperGuardAnime() const { + bool checkUpperGuardAnime() const { return checkUpperAnime(LKANM_BCK_ATNG) || checkUpperAnime(LKANM_BCK_ATNGHAM); } s16 checkTinkleShield() const { return mTinkleShieldTimer; } void setTinkleShield(s16 time) { mTinkleShieldTimer = time; } - BOOL checkNoDamageMode() const { return checkEquipDragonShield() || checkTinkleShield() != 0; } + bool checkNoDamageMode() const { return checkEquipDragonShield() || checkTinkleShield() != 0; } s16 checkTinkleHover() const { return mTinkleHoverTimer; } void setHoverBoots(s16 time) { onNoResetFlg0(daPyFlg0_HOVER_BOOTS); @@ -1770,12 +1764,12 @@ public: } void onShipTact() { onNoResetFlg1(daPyFlg1_SHIP_TACT); } void offShipTact() { offNoResetFlg1(daPyFlg1_SHIP_TACT); } - BOOL checkShipGetOff() { return mCurProc == daPyProc_SHIP_GET_OFF_e; } + bool checkShipGetOff() { return mCurProc == daPyProc_SHIP_GET_OFF_e; } void onShipDrop(s16 param_1) { onNoResetFlg0(daPyFlg0_SHIP_DROP); m3550 = param_1; } - BOOL checkCarryActionNow() const { + bool checkCarryActionNow() const { return mCurProc == daPyProc_GRAB_PUT_e || mCurProc == daPyProc_GRAB_UP_e || mCurProc == daPyProc_GRAB_THROW_e; @@ -1798,7 +1792,7 @@ public: mActivePlayerBombs--; } } - BOOL checkSwordEquip() const { + bool checkSwordEquip() const { return dComIfGs_getSelectEquip(0) != dItem_NONE_e || checkSwordMiniGame(); } @@ -2210,9 +2204,7 @@ public: /* 0x362C */ fpc_ProcID mTactZevPartnerId; /* 0x3630 */ fpc_ProcID m3630; /* 0x3634 */ fpc_ProcID mWhirlId; -#if VERSION > VERSION_DEMO /* 0x3638 */ fpc_ProcID mMsgId; -#endif /* 0x363C */ J3DFrameCtrl* mpSeAnmFrameCtrl; /* 0x3640 */ s16 m3640; /* 0x3644 */ f32 m3644; diff --git a/include/d/actor/d_a_tag_photo.h b/include/d/actor/d_a_tag_photo.h index 1818d152a..972265be0 100644 --- a/include/d/actor/d_a_tag_photo.h +++ b/include/d/actor/d_a_tag_photo.h @@ -7,7 +7,7 @@ class daTagPhoto_c : public fopAc_ac_c { public: daTagPhoto_c(); - int getTagNo() { return mTagNo; } + void getTagNo() {} cPhs_State _create(); void createHeap(); @@ -32,9 +32,6 @@ public: public: /* Place member variables here */ - /* 0x290 */ u8 field_0x290[0x318 - 0x290]; - /* 0x318 */ u8 mTagNo; - /* 0x31C */ u8 field_0x31C[0x320 - 0x31C]; -}; // Size: 0x320 +}; #endif /* D_A_TAG_PHOTO_H */ diff --git a/include/d/d_bg_s_acch.h b/include/d/d_bg_s_acch.h index 2310e6922..42fbfe438 100644 --- a/include/d/d_bg_s_acch.h +++ b/include/d/d_bg_s_acch.h @@ -91,7 +91,7 @@ public: cXyz* speed = NULL, csXyz* angle = NULL, csXyz* shape_angle = NULL); void GroundCheckInit(dBgS&); void GroundCheck(dBgS&); - void GroundRoofProc(dBgS&); + f32 GroundRoofProc(dBgS&); void LineCheck(dBgS&); void CrrPos(dBgS&); f32 GetWallAllR(); diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index d2a403cb8..d8fba0876 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -522,10 +522,6 @@ public: u8 getPictureStatus() { return mPictureStatus; } void setPictureStatusOn() { mPictureStatus = 2; } - void setPictureStatusGetOn(u8 to_set) { - mPictureStatus = 3; - field_0x495f = to_set; - } u8 getScopeMesgStatus() { return mScopeMesgStatus; } void setScopeMesgStatus(u8 status) { mScopeMesgStatus = status; } @@ -2772,10 +2768,6 @@ inline void dComIfGp_setPictureStatusOn() { g_dComIfG_gameInfo.play.setPictureStatusOn(); } -inline void dComIfGp_setPictureStatusGetOn(u8 to_set){ - g_dComIfG_gameInfo.play.setPictureStatusGetOn(to_set); -} - inline s16 dComIfGp_getMiniGameRupee() { return g_dComIfG_gameInfo.play.getMiniGameRupee(); } diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 967253aec..267ee99cb 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -413,11 +413,7 @@ public: class dDlst_mirrorPacket : public J3DPacket { public: void init(ResTIMG*); -#if VERSION == VERSION_DEMO - void update(Mtx, u8); -#else void update(Mtx, u8, f32); -#endif virtual void draw(); /* 0x0010 */ u8 field_0x0010[0x0040 - 0x0010]; diff --git a/include/d/d_picture_box.h b/include/d/d_picture_box.h index 60a60431e..5d8ac4490 100644 --- a/include/d/d_picture_box.h +++ b/include/d/d_picture_box.h @@ -67,5 +67,5 @@ class dJle_Pb_c { void draw(); void _delete(JKRExpHeap*); }; -void dPb_erasePicture(); + #endif /* D_PICTURE_BOX_H */ diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 770c91447..a5ea8ecab 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -430,14 +430,15 @@ inline f32 fopAcM_searchActorDistanceY(fopAc_ac_c* actorA, fopAc_ac_c* actorB) { return actorB->current.pos.y - actorA->current.pos.y; } -inline int fopAcM_GetSetId(fopAc_ac_c* p_actor) { +inline u16 fopAcM_GetSetId(fopAc_ac_c* p_actor) { return p_actor->setID; } inline void dComIfGs_onActor(int bitNo, int roomNo); inline void fopAcM_onActor(fopAc_ac_c* p_actor) { - dComIfGs_onActor(fopAcM_GetSetId(p_actor), fopAcM_GetHomeRoomNo(p_actor)); + int setId = fopAcM_GetSetId(p_actor); + dComIfGs_onActor(setId, fopAcM_GetHomeRoomNo(p_actor)); } inline bool fopAcM_IsFirstCreating(void* i_actor) { diff --git a/src/d/actor/d_a_am.cpp b/src/d/actor/d_a_am.cpp index 92270d597..a69abe01e 100644 --- a/src/d/actor/d_a_am.cpp +++ b/src/d/actor/d_a_am.cpp @@ -57,7 +57,7 @@ static BOOL nodeCallBack(J3DNode* node, int calcTiming) { am_class* i_this = (am_class*)model->getUserArea(); if (i_this) { if (jntNo >= 1 && jntNo <= 4) { - MTXCopy(model->getAnmMtx(jntNo), *calc_mtx); + cMtx_copy(model->getAnmMtx(jntNo), *calc_mtx); } cXyz offset; @@ -369,7 +369,6 @@ static void bomb_move_set(am_class* i_this, u8 alwaysMoveY) { /* 00000F04-00001138 .text bomb_nomi_check__FP8am_class */ static BOOL bomb_nomi_check(am_class* i_this) { fopAc_ac_c* actor = i_this; - fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); i_this->mStts.Move(); if (i_this->mCurrBckIdx != AM_BCK_OPEN && i_this->mCurrBckIdx != AM_BCK_OPEN_LOOP && @@ -392,7 +391,8 @@ static BOOL bomb_nomi_check(am_class* i_this) { if (fpcM_GetName(hitActor) == PROC_BOMB) { daBomb_c* bomb = (daBomb_c*)hitActor; if (!bomb->getBombCheck_Flag() && bomb->getBombRestTime() > 1) { - if (i_this->mMouthPos.y - (20.0f + REG8_F(1)) < bomb->current.pos.y) { + f32 offsetY = 20.0f + REG8_F(1); + if (i_this->mMouthPos.y - offsetY < bomb->current.pos.y) { // Swallow the bomb. bomb->setBombCheck_Flag(); bomb->change_state((daBomb_c::State_e)2); @@ -407,7 +407,8 @@ static BOOL bomb_nomi_check(am_class* i_this) { } else if (fpcM_GetName(hitActor) == PROC_Bomb2) { daBomb2::Act_c* bomb2 = (daBomb2::Act_c*)hitActor; if (!bomb2->chk_eat() && bomb2->get_time() > 1) { - if (i_this->mMouthPos.y - (20.0f + REG8_F(1)) < bomb2->current.pos.y) { + f32 offsetY = 20.0f + REG8_F(1); + if (i_this->mMouthPos.y - offsetY < bomb2->current.pos.y) { // Swallow the bomb. bomb2->set_eat(); i_this->mSwallowedActorPID = fopAcM_GetID(bomb2); @@ -428,7 +429,9 @@ static BOOL bomb_nomi_check(am_class* i_this) { /* 00001138-000011E4 .text BG_check__FP8am_class */ static void BG_check(am_class* i_this) { - i_this->mAcchCir.SetWall(30.0f + REG12_F(3), 150.0f + REG12_F(4)); + f32 halfHeight = 30.0f + REG12_F(3); + f32 radius = 150.0f + REG12_F(4); + i_this->mAcchCir.SetWall(halfHeight, radius); i_this->current.pos.y -= i_this->mCorrectionOffsetY; i_this->old.pos.y -= i_this->mCorrectionOffsetY; @@ -492,20 +495,17 @@ static void action_dousa(am_class* i_this) { anm_init(i_this, AM_BCK_SLEEP_LOOP, 1.0f, J3DFrameCtrl::EMode_LOOP, 1.0f, -1); i_this->mMode += 1; // Fall-through - case 1: { + case 1: if (i_this->mStartsInactive == 1 && i_this->mSwitch != 0xFF && !dComIfGs_isSwitch(i_this->mSwitch, dComIfGp_roomControl_getStayNo())) { break; } fopAcM_OnStatus(i_this, fopAcStts_SHOWMAP_e); - f32 f31 = 1000.0f; - if (fopAcM_searchPlayerDistance(i_this) < f31) { -#if VERSION > VERSION_DEMO + if (fopAcM_searchPlayerDistance(i_this) < 1000.0f) { f32 yDist = player->current.pos.y - i_this->current.pos.y; yDist = std::sqrtf(yDist*yDist); // ??? if (yDist > 300.0f) { break; } -#endif if (Line_check(i_this, player->current.pos)) { anm_init(i_this, AM_BCK_OKIRU, 1.0f, J3DFrameCtrl::EMode_NONE, 1.0f, -1); fopAcM_monsSeStart(i_this, JA_SE_CV_AM_AWAKE, 0); @@ -516,7 +516,6 @@ static void action_dousa(am_class* i_this) { } } break; - } case MODE_DOUSA_OKIRU: if (!i_this->mpMorf->isStop()) { break; @@ -555,19 +554,16 @@ static void action_dousa(am_class* i_this) { return; } } else { - f32 f31 = 2000.0f; - if (fopAcM_searchPlayerDistance(i_this) > f31) { + if (fopAcM_searchPlayerDistance(i_this) > 2000.0f) { i_this->mMode = MODE_DOUSA_SLEEP_INIT; break; } -#if VERSION > VERSION_DEMO f32 yDist = player->current.pos.y - i_this->current.pos.y; yDist = std::sqrtf(yDist*yDist); // ??? if (yDist > 300.0f) { i_this->mMode = MODE_DOUSA_SLEEP_INIT; break; } -#endif } s16 yRotDiff = cLib_distanceAngleS(i_this->shape_angle.y, i_this->mTargetAngleY); if (yRotDiff < 0x100) { @@ -625,16 +621,7 @@ static void action_dousa(am_class* i_this) { fopAcM_monsSeStart(i_this, JA_SE_CV_AM_OPEN_MOUTH, 0); i_this->mNeedleCyl.OffAtSetBit(); i_this->mNeedleCyl.OffAtSetBit(); -#if VERSION == VERSION_DEMO - if (i_this->m033C_demo == NULL) -#else - if (i_this->mSmokeCbs[2].getEmitter() == NULL) -#endif - { -#if VERSION == VERSION_DEMO - i_this->mSmokeCbs[2].remove(); - i_this->m033C_demo = -#endif + if (i_this->mSmokeCbs[2].getEmitter() == NULL) { dComIfGp_particle_setToon( dPa_name::ID_SCENE_A154, &i_this->mWaistPos, &i_this->shape_angle, NULL, 0xB9, &i_this->mSmokeCbs[2], fopAcM_GetRoomNo(i_this) @@ -653,15 +640,7 @@ static void action_dousa(am_class* i_this) { i_this->mTargetAngleY = fopAcM_searchPlayerAngleY(i_this); } if (i_this->mCountDownTimers[0] == 0) { -#if VERSION == VERSION_DEMO - if (i_this->m033C_demo) { - i_this->m033C_demo->becomeInvalidEmitter(); - i_this->m033C_demo = NULL; - i_this->mSmokeCbs[2].remove(); - } -#else i_this->mSmokeCbs[2].remove(); -#endif i_this->mMode = 3; } break; @@ -683,25 +662,9 @@ static void action_dousa(am_class* i_this) { medama_move(i_this); if (i_this->mMode != 2 && medama_atari_check(i_this)) { -#if VERSION == VERSION_DEMO - if (i_this->m033C_demo) { - i_this->m033C_demo->becomeInvalidEmitter(); - i_this->m033C_demo = NULL; - i_this->mSmokeCbs[2].remove(); - } -#else i_this->mSmokeCbs[2].remove(); -#endif } else if (bomb_nomi_check(i_this)) { -#if VERSION == VERSION_DEMO - if (i_this->m033C_demo) { - i_this->m033C_demo->becomeInvalidEmitter(); - i_this->m033C_demo = NULL; - i_this->mSmokeCbs[2].remove(); - } -#else i_this->mSmokeCbs[2].remove(); -#endif } } @@ -983,8 +946,7 @@ static BOOL daAM_Execute(am_class* i_this) { fopAcM_setGbaName(i_this, dItem_BOW_e, 0xC, 0x2A); if (enemy_ice(&i_this->mEnemyIce)) { - J3DModel* model = i_this->mpMorf->getModel(); - model->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); i_this->mpMorf->calc(); return TRUE; } @@ -1105,14 +1067,8 @@ static BOOL daAM_Delete(am_class* i_this) { for (int i = 0; i < 4; i++) { i_this->mSmokeCbs[i].remove(); } -#if VERSION == VERSION_DEMO - if (i_this->m033C_demo) { - i_this->m033C_demo->becomeInvalidEmitter(); - i_this->m033C_demo = NULL; - } -#else i_this->mSmokeCbs[2].remove(); -#endif + if (i_this->m033C) { i_this->m033C->becomeInvalidEmitter(); i_this->m033C = NULL; diff --git a/src/d/actor/d_a_am2.cpp b/src/d/actor/d_a_am2.cpp index f56d80536..17bee58cc 100644 --- a/src/d/actor/d_a_am2.cpp +++ b/src/d/actor/d_a_am2.cpp @@ -365,7 +365,8 @@ static BOOL body_atari_check(am2_class* i_this) { /* 00000F54-00000FF4 .text BG_check__FP9am2_class */ static void BG_check(am2_class* i_this) { - i_this->mAcchCir.SetWall(40.0f + REG8_F(12), i_this->mAcchRadius); + f32 halfHeight = 40.0f + REG8_F(12); + i_this->mAcchCir.SetWall(halfHeight, i_this->mAcchRadius); i_this->current.pos.y -= i_this->mCorrectionOffsetY; i_this->old.pos.y -= i_this->mCorrectionOffsetY; diff --git a/src/d/actor/d_a_npc_md.cpp b/src/d/actor/d_a_npc_md.cpp index b8adc0ddc..d7af68d2d 100644 --- a/src/d/actor/d_a_npc_md.cpp +++ b/src/d/actor/d_a_npc_md.cpp @@ -3211,11 +3211,7 @@ BOOL daNpc_Md_c::draw() { f32 temp = mCps.GetAtVecP()->abs(); mDoMtx_stack_c::scaleM(0.1f, 0.1f, temp * (1.0f/9600.0f)); mDoMtx_stack_c::revConcat(mtx); -#if VERSION == VERSION_DEMO - m0B70.update(mDoMtx_stack_c::get(), 0xFF); -#else m0B70.update(mDoMtx_stack_c::get(), 0xFF, 90.0f); -#endif dComIfGd_getXluList()->entryImm(&m0B70, 0x1F); } diff --git a/src/d/actor/d_a_npc_photo.cpp b/src/d/actor/d_a_npc_photo.cpp index a65a4838a..914bfce01 100644 --- a/src/d/actor/d_a_npc_photo.cpp +++ b/src/d/actor/d_a_npc_photo.cpp @@ -4,2276 +4,338 @@ // #include "d/actor/d_a_npc_photo.h" +#include "m_Do/m_Do_ext.h" #include "d/d_procname.h" #include "d/d_priority.h" -#include "d/d_com_lib_game.h" -#include "d/d_com_inf_game.h" -#include "d/d_a_obj.h" -#include "d/d_path.h" -#include "d/actor/d_a_player_main.h" -#include "d/d_camera.h" -#include "d/res/res_po.h" -#include "d/d_snap.h" -#include "d/d_kankyo_rain.h" -#include "d/d_picture_box.h" -#include "d/actor/d_a_tag_photo.h" - -#include "weak_bss_936_to_1036.h" // IWYU pragma: keep -#include "weak_data_1811.h" // IWYU pragma: keep - -extern dCcD_SrcCyl dNpc_cyl_src; - -const char daNpcPhoto_c::m_arcname[] = "Auc"; - - -static const char* l_arcname_tbl[] = { - "Po" -}; - -static sPhotoAnmDat l_npc_anm_wait[] = { - { - 0x00, - 0x08, - 0xFF, - }, -}; - -static sPhotoAnmDat l_npc_anm_talk[] = { - { - 0x01, - 0x08, - 0xFF, - }, -}; - -static sPhotoAnmDat l_npc_anm_walk[] = { - { - 0x03, - 0x08, - 0xFF, - }, -}; - -static sPhotoAnmDat l_npc_anm_spit[] = { - { - 0x04, - 0x08, - 0x01 - }, - { - 0x00, - 0x08, - 0xFF, - }, -}; - -static sPhotoAnmDat l_npc_anm_talk2[] = { - { - 0x02, - 0x08, - 0x03, - }, - { - 0x00, - 0x08, - 0xFF, - }, -}; - -static sPhotoAnmDat l_npc_anm_talk4[] = { - { - 0x02, - 0x08, - 0x01, - }, - { - 0x01, - 0x08, - 0xFF, - }, -}; - -struct NpcDatStruct { - /* 0x00 */ f32 field_0x00; - /* 0x04 */ s16 field_0x04; - /* 0x06 */ s16 field_0x06; - /* 0x08 */ s16 field_0x08; - /* 0x0A */ s16 field_0x0A; - /* 0x0C */ s16 field_0x0C; - /* 0x0E */ s16 field_0x0E; - /* 0x10 */ s16 field_0x10; - /* 0x12 */ s16 field_0x12; - /* 0x14 */ s16 field_0x14; - /* 0x16 */ s16 field_0x16; - /* 0x18 */ s16 field_0x18; - /* 0x1C */ f32 field_0x1C; - /* 0x20 */ f32 field_0x20; - /* 0x24 */ f32 field_0x24; - /* 0x28 */ s16 field_0x28; - /* 0x2C */ f32 field_0x2C; - /* 0x30 */ f32 field_0x30; - /* 0x34 */ f32 field_0x34; - /* 0x38 */ f32 field_0x38; - /* 0x3C */ f32 field_0x3C; - /* 0x40 */ f32 field_0x40; - /* 0x44 */ s16 field_0x44; - /* 0x46 */ s16 field_0x46; - /* 0x48 */ s16 field_0x48; - /* 0x4A */ s16 field_0x4A; - /* 0x4C */ s16 field_0x4C; - /* 0x4E */ s16 field_0x4E; - /* 0x50 */ s16 field_0x50; - /* 0x52 */ bool field_0x52; - /* 0x53 */ bool field_0x53; -}; // Size: 0x54 - -static NpcDatStruct l_npc_dat = { - 0.0f, - 0x09C4, - 0x07D0, - 0x1388, - 0x1F40, - 0xFF6A, - 0xFE00, - 0xFC18, - 0xE0C0, - 0x01f4, - 0x0320, - 0x0708, - 0.0f, - 215.0f, - 30.0f, - 0x7FFF, - 200.0f, - 300.0f, - -50.0f, - 0.3f, - 5.0f, - 1.3f, - 0x03E8, - 0x0006, - 0x0400, - 0x001E, - 0x001E, - 0x270F, - 0x270F, - true, - true, -}; - -static u32 l_msg_1st_talk[] = { - 0x2A31, - 0x2A32, - 0x2A33, - 0x0000 -}; - -static u32 l_msg_2nd_talk[] = { - 0x2A34, - 0x0000 -}; - -static u32 l_msg_1st_photo[] = { - 0x2A35, - 0x2A36, - 0x0000 -}; - -static u32 l_msg_2nd_photo[] = { - 0x2A37, - 0x2A38, - 0x0000 -}; - -static u32 l_msg_1st_order[] = { - 0x2A39, - 0x2A3A, - 0x2A3C, - 0x2A3D, - 0x2A3E, - 0x2A3F, - 0x2A40, - 0x2A41, - 0x2A42, - 0x2A43, - 0x0001, -}; - -static s16 l_msg_1st_order_c[] = { - 0xFFFF, - 0xFF00, - 0xFF01, - 0xFFFF, - 0x0002 -}; - -static u32 l_msg_1st_order_not_end[] = { - 0x2A44, - 0x2A45, - 0x0000 -}; - -static u16 l_msg_1st_order_not_end_c[] = { - 0xFF02 -}; - -static u32 l_msg_2nd_order[] = { - 0x2A46, - 0x2A47, - 0x2A48, - 0x0003 -}; - -static u8 l_msg_2nd_order_c[] = { - 0xFF, - 0x00, - 0xFF -}; - -static u32 l_msg_2nd_order_not_end[] = { - 0x2A49, - 0x2A4A, - 0x0000 -}; - -static u16 l_msg_2nd_order_not_end_c[] = { - 0xFF02 -}; - -static u32 l_msg_3rd_order[] = { - 0x2A4B, - 0x2A4C, - 0x2A4D, - 0x2A4E, - 0x0005, -}; - -static u32 l_msg_3rd_order_c[] = { - 0xFF00FF02 -}; - -static u32 l_msg_3rd_order_not_end[] = { - 0x2A4F, - 0x2A50, - 0x0000, -}; - -static u16 l_msg_3rd_order_not_end_c[] = { - 0xFFFF -}; - -static u32 l_msg_3rd_order_end[] = { - 0x2A51, - 0x0000, -}; - -static u32 l_msg_not_color[] = { - 0x2A52, - 0x2A53, - 0x0000 -}; - -static u16 l_msg_not_color_c[] = { - 0xFF00 -}; - -static u32 l_msg_color[] = { - 0x2A54, - 0x2A55, - 0x0000 -}; - -static u16 l_msg_color_c[] = { - 0xFF01 -}; - -static u32 l_msg_week_1st[] = { - 0x3781, - 0x3782, - 0x3783, - 0x3784, - 0x3785, - 0x0000 -}; - -static u32 l_msg_week0[] = { - 0x3779, - 0x377A, - 0x3785, - 0x0000 -}; - -static u32 l_msg_week1[] = { - 0x3779, - 0x377B, - 0x3785, - 0x0000 -}; - -static u32 l_msg_week2[] = { - 0x3779, - 0x377C, - 0x3785, - 0x0000 -}; - -static u32 l_msg_week3[] = { - 0x3779, - 0x377D, - 0x3785, - 0x0000 -}; - -static u32 l_msg_week4[] = { - 0x3779, - 0x377E, - 0x3785, - 0x0000 -}; - -static u32 l_msg_week5[] = { - 0x3779, - 0x377F, - 0x3785, - 0x0000 -}; - -static u32 l_msg_week6[] = { - 0x3779, - 0x3780, - 0x3785, - 0x0000 -}; - -static u32* l_msg_week[] = { - l_msg_week0, l_msg_week1, l_msg_week2, l_msg_week3, - l_msg_week4, l_msg_week5, l_msg_week6, -}; - - -static u32 l_msg_1st_talk_photo[] = { - 0x2A69, - 0x2A6A, - 0x2A6B, - 0x2A6C, - 0x0000 -}; - - -static u32 l_msg_talk_photo_0[] = { - 0x2A6E, - 0x2A6F, - 0x0000, -}; - -static u32 l_msg_talk_photo_1[] = { - 0x2A71, - 0x2A72, - 0x0000, -}; - -static u32 l_msg_talk_photo_2[] = { - 0x2A74, - 0x2A75, - 0x0000, -}; - -static u32 l_msg_talk_photo_3[] = { - 0x2A77, - 0x2A78, - 0x0000, -}; - -static u32 l_msg_talk_photo_4[] = { - 0x2A7A, - 0x2A7B, - 0x0000, -}; - -static u32 l_msg_talk_photo_5[] = { - 0x2A7D, - 0x2A7E, - 0x0000, -}; - -static u32 l_msg_talk_photo_6[] = { - 0x2A80, - 0x2A81, - 0x0000, -}; - -static u32* l_msg_talk_photo[] = { - l_msg_talk_photo_0, l_msg_talk_photo_1, l_msg_talk_photo_2, l_msg_talk_photo_3, - l_msg_talk_photo_4, l_msg_talk_photo_5, l_msg_talk_photo_6, -}; - -static u32 l_msg_buy_photo[] = { - 0x3786, - 0x0000 -}; - -static u32 l_msg_get_photo[] = { - 0x3785, - 0x0000 -}; - -static u32 l_msg_2F[] = { - 0x2A82, - 0x2A83, - 0x2A84 -}; - -static u32 l_msg_down[] = { - 0x2A86, - 0x0000 -}; - -static u32 l_msg_ub4[] = { - 0x2D62, - 0x0000, -}; - -static u32 l_msg_1st_order_xy[] = { - 0x2A5E, - 0x2A5F, - 0x2A60, - 0x0002 -}; - -static u32 l_msg_2nd_order_xy[] = { - 0x2A61, - 0x2A62, - 0x2A60, - 0x0004 -}; - -static u32 l_msg_3rd_order_xy[] = { - 0x2A64, - 0x2A60, - 0x0006 -}; - -static u32 l_msg_color_xy[] = { - 0x2A58, - 0x2A59, - 0x2A5A, - 0x0007, - 0x2A85, - 0x0008, - 0x2A5B, - 0x0000 -}; - -static u32 l_msg_xy_buy_photo[] = { - 0x3788, - 0x3789, - 0x0009, - 0x378C, - 0x000A, - 0x378D, - 0x000B, - 0x3786, - 0x0000 -}; - -static dCcD_SrcCyl l_cyl_src2 = { - // dCcD_SrcGObjInf - { - /* Flags */ 0, - /* SrcObjAt Type */ 0, - /* SrcObjAt Atp */ 0, - /* SrcObjAt SPrm */ 0, - /* SrcObjTg Type */ 0, - /* SrcObjTg SPrm */ 0, - /* SrcObjCo SPrm */ cCcD_CoSPrm_NoCoHitInfSet_e | cCcD_CoSPrm_VsGrpAll_e | cCcD_CoSPrm_IsOther_e | cCcD_CoSPrm_Set_e, - /* SrcGObjAt Se */ 0, - /* SrcGObjAt HitMark */ 0, - /* SrcGObjAt Spl */ 0, - /* SrcGObjAt Mtrl */ 0, - /* SrcGObjAt SPrm */ 0, - /* SrcGObjTg Se */ 0, - /* SrcGObjTg HitMark */ 0, - /* SrcGObjTg Spl */ 0, - /* SrcGObjTg Mtrl */ 0, - /* SrcGObjTg SPrm */ dCcG_TgSPrm_NoHitMark_e, - /* SrcGObjCo SPrm */ 0, - }, - // cM3dGCylS - { - /* Center */ 0.0f, 0.0f, 0.0f, - /* Radius */ 40.0f, - /* Height */ 160.0f, - }, -}; - -static char* l_npc_staff_id = { - "Po" -}; - -static const int l_bck_ix_tbl[] = { - PO_BCK_WAIT01, - PO_BCK_TALK01, - PO_BCK_TALK02, - PO_BCK_WALK01, - PO_BCK_SPIT, -}; - -static const int l_btp_ix_tbl[] = { - PO_BTP_MABA01, - PO_BTP_MABA02 -}; - -struct SaveDatStruct { - /* 0x00 */ u16 field_0x00; - /* 0x02 */ u16 field_0x02; - /* 0x04 */ u16 field_0x04; - /* 0x06 */ u16 field_0x06; -}; // Size: 0x08 - -static const SaveDatStruct l_save_dat = { - 0x1208, - 0x1701, - 0x1601, - 0xC407, -}; - - -struct PsoData { - /* 0x00 */ f32 field_0x00; - /* 0x04 */ f32 field_0x04; - /* 0x08 */ f32 field_0x08; - /* 0x0C */ f32 field_0x0C; - /* 0x10 */ f32 field_0x10; - /* 0x14 */ s16 field_0x14; - /* 0x16 */ u8 field_0x16; - /* 0x17 */ u8 field_0x17; -}; // Size: 0x18 - -static PsoData l_pso_photo = { - 0.0f, - 100.0f, - -30.0f, - 40.0f, - 90.0f, - 0x0000, - 0xFF, - 0x04 -}; - -static cXyz l_counter_pos[] = { - cXyz(-490.0f, 0.0f, -10.0f), - cXyz(-260.0f, 0.0f, -250.0f) -}; - -static cXyz l_gallery_pos(-260.0f, 500.0f, 400.0f); /* 000000EC-000002D0 .text __ct__12daNpcPhoto_cFv */ daNpcPhoto_c::daNpcPhoto_c() { - field_0x9C3 = 0; - field_0x9C2 = false; - field_0x9C0 = 0; - field_0x9C1 = 0; - field_0x984 = 0.0f; - field_0x9A8 = 0; - field_0x988 = 60.0f; - field_0x958.x = 0.0f; - field_0x958.y = 0.0f; - field_0x958.z = 0.0f; - field_0x9CD = false; - field_0x9D6 = 0; - field_0x994 = true; - field_0x9AE = home.angle.y; - field_0x9C8 = false; - field_0x9C7 = true; - field_0x98C = -1.0f; + /* Nonmatching */ } /* 00000740-00000858 .text daNpc_Photo_nodeCallBack__FP7J3DNodei */ -static BOOL daNpc_Photo_nodeCallBack(J3DNode* node, int calcTiming) { - if (calcTiming == J3DNodeCBCalcTiming_In) { - J3DModel* model = j3dSys.getModel(); - J3DJoint* joint = (J3DJoint*)node; - daNpcPhoto_c* i_this = (daNpcPhoto_c*)model->getUserArea(); - s32 jntNo = joint->getJntNo(); - cMtx_copy(model->getAnmMtx(jntNo), *calc_mtx); - - if(jntNo == i_this->m_jnt.getHeadJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->m_jnt.getHead_y()); - mDoMtx_ZrotM(*calc_mtx, -i_this->m_jnt.getHead_x()); - } - - if(jntNo == i_this->m_jnt.getBackboneJntNum()) { - mDoMtx_XrotM(*calc_mtx, i_this->m_jnt.getBackbone_y()); - mDoMtx_ZrotM(*calc_mtx, -i_this->m_jnt.getBackbone_x()); - } - - model->setAnmMtx(jntNo, *calc_mtx); - cMtx_copy(*calc_mtx, J3DSys::mCurrentMtx); - } - return TRUE; +static BOOL daNpc_Photo_nodeCallBack(J3DNode*, int) { + /* Nonmatching */ } /* 00000858-00000878 .text CheckCreateHeap__FP10fopAc_ac_c */ -static BOOL CheckCreateHeap(fopAc_ac_c* i_this) { - return static_cast(i_this)->createHeap(); +static BOOL CheckCreateHeap(fopAc_ac_c*) { + /* Nonmatching */ } /* 00000878-0000095C .text phase_1__FP12daNpcPhoto_c */ -static cPhs_State phase_1(daNpcPhoto_c* i_this) { - fopAcM_SetupActor(i_this, daNpcPhoto_c); - s16 arg0 = i_this->getPrmArg0(); - if(arg0 != 255){ - if(arg0 == 0){ - if(!dComIfGs_checkGetItem(dItem_COLLECT_MAP_20_e) && arg0 != dComIfGp_getStartStagePoint()){ - return cPhs_STOP_e; - } - } else{ - if(dComIfGs_checkGetItem(dItem_COLLECT_MAP_20_e) || arg0 != dComIfGp_getStartStagePoint()) { - return cPhs_STOP_e; - } - i_this->field_0x9C1 = 4; - } - } - i_this->field_0x9C2 = true; - return cPhs_NEXT_e; +void phase_1(daNpcPhoto_c*) { + /* Nonmatching */ } /* 0000095C-000009D4 .text phase_2__FP12daNpcPhoto_c */ -static cPhs_State phase_2(daNpcPhoto_c* i_this) { - cPhs_State phase_state = dComIfG_resLoad(i_this->getPhaseP(), l_arcname_tbl[0]); - if (phase_state == cPhs_COMPLEATE_e) { - if (fopAcM_entrySolidHeap(i_this, CheckCreateHeap, 0)) { - return i_this->createInit(); - } else { - i_this->mpMorf = NULL; - return cPhs_ERROR_e; - } - } - return phase_state; +void phase_2(daNpcPhoto_c*) { + /* Nonmatching */ } /* 000009D4-00000A04 .text _create__12daNpcPhoto_cFv */ cPhs_State daNpcPhoto_c::_create() { - static cPhs__Handler l_method[] = { - (cPhs__Handler)phase_1, - (cPhs__Handler)phase_2, - NULL, - }; - return dComLbG_PhaseHandler(&mPhs2, l_method, this); + /* Nonmatching */ } /* 00000A04-00000CA0 .text createHeap__12daNpcPhoto_cFv */ -BOOL daNpcPhoto_c::createHeap() { - J3DModelData* modelData = (J3DModelData *)dComIfG_getObjectIDRes(l_arcname_tbl[0], PO_BDL_PO); - mpMorf = new mDoExt_McaMorf( - modelData, - NULL, NULL, - (J3DAnmTransform*)dComIfG_getObjectIDRes(l_arcname_tbl[0], l_bck_ix_tbl[field_0x9C8]), - J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 1, NULL, - 0x80000,0x11020022 - ); - - if (mpMorf == NULL || mpMorf->getModel() == NULL) { - return FALSE; - } - - m_jnt.setHeadJntNum(modelData->getJointName()->getIndex("head")); - JUT_ASSERT(0x4A7, m_jnt.getHeadJntNum() >= 0); - m_jnt.setBackboneJntNum(modelData->getJointName()->getIndex("backbone")); - JUT_ASSERT(0x4AC, m_jnt.getBackboneJntNum() >= 0); - - if (!initTexPatternAnm(false, -1)) { - return FALSE; - } - - for(u16 i = 0; i < modelData->getJointNum(); i++) { - if(i == m_jnt.getHeadJntNum() || i == m_jnt.getBackboneJntNum()) { - modelData->getJointNodePointer(i)->setCallBack(daNpc_Photo_nodeCallBack); - } - } - mpMorf->getModel()->setUserArea((u32)this); - mAcchCir.SetWall(30.0f, 30.0f); - mObjAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, &mAcchCir, fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this), fopAcM_GetShapeAngle_p(this)); - return TRUE; - - - return FALSE; +void daNpcPhoto_c::createHeap() { + /* Nonmatching */ } /* 00000CA0-00000CC0 .text daNpcPhoto_XyCheckCB__FPvi */ -static s16 daNpcPhoto_XyCheckCB(void* i_this, int i_itemBtn) { - return ((daNpcPhoto_c*)i_this)->XyCheckCB(i_itemBtn); +static s16 daNpcPhoto_XyCheckCB(void*, int) { + /* Nonmatching */ } /* 00000CC0-00000CE0 .text daNpcPhoto_XyEventCB__FPvi */ -static s16 daNpcPhoto_XyEventCB(void* i_this, int i_itemBtn) { - return ((daNpcPhoto_c*)i_this)->XyEventCB(i_itemBtn); +static s16 daNpcPhoto_XyEventCB(void*, int) { + /* Nonmatching */ } /* 00000CE0-00001048 .text createInit__12daNpcPhoto_cFv */ -cPhs_State daNpcPhoto_c::createInit() { - int temp = 0xFF; - - u8 pathIndex = getPrmRailID(); - if(pathIndex != 0xFF) { - mPathRun.setInf(pathIndex, fopAcM_GetRoomNo(this), true); - if(mPathRun.mPath == NULL) { - return cPhs_ERROR_e; - } - - dPath_GetNextRoomPath(mPathRun.mPath, -1); - - if(dComIfGs_isEventBit(l_save_dat.field_0x02)) { - cXyz point = mPathRun.getPoint(mPathRun.mCurrPointIndex); - old.pos = point; - current.pos = old.pos; - mPathRun.incIdxLoop(); - field_0x9A8 = 1; - field_0x9C1 = 2; - } - temp = 0xFE; - } - gravity = -9.0f; - - mPhotoLinkBackEventIdx = dComIfGp_evmng_getEventIdx("PHOTO_LINK_BACK",0xff); - mPhotoGetItemEventIdx = dComIfGp_evmng_getEventIdx("PHOTO_GET_ITEM",0xff); - mPhotoGetItem2EventIdx = dComIfGp_evmng_getEventIdx("PHOTO_GET_ITEM2",0xff); - mPhotoGetPhotoEventIdx = dComIfGp_evmng_getEventIdx("PHOTO_GET_PHOTO",0xff); - mPhotoGalleryEventIdx = dComIfGp_evmng_getEventIdx("PHOTO_GALLERY",0xff); - mPhotoCounterTalk0EventIdx = dComIfGp_evmng_getEventIdx("PHOTO_COUNTER_TALK0",0xff); - mPhotoCounterTalk1EventIdx = dComIfGp_evmng_getEventIdx("PHOTO_COUNTER_TALK1",0xff); - mPhotoDateUB4EventIdx = dComIfGp_evmng_getEventIdx("PHOTO_DATE_UB4",0xff); - field_0x9A6 = mPhotoCounterTalk0EventIdx; - - mEventCut.setActorInfo2(l_npc_staff_id, this); - - field_0x9B6 = 0; - field_0x9BC = false; - field_0x9BD = false; - - fopAcM_SetMtx(this, mpMorf->getModel()->getBaseTRMtx()); - attention_info.distances[fopAc_Attn_TYPE_TALK_e] = 173; - attention_info.distances[fopAc_Attn_TYPE_SPEAK_e] = 173; - attention_info.flags = fopAc_Attn_UNK1000000_e | fopAc_Attn_LOCKON_TALK_e | fopAc_Attn_ACTION_SPEAK_e; - - eventInfo.setXyCheckCB(&daNpcPhoto_XyCheckCB); - eventInfo.setXyEventCB(&daNpcPhoto_XyEventCB); - - if (field_0x9C1 == 4) { - field_0x9D7 = false; - field_0x9D8 = false; - } else { - field_0x9D7 = l_npc_dat.field_0x52; - field_0x9D8 = l_npc_dat.field_0x53; - } - - field_0x9B2 = l_npc_dat.field_0x28; - mObjAcch.CrrPos(*dComIfG_Bgsp()); - - if(mObjAcch.GetGroundH() != -G_CM3D_F_INF) { - current.pos.y = home.pos.y = mObjAcch.GetGroundH(); - } - - setMtx(); - mpMorf->getModel()->calc(); - mStts.Init(temp, 0xFF, this); - mCyl.Set(dNpc_cyl_src); - mCyl.SetStts(&mStts); - setCollision(&mCyl, current.pos + field_0x958, field_0x988, 150.0f); - field_0x6F8[0].Set(l_cyl_src2); - field_0x6F8[0].SetStts(&mStts); - field_0x6F8[1].Set(l_cyl_src2); - field_0x6F8[1].SetStts(&mStts); - return 4; +void daNpcPhoto_c::createInit() { + /* Nonmatching */ } /* 00001048-000010A4 .text _delete__12daNpcPhoto_cFv */ bool daNpcPhoto_c::_delete() { - dComIfG_resDelete(getPhaseP(), l_arcname_tbl[0]); - if(heap && mpMorf) { - mpMorf->stopZelAnime(); - } - return true; + /* Nonmatching */ } /* 000010A4-0000125C .text _draw__12daNpcPhoto_cFv */ bool daNpcPhoto_c::_draw() { - - J3DModel* model = mpMorf->getModel(); - J3DModelData *model_data = model->getModelData(); - g_env_light.settingTevStruct(TEV_TYPE_ACTOR, ¤t.pos, &tevStr); - g_env_light.setLightTevColorType(model, &tevStr); - mBtpAnm.entry(model_data, mFrame); - mpMorf->updateDL(); - mBtpAnm.remove(model_data); - - cXyz shadowPos( - current.pos.x, - current.pos.y + 150.0f, - current.pos.z - ); - - mShadowId = dComIfGd_setShadow( - mShadowId, 1, mpMorf->getModel(), &shadowPos, 800.0f, 20.0f, - current.pos.y, mObjAcch.GetGroundH(), mObjAcch.m_gnd, &tevStr - ); - - if (field_0x9C1 == 4) { - dSnap_Obj obj; - - cXyz temp( - l_pso_photo.field_0x00, - l_pso_photo.field_0x04, - l_pso_photo.field_0x08 - ); - temp += current.pos; - obj.SetInf(5, this, l_pso_photo.field_0x16, l_pso_photo.field_0x17, 0x7FFF); - obj.SetGeo(temp, l_pso_photo.field_0x0C, l_pso_photo.field_0x10, l_pso_photo.field_0x14 + current.angle.y); - dSnap_RegistSnapObj(obj); - } else { - dSnap_RegistFig(DSNAP_TYPE_UNK5E, this, 1.0f, 1.0f, 1.0f); - } - return true; + /* Nonmatching */ } -static daNpcPhoto_c::MoveFunc_t moveProc[] = { - &daNpcPhoto_c::executeWait, - &daNpcPhoto_c::executeTalk, - &daNpcPhoto_c::executeWalk, - &daNpcPhoto_c::executeTurn, -}; - /* 0000125C-0000151C .text _execute__12daNpcPhoto_cFv */ bool daNpcPhoto_c::_execute() { - m_jnt.setParam( - l_npc_dat.field_0x08, l_npc_dat.field_0x0A, l_npc_dat.field_0x10, - l_npc_dat.field_0x12, l_npc_dat.field_0x04, l_npc_dat.field_0x06, - l_npc_dat.field_0x0C, l_npc_dat.field_0x0E, l_npc_dat.field_0x14 - ); - - chkAttention(); - mEyePos.set( - current.pos.x, - current.pos.y + l_npc_dat.field_0x30, - current.pos.z - ); - - checkOrder(); - - if (!dComIfGp_event_runCheck() || (eventInfo.checkCommandTalk() && field_0x9C7)) { - (this->*moveProc[field_0x9C0])(); - } else { - eventMove(); - } - - eventOrder(); - playTexPatternAnm(); - playAnm(); - - if(field_0x9C8 == 3){ - cLib_chaseF(&speedF, field_0x984, 0.1f); - float temp = speedF * l_npc_dat.field_0x38; - - if(temp < 0.5f) { - temp = 0.5f; - } - mpMorf->setPlaySpeed(temp); - } else { - cLib_chaseF(&speedF, field_0x984, 0.5f); - } - - fopAcM_posMoveF(this, mStts.GetCCMoveP()); - mObjAcch.CrrPos(*dComIfG_Bgsp()); - setCollision(&mCyl, current.pos + field_0x958, field_0x988, 150.0f); - - if (field_0x9C1 == 2) { - for(int i = 0; i < 2; i++) { - setCollision(&field_0x6F8[i], - cXyz( - l_counter_pos[i].x, - l_counter_pos[i].y, - l_counter_pos[i].z - ), - 110.0f, 150.0f - ); - } - } - - cXyz temp( - l_npc_dat.field_0x1C, - l_npc_dat.field_0x20, - l_npc_dat.field_0x24 - ); - - mDoMtx_stack_c::YrotS(current.angle.y); - mDoMtx_stack_c::multVec(&temp, &temp); - temp += current.pos; - attention_info.position = temp; - eyePos = mEyePos; - lookBack(); - setMtx(); - return false; + /* Nonmatching */ } - /* 0000151C-00001580 .text executeCommon__12daNpcPhoto_cFv */ -bool daNpcPhoto_c::executeCommon() { - if (field_0x9BD) { - field_0x9BE = 1; - } else { - field_0x9BE = 0; - } - - if (field_0x9BC == 1) { - executeSetMode(1); - } - return field_0x9BC; +void daNpcPhoto_c::executeCommon() { + /* Nonmatching */ } /* 00001580-000017D0 .text executeSetMode__12daNpcPhoto_cFUc */ -void daNpcPhoto_c::executeSetMode(u8 param_1) { - s16 angle; - field_0x984 = 0.0f; - - switch (param_1) { - case 0: - setAnmTbl(l_npc_anm_wait); - field_0x9A8 = l_npc_dat.field_0x4A + cM_rndF(l_npc_dat.field_0x4C - l_npc_dat.field_0x4A); - break; - case 2: - setAnmTbl(l_npc_anm_walk); - field_0x9A8 = l_npc_dat.field_0x4E + cM_rndF(l_npc_dat.field_0x50 - l_npc_dat.field_0x4E); - break; - case 3: - cXyz point = mPathRun.getPoint(mPathRun.mCurrPointIndex); - dNpc_calc_DisXZ_AngY(current.pos, point, NULL, &angle); - - if (angle == current.angle.y) { - param_1 = 2; - setAnmTbl(l_npc_anm_walk); - field_0x9A8 = l_npc_dat.field_0x4E + cM_rndF(l_npc_dat.field_0x50 - l_npc_dat.field_0x4E); - } - break; - } - field_0x9C0 = param_1; +void daNpcPhoto_c::executeSetMode(unsigned char) { + /* Nonmatching */ } /* 000017D0-00001A80 .text executeWait__12daNpcPhoto_cFv */ void daNpcPhoto_c::executeWait() { - if(!executeCommon()) { - field_0x988 = 60.0f; - field_0x958.x = 0.0f; - field_0x958.y = 0.0f; - field_0x958.z = 0.0f; - field_0x9CD = false; - - if(!dComIfGs_isEventBit(l_save_dat.field_0x02)){ - field_0x988 = 150.0f; - f32 zPos = l_npc_dat.field_0x34; - field_0x958.x = 0.0f; - field_0x958.y = 0.0f; - field_0x958.z = zPos; - - if(mCyl.ChkCoHit()) { - daNpcPhoto_c* pActor = (daNpcPhoto_c*)mCyl.GetCoHitAc(); - if(pActor && fopAcM_GetProfName(pActor) == PROC_PLAYER) { - field_0x9BE = 2; - } - - } - } else if(field_0x9C1 == 4 && ((field_0x9C6 & 0x10) == 0)){ - daPy_py_c* link = (daPy_py_c*)dComIfGp_getLinkPlayer(); - - if (link->current.pos.y < 10.0f && link->current.pos.x > -300.0f && link->current.pos.z > -500.0f) { - field_0x9BE = 10; - } - } else { - if( - dComIfGp_getStartStagePoint() == 0 && - (!dComIfGs_isEventBit(l_save_dat.field_0x04) && field_0x9BE != 7) && - dComIfGp_getLinkPlayer()->current.pos.y > 400.0f && - dComIfGp_getLinkPlayer()->current.pos.x > -600.0f){ - field_0x9BE = 7; - } - - if(field_0x9C1 == 2){ - eventInfo.setEventId(-1); - field_0x9C7 = true; - - dCcD_GObjInf* pGObjInf; - for (int i = 0; i < 2; i++) { - pGObjInf = &field_0x6F8[i]; - if (pGObjInf->ChkCoHit()) { - daNpcPhoto_c* pActor = (daNpcPhoto_c*)pGObjInf->GetCoHitAc(); - if(pActor != NULL && fopAcM_GetProfName(pActor) == PROC_PLAYER) { - field_0x9CD = true; - break; - } - } - } - } - - if(field_0x9C1 == 1 && !field_0x9BD && dComIfGp_getLinkPlayer()->current.pos.y < current.pos.y + -50.0f) { - executeSetMode(3); - field_0x9C1 = 3; - } - - if(field_0x9C1 == 3 && !field_0x9BD) { - if(field_0x9A8 == 0) { - executeSetMode(3); - } else { - field_0x9A8--; - } - } - } - } + /* Nonmatching */ } /* 00001A80-00001BB4 .text executeTalk__12daNpcPhoto_cFv */ void daNpcPhoto_c::executeTalk() { - executeCommon(); - if(!dComIfGp_event_chkTalkXY() || dComIfGp_evmng_ChkPresentEnd()) { - if(talk2(1) == fopMsgStts_BOX_CLOSED_e){ - field_0x9BC = false; - executeSetMode(0); - u8 temp = field_0x9C6; - if((temp & 1) != 0){ - field_0x9C6 = temp & 254; - mItemNo = 31; - field_0x9BE = 4; - - } else { - if((temp & 2) != 0){ - field_0x9C6 = temp & ~0x02; - mItemNo = 38; - field_0x9BE = 5; - - } else { - if((temp & 4) != 0){ - field_0x9C6 = temp & ~0x04; - field_0x9BE = 3; - setAnmTbl(l_npc_anm_spit); - field_0x9C9 |= 4; - } else { - field_0x9C6 = temp | 64; - } - } - } - } else { - setAnmFromMsgTag(); - } - } + /* Nonmatching */ } /* 00001BB4-00001D98 .text executeWalk__12daNpcPhoto_cFv */ void daNpcPhoto_c::executeWalk() { - if(!executeCommon()) { - bool temp = false; - if(mPathRun.chkPointPass(current.pos, mPathRun.mbGoingForwards) && !mPathRun.nextIdxAuto()) { - temp = true; - } - - if (field_0x9BD != 0) { - executeSetMode(0); - } else if (!temp) { - cXyz point = mPathRun.getPoint(mPathRun.mCurrPointIndex); - s16 angle; - dNpc_calc_DisXZ_AngY(current.pos, point, NULL, &angle); - field_0x9BA = angle; - field_0x994 = false; - field_0x9B6 = l_npc_dat.field_0x18; - field_0x9D6 = 2; - m_jnt.setTrn(); - field_0x984 = l_npc_dat.field_0x3C; - - u8 pointIndex = mPathRun.mCurrPointIndex; - - if (mPathRun.mbGoingForwards) { - pointIndex--; - } else { - pointIndex++; - } - - cXyz point2 = mPathRun.getPoint(pointIndex); - if (point2.y - point.y > 400.0f) { - field_0x984 = l_npc_dat.field_0x3C * l_npc_dat.field_0x40; - } - - } else{ - executeSetMode(0); - field_0x9C1 = 2; - field_0x9AE = home.angle.y; - } - } + /* Nonmatching */ } /* 00001D98-00001E5C .text executeTurn__12daNpcPhoto_cFv */ void daNpcPhoto_c::executeTurn() { - if (!executeCommon()) { - s16 angle; - cXyz point = mPathRun.getPoint(mPathRun.mCurrPointIndex); - dNpc_calc_DisXZ_AngY(current.pos, point, NULL, &angle); // maybe not oldpos - field_0x9BA = angle; - field_0x994 = false; - field_0x9D6 = 2; - if (!m_jnt.trnChk()) { - executeSetMode(2); - } - } + /* Nonmatching */ } /* 00001E5C-00001FDC .text checkOrder__12daNpcPhoto_cFv */ void daNpcPhoto_c::checkOrder() { - if(eventInfo.mCommand == dEvtCmd_INDEMO_e){ - if(dComIfGp_evmng_startCheck(mPhotoLinkBackEventIdx) && field_0x9BE == 3){ - field_0x9BE = 0; - } else if(dComIfGp_evmng_startCheck(mPhotoGetItemEventIdx) && field_0x9BE == 4){ - field_0x9BE = 0; - } else if(dComIfGp_evmng_startCheck(mPhotoGetItem2EventIdx) && field_0x9BE == 5){ - field_0x9BE = 0; - } else if(dComIfGp_evmng_startCheck(mPhotoGetPhotoEventIdx) && field_0x9BE == 6){ - field_0x9BE = 0; - } else if(dComIfGp_evmng_startCheck(mPhotoGalleryEventIdx) && field_0x9BE == 7){ - field_0x9BE = 0; - } else if(dComIfGp_evmng_startCheck(mPhotoDateUB4EventIdx) && field_0x9BE == 10){ - field_0x9BE = 0; - } - } else if(eventInfo.mCommand == dEvtCmd_INTALK_e && (field_0x9BE == 2 || field_0x9BE == 1)){ - field_0x9BC = true; - executeSetMode(1); - } + /* Nonmatching */ } /* 00001FDC-000021B8 .text eventOrder__12daNpcPhoto_cFv */ void daNpcPhoto_c::eventOrder() { - if (field_0x9C6 & 0x40) { - field_0x9C6 &= ~0x40; - dComIfGp_event_reset(); - initTexPatternAnm(true, -1); - field_0x9C9 &= 0x7F; - field_0x9C7 = true; - field_0x9BC = false; - executeSetMode(0); - } - u8 temp = field_0x9BE; - if(temp == 2 || temp == 1){ - eventInfo.onCondition(dEvtCnd_CANTALK_e); - eventInfo.onCondition(dEvtCnd_CANTALKITEM_e); - if (field_0x9BE == 2) { - fopAcM_orderSpeakEvent(this); - } - } else if(temp == 3){ - fopAcM_orderChangeEventId(dComIfGp_getLinkPlayer(), this, mPhotoLinkBackEventIdx, 0, 0xFFFF); - } else if(temp == 4){ - fopAcM_orderChangeEventId(dComIfGp_getLinkPlayer(), this, mPhotoGetItemEventIdx, 0, 0xFFFF); - } else if(temp == 5){ - fopAcM_orderChangeEventId(dComIfGp_getLinkPlayer(), this, mPhotoGetItem2EventIdx, 0, 0xFFFF); - } else if(temp == 6){ - fopAcM_orderChangeEventId(dComIfGp_getLinkPlayer(), this, mPhotoGetPhotoEventIdx, 0, 0xFFFF); - } else if(temp == 7){ - fopAcM_orderOtherEventId(this, mPhotoGalleryEventIdx); - } else if(temp == 10){ - fopAcM_orderOtherEventId(this, mPhotoDateUB4EventIdx); - } + /* Nonmatching */ } /* 000021B8-00002368 .text eventMove__12daNpcPhoto_cFv */ void daNpcPhoto_c::eventMove() { - if(dComIfGp_evmng_endCheck(mPhotoLinkBackEventIdx)){ - field_0x9C6 |= 0x40; - } else if(dComIfGp_evmng_endCheck(field_0x9A6)){ - field_0x9C6 |= 0x40; - eventInfo.mEventId = -1; - field_0x9C7 = true; - field_0x9BE = 0; - field_0x9BC = false; - executeSetMode(0); - } else if(dComIfGp_evmng_endCheck(mPhotoGetItemEventIdx)){ - field_0x9C6 |= 0x40; - } else if(dComIfGp_evmng_endCheck(mPhotoGetItem2EventIdx)){ - field_0x9C6 |= 0x40; - } else if(dComIfGp_evmng_endCheck(mPhotoGetPhotoEventIdx)){ - field_0x9C6 |= 0x40; - } else if(dComIfGp_evmng_endCheck(mPhotoGalleryEventIdx)){ - field_0x9C6 |= 0x40; - } else if(dComIfGp_evmng_endCheck(mPhotoDateUB4EventIdx)){ - field_0x9C6 |= 0x40; - field_0x9C6 |= 0x10; - field_0x9D7 = true; - field_0x9D8 = true; - } else{ - bool temp = mEventCut.getAttnFlag(); - - if(mEventCut.cutProc()) { - if(!mEventCut.getAttnFlag()) { - mEventCut.setAttnFlag(temp); - } - } else { - privateCut(); - setAnmFromMsgTag(); - } - } + /* Nonmatching */ } /* 00002368-00002560 .text privateCut__12daNpcPhoto_cFv */ void daNpcPhoto_c::privateCut() { - static char* cut_name_tbl[] = { - "MES_SET", - "SE_SET", - "POS_SET", - "GET_ITEM", - "SET_ANGLE", - "SET_EYE", - "TURN_TO_PLAYER", - "CLR_HANME", - "GET_PHOTO", - "MES_SET_UB", - "LOOK_UB" - }; - enum { - ACT_MES_SET, - ACT_SE_SET, - ACT_POS_SET, - ACT_GET_ITEM, - ACT_SET_ANGLE, - ACT_SET_EYE, - ACT_TURN_TO_PLAYER, - ACT_CLR_HANME, - ACT_GET_PHOTO, - ACT_MES_SET_UB, - ACT_LOOK_UB, - }; - - int staffIdx = dComIfGp_evmng_getMyStaffId(l_npc_staff_id); - if (staffIdx == -1) { - return; - } - - mActIdx = dComIfGp_evmng_getMyActIdx(staffIdx, cut_name_tbl, ARRAY_SIZE(cut_name_tbl), TRUE, 0); - if (mActIdx == -1) { - dComIfGp_evmng_cutEnd(staffIdx); - return; - } - - if (dComIfGp_evmng_getIsAddvance(staffIdx)) { - switch (mActIdx) { - case ACT_MES_SET: - eventMesSetInit(staffIdx); - break; - case ACT_SE_SET: - eventSeSetInit(staffIdx); - break; - case ACT_POS_SET: - eventPosSetInit(); - break; - case ACT_GET_ITEM: - eventGetItemInit(); - break; - case ACT_SET_ANGLE: - eventSetAngleInit(); - break; - case ACT_SET_EYE: - eventSetEyeInit(); - break; - case ACT_TURN_TO_PLAYER: - eventTurnToPlayerInit(); - break; - case ACT_CLR_HANME: - eventClrHanmeInit(); - break; - case ACT_GET_PHOTO: - eventGetPhotoInit(); - break; - case ACT_MES_SET_UB: - eventMesSetUbInit(staffIdx); - break; - } - } - - bool evtRes; - switch (mActIdx) { - case ACT_MES_SET: - evtRes = eventMesSet(); - break; - case ACT_GET_ITEM: - evtRes = eventGetItem(); - break; - case ACT_SET_EYE: - evtRes = eventSetEye(); - break; - case ACT_TURN_TO_PLAYER: - evtRes = eventTurnToPlayer(); - break; - case ACT_GET_PHOTO: - evtRes = eventGetPhoto(); - break; - case ACT_MES_SET_UB: - evtRes = eventMesSetUb(); - break; - case ACT_LOOK_UB: - evtRes = eventLookUb(); - break; - default: - evtRes = true; - break; - } - if (evtRes) { - dComIfGp_evmng_cutEnd(staffIdx); - } + /* Nonmatching */ } /* 00002560-00002758 .text eventMesSetInit__12daNpcPhoto_cFi */ -void daNpcPhoto_c::eventMesSetInit(int i_staffId) { - int* pData = dComIfGp_evmng_getMyIntegerP(i_staffId, "MsgNo"); - - if(pData) { - field_0x980 = NULL; - field_0x9D0 = NULL; - u32 msgNo = *pData; - - switch (msgNo) { - case 0: - if (!dComIfGs_isEventBit(l_save_dat.field_0x04)) { - field_0x980 = l_msg_1st_talk_photo; - field_0x9D0 = NULL; - dComIfGs_onEventBit(l_save_dat.field_0x04); - - } else { - int temp = 0; - daTagPhoto_c* ac = (daTagPhoto_c*)dComIfGp_event_getPt2(); - if(ac != NULL){ - temp = ac->getTagNo(); - } - field_0x980 = l_msg_talk_photo[(temp & 0xFF)]; - field_0x9D0 = NULL; - } - setMessage(*field_0x980); - break; - case 1: - setMessage(getMsg()); - break; - case 99: - mDoAud_seStart(JA_SE_UTSUSHIE_TO_DX); - field_0x980 ++; - - if (field_0x9D0 != NULL) { - field_0x9D0++; - } - setMessage(*field_0x980); - break; - default: - setMessage(msgNo); - break; - } - } else { - field_0x980 ++; - - if (field_0x9D0 != 0) { - field_0x9D0++; - } - setMessage(*field_0x980); - } +void daNpcPhoto_c::eventMesSetInit(int) { + /* Nonmatching */ } /* 00002758-0000278C .text eventMesSet__12daNpcPhoto_cFv */ -bool daNpcPhoto_c::eventMesSet() { - return talk2(0) == fopMsgStts_BOX_CLOSED_e; +void daNpcPhoto_c::eventMesSet() { + /* Nonmatching */ } /* 0000278C-0000289C .text eventSeSetInit__12daNpcPhoto_cFi */ -void daNpcPhoto_c::eventSeSetInit(int i_staffId) { - int* seNo = dComIfGp_evmng_getMyIntegerP(i_staffId, "SeNo"); - - if(seNo != NULL) { - switch (*seNo) { - case 0: - mDoAud_seStart(JA_SE_UTSUSHIE_TO_DX); - break; - default: - mDoAud_seStart(JA_SE_UTSUSHIE_TO_DX); - break; - } - } else { - mDoAud_seStart(JA_SE_UTSUSHIE_TO_DX); - } +void daNpcPhoto_c::eventSeSetInit(int) { + /* Nonmatching */ } - /* 0000289C-00002C60 .text eventPosSetInit__12daNpcPhoto_cFv */ void daNpcPhoto_c::eventPosSetInit() { - s16 angle; - daTagPhoto_c* ac = (daTagPhoto_c*)dComIfGp_event_getPt2(); - - if(ac){ - cXyz temp = ac->current.pos; - dPath* path = dPath_GetNextRoomPath(mPathRun.mPath, fopAcM_GetRoomNo(this)); - - if(path != NULL){ - dPnt* pnt = dPath_GetPnt(path, ac->getTagNo()); - if(pnt != NULL){ - old.pos = pnt->m_position; - current.pos = old.pos; - dBgS_GndChk gndChk; - - Vec temp; - temp.y = current.pos.y; - temp.z = current.pos.z; - temp.y += 50.0f; - temp.x = current.pos.x; - - gndChk.SetPos(&temp); - - f32 floor_y = dComIfG_Bgsp()->GroundCross(&gndChk); - if(floor_y != -G_CM3D_F_INF){ - old.pos.y = floor_y; - current.pos.y = floor_y; - } - } - } - dNpc_calc_DisXZ_AngY(current.pos, temp, NULL, &angle); - shape_angle.y = current.angle.y = field_0x9AE = angle; - } else { - daPy_lk_c* link = daPy_getPlayerLinkActorClass(); - old.pos = l_gallery_pos; - current.pos = old.pos; - dNpc_calc_DisXZ_AngY(current.pos, link->current.pos, NULL, &angle); - shape_angle.y = current.angle.y = field_0x9AE = angle; - } - dComIfGp_event_setTalkPartner(this); - mPathRun.mCurrPointIndex = mPathRun.mPath->m_num - 2; - mPathRun.mbGoingForwards = false; - - executeSetMode(0); - field_0x9C1 = 1; - int temp = cM_rndF(3.0f); - if (temp == 3) { - temp = 0; - } - mMsgNno = l_msg_2F[temp]; + /* Nonmatching */ } /* 00002FE0-0000303C .text eventGetItemInit__12daNpcPhoto_cFv */ void daNpcPhoto_c::eventGetItemInit() { - fpc_ProcID itemID = fopAcM_createItemForPresentDemo(¤t.pos, mItemNo, 0, -1, fopAcM_GetRoomNo(this)); - if (itemID != fpcM_ERROR_PROCESS_ID_e) { - dComIfGp_event_setItemPartnerId(itemID); - } + /* Nonmatching */ } /* 0000303C-00003044 .text eventGetItem__12daNpcPhoto_cFv */ -bool daNpcPhoto_c::eventGetItem() { - return true; +void daNpcPhoto_c::eventGetItem() { + /* Nonmatching */ } /* 00003044-000030A8 .text eventSetAngleInit__12daNpcPhoto_cFv */ void daNpcPhoto_c::eventSetAngleInit() { - daPy_lk_c* link = daPy_getPlayerLinkActorClass(); - cXyz pos = current.pos - link->current.pos; - link->changeDemoMoveAngle(cM_atan2s(pos.x, pos.z)); + /* Nonmatching */ } /* 000030A8-000030F0 .text eventSetEyeInit__12daNpcPhoto_cFv */ void daNpcPhoto_c::eventSetEyeInit() { - field_0x9B0 = 0; - dComIfGp_event_setTalkPartner(this); + /* Nonmatching */ } /* 000030F0-000031F0 .text eventSetEye__12daNpcPhoto_cFv */ -bool daNpcPhoto_c::eventSetEye() { - daPy_lk_c* link = daPy_getPlayerLinkActorClass(); - s16 temp = link->shape_angle.y + cM_ssin(field_0x9B0) * 12288.0f; - field_0x9B0 += 0x400; - mEyePos.x = 0.0f; - mEyePos.y = 0.0f; - mEyePos.z = 100.0f; - mDoMtx_stack_c::YrotS(temp); - mDoMtx_stack_c::XrotM(-0x1000); - mDoMtx_stack_c::multVec(&mEyePos, &mEyePos); - mEyePos += link->eyePos; - return TRUE; +void daNpcPhoto_c::eventSetEye() { + /* Nonmatching */ } /* 000031F0-00003260 .text eventTurnToPlayerInit__12daNpcPhoto_cFv */ void daNpcPhoto_c::eventTurnToPlayerInit() { - fopAc_ac_c* link = dComIfGp_getLinkPlayer(); - dNpc_calc_DisXZ_AngY(current.pos, link->current.pos, 0, &field_0x9AE); + /* Nonmatching */ } /* 00003260-00003278 .text eventTurnToPlayer__12daNpcPhoto_cFv */ -bool daNpcPhoto_c::eventTurnToPlayer() { - return current.angle.y == field_0x9AE ? TRUE : FALSE; +void daNpcPhoto_c::eventTurnToPlayer() { + /* Nonmatching */ } /* 00003278-000032B8 .text eventClrHanmeInit__12daNpcPhoto_cFv */ void daNpcPhoto_c::eventClrHanmeInit() { - initTexPatternAnm(true, -1); - field_0x9C9 &= 0x7F; + /* Nonmatching */ } /* 000032B8-00003300 .text eventGetPhotoInit__12daNpcPhoto_cFv */ void daNpcPhoto_c::eventGetPhotoInit() { - dComIfGp_setPictureStatusGetOn(dKy_get_dayofweek()); - field_0x9B0 = 10; + /* Nonmatching */ } /* 00003300-0000331C .text eventGetPhoto__12daNpcPhoto_cFv */ -bool daNpcPhoto_c::eventGetPhoto() { - field_0x9B0--; - return field_0x9B0 == 0; +void daNpcPhoto_c::eventGetPhoto() { + /* Nonmatching */ } /* 0000331C-0000333C .text eventMesSetUbInit__12daNpcPhoto_cFi */ -void daNpcPhoto_c::eventMesSetUbInit(int i_staffId) { - eventMesSetInit(i_staffId); +void daNpcPhoto_c::eventMesSetUbInit(int) { + /* Nonmatching */ } /* 0000333C-00003370 .text eventMesSetUb__12daNpcPhoto_cFv */ -bool daNpcPhoto_c::eventMesSetUb() { - eventLookUb(); - return eventMesSet(); +void daNpcPhoto_c::eventMesSetUb() { + /* Nonmatching */ } /* 00003370-000033E4 .text eventLookUb__12daNpcPhoto_cFv */ -bool daNpcPhoto_c::eventLookUb() { - fopAc_ac_c* pActor = fopAcM_searchFromName("Ub4", 0, 0); - if (pActor != NULL) { - mLookAtPos = pActor->eyePos; - field_0x9D6 = 1; - field_0x994 = false; - } - return true; +void daNpcPhoto_c::eventLookUb() { + /* Nonmatching */ } /* 000033E4-0000357C .text talk2__12daNpcPhoto_cFi */ -u16 daNpcPhoto_c::talk2(int i_param) { - u16 status = 0xFF; - if(mCurrMsgBsPcId == fpcM_ERROR_PROCESS_ID_e) { - - if(i_param == 1) { - mCurrMsgNo = getMsg(); - } - - mCurrMsgBsPcId = fopMsgM_messageSet(mCurrMsgNo, this); - mpCurrMsg = NULL; - field_0x9D5 = 1; - setMsgCamera(); - } else if(mpCurrMsg){ - status = mpCurrMsg->mStatus; - switch(status) { - case fopMsgStts_MSG_DISPLAYED_e: - mpCurrMsg->mStatus = next_msgStatus(&mCurrMsgNo); - - if(mpCurrMsg->mStatus == fopMsgStts_MSG_CONTINUES_e) { - fopMsgM_messageSet(mCurrMsgNo); - } - break; - - case fopMsgStts_MSG_TYPING_e: - if (field_0x9D5 != 0) { - field_0x9D5 = 0; - setMsgCamera(); - } - break; - - case fopMsgStts_BOX_CLOSED_e: - if (field_0x9D4) { - dCamera_c* pCam = dCam_getBody(); - pCam->Start(); - } - - if ((field_0x9C6 & 0x20) != 0) { - field_0x9C6 &= ~0x20; - field_0x9C6 |= 0x40; - } - mpCurrMsg->mStatus = fopMsgStts_MSG_DESTROYED_e; - mCurrMsgBsPcId = fpcM_ERROR_PROCESS_ID_e; - break; - } - if(status != fopMsgStts_MSG_TYPING_e) { - field_0x9D5 = 1; - } - anmAtr(status); - } else { - mpCurrMsg = fopMsgM_SearchByID(mCurrMsgBsPcId); - } - return status; +void daNpcPhoto_c::talk2(int) { + /* Nonmatching */ } -static cXyz l_msg_camera[][2] = { - {cXyz(-1336.0f, -497.0f, 928.0f), cXyz(185.0f, -26.0f, 0.0f)}, - {cXyz(-1213.0f, -902.0f, -244.0f), cXyz(284.0f, 36.0f, 280.0f)}, - {cXyz(-29.0f, 252.0f, -1634.0f), cXyz(5.0f, -91.0f, 178.0f)}, -}; - /* 0000357C-000036DC .text setMsgCamera__12daNpcPhoto_cFv */ void daNpcPhoto_c::setMsgCamera() { - if (field_0x9D0 != NULL) { - dCamera_c* pCam = dCam_getBody(); - if (*(s8*)field_0x9D0 >= 0) { - pCam->Stop(); - cXyz temp = l_msg_camera[*(s8*)field_0x9D0][0]; - cXyz temp2 = l_msg_camera[*(s8*)field_0x9D0][1]; - mDoMtx_stack_c::YrotS(current.angle.y); - mDoMtx_stack_c::multVec(&temp, &temp); - mDoMtx_stack_c::multVec(&temp2, &temp2); - temp += attention_info.position; - temp2 += attention_info.position; - pCam->Set(temp, temp2, 60.0f, 0); - field_0x9D4 = true; - } else { - pCam->Start(); - field_0x9D4 = false; - } - } + /* Nonmatching */ } /* 000036DC-000038E8 .text next_msgStatus__12daNpcPhoto_cFPUl */ -u16 daNpcPhoto_c::next_msgStatus(u32* pMsgNo) { - u16 status = fopMsgStts_MSG_CONTINUES_e; - - switch(*pMsgNo) { - case 0x378A: - case 0x378B: - field_0x9C6 |= 0x20; - status = fopMsgStts_MSG_ENDS_e; - break; - - case 0x2A3A: - case 0x2A3D: - - if(mpCurrMsg->mSelectNum != 0) { - *pMsgNo = 0x2A3B; - field_0x980 = NULL; - field_0x9D0 = NULL; - break; - } - - default: - if(field_0x980 != NULL) { - field_0x980++; - if (field_0x9D0 != NULL) { - field_0x9D0++; - } - switch(*field_0x980) { - - case 7: - case 8: - case 11: - status = fopMsgStts_MSG_ENDS_e; - break; - case 9: - if(mpCurrMsg->mSelectNum == 0) { - if(dComIfGs_getRupee() < dComIfGp_getMessageRupee()){ - *pMsgNo = 0x378B; - } else { - field_0x980++; - if (field_0x9D0 != NULL) { - field_0x9D0++; - } - *pMsgNo = *field_0x980; - dComIfGp_setItemRupeeCount(-dComIfGp_getMessageRupee()); - dComIfGs_onTmpBit(0x301); - } - } else { - field_0x980 = NULL; - *pMsgNo = 0x378A; - } - break; - case 10: - status = fopMsgStts_MSG_ENDS_e; - break; - case 6: - field_0x9C6 |= 1; - field_0x9CC = true; - - case 2: - case 4: - dPb_erasePicture(); - case 1: - case 3: - case 5: { - u8 reg = dComIfGs_getEventReg(l_save_dat.field_0x06); - reg++; - dComIfGs_setEventReg(l_save_dat.field_0x06, reg); - } - case 0: - field_0x980 = NULL; - field_0x9D0 = NULL; - status = fopMsgStts_MSG_ENDS_e; - break; - default: - *pMsgNo = *field_0x980; - break; - } - } else { - status = fopMsgStts_MSG_ENDS_e; - } - } - return status; +void daNpcPhoto_c::next_msgStatus(unsigned long*) { + /* Nonmatching */ } /* 000038E8-00003E68 .text getMsg__12daNpcPhoto_cFv */ -u32 daNpcPhoto_c::getMsg() { - u32 msgNo = 0; - u8 eventReg = dComIfGs_getEventReg(l_save_dat.field_0x06); - field_0x980 = 0; - field_0x9D0 = 0; - - if(g_dComIfG_gameInfo.play.getEvent().chkPhoto()) { - if (eventReg < 1) { - msgNo = 0x2A5C; - } else if (eventReg < 3) { - if (eventReg == 2) { - msgNo = 0x2A57; - } else { - if (isPhotoOk()) { - field_0x980 = l_msg_1st_order_xy; - field_0x9D0 = 0; - } else { - msgNo = 0x2A5D; - } - } - } else if (eventReg < 5) { - if (eventReg == 4) { - msgNo = 0x2A57; - } else { - if (isPhotoOk()) { - field_0x980 = l_msg_2nd_order_xy; - field_0x9D0 = 0; - } else { - msgNo = 0x2A5D; - } - } - } else if (eventReg < 6) { - if (isPhotoOk()) { - field_0x980 = l_msg_3rd_order_xy; - field_0x9D0 = 0; - } else { - msgNo = 0x2A5D; - } - } else { - msgNo = 0x2A63; - } - } else if(dComIfGp_event_chkTalkXY()) { - u32 itemNo = dComIfGp_event_getPreItemNo(); - - if(itemNo == CAMERA2 && dComIfGs_isTmpBit(0x302)) { - if (dComIfGs_getPictureNum() < 3) { - field_0x980 = l_msg_xy_buy_photo; - mItemNo = SALVAGE_ITEM1; - } else { - msgNo = 0x3787; - } - } else if(itemNo == dItem_FIREFLY_BOTTLE_e) { - if(eventReg >= 6 && !dComIfGs_checkGetItem(CAMERA2)) { - field_0x980 = l_msg_color_xy; - field_0x9D0 = 0; - dComIfGs_setEquipBottleItemEmpty(); - mItemNo = CAMERA2; - } else{ - msgNo = 0x2A57; - } - } else { - msgNo = 0x2A56; - } - } else if (field_0x9C1 == 3) { - field_0x980 = l_msg_down; - field_0x9D0 = 0; - } else if (field_0x9C1 == 4) { - field_0x980 = l_msg_ub4; - field_0x9D0 = 0; - } else if (dComIfGs_isEventBit(l_save_dat.field_0x04)) { - if(field_0x9C1 == 1) { - msgNo = mMsgNno; - } else { - if(dComIfGs_checkGetItem(CAMERA2)) { - if(dComIfGs_isTmpBit(0x301)) { - field_0x980 = (u32*)l_msg_buy_photo; - field_0x9D0 = 0; - } else { - if(dComIfGs_isTmpBit(0x302)) { - field_0x980 = l_msg_get_photo; - field_0x9D0 = 0; - - } else { - if(isPhotoDxOk()) { - dComIfGs_onTmpBit(0x302); - if(dComIfGs_isEventBit(0x3808) == 0) { - dComIfGs_onEventBit(0x3808); - field_0x980 = (u32*)l_msg_week_1st; - field_0x9D0 = 0; - } else { - field_0x980 = l_msg_week[dKy_get_dayofweek()]; - field_0x9D0 = 0; - } - } else { - field_0x980 = l_msg_color; - field_0x9D0 = (u8*)l_msg_color_c; - } - } - - } - } else { - eventReg = dComIfGs_getEventReg(l_save_dat.field_0x06); - if (eventReg < 1) { - field_0x980 = l_msg_1st_order; - field_0x9D0 = (u8*)l_msg_1st_order_c; - } else if (eventReg < 2) { - field_0x980 = l_msg_1st_order_not_end; - field_0x9D0 = (u8*)l_msg_1st_order_not_end_c; - } else if (eventReg < 3) { - field_0x980 = l_msg_2nd_order; - field_0x9D0 = (u8*)l_msg_2nd_order_c; - } else if (eventReg < 4) { - field_0x980 = l_msg_2nd_order_not_end; - field_0x9D0 = (u8*)l_msg_2nd_order_not_end_c; - } else if (eventReg < 5) { - field_0x980 = l_msg_3rd_order; - field_0x9D0 = (u8*)l_msg_3rd_order_c; - } else if (eventReg < 6) { - field_0x980 = l_msg_3rd_order_not_end; - field_0x9D0 = (u8*)l_msg_3rd_order_not_end_c; - } else if (field_0x9CC == 1) { - field_0x980 = l_msg_3rd_order_end; - field_0x9D0 = 0; - } else { - field_0x980 = l_msg_not_color; - field_0x9D0 = (u8*)l_msg_not_color_c; - } - } - } - } else if(dComIfGs_checkGetItem(CAMERA) || dComIfGs_checkGetItem(CAMERA2)) { - if(!dComIfGs_isEventBit(l_save_dat.field_0x02)) { - field_0x980 = l_msg_1st_photo; - field_0x9D0 = 0; - dComIfGs_onEventBit(l_save_dat.field_0x02); - initTexPatternAnm(true, 1); - } else { - field_0x980 = l_msg_2nd_photo; - field_0x9D0 = 0; - } - } else { - if(dComIfGs_isEventBit(l_save_dat.field_0x00) == 0) { - field_0x980 = l_msg_1st_talk; - field_0x9D0 = 0; - dComIfGs_onEventBit(l_save_dat.field_0x00); - field_0x9C6 |= 4; - } else { - field_0x980 = l_msg_2nd_talk; - field_0x9D0 = 0; - field_0x9C6 |= 4; - } - } - if (field_0x980 != NULL) { - msgNo = *field_0x980; - } - return msgNo; +void daNpcPhoto_c::getMsg() { + /* Nonmatching */ } /* 00003E68-00003E78 .text setMessage__12daNpcPhoto_cFUl */ -void daNpcPhoto_c::setMessage(u32 msg) { - mCurrMsgBsPcId = fpcM_ERROR_PROCESS_ID_e; - mCurrMsgNo = msg; +void daNpcPhoto_c::setMessage(unsigned long) { + /* Nonmatching */ } /* 00003E78-00003FD8 .text setAnmFromMsgTag__12daNpcPhoto_cFv */ void daNpcPhoto_c::setAnmFromMsgTag() { - switch(dComIfGp_getMesgAnimeAttrInfo()){ - case 0: - setAnmTbl(l_npc_anm_wait); - field_0x9C9 &= 0x7f; - break; - case 1: - setAnmTbl(l_npc_anm_talk); - field_0x9C9 &= 0x7f; - - break; - case 2: - setAnmTbl(l_npc_anm_talk2); - field_0x9C9 &= 0x7f; - break; - case 3: - setAnmTbl(l_npc_anm_wait); - initTexPatternAnm(true, 0); - field_0x9C9 &= 0x7f; - break; - case 4: - setAnmTbl(l_npc_anm_talk2); - field_0x9C9 &= 0x7f; - break; - case 5: - setAnmTbl(l_npc_anm_wait); - initTexPatternAnm(true, 1); - field_0x9C9 |= 0x80; - mFrame = 1; - break; - case 6: - setAnmTbl(l_npc_anm_talk); - initTexPatternAnm(true, 0); - field_0x9C9 &= 0x7f; - break; - case 9: - setAnmTbl(l_npc_anm_spit); - field_0x9C9 &= 0x7f; - } - dComIfGp_setMesgAnimeAttrInfo(0xFF); + /* Nonmatching */ } /* 00003FD8-00004004 .text getPrmRailID__12daNpcPhoto_cFv */ -u8 daNpcPhoto_c::getPrmRailID() { - return daObj::PrmAbstract(this, PRM_RAIL_ID_W, PRM_RAIL_ID_S); +void daNpcPhoto_c::getPrmRailID() { + /* Nonmatching */ } /* 00004004-00004030 .text getPrmArg0__12daNpcPhoto_cFv */ -u8 daNpcPhoto_c::getPrmArg0() { - return daObj::PrmAbstract(this, PRM_ARG0_W, PRM_ARG0_S); +void daNpcPhoto_c::getPrmArg0() { + /* Nonmatching */ } /* 00004030-000040B8 .text setMtx__12daNpcPhoto_cFv */ void daNpcPhoto_c::setMtx() { - mpMorf->getModel()->setBaseScale(scale); - mDoMtx_stack_c::transS(current.pos); - mDoMtx_stack_c::YrotM(current.angle.y); - mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get()); + /* Nonmatching */ } /* 000040B8-0000432C .text chkAttention__12daNpcPhoto_cFv */ void daNpcPhoto_c::chkAttention() { - - if(mEventCut.getAttnFlag()) { - mLookAtPos = mEventCut.getAttnPos(); - field_0x9D6 = 1; - if (field_0x9D7) { - field_0x994 = false; - m_jnt.setTrn(); - } else { - field_0x994 = true; - } - if (!field_0x9BD) { - field_0x9BD = true; - } - - } else { - fopAc_ac_c* link = dComIfGp_getLinkPlayer(); - f32 temp = l_npc_dat.field_0x2C; - s16 angle; - f32 temp3; - int temp2 = field_0x9B2; - dNpc_calc_DisXZ_AngY(current.pos, link->current.pos, &temp3, &angle); - if (field_0x9BD != NULL) { - temp += 40.0f; - temp2 += 1820; - } - - angle -= shape_angle.y; - - if((temp > temp3 && temp2 > abs(angle)) || field_0x9CD != NULL) { - mLookAtPos = dNpc_playerEyePos(l_npc_dat.field_0x00); - field_0x9D6 = 1; - if (field_0x9D7) { - field_0x994 = false; - } else { - field_0x994 = true; - } - if (!field_0x9D8) { - field_0x9BA = field_0x9AE; - field_0x994 = false; - field_0x9D6 = 2; - m_jnt.setTrn(); - } - if (!field_0x9BD) { - field_0x9BD = true; - } - } else { - if (field_0x9BD == true) { - field_0x9BD = false; - field_0x9AC = 30; - } - field_0x9D6 = 0; - if ((field_0x9C0 == 0) && (field_0x9C1 != 3)) { - if (field_0x9AC != 0) { - field_0x9AC--; - } else { - field_0x9BA = field_0x9AE; - field_0x994 = false; - field_0x9D6 = 2; - m_jnt.setTrn(); - } - } - } - } - field_0x9B6 = l_npc_dat.field_0x16; + /* Nonmatching */ } /* 0000432C-00004478 .text lookBack__12daNpcPhoto_cFv */ void daNpcPhoto_c::lookBack() { - short target = field_0x9B6; - short desiredYRot = current.angle.y; - cXyz* dstTemp = NULL; - cXyz temp2; - cXyz dstPos = eyePos; - bool temp3 = field_0x994; - - switch(field_0x9D6) { - case 1: - temp2 = mLookAtPos; - dstTemp = &temp2; - break; - case 2: - desiredYRot = field_0x9BA; - break; - case 0: - default: - break; - } - - if (field_0x9BC && field_0x9D7) { - temp3 = false; - m_jnt.setTrn(); - } - - if (m_jnt.trnChk()) { - if(mEventCut.getTurnSpeed() != 0) { - target = mEventCut.getTurnSpeed(); - } - cLib_addCalcAngleS2(&field_0x9B8, target, 4, 0x800); - } else { - field_0x9B8 = 0; - } - - m_jnt.lookAtTarget(¤t.angle.y, dstTemp, dstPos, desiredYRot, field_0x9B8, temp3); - shape_angle = current.angle; + /* Nonmatching */ } /* 00004478-000045C0 .text initTexPatternAnm__12daNpcPhoto_cFbi */ -BOOL daNpcPhoto_c::initTexPatternAnm(bool i_modify, int i_param2) { - J3DModelData *modelData = mpMorf->getModel()->getModelData(); - if(i_param2 == -1) { - if(dComIfGs_isEventBit(l_save_dat.field_0x02)) { - i_param2 = 1; - } else { - i_param2 = 0; - } - } - m_head_tex_pattern = (J3DAnmTexPattern*)dComIfG_getObjectIDRes(l_arcname_tbl[0], l_btp_ix_tbl[i_param2]); - JUT_ASSERT(0xBAA, m_head_tex_pattern != NULL); - - if(!mBtpAnm.init(modelData, m_head_tex_pattern, TRUE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, i_modify, 0)) { - return FALSE; - } - mFrame = 0; - mTimer = 0; - return TRUE; +void daNpcPhoto_c::initTexPatternAnm(bool, int) { + /* Nonmatching */ } /* 000045C0-00004638 .text playTexPatternAnm__12daNpcPhoto_cFv */ void daNpcPhoto_c::playTexPatternAnm() { - if (((field_0x9C9 & 0x80) == 0) && cLib_calcTimer(&mTimer)== 0) { - if (mFrame >= m_head_tex_pattern->getFrameMax()) { - mFrame -= m_head_tex_pattern->getFrameMax(); - mTimer = 0x78; - } else { - mFrame++; - } - } + /* Nonmatching */ } /* 00004638-0000474C .text playAnm__12daNpcPhoto_cFv */ void daNpcPhoto_c::playAnm() { - field_0x9C9 &= 0xFE; - u32 mtrlSndId; - s8 roomNo = fopAcM_GetRoomNo(this); - - if (mObjAcch.ChkGroundHit()) { - mtrlSndId = dComIfG_Bgsp()->GetMtrlSndId(mObjAcch.m_gnd); - } - else { - mtrlSndId = 0; - } - - if(mpMorf->play(&eyePos, mtrlSndId, dComIfGp_getReverb(roomNo))){ - field_0x9C9 &= ~0x4; - if (mpAnmDat != 0) { - if (field_0x9CA > 0) { - field_0x9CA--; - if (field_0x9CA == 0) { - mpAnmDat++; - if (setAnmTbl(mpAnmDat) != 0) { - field_0x9C9 |= 1; - } - } else { - setAnm(mpAnmDat->field_0x00, 0, 0.0f); - } - } - } - } + /* Nonmatching */ } /* 0000474C-0000481C .text setAnm__12daNpcPhoto_cFUcif */ -void daNpcPhoto_c::setAnm(u8 param_1, int param_2, f32 param_3) { - if(field_0x98C >= 0.0f) { - param_3 = field_0x98C; - field_0x98C = -1.0f; - } - - J3DAnmTransform* pAnmRes = static_cast(dComIfG_getObjectIDRes(l_arcname_tbl[0], l_bck_ix_tbl[param_1])); - mpMorf->setAnm(pAnmRes, param_2, param_3, 1.0f, 0.0f, -1.0f, NULL); - field_0x9C8 = param_1; +void daNpcPhoto_c::setAnm(unsigned char, int, float) { + /* Nonmatching */ } /* 0000481C-000048D0 .text setAnmTbl__12daNpcPhoto_cFP12sPhotoAnmDat */ -bool daNpcPhoto_c::setAnmTbl(sPhotoAnmDat* i_anmDat) { - if((field_0x9C9 & 4) != 0){ - return false; - } - if(i_anmDat->field_0x00 == 0xFF) { - mpAnmDat = 0; - return true; - } - mpAnmDat = i_anmDat; - field_0x9CA = mpAnmDat->field_0x02; - - int temp = 2; - if(field_0x9CA > 0) { - temp = 0; - } - if(field_0x9C8 != mpAnmDat->field_0x00 || temp == 0) { - setAnm(mpAnmDat->field_0x00, temp, mpAnmDat->field_0x01); - } - - return false; +void daNpcPhoto_c::setAnmTbl(sPhotoAnmDat*) { + /* Nonmatching */ } /* 000048D0-00004950 .text XyCheckCB__12daNpcPhoto_cFi */ -s16 daNpcPhoto_c::XyCheckCB(int i_itemBtn) { - if(dComIfGs_isTmpBit(0x302) && !dComIfGs_isTmpBit(0x301)){ - attention_info.flags = fopAc_Attn_LOCKON_TALK_e | fopAc_Attn_ACTION_SPEAK_e; - } else { - attention_info.flags = fopAc_Attn_UNK1000000_e | fopAc_Attn_LOCKON_TALK_e | fopAc_Attn_ACTION_SPEAK_e; - } - return 1; +void daNpcPhoto_c::XyCheckCB(int) { + /* Nonmatching */ } /* 00004950-00004A5C .text XyEventCB__12daNpcPhoto_cFi */ -s16 daNpcPhoto_c::XyEventCB(int i_itemBtn) { - s16 eventIdx; - u8 itemNo = dComIfGp_getSelectItem(i_itemBtn); - if(itemNo == CAMERA2 && dComIfGs_isTmpBit(0x302)){ - if(dComIfGs_getPictureNum() < 3){ - eventIdx = mPhotoGetPhotoEventIdx; - field_0x9C7 = false; - } else { - return dComIfGp_evmng_getEventIdx("DEFAULT_TALK_XY",0xff); - } - } else { - if(itemNo == dItem_FIREFLY_BOTTLE_e && dComIfGs_getEventReg(l_save_dat.field_0x06) >= 6 && !dComIfGs_checkGetItem(CAMERA2)){ - eventIdx = mPhotoGetItem2EventIdx; - field_0x9C7 = false; - } else { - eventIdx = dComIfGp_evmng_getEventIdx("DEFAULT_TALK_XY",0xff); - } - } - return eventIdx; +void daNpcPhoto_c::XyEventCB(int) { + /* Nonmatching */ } /* 00004A5C-00004B08 .text isPhotoOk__12daNpcPhoto_cFv */ -BOOL daNpcPhoto_c::isPhotoOk() { - u8 reg = dComIfGs_getEventReg(l_save_dat.field_0x06); - - reg = reg & 0xff; - if (reg == 1) { - if (dComIfGp_getPictureResult() == 1) { - return TRUE; - } - } else if (reg == 3) { - if (dComIfGp_getPictureResult() == 2) { - return TRUE; - } - } else if ((reg == 5) && (dComIfGp_getPictureResult() == 3)) { - return TRUE; - } - return FALSE; +void daNpcPhoto_c::isPhotoOk() { + /* Nonmatching */ } /* 00004B08-00004CCC .text isPhotoDxOk__12daNpcPhoto_cFv */ -BOOL daNpcPhoto_c::isPhotoDxOk() { - switch(dKy_get_dayofweek()){ - case 0: - if(dComIfGs_isEventBit(0x2D02)) { - return TRUE; - } - break; - case 1: - if(dComIfGs_isEventBit(0x3910)) { - return TRUE; - } - break; - case 2: - if (dComIfGs_isEventBit(0x3002) || - dComIfGs_isEventBit(0x3001) || - dComIfGs_isEventBit(0x3008) || - dComIfGs_isEventBit(0x3004) || - dComIfGs_isEventBit(0x3020) || - dComIfGs_isEventBit(0x3010) || - dComIfGs_isEventBit(0x3180)) { - return TRUE; - } - break; - case 3: - if(dComIfGs_isEventBit(0x3920)) { - return TRUE; - } - break; - case 4: - if(dComIfGs_isEventBit(0x1001)) { - return TRUE; - } - break; - case 5: - if(dComIfGs_isEventBit(0x2D20)) { - return TRUE; - } - break; - case 6: - if(dComIfGs_isEventBit(0x2D40)) { - return TRUE; - } - break; - } - return FALSE; +void daNpcPhoto_c::isPhotoDxOk() { + /* Nonmatching */ } /* 00004CCC-00004D44 .text setCollision__12daNpcPhoto_cFP8dCcD_Cyl4cXyzff */ -void daNpcPhoto_c::setCollision(dCcD_Cyl* cyl, cXyz center, f32 radius, f32 height) { - cyl->SetC(center); - cyl->SetR(radius); - cyl->SetH(height); - dComIfG_Ccsp()->Set(cyl); +void daNpcPhoto_c::setCollision(dCcD_Cyl*, cXyz, float, float) { + /* Nonmatching */ } /* 00004D44-00004D64 .text daNpc_PhotoCreate__FPv */ -static s32 daNpc_PhotoCreate(void* i_this) { - return static_cast(i_this)->_create(); +static s32 daNpc_PhotoCreate(void*) { + /* Nonmatching */ } /* 00004D64-00004D88 .text daNpc_PhotoDelete__FPv */ -static BOOL daNpc_PhotoDelete(void* i_this) { - return static_cast(i_this)->_delete(); +static BOOL daNpc_PhotoDelete(void*) { + /* Nonmatching */ } /* 00004D88-00004DAC .text daNpc_PhotoExecute__FPv */ -static BOOL daNpc_PhotoExecute(void* i_this) { - return static_cast(i_this)->_execute(); +static BOOL daNpc_PhotoExecute(void*) { + /* Nonmatching */ } /* 00004DAC-00004DD0 .text daNpc_PhotoDraw__FPv */ -static BOOL daNpc_PhotoDraw(void* i_this) { - return static_cast(i_this)->_draw(); +static BOOL daNpc_PhotoDraw(void*) { + /* Nonmatching */ } /* 00004DD0-00004DD8 .text daNpc_PhotoIsDelete__FPv */ static BOOL daNpc_PhotoIsDelete(void*) { - return TRUE; + /* Nonmatching */ } static actor_method_class daNpc_PhotoMethodTable = { diff --git a/src/d/actor/d_a_obj_figure.cpp b/src/d/actor/d_a_obj_figure.cpp index 58cd244f7..99a95cf2a 100644 --- a/src/d/actor/d_a_obj_figure.cpp +++ b/src/d/actor/d_a_obj_figure.cpp @@ -90,158 +90,680 @@ static dCcD_SrcCyl l_cyl_src = { struct FigureData { /* 0x00 */ int mBmdId; /* 0x04 */ int mModelAttr; -#if VERSION > VERSION_DEMO /* 0x08 */ int mRoomId; -#endif }; // Size: 0x0C -#if VERSION == VERSION_DEMO -#define FIGUREDAT(bmdIdx, dlistFlags, roomId) \ - { \ - bmdIdx, dlistFlags \ - } -#else -#define FIGUREDAT(bmdIdx, dlistFlags, roomId) \ - { \ - bmdIdx, dlistFlags, roomId \ - } -#endif - static const FigureData l_figure_dat_tbl[TOTAL_FIGURE_COUNT] = { - FIGUREDAT(0x00, 0x37441422, -1), - FIGUREDAT(0x01, 0x37441422, -1), - FIGUREDAT(0x02, 0x37441422, -1), - FIGUREDAT(0x03, 0x37441422, -1), - FIGUREDAT(0x0A, 0x37441422, -1), - FIGUREDAT(0x04, 0x37441422, -1), - FIGUREDAT(0x05, 0x37441422, -1), - FIGUREDAT(0x06, 0x37441422, -1), - FIGUREDAT(0x07, 0x37441422, -1), - FIGUREDAT(0x08, 0x37441422, -1), - FIGUREDAT(0x09, 0x11001222, -1), - FIGUREDAT(0x0B, 0x37441422, -1), - FIGUREDAT(0x0C, 0x37441422, -1), - FIGUREDAT(0x0D, 0x37441422, -1), - FIGUREDAT(0x00, 0x37441422, -1), - FIGUREDAT(0x01, 0x37441422, -1), - FIGUREDAT(0x02, 0x37441422, -1), - FIGUREDAT(0x04, 0x37441422, -1), - FIGUREDAT(0x05, 0x37441422, -1), - FIGUREDAT(0x07, 0x37441422, -1), - FIGUREDAT(0x08, 0x37441422, -1), - FIGUREDAT(0x09, 0x37441422, -1), - FIGUREDAT(0x0A, 0x37441422, -1), - FIGUREDAT(0x0B, 0x37441422, -1), - FIGUREDAT(0x0C, 0x37441422, -1), - FIGUREDAT(0x0D, 0x37441422, -1), - FIGUREDAT(0x0E, 0x37441422, -1), - FIGUREDAT(0x0F, 0x37441422, -1), - FIGUREDAT(0x10, 0x37441422, -1), - FIGUREDAT(0x11, 0x37441422, -1), - FIGUREDAT(0x12, 0x37441422, -1), - FIGUREDAT(0x13, 0x37441422, -1), - FIGUREDAT(0x14, 0x37441422, -1), - FIGUREDAT(0x15, 0x37441422, -1), - FIGUREDAT(0x16, 0x37441422, -1), - FIGUREDAT(0x17, 0x37441422, -1), - FIGUREDAT(0x18, 0x37441422, -1), - FIGUREDAT(0x19, 0x37441422, -1), - FIGUREDAT(0x1A, 0x37441422, -1), - FIGUREDAT(0x1B, 0x37441422, -1), - FIGUREDAT(0x1C, 0x37441422, -1), - FIGUREDAT(0x00, 0x37441422, 8), - FIGUREDAT(0x01, 0x37441422, 8), - FIGUREDAT(0x02, 0x37441422, 8), - FIGUREDAT(0x03, 0x37441422, 8), - FIGUREDAT(0x04, 0x37441422, 8), - FIGUREDAT(0x05, 0x37441422, 8), - FIGUREDAT(0x06, 0x37441422, 8), - FIGUREDAT(0x07, 0x37441422, 8), - FIGUREDAT(0x08, 0x37441422, 8), - FIGUREDAT(0x09, 0x37441422, 8), - FIGUREDAT(0x0A, 0x37441422, 8), - FIGUREDAT(0x0B, 0x37441422, 8), - FIGUREDAT(0x0C, 0x37441422, 8), - FIGUREDAT(0x0D, 0x37441422, 8), - FIGUREDAT(0x0E, 0x37441422, 8), - FIGUREDAT(0x0F, 0x37441422, 8), - FIGUREDAT(0x10, 0x37441422, 8), - FIGUREDAT(0x11, 0x37441422, 8), - FIGUREDAT(0x12, 0x37441422, 8), - FIGUREDAT(0x13, 0x37441422, 8), - FIGUREDAT(0x06, 0x37441422, 9), - FIGUREDAT(0x01, 0x37441422, 9), - FIGUREDAT(0x02, 0x37441422, 9), - FIGUREDAT(0x05, 0x37441422, 9), - FIGUREDAT(0x00, 0x11001222, -1), - FIGUREDAT(0x01, 0x37441422, -1), - FIGUREDAT(0x02, 0x37441422, -1), - FIGUREDAT(0x03, 0x37441422, -1), - FIGUREDAT(0x04, 0x37441422, -1), - FIGUREDAT(0x05, 0x37441422, -1), - FIGUREDAT(0x06, 0x37441422, -1), - FIGUREDAT(0x07, 0x37441422, -1), - FIGUREDAT(0x08, 0x37441422, -1), - FIGUREDAT(0x09, 0x37441422, -1), - FIGUREDAT(0x0A, 0x37441422, -1), - FIGUREDAT(0x0B, 0x37441422, -1), - FIGUREDAT(0x0C, 0x37441422, -1), - FIGUREDAT(0x0D, 0x37441422, -1), - FIGUREDAT(0x0E, 0x37441422, -1), - FIGUREDAT(0x0F, 0x37441422, -1), - FIGUREDAT(0x10, 0x37441422, -1), - FIGUREDAT(0x11, 0x11001222, -1), - FIGUREDAT(0x00, 0x37441422, -1), - FIGUREDAT(0x05, 0x37441422, -1), - FIGUREDAT(0x06, 0x37441422, -1), - FIGUREDAT(0x07, 0x37441422, -1), - FIGUREDAT(0x08, 0x37441422, -1), - FIGUREDAT(0x09, 0x37441422, -1), - FIGUREDAT(0x0A, 0x37441422, -1), - FIGUREDAT(0x0B, 0x37441422, -1), - FIGUREDAT(0x0C, 0x37441422, -1), - FIGUREDAT(0x0D, 0x37441422, -1), - FIGUREDAT(0x01, 0x37441422, -1), - FIGUREDAT(0x02, 0x37441422, -1), - FIGUREDAT(0x03, 0x37441422, -1), - FIGUREDAT(0x04, 0x37441422, -1), - FIGUREDAT(0x00, 0x37441422, -1), - FIGUREDAT(0x01, 0x37441422, -1), - FIGUREDAT(0x02, 0x37441422, -1), - FIGUREDAT(0x03, 0x37441422, -1), - FIGUREDAT(0x04, 0x37441422, -1), - FIGUREDAT(0x05, 0x37441422, -1), - FIGUREDAT(0x06, 0x37441422, -1), - FIGUREDAT(0x07, 0x37441422, -1), - FIGUREDAT(0x08, 0x37441422, -1), - FIGUREDAT(0x09, 0x37441422, -1), - FIGUREDAT(0x12, 0x37441422, -1), - FIGUREDAT(0x0A, 0x11001222, -1), - FIGUREDAT(0x0B, 0x11001222, -1), - FIGUREDAT(0x0C, 0x11001222, -1), - FIGUREDAT(0x0D, 0x37441422, -1), - FIGUREDAT(0x0E, 0x37441422, -1), - FIGUREDAT(0x0F, 0x37441422, -1), - FIGUREDAT(0x10, 0x37441422, -1), - FIGUREDAT(0x11, 0x37441422, -1), - FIGUREDAT(0x00, 0x37441422, 0xA), - FIGUREDAT(0x01, 0x37441422, 0xA), - FIGUREDAT(0x02, 0x11001222, 0xA), - FIGUREDAT(0x03, 0x11001222, 0xA), - FIGUREDAT(0x04, 0x11001222, 0xA), - FIGUREDAT(0x05, 0x37441422, 0xA), - FIGUREDAT(0x06, 0x37441422, 0xA), - FIGUREDAT(0x07, 0x37441422, 0xA), - FIGUREDAT(0x00, 0x37441422, 0xB), - FIGUREDAT(0x01, 0x11001222, 0xB), - FIGUREDAT(0x02, 0x11001222, 0xB), - FIGUREDAT(0x03, 0x37441422, 0xB), - FIGUREDAT(0x04, 0x37441422, 0xB), - FIGUREDAT(0x00, 0x11001222, 0xC), - FIGUREDAT(0x01, 0x37441422, 0xC), - FIGUREDAT(0x02, 0x11001222, 0xC), - FIGUREDAT(0x03, 0x11001222, 0xC), - FIGUREDAT(0x04, 0x37441422, 0xC), + { + 0, + 0x37441422, + -1 + }, + { + 1, + 0x37441422, + -1 + }, + { + 2, + 0x37441422, + -1 + }, + { + 3, + 0x37441422, + -1 + }, + { + 0xA, + 0x37441422, + -1 + }, + { + 4, + 0x37441422, + -1 + }, + { + 5, + 0x37441422, + -1 + }, + { + 6, + 0x37441422, + -1 + }, + { + 7, + 0x37441422, + -1 + }, + { + 8, + 0x37441422, + -1 + }, + { + 9, + 0x11001222, + -1 + }, + { + 0xB, + 0x37441422, + -1 + }, + { + 0xC, + 0x37441422, + -1 + }, + { + 0xD, + 0x37441422, + -1 + }, + { + 0, + 0x37441422, + -1 + }, + { + 1, + 0x37441422, + -1 + }, + { + 2, + 0x37441422, + -1 + }, + { + 4, + 0x37441422, + -1 + }, + { + 5, + 0x37441422, + -1 + }, + { + 7, + 0x37441422, + -1 + }, + { + 8, + 0x37441422, + -1 + }, + { + 9, + 0x37441422, + -1 + }, + { + 0xA, + 0x37441422, + -1 + }, + { + 0xB, + 0x37441422, + -1 + }, + { + 0xC, + 0x37441422, + -1 + }, + { + 0xD, + 0x37441422, + -1 + }, + { + 0xE, + 0x37441422, + -1 + }, + { + 0xF, + 0x37441422, + -1 + }, + { + 0x10, + 0x37441422, + -1 + }, + { + 0x11, + 0x37441422, + -1 + }, + { + 0x12, + 0x37441422, + -1 + }, + { + 0x13, + 0x37441422, + -1 + }, + { + 0x14, + 0x37441422, + -1 + }, + { + 0x15, + 0x37441422, + -1 + }, + { + 0x16, + 0x37441422, + -1 + }, + { + 0x17, + 0x37441422, + -1 + }, + { + 0x18, + 0x37441422, + -1 + }, + { + 0x19, + 0x37441422, + -1 + }, + { + 0x1A, + 0x37441422, + -1 + }, + { + 0x1B, + 0x37441422, + -1 + }, + { + 0x1C, + 0x37441422, + -1 + }, + { + 0, + 0x37441422, + 8 + }, + { + 1, + 0x37441422, + 8 + }, + { + 2, + 0x37441422, + 8 + }, + { + 3, + 0x37441422, + 8 + }, + { + 4, + 0x37441422, + 8 + }, + { + 5, + 0x37441422, + 8 + }, + { + 6, + 0x37441422, + 8 + }, + { + 7, + 0x37441422, + 8 + }, + { + 8, + 0x37441422, + 8 + }, + { + 9, + 0x37441422, + 8 + }, + { + 0xA, + 0x37441422, + 8 + }, + { + 0xB, + 0x37441422, + 8 + }, + { + 0xC, + 0x37441422, + 8 + }, + { + 0xD, + 0x37441422, + 8 + }, + { + 0xE, + 0x37441422, + 8 + }, + { + 0xF, + 0x37441422, + 8 + }, + { + 0x10, + 0x37441422, + 8 + }, + { + 0x11, + 0x37441422, + 8 + }, + { + 0x12, + 0x37441422, + 8 + }, + { + 0x13, + 0x37441422, + 8 + }, + { + 6, + 0x37441422, + 9 + }, + { + 1, + 0x37441422, + 9 + }, + { + 2, + 0x37441422, + 9 + }, + { + 5, + 0x37441422, + 9 + }, + { + 0, + 0x11001222, + -1 + }, + { + 1, + 0x37441422, + -1 + }, + { + 2, + 0x37441422, + -1 + }, + { + 3, + 0x37441422, + -1 + }, + { + 4, + 0x37441422, + -1 + }, + { + 5, + 0x37441422, + -1 + }, + { + 6, + 0x37441422, + -1 + }, + { + 7, + 0x37441422, + -1 + }, + { + 8, + 0x37441422, + -1 + }, + { + 9, + 0x37441422, + -1 + }, + { + 0xA, + 0x37441422, + -1 + }, + { + 0xB, + 0x37441422, + -1 + }, + { + 0xC, + 0x37441422, + -1 + }, + { + 0xD, + 0x37441422, + -1 + }, + { + 0xE, + 0x37441422, + -1 + }, + { + 0xF, + 0x37441422, + -1 + }, + { + 0x10, + 0x37441422, + -1 + }, + { + 0x11, + 0x11001222, + -1 + }, + { + 0, + 0x37441422, + -1 + }, + { + 5, + 0x37441422, + -1 + }, + { + 6, + 0x37441422, + -1 + }, + { + 7, + 0x37441422, + -1 + }, + { + 8, + 0x37441422, + -1 + }, + { + 9, + 0x37441422, + -1 + }, + { + 0xA, + 0x37441422, + -1 + }, + { + 0xB, + 0x37441422, + -1 + }, + { + 0xC, + 0x37441422, + -1 + }, + { + 0xD, + 0x37441422, + -1 + }, + { + 1, + 0x37441422, + -1 + }, + { + 2, + 0x37441422, + -1 + }, + { + 3, + 0x37441422, + -1 + }, + { + 4, + 0x37441422, + -1 + }, + { + 0, + 0x37441422, + -1 + }, + { + 1, + 0x37441422, + -1 + }, + { + 2, + 0x37441422, + -1 + }, + { + 3, + 0x37441422, + -1 + }, + { + 4, + 0x37441422, + -1 + }, + { + 5, + 0x37441422, + -1 + }, + { + 6, + 0x37441422, + -1 + }, + { + 7, + 0x37441422, + -1 + }, + { + 8, + 0x37441422, + -1 + }, + { + 9, + 0x37441422, + -1 + }, + { + 0x12, + 0x37441422, + -1 + }, + { + 0xA, + 0x11001222, + -1 + }, + { + 0xB, + 0x11001222, + -1 + }, + { + 0xC, + 0x11001222, + -1 + }, + { + 0xD, + 0x37441422, + -1 + }, + { + 0xE, + 0x37441422, + -1 + }, + { + 0xF, + 0x37441422, + -1 + }, + { + 0x10, + 0x37441422, + -1 + }, + { + 0x11, + 0x37441422, + -1 + }, + { + 0, + 0x37441422, + 0xA + }, + { + 1, + 0x37441422, + 0xA + }, + { + 2, + 0x11001222, + 0xA + }, + { + 3, + 0x11001222, + 0xA + }, + { + 4, + 0x11001222, + 0xA + }, + { + 5, + 0x37441422, + 0xA + }, + { + 6, + 0x37441422, + 0xA + }, + { + 7, + 0x37441422, + 0xA + }, + { + 0, + 0x37441422, + 0xB + }, + { + 1, + 0x11001222, + 0xB + }, + { + 2, + 0x11001222, + 0xB + }, + { + 3, + 0x37441422, + 0xB + }, + { + 4, + 0x37441422, + 0xB + }, + { + 0, + 0x11001222, + 0xC + }, + { + 1, + 0x37441422, + 0xC + }, + { + 2, + 0x11001222, + 0xC + }, + { + 3, + 0x11001222, + 0xC + }, + { + 4, + 0x37441422, + 0xC + }, }; struct FigureCheckTbl { @@ -379,11 +901,9 @@ static cPhs_State phase_2(daObjFigure_c* i_this) { i_this->setResFlag(0x2); u8 figureNo = i_this->getFigureNo(); int id = dSnap_GetFigRoomId(figureNo); -#if VERSION > VERSION_DEMO if(l_figure_dat_tbl[figureNo].mRoomId >= 0) { id = l_figure_dat_tbl[figureNo].mRoomId; } -#endif cPhs_State status = dComIfG_resLoad(i_this->getPhase2P(), l_arcname_tbl[id]); @@ -413,11 +933,9 @@ cPhs_State daObjFigure_c::_create() { /* 00000720-00000A90 .text createHeap__13daObjFigure_cFv */ BOOL daObjFigure_c::createHeap() { int id = dSnap_GetFigRoomId(getFigureNo()); -#if VERSION > VERSION_DEMO if(l_figure_dat_tbl[getFigureNo()].mRoomId >= 0) { id = l_figure_dat_tbl[getFigureNo()].mRoomId; } -#endif J3DModelData* pModelData; const char* arcname = l_arcname_tbl[id]; @@ -522,16 +1040,14 @@ cPhs_State daObjFigure_c::createInit() { /* 00000BF4-00000C78 .text _delete__13daObjFigure_cFv */ BOOL daObjFigure_c::_delete() { - dComIfG_resDeleteDemo(getPhase1P(), "Figure"); + dComIfG_resDelete(getPhase1P(), "Figure"); int id = dSnap_GetFigRoomId(getFigureNo()); -#if VERSION > VERSION_DEMO if(l_figure_dat_tbl[getFigureNo()].mRoomId >= 0) { id = l_figure_dat_tbl[getFigureNo()].mRoomId; } -#endif - dComIfG_resDeleteDemo(getPhase2P(), l_arcname_tbl[id]); + dComIfG_resDelete(getPhase2P(), l_arcname_tbl[id]); return true; } @@ -981,13 +1497,11 @@ void linkDraw(mDoExt_McaMorf* pMorf) { /* Nonmatching - regalloc (maybe the same issue as daPy_lk_c::draw?) */ pMorf->calc(); -#if VERSION > VERSION_DEMO J3DModel* model = pMorf->getModel(); J3DModelData* modelData = model->getModelData(); j3dSys.setModel(model); j3dSys.setTexture(modelData->getTexture()); model->unlock(); -#endif static mDoExt_offCupOnAupPacket l_offCupOnAupPacket1; static mDoExt_offCupOnAupPacket l_offCupOnAupPacket2; @@ -998,11 +1512,6 @@ void linkDraw(mDoExt_McaMorf* pMorf) { J3DShape* ZOffNoneShape[4]; J3DShape* ZOnShape[4]; -#if VERSION == VERSION_DEMO - J3DModel* model = pMorf->getModel(); - J3DModelData* modelData = model->getModelData(); -#endif - J3DJoint* link_root_joint = modelData->getJointNodePointer(0x00); // link_root joint J3DJoint* cl_eye_joint = modelData->getJointNodePointer(0x13); // cl_eye joint J3DJoint* cl_mayu_joint = modelData->getJointNodePointer(0x15); // cl_mayu joint @@ -1019,14 +1528,14 @@ void linkDraw(mDoExt_McaMorf* pMorf) { if (mtl->getZMode()->getCompareEnable() == 0) { if ((u8)mtl->getBlend()->getType() == GX_BM_BLEND) { ZOffBlendShape[zoff_blend_cnt++] = mtl->getShape(); - JUT_ASSERT(VERSION_SELECT(1713, 1767, 1767, 1767), zoff_blend_cnt <= 4); + JUT_ASSERT(1767, zoff_blend_cnt <= 4); } else { ZOffNoneShape[zoff_none_cnt++] = mtl->getShape(); - JUT_ASSERT(VERSION_SELECT(1717, 1770, 1770, 1770), zoff_none_cnt <= 4); + JUT_ASSERT(1770, zoff_none_cnt <= 4); } } else { ZOnShape[zon_cnt++] = mtl->getShape(); - JUT_ASSERT(VERSION_SELECT(1722, 1774, 1774, 1774), zon_cnt <= 4); + JUT_ASSERT(1774, zon_cnt <= 4); } mtl = mtl->getNext(); } @@ -1063,7 +1572,6 @@ void linkDraw(mDoExt_McaMorf* pMorf) { link_root_joint->entryIn(); -#if VERSION > VERSION_DEMO for (i = 0, mtl = link_root_joint->getMesh(); mtl != NULL; i++, mtl = mtl->getNext()) { if (i != 2 && i != 5) { mtl->getShape()->show(); @@ -1071,7 +1579,6 @@ void linkDraw(mDoExt_McaMorf* pMorf) { mtl->getShape()->hide(); } } -#endif l_onCupOffAupPacket1.entryOpa(); @@ -1090,12 +1597,8 @@ void linkDraw(mDoExt_McaMorf* pMorf) { ZOnShape[i]->hide(); } -#if VERSION == VERSION_DEMO - pMorf->entryDL(); -#else dComIfGd_setList(); mDoExt_modelEntryDL(pMorf->getModel()); -#endif for (mtl = link_root_joint->getMesh(); mtl != NULL; mtl = mtl->getNext()) { mtl->getShape()->show(); @@ -1103,10 +1606,6 @@ void linkDraw(mDoExt_McaMorf* pMorf) { modelData->getJointNodePointer(0x14)->getMesh()->getShape()->show(); // cl_hana joint modelData->getJointNodePointer(0x29)->getMesh()->getShape()->show(); // cl_back joint - -#if VERSION == VERSION_DEMO - dComIfGd_setList(); -#endif } static actor_method_class daSampleMethodTable = { diff --git a/src/d/actor/d_a_player_dproc.inc b/src/d/actor/d_a_player_dproc.inc index 5de3e829c..f5578b6c8 100644 --- a/src/d/actor/d_a_player_dproc.inc +++ b/src/d/actor/d_a_player_dproc.inc @@ -418,7 +418,6 @@ void daPy_lk_c::setGetItemSound(u16 param_1, int param_2) { } } -#if VERSION > VERSION_DEMO /* 8012E418-8012E6B4 .text setGetDemo__9daPy_lk_cFv */ BOOL daPy_lk_c::setGetDemo() { int staffIdx = dComIfGp_evmng_getMyStaffId("Link", this); @@ -489,7 +488,6 @@ BOOL daPy_lk_c::setGetDemo() { m34CE = 0; return FALSE; } -#endif /* 8012E6B4-8012E8B0 .text dProcGetItem_init__9daPy_lk_cFv */ BOOL daPy_lk_c::dProcGetItem_init() { diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp index c69193bf6..b23aeaa01 100644 --- a/src/d/actor/d_a_player_main.cpp +++ b/src/d/actor/d_a_player_main.cpp @@ -50,11 +50,9 @@ JGeometry::TVec3 l_hammer_splash_particle_scale(0.67f, 0.67f, 0.67f); #include "d/actor/d_a_player_HIO_data.inc" -#if VERSION > VERSION_DEMO cXyz l_debug_keep_pos; csXyz l_debug_current_angle; csXyz l_debug_shape_angle; -#endif GXColor l_freeze_fade_color = {0xFF, 0xFF, 0xFF, 0xFF}; @@ -1026,7 +1024,12 @@ void daPy_lk_c::playTextureAnime() { /* 8010552C-8010558C .text checkPlayerGuard__9daPy_lk_cCFv */ BOOL daPy_lk_c::checkPlayerGuard() const { - return mCurProc == daPyProc_CROUCH_DEFENSE_e || checkUpperGuardAnime() || checkGuardSlip(); + /* Nonmatching */ + bool guard = false; + if (mCurProc == daPyProc_CROUCH_DEFENSE_e || checkUpperGuardAnime() || checkGuardSlip()) { + guard = true; + } + return guard; } /* 8010558C-801056E4 .text setOutPower__9daPy_lk_cFfsi */ @@ -1327,10 +1330,9 @@ s32 daPy_lk_c::setItemModel() { ((m_anm_heap_under[UNDER_MOVE0_e].mIdx == LKANM_BCK_DASHS || (m_anm_heap_under[UNDER_MOVE0_e].mIdx == LKANM_BCK_DASH)))))) { - MtxP mtx = mDoMtx_stack_c::get(); - dVar16 = mtx[0][3]; - dVar15 = mtx[1][3]; - dVar17 = mtx[2][3]; + dVar16 = mDoMtx_stack_c::now[0][3]; + dVar15 = mDoMtx_stack_c::now[1][3]; + dVar17 = mDoMtx_stack_c::now[2][3]; u16 uVar10 = cM_rad2s(((6.2831855f * (mFrameCtrlUnder[UNDER_MOVE0_e].getFrame() - 22.0f)) / mFrameCtrlUnder[UNDER_MOVE0_e].getEnd())); @@ -1535,11 +1537,7 @@ void daPy_lk_c::drawMirrorLightModel() { mDoMtx_stack_c::transS(l_ms_light_local_start); mDoMtx_stack_c::YrotM(-0x8000); mDoMtx_stack_c::revConcat(mpEquippedShieldModel->getBaseTRMtx()); -#if VERSION == VERSION_DEMO - mMirrorPacket.update(mDoMtx_stack_c::get(), 0xFF); -#else mMirrorPacket.update(mDoMtx_stack_c::get(), 0xFF, 60.0f); -#endif dComIfGd_getXluList()->entryImm(&mMirrorPacket, 0xFF); updateDLSetLight(mpYmsls00Model, 0); } @@ -1570,55 +1568,37 @@ void daPy_lk_c::drawShadow() { } mtl->getShape()->hide(); } - f32 f31; + f32 fVar1; if (checkModeFlg(ModeFlg_HANG)) { - f31 = m35DC; + fVar1 = m35DC; } else { - f31 = mAcch.GetGroundH(); + fVar1 = mAcch.GetGroundH(); } - f32 f1; - if (!strcmp(dComIfGp_getStartStageName(), "M_DaiB") || - !strcmp(dComIfGp_getStartStageName(), "Xboss2")) + f32 dVar9 = fVar1; + if ((!strcmp(dComIfGp_getStartStageName(), "M_DaiB")) || + (!strcmp(dComIfGp_getStartStageName(), "Xboss2"))) { - f1 = 1400.0f; + fVar1 = 1400.0f; } else { - f1 = daPy_HIO_basic_c0::m.field_0x10; + fVar1 = daPy_HIO_basic_c0::m.field_0x10; } - int iVar4 = dComIfGd_setShadow(m3614, 0, mpCLModel, &local_30, f1, 30.0f, current.pos.y, - f31, mAcch.m_gnd, &tevStr, 0, 1.0f, + int iVar4 = dComIfGd_setShadow(m3614, 0, mpCLModel, &local_30, fVar1, 30.0f, current.pos.y, + dVar9, mAcch.m_gnd, &tevStr, 0, 1.0f, &dDlst_shadowControl_c::mSimpleTexObj); m3614 = iVar4; if ((u32)m3614 != 0) { if ((checkNoResetFlg1(daPyFlg1_CASUAL_CLOTHES)) && (!checkCaughtShapeHide())) { dComIfGd_addRealShadow(m3614, mpKatsuraModel); } - if (checkSwordEquip() -#if VERSION == VERSION_DEMO - && !checkLastDemoSwordNoDraw(1) -#else - && !checkDemoSwordNoDraw(1) -#endif - ) { + if ((checkSwordEquip()) && (!checkDemoSwordNoDraw(1))) { dComIfGd_addRealShadow(m3614, mpEquippedSwordModel); } - if ((mpEquipItemModel != NULL -#if VERSION == VERSION_DEMO - && !checkLastDemoSwordNoDraw(0) -#else - && !checkDemoSwordNoDraw(0) -#endif - ) && + if (((mpEquipItemModel != NULL) && (!checkDemoSwordNoDraw(0))) && ((!checkBowItem(mEquipItem) || (!checkPlayerGuard())))) { dComIfGd_addRealShadow(m3614, mpEquipItemModel); } - if (dComIfGs_getSelectEquip(1) != dItem_NONE_e -#if VERSION == VERSION_DEMO - && !checkLastDemoSwordNoDraw(1) -#else - && !checkDemoShieldNoDraw() -#endif - ) { + if ((dComIfGs_getSelectEquip(1) != dItem_NONE_e) && (!checkDemoShieldNoDraw())) { dComIfGd_addRealShadow(m3614, mpEquippedShieldModel); } fopAc_ac_c* pfVar10; @@ -1838,13 +1818,9 @@ BOOL daPy_lk_c::draw() { } else { hideHatAndBackle(link_root_joint->getMesh()); } - if ( - (!checkNormalSwordEquip() && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_FF1_e) - || checkCaughtShapeHide() -#if VERSION > VERSION_DEMO - || checkDemoShieldNoDraw() -#endif - ) { + if ((!checkNormalSwordEquip() && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_FF1_e) || + checkCaughtShapeHide() || checkDemoShieldNoDraw()) + { mpCLModelData->getJointNodePointer(0x0D)->getMesh()->getShape()->hide(); // cl_podA joint } else { mpCLModelData->getJointNodePointer(0x0D)->getMesh()->getShape()->show(); // cl_podA joint @@ -1867,11 +1843,7 @@ BOOL daPy_lk_c::draw() { mpCLModelData->getJointNodePointer(0x29)->getMesh()->getShape()->show(); // cl_back joint if (!r24) { entryDLSetLight(mpHandsModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); - if (checkNoResetFlg1(daPyFlg1_CASUAL_CLOTHES) && !checkCaughtShapeHide() -#if VERSION > VERSION_DEMO - && !dComIfGp_checkCameraAttentionStatus(mCameraInfoIdx, 0x20) -#endif - ) { + if (checkNoResetFlg1(daPyFlg1_CASUAL_CLOTHES) && !checkCaughtShapeHide() && !dComIfGp_checkCameraAttentionStatus(mCameraInfoIdx, 0x20)) { entryDLSetLight(mpKatsuraModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } if (checkFreezeState() && checkMaskDraw()) { @@ -1880,11 +1852,7 @@ BOOL daPy_lk_c::draw() { if (dComIfGs_getSelectEquip(2) == dItem_POWER_BRACELETS_e) { entryDLSetLight(mpPringModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } - if (checkMasterSwordEquip() && !checkCaughtShapeHide() -#if VERSION > VERSION_DEMO - && !checkDemoShieldNoDraw() -#endif - ) { + if (checkMasterSwordEquip() && !checkCaughtShapeHide() && !checkDemoShieldNoDraw()) { updateDLSetLight(mpPodmsModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } } @@ -1917,23 +1885,11 @@ BOOL daPy_lk_c::draw() { mDoExt_modelUpdateDL(mpSuimenMunyaModel); } if (!r24 && !dComIfGp_checkCameraAttentionStatus(mCameraInfoIdx, 0x20)) { - if (checkSwordEquip() -#if VERSION == VERSION_DEMO - && !checkLastDemoSwordNoDraw(1) -#else - && !checkDemoSwordNoDraw(1) -#endif - ) { + if (checkSwordEquip() && !checkDemoSwordNoDraw(TRUE)) { entryDLSetLight(mpEquippedSwordModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } } - if (dComIfGs_getSelectEquip(1) != dItem_NONE_e && !checkCaughtShapeHide() -#if VERSION == VERSION_DEMO - && !checkLastDemoSwordNoDraw(1) -#else - && !checkDemoShieldNoDraw() -#endif - ) { + if (dComIfGs_getSelectEquip(1) != dItem_NONE_e && !checkCaughtShapeHide() && !checkDemoShieldNoDraw()) { entryDLSetLight(mpEquippedShieldModel, checkNoResetFlg1(daPyFlg1_FREEZE_STATE)); } dComIfGd_setList(); @@ -1943,13 +1899,7 @@ BOOL daPy_lk_c::draw() { if (mpBottleContentsModel != NULL) { updateDLSetLight(mpBottleContentsModel, 0); } - if (mpEquipItemModel && !checkCaughtShapeHide() -#if VERSION == VERSION_DEMO - && !checkLastDemoSwordNoDraw(0) -#else - && !checkDemoSwordNoDraw(0) -#endif - ) { + if (mpEquipItemModel && !checkCaughtShapeHide() && !checkDemoSwordNoDraw(FALSE)) { if (!checkBowItem(mEquipItem) || !checkPlayerGuard()) { if (mEquipItem == dItem_HOOKSHOT_e) { if (mActorKeepEquip.getActor()) { @@ -9028,8 +8978,8 @@ void daPy_lk_c::setNeckAngle() { r28 = true; } else if (checkModeFlg(ModeFlg_00000080 | ModeFlg_08000000)) { if ((!dComIfGp_event_runCheck()) || (mDemo.getDemoMode() == daPy_demo_c::DEMO_UNK39_e)) { - if (dComIfGp_att_getLookTarget() != NULL) { - sp18 = &dComIfGp_att_getLookTarget()->eyePos; + if (dComIfGp_getAttention().getLookTarget() != NULL) { + sp18 = &dComIfGp_getAttention().getLookTarget()->eyePos; r28 = true; } else { if ((((checkAttentionPosAngle(r23_2, &sp18)) || @@ -11212,11 +11162,9 @@ void daPy_lk_c::checkRoofRestart() { /* 80121870-80122D30 .text execute__9daPy_lk_cFv */ BOOL daPy_lk_c::execute() { /* Nonmatching - regalloc */ -#if VERSION > VERSION_DEMO if (setGetDemo()) { return TRUE; } -#endif if (checkNoResetFlg1(daPyFlg1_UNK200)) { fopMsgM_demoMsgFlagOn(); @@ -11236,11 +11184,9 @@ BOOL daPy_lk_c::execute() { dComIfGs_setBottleItemIn(dItem_FOREST_WATER_e, dItem_WATER_BOTTLE_e); mDemo.setDemoType(5); m3628 = fpcM_ERROR_PROCESS_ID_e; -#if VERSION > VERSION_DEMO if (mCurProc == daPyProc_SCOPE_e) { procWait_init(); } -#endif } } } @@ -11288,11 +11234,9 @@ BOOL daPy_lk_c::execute() { } } -#if VERSION > VERSION_DEMO current.pos = l_debug_keep_pos; shape_angle = l_debug_shape_angle; current.angle = l_debug_current_angle; -#endif mCameraInfoIdx = dComIfGp_getPlayerCameraID(0); m3748 = current.pos; @@ -11564,7 +11508,7 @@ BOOL daPy_lk_c::execute() { m357C = m3580; m3580 = -1; mCurrAttributeCode = dBgS_Attr_UNK1B_e; - roomNo = fopAcM_GetRoomNo(this); + roomNo = current.roomNo; checkFallCode(); } @@ -11602,9 +11546,7 @@ BOOL daPy_lk_c::execute() { mpCLModelData->getJointNodePointer(0x02)->setMtxCalc(m_pbCalc[PART_UPPER_e]); // body_chn joint mpCLModelData->getJointNodePointer(0x1D)->setMtxCalc(m_pbCalc[PART_UNDER_e]); // wash_chn joint -#if VERSION > VERSION_DEMO checkOriginalHatAnimation(); -#endif static const Vec nsword_top = {45.0f, -31.0f, 0.0f}; static const Vec msword_top = {57.0f, 48.0f, 0.0f}; @@ -11641,11 +11583,7 @@ BOOL daPy_lk_c::execute() { m36D0 = mSwordTopPos; m36DC = m36C4; - if (mEquipItem == daPyItem_BOKO_e -#if VERSION > VERSION_DEMO - && mActorKeepEquip.getActor() -#endif - ) { + if (mEquipItem == daPyItem_BOKO_e && mActorKeepEquip.getActor()) { daBoko_c* boko = static_cast(mActorKeepEquip.getActor()); boko->getTopPos(&mSwordTopPos); boko->getBlurRootPos(&m36C4); @@ -11685,9 +11623,7 @@ BOOL daPy_lk_c::execute() { eventInfo.onCondition(dEvtCnd_CANTALK_e); } } -#if VERSION > VERSION_DEMO eventInfo.onCondition(dEvtCnd_CANGETITEM_e); -#endif JPABaseEmitter* emitter = mSmokeEcallBack.getEmitter(); if (emitter) { @@ -11719,11 +11655,9 @@ BOOL daPy_lk_c::execute() { if (dComIfGp_getDoStatus() == dActStts_UNK43) { dComIfGp_setDoStatus(dActStts_JUMP_e); } -#if VERSION > VERSION_DEMO if (checkResetFlg0(daPyRFlg0_UNK10000000)) { dComIfGp_setAStatus(dActStts_BLANK_e); } -#endif } offNoResetFlg1((daPy_FLG1)(daPyFlg1_UNK4 | daPyFlg1_FORCE_VOMIT_JUMP | daPyFlg1_FORCE_VOMIT_JUMP_SHORT | daPyFlg1_UNK10000000)); @@ -11752,11 +11686,9 @@ BOOL daPy_lk_c::execute() { mWhirlId = fpcM_ERROR_PROCESS_ID_e; -#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; -#endif return TRUE; } @@ -12656,11 +12588,9 @@ cPhs_State daPy_lk_c::makeBgWait() { if ((dComIfGs_getLastSceneMode() & 0x4000) != 0) { onNoResetFlg1(daPyFlg1_UNK8000); } -#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; -#endif return cPhs_NEXT_e; } @@ -13031,11 +12961,9 @@ void daPy_lk_c::setPlayerPosAndAngle(cXyz* param_1, s16 param_2) { shape_angle.y = param_2; current.angle.y = param_2; m34DE = shape_angle.y; -#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; -#endif } /* 80128C10-80128CE4 .text setPlayerPosAndAngle__9daPy_lk_cFP4cXyzP5csXyz */ @@ -13052,11 +12980,9 @@ void daPy_lk_c::setPlayerPosAndAngle(cXyz* param_1, csXyz* param_2) { current.angle.y = shape_angle.y; m34DE = shape_angle.y; } -#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; -#endif } /* 80128CE4-80128DC0 .text setPlayerPosAndAngle__9daPy_lk_cFPA4_f */ @@ -13069,11 +12995,9 @@ void daPy_lk_c::setPlayerPosAndAngle(MtxP param_1) { mDoMtx_MtxToRot(param_1, &shape_angle); current.angle.y = shape_angle.y; m34DE = shape_angle.y; -#if VERSION > VERSION_DEMO l_debug_keep_pos = current.pos; l_debug_shape_angle = shape_angle; l_debug_current_angle = current.angle; -#endif } } diff --git a/src/d/actor/d_a_player_sword.inc b/src/d/actor/d_a_player_sword.inc index b069689d9..8d3b24809 100644 --- a/src/d/actor/d_a_player_sword.inc +++ b/src/d/actor/d_a_player_sword.inc @@ -154,12 +154,7 @@ void daPy_lk_c::setLightSaver() { mpEquipItemBrk->setFrame(2.0f); } mpSwordModel1->setBaseTRMtx(mpEquipItemModel->getBaseTRMtx()); - if ( -#if VERSION == VERSION_DEMO - !checkLastDemoSwordNoDraw(0) && -#else - !checkDemoSwordNoDraw(0) && -#endif + if (!checkDemoSwordNoDraw(0) && ((checkChanceMode() || checkNoResetFlg1(daPyFlg1_UNK8000)) || checkFinalMasterSwordEquip())) { simpleAnmPlay(mpSwordBtk); @@ -226,17 +221,6 @@ void daPy_lk_c::setLightSaver() { } } -#if VERSION == VERSION_DEMO -BOOL daPy_lk_c::checkLastDemoSwordNoDraw(BOOL param_0) { - if ((mEquipItem == daPyItem_SWORD_e || param_0) && - dComIfGs_isEventBit(0x3f40)) - { - return TRUE; - } else { - return FALSE; - } -} -#else /* 80155490-801554C8 .text checkDemoShieldNoDraw__9daPy_lk_cFv */ BOOL daPy_lk_c::checkDemoShieldNoDraw() { if (dComIfGs_isEventBit(0x3f40)) { @@ -256,7 +240,6 @@ BOOL daPy_lk_c::checkDemoSwordNoDraw(BOOL param_0) { return false; } } -#endif /* 80155544-80155574 .text checkChanceMode__9daPy_lk_cFv */ BOOL daPy_lk_c::checkChanceMode() { diff --git a/src/d/d_bg_s_acch.cpp b/src/d/d_bg_s_acch.cpp index c8cc4ee10..c28f50a04 100644 --- a/src/d/d_bg_s_acch.cpp +++ b/src/d/d_bg_s_acch.cpp @@ -154,22 +154,28 @@ void dBgS_Acch::GroundCheck(dBgS& i_bgs) { } /* 800A305C-800A313C .text GroundRoofProc__9dBgS_AcchFR4dBgS */ -void dBgS_Acch::GroundRoofProc(dBgS& i_bgs) { +f32 dBgS_Acch::GroundRoofProc(dBgS& i_bgs) { + f32 y = -G_CM3D_F_INF; if (m_ground_h != -G_CM3D_F_INF) { - if (field_0xb8 < m_roof_height && m_roof_height < pm_pos->y) { - pm_pos->y = m_roof_height; + // y = m_roof_height; + // fakematch to fix load order + if (field_0xb8 < (y = m_roof_height) && y < pm_pos->y) { + pm_pos->y = y; } if (!(m_flags & ROOF_NONE)) { - if (m_ground_h >= m_roof_y) { + y = m_ground_h; + if (y >= m_roof_y) { m_roof.SetExtChk(*this); ClrRoofHit(); cXyz pos = *pm_pos; m_roof.SetPos(pos); - m_roof_y = i_bgs.RoofChk(&m_roof); + y = i_bgs.RoofChk(&m_roof); + m_roof_y = y; } } } + return y; } /* 800A313C-800A3460 .text LineCheck__9dBgS_AcchFR4dBgS */ @@ -193,7 +199,7 @@ void dBgS_Acch::LineCheck(dBgS& i_bgs) { cM3dGPla* pla = i_bgs.GetTriPla(linChk); if (!cBgW_CheckBGround(pla->GetNP()->y)) { - VECAdd(GetPos(), pla->GetNP(), GetPos()); + VECAdd(pm_pos, pla->GetNP(), pm_pos); if (!cM3d_IsZero(std::sqrtf(pla->GetNP()->x*pla->GetNP()->x + pla->GetNP()->z*pla->GetNP()->z))) pm_acch_cir[i].SetWallHDirect(pm_pos->y); @@ -226,12 +232,15 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) { Init(); f32 lowH_R = GetWallAllLowH_R(); - f32 distXZ2 = GetOldPos()->abs2XZ(*GetPos()); - f32 distY = GetOldPos()->y - GetPos()->y; + cXyz* temp9 = pm_old_pos; + cXyz* temp10 = pm_pos; + f32 distXZ2 = temp9->abs2XZ(*temp10); + f32 distY = pm_old_pos->y - pm_pos->y; f32 lowH = GetWallAllLowH(); - field_0xb4 = GetPos()->y; - f32 temp7 = lowH + GetOldPos()->y; - f32 temp8 = m_ground_check_offset + GetPos()->y; + field_0xb4 = pm_pos->y; + f32 oldY = pm_old_pos->y; + f32 temp7 = lowH + oldY; + f32 temp8 = m_ground_check_offset + pm_pos->y; bool ranLineCheck = false; OffLineCheckHit(); @@ -321,12 +330,10 @@ void dBgS_Acch::CrrPos(dBgS& i_bgs) { } } -#if VERSION > VERSION_DEMO CHECK_FLOAT_CLASS(780, pm_pos->x); CHECK_FLOAT_CLASS(781, pm_pos->y); CHECK_FLOAT_CLASS(782, pm_pos->z); CHECK_PVEC3_RANGE(786, pm_pos); -#endif } /* 800A3F50-800A3F8C .text GetWallAllR__9dBgS_AcchFv */ @@ -361,10 +368,11 @@ void dBgS_Acch::CalcWallBmdCyl() { f32 max_h = min_h; if (m_tbl_size >= 1) { for (s32 i = 0; i < m_tbl_size; i++) { - if (min_h > pm_acch_cir[i].GetWallH()) - min_h = pm_acch_cir[i].GetWallH(); - if (max_h < pm_acch_cir[i].GetWallH()) - max_h = pm_acch_cir[i].GetWallH(); + f32 h = pm_acch_cir[i].GetWallH(); + if (min_h > h) + min_h = h; + if (max_h < h) + max_h = h; } } diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index c680ca1f4..275f473c8 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -1953,13 +1953,8 @@ void mirrorPolygonCheck(cXyz* min_p, cXyz* max_p, f32 rad, dDlst_shadowPoly_c* p dComIfG_Bgsp()->ShdwDraw(&shdwDraw); } -#if VERSION == VERSION_DEMO -void dDlst_mirrorPacket::update(Mtx mtx, u8 alpha) -#else /* 80085808-800859DC .text update__18dDlst_mirrorPacketFPA4_fUcf */ -void dDlst_mirrorPacket::update(Mtx mtx, u8 alpha, f32 rad) -#endif -{ +void dDlst_mirrorPacket::update(Mtx mtx, u8 alpha, f32 rad) { mShadowPoly.mCount = 0; static cXyz l_p1Offset(0.0f, 0.0f, 0.0f); static cXyz l_p2Offset(0.0f, 0.0f, 10000.0f); @@ -1967,11 +1962,7 @@ void dDlst_mirrorPacket::update(Mtx mtx, u8 alpha, f32 rad) cXyz offs, offs2; mDoMtx_multVec(mtx, &l_p1Offset, &offs); mDoMtx_multVec(mtx, &l_p2Offset, &offs2); -#if VERSION == VERSION_DEMO - mirrorPolygonCheck(&offs, &offs2, 60.0f, &mShadowPoly); -#else mirrorPolygonCheck(&offs, &offs2, rad, &mShadowPoly); -#endif Mtx viewMtx; mDoMtx_lookAt(viewMtx, &offs, &offs2, 0);