Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2140,7 +2140,7 @@ def MatchingFor(*versions):
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_zra_freeze"),
ActorRel(NonMatching, "d_a_obj_zra_rock"),
ActorRel(NonMatching, "d_a_passer_mng"),
ActorRel(NonMatching, "d_a_peru"),
ActorRel(Equivalent, "d_a_peru"),
ActorRel(NonMatching, "d_a_ppolamp"),
ActorRel(MatchingFor("GZ2E01"), "d_a_skip_2D"),
ActorRel(MatchingFor("GZ2E01"), "d_a_startAndGoal", extra_cflags=['-pragma "nosyminline off"']),
Expand Down
10 changes: 6 additions & 4 deletions include/d/actor/d_a_npc.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,12 @@ class daNpcT_c : public fopAc_ac_c {
static s32 mFindCount;

enum Mode {
/* 0 */ MODE_ENTER,
/* 1 */ MODE_INIT,
/* 2 */ MODE_RUN,
/* 3 */ MODE_EXIT,
/* 0 */ MODE_ENTER,
/* 1 */ MODE_INIT,
/* 2 */ MODE_RUN,
/* 3 */ MODE_EXIT,
/* 4 */ MODE_4,
/* -1 */ MODE_INVALID = -1,
};

enum AnmFlags {
Expand Down
22 changes: 22 additions & 0 deletions include/d/actor/d_a_obj_catdoor.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@ class daObjCatDoor_c : public fopAc_ac_c {
inline int create();
inline void create_init();

void _toDoorOpened() {
mDoor1.angle = 0x8800;
mDoor2.angle = 0x7800;
setBaseMtx();
fopAcM_onSwitch(this, getSwitchNo());
}

void setDoorOpen() {
mRotSpeed = attr()[1];
dBgW* bgw1 = &mDoor1.bgw;
if (bgw1->ChkUsed()) {
dComIfG_Bgsp().Release(bgw1);
}

dBgW* bgw2 = &mDoor2.bgw;
if (bgw2->ChkUsed()) {
dComIfG_Bgsp().Release(bgw2);
}

Z2GetAudioMgr()->seStart(Z2SE_OBJ_GZ_NE_DOOR_OP, &current.pos, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
}

private:
/* 0x568 */ request_of_phase_process_class mPhaseReq;
/* 0x570 */ daObjCatDoor_Door_c mDoor1;
Expand Down
166 changes: 117 additions & 49 deletions include/d/actor/d_a_peru.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#ifndef D_A_PERU_H
#define D_A_PERU_H

#include "d/actor/d_a_tag_evtarea.h"
#include "dolphin/types.h"
#include "d/actor/d_a_npc.h"
#include "SSystem/SComponent/c_counter.h"

/**
* @ingroup actors-npcs
Expand All @@ -12,75 +14,141 @@
* @details
*
*/
class daPeru_c : public fopAc_ac_c {
class daPeru_c : public daNpcT_c {
public:
/* 80D46EEC */ ~daPeru_c();
/* 80D46FCC */ void create();
/* 80D4720C */ void CreateHeap();
/* 80D4765C */ void typeInitialize();
/* 80D47750 */ void Delete();
/* 80D47784 */ void Execute();
/* 80D477A4 */ void Draw();
/* 80D47840 */ void createHeapCallBack(fopAc_ac_c*);
/* 80D47860 */ void ctrlJointCallBack(J3DJoint*, int);
/* 80D478B8 */ void isDelete();
typedef int (daPeru_c::*cutAppearFunc)(int);
typedef int (daPeru_c::*actionFunc)(int);

/* 80D46EEC */ virtual ~daPeru_c();
/* 80D46FCC */ int create();
/* 80D4720C */ int CreateHeap();
/* 80D4765C */ int typeInitialize();
/* 80D47750 */ int Delete();
/* 80D47784 */ int Execute();
/* 80D477A4 */ int Draw();
/* 80D47840 */ static int createHeapCallBack(fopAc_ac_c*);
/* 80D47860 */ static int ctrlJointCallBack(J3DJoint*, int);
/* 80D478B8 */ int isDelete();
/* 80D478EC */ void reset();
/* 80D47B20 */ void setParam();
/* 80D47C4C */ void setAfterTalkMotion();
/* 80D47CAC */ void srchActors();
/* 80D47D5C */ void evtTalk();
/* 80D47E48 */ void evtCutProc();
/* 80D47D5C */ int evtTalk();
/* 80D47E48 */ int evtCutProc();
/* 80D47F10 */ void action();
/* 80D47F5C */ void setAttnPos();
/* 80D481A4 */ void setCollision();
/* 80D4835C */ bool drawDbgInfo();
/* 80D48364 */ void setAction(int (daPeru_c::*)(int), int);
/* 80D48414 */ void wait(int);
/* 80D486A0 */ void is_AppearDemo_start();
/* 80D4835C */ BOOL drawDbgInfo();
/* 80D48364 */ int setAction(actionFunc, int);
/* 80D48414 */ int wait(int);
/* 80D486A0 */ BOOL is_AppearDemo_start();
/* 80D48720 */ void _AppearDemoTag_delete();
/* 80D48750 */ void talk(int);
/* 80D48A7C */ void jump_st(int);
/* 80D48C58 */ void jump_ed(int);
/* 80D48E34 */ void sniff(int);
/* 80D48FA8 */ void demo_appear(int);
/* 80D4910C */ void demo_walk_to_link(int);
/* 80D492A8 */ void demo_walk_circle(int);
/* 80D49418 */ void demo_walk_to_window(int);
/* 80D4971C */ void demo_walk_to_pathway(int);
/* 80D499AC */ void cutAppear(int);
/* 80D49A40 */ void _cutAppear_Init(int const&);
/* 80D4A334 */ void _cutAppear_Main(int const&);
/* 80D48750 */ int talk(int);
/* 80D48A7C */ int jump_st(int);
/* 80D48C58 */ int jump_ed(int);
/* 80D48E34 */ int sniff(int);
/* 80D48FA8 */ int demo_appear(int);
/* 80D4910C */ int demo_walk_to_link(int);
/* 80D492A8 */ int demo_walk_circle(int);
/* 80D49418 */ int demo_walk_to_window(int);
/* 80D4971C */ int demo_walk_to_pathway(int);
/* 80D499AC */ int cutAppear(int);
/* 80D49A40 */ int _cutAppear_Init(int const&);
/* 80D4A334 */ int _cutAppear_Main(int const&);
/* 80D4A840 */ void _catdoor_open();
/* 80D4A920 */ void _catdoor_open_demoskip();
/* 80D4A984 */ void cutAppear_skip(int);
/* 80D4AA18 */ void _cutAppear_skip_Init(int const&);
/* 80D4AAF0 */ void _cutAppear_skip_Main(int const&);
/* 80D4BE2C */ daPeru_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
daNpcT_evtData_c const*, char**);
/* 80D4BEC4 */ s32 getEyeballMaterialNo();
/* 80D4BECC */ s32 getHeadJointNo();
/* 80D4BED4 */ s32 getNeckJointNo();
/* 80D4BEDC */ bool getBackboneJointNo();
/* 80D4BEE4 */ void checkChangeJoint(int);
/* 80D4BEF4 */ void checkRemoveJoint(int);
/* 80D4BF04 */ void beforeMove();

static void* mCutNameList[3];
static u8 mCutList[36];
/* 80D4A984 */ int cutAppear_skip(int);
/* 80D4AA18 */ int _cutAppear_skip_Init(int const&);
/* 80D4AAF0 */ int _cutAppear_skip_Main(int const&);
/* 80D4BE2C */ daPeru_c(daNpcT_faceMotionAnmData_c const* param_1,
daNpcT_motionAnmData_c const* param_2,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6,
daNpcT_evtData_c const* param_7, char** param_8)
: daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {
OS_REPORT("|%06d:%x|daPeru_c -> コンストラクト\n", g_counter, this);
}
/* 80D4BEC4 */ s32 getEyeballMaterialNo() { return 1; }
/* 80D4BECC */ s32 getHeadJointNo() { return 4; }
/* 80D4BED4 */ s32 getNeckJointNo() { return 3; }
/* 80D4BEDC */ s32 getBackboneJointNo() { return 1; }
/* 80D4BEE4 */ int checkChangeJoint(int param_1) { return param_1 == 4; }
/* 80D4BEE4 */ int checkRemoveJoint(int param_1) { return param_1 == 5; }
/* 80D4BF04 */ void beforeMove() {
if (checkHide() || mNoDraw) {
attention_info.flags = 0;
}
}

u8 getType() {
u8 type = fopAcM_GetParam(this);
if (type == 0xff) {
type = 0;
}
return type;
}

int getFlowNodeNo() {
u16 flowNode = home.angle.x;
if (flowNode == 0xffff) {
return -1;
}
return flowNode;
}

bool chkAction(actionFunc func) { return mActionFunc == func; }
void _AppearDemoStart() { mEvtNo = 1; }

BOOL decTimer() {
field_0xe6c--;
return field_0xe6c <= 0;
}

BOOL decCnt() {
field_0xe6a--;
return field_0xe6a <= 0;
}

void setTimer(int timer) { field_0xe6c = timer; }
void setCnt(int cnt) { field_0xe6a = cnt; }
int getCnt() { return field_0xe6a; }

static const char* mCutNameList[3];
static cutAppearFunc mCutList[3];

private:
/* 0x568 */ u8 field_0x568[0x112c - 0x568];
/* 0x0E40 */ daNpcT_ActorMngr_c mActors[3];
/* 0x0E58 */ int field_0xe58;
/* 0x0E5C */ actionFunc mActionFunc;
/* 0x0E68 */ s16 field_0xe68;
/* 0x0E6A */ s16 field_0xe6a;
/* 0x0E6C */ s16 field_0xe6c;
/* 0x0E6E */ s16 field_0xe6e;
/* 0x0E70 */ u8 field_0xe70[0xe7c - 0xe70];
/* 0x0E7C */ s8 field_0xe7c;
/* 0x0E80 */ int field_0xe80;
/* 0x0E84 */ int field_0xe84;
/* 0x0E88 */ dCcD_Cyl mCyls[2];
/* 0x1100 */ daNpcT_Path_c mPath;
/* 0x1128 */ u8 mType;
/* 0x1129 */ u8 field_0x1129;
};

STATIC_ASSERT(sizeof(daPeru_c) == 0x112c);

struct PeruParams {
f32 field_0x00[18];
s16 field_0x48[4];
f32 field_0x50[4];
s16 field_0x60[2];
f32 field_0x64[13];
};

class daPeru_Param_c {
public:
/* 80D4BF7C */ ~daPeru_Param_c();
/* 80D4BF7C */ virtual ~daPeru_Param_c() {}

static u8 const m[152];
static PeruParams const m;
};

#endif /* D_A_PERU_H */
12 changes: 12 additions & 0 deletions include/f_op/f_op_actor_mng.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,18 @@ inline f32 fopAcM_getCullSizeSphereR(const fopAc_ac_c* i_actor) {
return i_actor->cull.sphere.radius;
}

inline void fopAcM_SetPosition(fopAc_ac_c* i_actor, f32 x, f32 y, f32 z) {
i_actor->current.pos.set(x, y, z);
}

inline void fopAcM_SetOldPosition(fopAc_ac_c* i_actor, f32 x, f32 y, f32 z) {
i_actor->old.pos.set(x, y, z);
}

inline void fopAcM_SetHomePosition(fopAc_ac_c* i_actor, f32 x, f32 y, f32 z) {
i_actor->home.pos.set(x, y, z);
}

inline void dComIfGs_onSwitch(int i_no, int i_roomNo);
inline void dComIfGs_offSwitch(int i_no, int i_roomNo);
inline BOOL dComIfGs_isSwitch(int i_no, int i_roomNo);
Expand Down
Loading