Skip to content

Commit 958916a

Browse files
authored
d_a_obj_ganonwall2 Matching (#2437)
* d_a_obj_ganonwall2 Mathcing * d_a_obj_ganonwall2.cpp formatting * d_a_obj_ganonwall.cpp formatting
1 parent c7e1b04 commit 958916a

File tree

4 files changed

+181
-269
lines changed

4 files changed

+181
-269
lines changed

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,7 @@ def MatchingFor(*versions) -> bool:
19191919
ActorRel(NonMatching, "d_a_obj_fw"),
19201920
ActorRel(NonMatching, "d_a_obj_gadget"),
19211921
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_ganonwall"),
1922-
ActorRel(NonMatching, "d_a_obj_ganonwall2"),
1922+
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_ganonwall2"),
19231923
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_gb"),
19241924
ActorRel(NonMatching, "d_a_obj_geyser"),
19251925
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_glowSphere"),

include/d/actor/d_a_obj_ganonwall2.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef D_A_OBJ_GANONWALL2_H
22
#define D_A_OBJ_GANONWALL2_H
33

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

67
/**
@@ -11,19 +12,25 @@
1112
* @details
1213
*
1314
*/
14-
class daObjGWall2_c : public fopAc_ac_c {
15+
class daObjGWall2_c : public dBgS_MoveBgActor {
1516
public:
1617
/* 80BF57D8 */ void initBaseMtx();
1718
/* 80BF5814 */ void setBaseMtx();
18-
/* 80BF5878 */ void Create();
19-
/* 80BF5950 */ void CreateHeap();
20-
/* 80BF5AB4 */ void create1st();
21-
/* 80BF5B74 */ void Execute(f32 (**)[3][4]);
22-
/* 80BF5C0C */ void Draw();
23-
/* 80BF6004 */ void Delete();
19+
/* 80BF5878 */ int Create();
20+
/* 80BF5950 */ int CreateHeap();
21+
/* 80BF5AB4 */ int create1st();
22+
/* 80BF5B74 */ int Execute(f32 (**)[3][4]);
23+
/* 80BF5C0C */ int Draw();
24+
/* 80BF6004 */ int Delete();
25+
26+
u32 getEventBit1() { return fopAcM_GetParamBit(this, 0, 10); }
2427

2528
private:
26-
/* 0x568 */ u8 field_0x568[0x5c0 - 0x568];
29+
/* 0x5A0 */ request_of_phase_process_class mPhaseReq;
30+
/* 0x5A8 */ J3DModel* mpModel;
31+
/* 0x5AC */ mDoExt_btkAnm* mpBtkAnm;
32+
/* 0x5B0 */ u16 mMatIdx;
33+
/* 0x5B2 */ cXyz mSePos;
2734
};
2835

2936
STATIC_ASSERT(sizeof(daObjGWall2_c) == 0x5c0);

src/d/actor/d_a_obj_ganonwall.cpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ int daObjGWall_c::Create() {
6565
fopAcM_setCullSizeBox2(this, mpModel->getModelData());
6666
cullSizeFar = 1000000.f;
6767
mMatIdx = 0xffff;
68-
JUTNameTab* name_table = mpModel->mModelData->getMaterialTable().getMaterialName();
69-
for (u16 i = 0; i < mpModel->mModelData->getMaterialTable().getMaterialNum(); i++) {
68+
JUTNameTab* name_table = mpModel->getModelData()->getMaterialTable().getMaterialName();
69+
for (u16 i = 0; i < mpModel->getModelData()->getMaterialTable().getMaterialNum(); i++) {
7070
if (strcmp(name_table->getName(i), l_matName) == 0) {
7171
mMatIdx = i;
7272
}
@@ -85,7 +85,7 @@ int daObjGWall_c::CreateHeap() {
8585
J3DAnmTextureSRTKey* btk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 7);
8686
mpBtkAnm = new mDoExt_btkAnm();
8787
if (mpBtkAnm == NULL ||
88-
mpBtkAnm->init(&model_data->getMaterialTable(), btk, 1, 2, 1.0, 0, -1) == 0)
88+
mpBtkAnm->init(model_data, btk, 1, 2, 1.0, 0, -1) == 0)
8989
{
9090
return 0;
9191
}
@@ -130,30 +130,27 @@ int daObjGWall_c::draw() {
130130
}
131131

132132
g_env_light.settingTevStruct(0, &current.pos, &tevStr);
133-
g_env_light.setLightTevColorType_MAJI(mpModel->mModelData, &tevStr);
133+
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
134134
mpBtkAnm->entry(mpModel->getModelData());
135135

136-
J3DModelData* model_data;
137-
for (u16 i = 0;
138-
model_data = mpModel->getModelData(), i < model_data->getMaterialTable().getMaterialNum();
139-
i++)
140-
{
141-
J3DMaterial* mat = model_data->getMaterialTable().getMaterialNodePointer(i);
136+
for (u16 i = 0; i < mpModel->getModelData()->getMaterialTable().getMaterialNum(); i++) {
137+
J3DMaterial* mat = mpModel->getModelData()->getMaterialTable().getMaterialNodePointer(i);
142138
J3DFog* fog = mat->getPEBlock()->getFog();
143139
if (fog != NULL) {
144140
fog = mat->getPEBlock()->getFog();
145-
fog->getFogInfo()->mColor.r = '\0';
146-
fog->getFogInfo()->mColor.g = '\0';
147-
fog->getFogInfo()->mColor.b = '\0';
148-
fog->getFogInfo()->mStartZ = 1000.0f;
149-
fog->getFogInfo()->mEndZ = 250000.0f;
141+
J3DFogInfo* fog_info = fog->getFogInfo();
142+
fog_info->mColor.r = 0;
143+
fog_info->mColor.g = 0;
144+
fog_info->mColor.b = 0;
145+
fog_info->mStartZ = 1000.0f;
146+
fog_info->mEndZ = 250000.0f;
150147
}
151148
}
152149

153150
int hour = dKy_getdaytime_hour();
154151
float minute = dKy_getdaytime_minute();
155152
J3DGXColor* mat_tev_k_color =
156-
mpModel->mModelData->getMaterialTable().getMaterialNodePointer(mMatIdx)->getTevKColor(1);
153+
mpModel->getModelData()->getMaterialTable().getMaterialNodePointer(mMatIdx)->getTevKColor(1);
157154
int idx1 = l_idx[hour][0];
158155
int idx2 = l_idx[hour][1];
159156
mat_tev_k_color->r = (l_color[idx1].r +
@@ -204,8 +201,10 @@ static int daObjGWall_Create(daObjGWall_c* i_this) {
204201

205202
/* 80BF56EC-80BF570C -00001 0020+00 1/0 0/0 0/0 .data l_daObjGWall_Method */
206203
static actor_method_class l_daObjGWall_Method = {
207-
(process_method_func)daObjGWall_Create, (process_method_func)daObjGWall_Delete,
208-
(process_method_func)daObjGWall_Execute, 0,
204+
(process_method_func)daObjGWall_Create,
205+
(process_method_func)daObjGWall_Delete,
206+
(process_method_func)daObjGWall_Execute,
207+
0,
209208
(process_method_func)daObjGWall_Draw,
210209
};
211210

0 commit comments

Comments
 (0)