Skip to content

Commit 4cf1106

Browse files
authored
d_a_obj_flag2 equivalent (#2480)
* d_a_obj_flag2 equivalent * flag2 cleanup
1 parent 932f67e commit 4cf1106

File tree

4 files changed

+517
-818
lines changed

4 files changed

+517
-818
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ def MatchingFor(*versions) -> bool:
19131913
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_firepillar"),
19141914
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_firepillar2"),
19151915
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_flag"),
1916-
ActorRel(NonMatching, "d_a_obj_flag2"),
1916+
ActorRel(Equivalent, "d_a_obj_flag2"), # weak function order
19171917
ActorRel(NonMatching, "d_a_obj_flag3"),
19181918
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_food"),
19191919
ActorRel(NonMatching, "d_a_obj_fw"),

include/d/actor/d_a_obj_flag2.h

Lines changed: 75 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,65 @@
11
#ifndef D_A_OBJ_FLAG2_H
22
#define D_A_OBJ_FLAG2_H
33

4+
#include "d/d_cc_d.h"
45
#include "f_op/f_op_actor_mng.h"
56

7+
struct daObjFlag2_Attr_c {
8+
/* 0x00 */ f32 mGravity;
9+
/* 0x04 */ f32 mSpringCoeeficient;
10+
/* 0x08 */ f32 mDecayRate;
11+
/* 0x0C */ f32 mWindCoefficient;
12+
/* 0x10 */ f32 mTornado;
13+
};
14+
15+
class FlagCloth_c : public J3DPacket {
16+
public:
17+
/* 80BEC658 */ void initFlagPos(cXyz*, fopAc_ac_c*);
18+
/* 80BEC7CC */ cXyz calcFlagFactor(cXyz*, cXyz*, cXyz*, int);
19+
/* 80BEC928 */ void calcFlagFactorSub(cXyz*, cXyz*, cXyz*, f32);
20+
/* 80BECAE0 */ void calcFlagNormal(cXyz*, int);
21+
/* 80BECC34 */ inline void calcFlagNormalBack();
22+
/* 80BECC78 */ void initCcSphere(fopAc_ac_c*);
23+
/* 80BECCE4 */ void setCcSphere();
24+
/* 80BECD98 */ void execute();
25+
/* 80BEE0B8 */ cXyz getTargetPos() { return mPositions[4]; }
26+
27+
/* 80BECF30 */ void draw();
28+
/* 80BED9C4 */ virtual ~FlagCloth_c() {}
29+
30+
cXyz* getPos() { return mPositions; }
31+
cXyz* getNormal() { return mNormals; }
32+
cXyz* getNormalBack() { return mNormalBacks; }
33+
cXyz* getVec() { return mVecs; }
34+
void setSpringRate(f32 rate) { mSpringRate = rate; }
35+
void setWindRate(f32 rate) { mWindRate = rate; }
36+
void setDecayRate(f32 rate) { mDecayRate = rate; }
37+
void setGravity(f32 rate) { mGravity = rate; }
38+
void setTornado(f32 tornado) { mTornado = tornado; }
39+
GXTexObj* getImageTexObj() { return &mTexObj; }
40+
void setTexCoord_p(void* texCoordP) { mpTexCoord = texCoordP; }
41+
42+
/* 0x010 */ dKy_tevstr_c mTevStr;
43+
/* 0x398 */ GXTexObj mTexObj;
44+
/* 0x3B8 */ dCcD_Stts mStts;
45+
/* 0x3F4 */ dCcD_Sph mSph;
46+
/* 0x52C */ u8 field_0x52c[0x540 - 0x52c];
47+
/* 0x540 */ cXyz mPositions[21];
48+
/* 0x63C */ f32 field_0x63c;
49+
/* 0x640 */ cXyz mNormals[21];
50+
/* 0x73C */ f32 field_0x73c;
51+
/* 0x740 */ cXyz mNormalBacks[21];
52+
/* 0x740 */ cXyz mVecs[21];
53+
/* 0x938 */ cXyz* mpFlagPosition;
54+
/* 0x93C */ Mtx mModelMtx;
55+
/* 0x96C */ void* mpTexCoord;
56+
/* 0x970 */ f32 mSpringRate;
57+
/* 0x974 */ f32 mWindRate;
58+
/* 0x978 */ f32 mDecayRate;
59+
/* 0x97C */ f32 mGravity;
60+
/* 0x980 */ f32 mTornado;
61+
};
62+
663
/**
764
* @ingroup actors-objects
865
* @class daObjFlag2_c
@@ -17,34 +74,31 @@ class daObjFlag2_c : public fopAc_ac_c {
1774
/* 80BED368 */ void initBaseMtx();
1875
/* 80BED3B8 */ void initCollision();
1976
/* 80BED44C */ void setCollision();
20-
/* 80BED480 */ void createHeap();
21-
/* 80BED6A0 */ void create();
77+
/* 80BED480 */ int createHeap();
78+
/* 80BED6A0 */ int create();
2279
/* 80BED7A4 */ daObjFlag2_c();
23-
/* 80BEDCE0 */ void draw();
80+
/* 80BEDCE0 */ int draw();
2481
/* 80BEDEE0 */ ~daObjFlag2_c();
82+
inline int execute();
83+
84+
const daObjFlag2_Attr_c& attr() const { return M_attr; }
2585

26-
static u8 const M_attr[20];
86+
static daObjFlag2_Attr_c const M_attr;
2787

2888
private:
29-
/* 0x568 */ u8 field_0x568[0x10c0 - 0x568];
89+
/* 0x0568 */ J3DModel* mModel;
90+
/* 0x056C */ request_of_phase_process_class mFlagPhase;
91+
/* 0x0574 */ request_of_phase_process_class mArcPhase;
92+
/* 0x057C */ dCcD_Stts mStts;
93+
/* 0x05B8 */ dCcD_Cyl mCyl;
94+
/* 0x06F4 */ u8 field_0x6f4[0x700 - 0x6f4];
95+
/* 0x0700 */ FlagCloth_c mFlagCloth;
96+
/* 0x1084 */ u8 field_0x1084[0x10a0 - 0x1084];
97+
/* 0x10A0 */ cXyz mFlagPosition;
98+
/* 0x10AC */ bool mFlagValid;
99+
/* 0x10AD */ char mFlagName[16];
30100
};
31101

