Skip to content

Commit 0ab8dc2

Browse files
authored
Daswc (#2398)
* swball cleanup * daSwc00_c OK * Revert change in configure - we'll handle rel/dol changes in seperate PR
1 parent f08e883 commit 0ab8dc2

File tree

12 files changed

+396
-861
lines changed

12 files changed

+396
-861
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ def MatchingFor(*versions):
15561556
ActorRel(MatchingFor("GZ2E01"), "d_a_scene_exit2"),
15571557
ActorRel(MatchingFor("GZ2E01"), "d_a_shop_item"),
15581558
ActorRel(MatchingFor("GZ2E01"), "d_a_sq"),
1559-
ActorRel(NonMatching, "d_a_swc00"),
1559+
ActorRel(MatchingFor("GZ2E01"), "d_a_swc00"),
15601560
ActorRel(MatchingFor("GZ2E01"), "d_a_tag_CstaSw"),
15611561
ActorRel(MatchingFor("GZ2E01"), "d_a_tag_ajnot"),
15621562
ActorRel(NonMatching, "d_a_tag_attack_item"),

include/JSystem/J3DGraphBase/J3DSys.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <dolphin/gx.h>
55
#include <dolphin/mtx.h>
6+
#include "JSystem/JUtility/JUTAssert.h"
67

78
// Perhaps move to a new J3DEnum.h?
89
enum J3DError {
@@ -134,11 +135,18 @@ struct J3DSys {
134135

135136
// Type 0: Opa Buffer
136137
// Type 1: Xlu Buffer
137-
void setDrawBuffer(J3DDrawBuffer* buffer, int type) { mDrawBuffer[type] = buffer; }
138+
void setDrawBuffer(J3DDrawBuffer* buffer, int type) {
139+
J3D_ASSERT(114, type >= 0 && type < 2, "Error : range over.");
140+
J3D_ASSERT(115, buffer, "Error : null pointer.");
141+
mDrawBuffer[type] = buffer;
142+
}
138143

139144
// Type 0: Opa Buffer
140145
// Type 1: Xlu Buffer
141-
J3DDrawBuffer* getDrawBuffer(int type) { return mDrawBuffer[type]; }
146+
J3DDrawBuffer* getDrawBuffer(int type) {
147+
J3D_ASSERT(121, type >= 0 && type < 2, "Error : range over.");
148+
return mDrawBuffer[type];
149+
}
142150

143151
Mtx& getModelDrawMtx(u16 no) const { return mModelDrawMtx[no]; }
144152
J3DShapePacket* getShapePacket() const { return mShapePacket; }

include/d/actor/d_a_obj_swBallA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class daObjSwBallA_c : public fopAc_ac_c , public dEvLib_callback_c {
3030
/* 80CF3D84 */ void PutCrrPos();
3131
/* 80CF406C */ int draw();
3232
/* 80CF41F4 */ int _delete();
33-
/* 80CF4354 */ ~daObjSwBallA_c();
33+
/* 80CF4354 */ virtual ~daObjSwBallA_c() {}
3434

3535
u32 getArg0() { return fopAcM_GetParamBit(this, 0, 8); }
3636
u32 getSwbit2() { return fopAcM_GetParamBit(this, 8, 8); }

include/d/actor/d_a_obj_swBallB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class daObjSwBallB_c : public fopAc_ac_c, public dEvLib_callback_c {
3030
/* 80CF5388 */ void PutCrrPos();
3131
/* 80CF56A4 */ int draw();
3232
/* 80CF582C */ int _delete();
33-
/* 80CF5940 */ ~daObjSwBallB_c();
33+
/* 80CF5940 */ virtual ~daObjSwBallB_c() {}
3434

3535
s32 getID() { return fopAcM_GetParamBit(this, 0, 8); }
3636
u32 getSwbit2() { return fopAcM_GetParamBit(this, 8, 8); }

include/d/actor/d_a_swc00.h

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,42 @@
1313
*/
1414
class daSwc00_c : public fopAc_ac_c {
1515
public:
16-
public:
16+
typedef void (daSwc00_c::*actionFunc)();
17+
18+
enum Action {
19+
ACTION_WAIT,
20+
ACTION_ORDER_EVENT,
21+
ACTION_EVENT,
22+
ACTION_DEAD,
23+
};
24+
1725
/* 805A15FC */ int execute();
1826
/* 805A18E8 */ void event_proc_call();
1927
/* 805A19A4 */ void actionWait();
2028
/* 805A1A28 */ void actionOrderEvent();
2129
/* 805A1A94 */ void actionEvent();
2230
/* 805A1AF0 */ void actionDead();
2331

32+
void setAction(u8 action) { mAction = action; }
33+
2434
/* 0x568 */ cXyz field_0x568;
2535
/* 0x574 */ cXyz field_0x574;
26-
/* 0x580 */ u16 mEventID;
36+
/* 0x580 */ s16 mEventID;
2737
/* 0x582 */ u8 mAction;
28-
/* 0x584 */ u8 field_0x584[4];
38+
/* 0x583 */ u8 field_0x583;
39+
/* 0x584 */ u8 field_0x584;
40+
/* 0x585 */ u8 field_0x585[3];
2941
};
3042

3143
STATIC_ASSERT(sizeof(daSwc00_c) == 0x588);
3244

45+
inline u8 daSwc00_getCondition(daSwc00_c* i_this) {
46+
return i_this->shape_angle.x;
47+
}
48+
49+
inline int daSwc00_getShape(daSwc00_c* i_this) {
50+
return (fopAcM_GetParam(i_this) >> 18) & 3;
51+
}
52+
3353

3454
#endif /* D_A_SWC00_H */

include/d/d_s_play_env.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
1+
#include "JSystem/JHostIO/JORReflexible.h"
12
#include "SSystem/SComponent/c_xyz.h"
23

3-
class dScnPly_env_otherHIO_c {
4+
class dScnPly_env_otherHIO_c : public JORReflexible {
45
public:
56
/* 80259440 */ dScnPly_env_otherHIO_c();
67

78
/* 8025AC0C */ virtual ~dScnPly_env_otherHIO_c() {}
9+
void genMessage(JORMContext*);
810

9-
/* 0x4 */ f32 mShadowDensity;
10-
/* 0x8 */ u8 mLODBias;
11-
/* 0x9 */ u8 field_0x9;
12-
/* 0xA */ u8 mDispTransCylinder;
11+
/* 0x04 */ f32 mShadowDensity;
12+
/* 0x08 */ u8 mLODBias;
13+
/* 0x09 */ u8 field_0x9;
14+
/* 0x0A */ u8 mDispTransCylinder;
15+
#ifdef DEBUG
16+
/* 0x0B */ u8 field_0xb[0x46 - 0xb];
17+
/* 0x46 */ u8 field_0x46;
18+
/* 0x47 */ u8 field_0x47[0x4f - 0x47];
19+
#endif
1320
};
1421

15-
class dScnPly_env_debugHIO_c {
22+
class dScnPly_env_debugHIO_c : public JORReflexible {
1623
public:
1724
/* 80259468 */ dScnPly_env_debugHIO_c();
1825

1926
/* 8025ABC4 */ virtual ~dScnPly_env_debugHIO_c() {}
27+
void genMessage(JORMContext*);
2028

21-
private:
2229
/* 0x04 */ u8 field_0x4;
2330
/* 0x08 */ cXyz mBoxCullMinSize;
2431
/* 0x14 */ cXyz mBoxCullMaxSize;

src/d/actor/d_a_e_fm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ static void e_fm_damage_run(e_fm_class* i_this) {
988988
}
989989

990990
if (i_this->speedF > 1.0f && move_speed < 1.0f) {
991-
dComIfGp_getVibration().StartShock(YREG_S(3) + VIBMODE_S_POWER7, 0xF, cXyz(0.0f, 1.0f, 0.0f));
991+
dComIfGp_getVibration().StartShock(YREG_S(3) + (int)VIBMODE_S_POWER7, 0xF, cXyz(0.0f, 1.0f, 0.0f));
992992
dComIfGp_particle_set(0x8150, &i_this->home.pos, NULL, NULL);
993993
mDoAud_seStart(Z2SE_OBJ_FM_DIRTFALL, NULL, 0, 0);
994994
i_this->mSound.startCreatureSound(Z2SE_EN_FM_FOOTNOTE, 0, -1);

0 commit comments

Comments
 (0)