32102
STATIC_ASSERT(sizeof(daObjFlag2_c) == 0x10c0);
33103

34-
class FlagCloth_c {
35-
public:
36-
/* 80BEC658 */ void initFlagPos(cXyz*, fopAc_ac_c*);
37-
/* 80BEC7CC */ void calcFlagFactor(cXyz*, cXyz*, cXyz*, int);
38-
/* 80BEC928 */ void calcFlagFactorSub(cXyz*, cXyz*, cXyz*, f32);
39-
/* 80BECAE0 */ void calcFlagNormal(cXyz*, int);
40-
/* 80BECC34 */ void calcFlagNormalBack();
41-
/* 80BECC78 */ void initCcSphere(fopAc_ac_c*);
42-
/* 80BECCE4 */ void setCcSphere();
43-
/* 80BECD98 */ void execute();
44-
/* 80BECF30 */ void draw();
45-
/* 80BED9C4 */ ~FlagCloth_c();
46-
/* 80BEE0B8 */ void getTargetPos();
47-
};
48-
49-
50104
#endif /* D_A_OBJ_FLAG2_H */

include/d/d_kankyo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,5 +635,6 @@ void dKy_bgparts_activelight_set(LIGHT_INFLUENCE* light_inf_p, int bgpart_id);
635635
void dKy_bgparts_activelight_cut(int bgpart_id);
636636
int dKy_Indoor_check();
637637
void dKy_GfFog_tevstr_set(dKy_tevstr_c* tevstr_p);
638+
void dKy_setLight_mine(dKy_tevstr_c* tevstr_p);
638639

639640
#endif /* D_KANKYO_D_KANKYO_H */

0 commit comments

Comments
 (0)