1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
/**
* @file d_a_obj_burnbox.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_obj_burnbox.h"
#include "d/d_com_inf_game.h"
void daObjBurnBox_c::initBaseMtx() {
mpBoxModel->setBaseScale(scale);
setBaseMtx();
}
void daObjBurnBox_c::setBaseMtx() {
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::YrotM(shape_angle.y);
mpBoxModel->setBaseTRMtx(mDoMtx_stack_c::get());
MTXCopy(mDoMtx_stack_c::get(), mBgMtx);
}
const u32 l_bmd[3] = {
0x04,
0x04,
0x03,
};
const u32 l_heap_size[3] = {
0x0820,
0x0C00,
0x0820,
};
const dCcD_SrcCyl l_cyl_src = {
{
{0x0, {{0x0, 0x0, 0x1e}, {0x0, 0x1e}, 0x79}}, // mObj
{dCcD_SE_NONE, 0x1, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x6}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{
{0.0f, 0.0f, 0.0f}, // mCenter
40.0f, // mRadius
100.0f // mHeight
} // mCyl
}
};
int daObjBurnBox_c::Create() {
static const u16 particle_id[5] = {
0x8526, 0x8527, 0x8528, 0x8529, 0x8746,
};
initBaseMtx();
fopAcM_SetMtx(this, mpBoxModel->getBaseTRMtx());
mStts.Init(0xff, 0xff, this);
mCyl.Set(l_cyl_src);
mCyl.SetStts(&mStts);
fopAcM_setCullSizeBox2(this, mpBoxModel->getModelData());
cXyz particlePos = current.pos;
cXyz particleScale = scale;
int type = getType();
switch (type) {
case 0:
case 2:
particlePos.y += 37.5f;
particleScale.setall(0.5f);
break;
case 1:
particlePos.y += 75.0f;
break;
}
for (int index = 0; index < 5; index++) {
mpEmitters[index] = dComIfGp_particle_set(particle_id[index], &particlePos, NULL, &particleScale, 0xff,
NULL, -1, NULL, NULL, NULL);
}
return 1;
}
const char* l_arcName[3] = {
"Kkiba_00", // crate
"Kkiba_00",
"J_taru00", // barrel
};
int daObjBurnBox_c::CreateHeap() {
u8 type = getType();
J3DModelData* modelData = (J3DModelData*) dComIfG_getObjectRes(l_arcName[type], l_bmd[type]);
JUT_ASSERT(0x106, modelData != NULL);
mpBoxModel = mDoExt_J3DModel__create(modelData, J3DMdlFlag_DifferedDLBuffer, 0x11000084);
if (mpBoxModel == NULL) {
return 0;
}
return 1;
}
cPhs_Step daObjBurnBox_c::create1st() {
cPhs_Step phaseStep = dComIfG_resLoad(&mPhaseReq, l_arcName[getType()]);
if (phaseStep == cPhs_COMPLEATE_e) {
int dzb_id = -1;
u8 type = getType();
switch (type) {
case 1:
dzb_id = 7;
}
phaseStep = MoveBGCreate(l_arcName[type], dzb_id, dBgS_MoveBGProc_TypicalRotY,
l_heap_size[type], NULL);
if (phaseStep == cPhs_ERROR_e) {
return phaseStep;
}
}
return phaseStep;
}
int daObjBurnBox_c::Execute(Mtx** mtx) {
field_0x724++;
if (field_0x724 % 3 == 0) {
field_0x728--;
if (field_0x728 == -20) {
fopAcM_delete(this);
}
}
*mtx = &mBgMtx;
setBaseMtx();
switch (getType()) {
case 0:
case 2:
mCyl.SetC(current.pos);
dComIfG_Ccsp()->Set(&mCyl);
}
return 1;
}
int daObjBurnBox_c::Draw() {
g_env_light.settingTevStruct(0x10, ¤t.pos, &tevStr);
g_env_light.setLightTevColorType_MAJI(mpBoxModel, &tevStr);
dComIfGd_setListBG();
J3DModelData* boxModelData = mpBoxModel->getModelData();
for (u16 index = 0; index < boxModelData->getMaterialNum(); index++) {
J3DGXColorS10* tevColor = boxModelData->getMaterialNodePointer(index)->getTevColor(0);
tevColor->r = field_0x728;
tevColor->g = field_0x728;
tevColor->b = field_0x728;
}
mDoExt_modelUpdateDL(mpBoxModel);
for (u16 index = 0; index < boxModelData->getMaterialNum(); index++) {
J3DGXColorS10* tevColor = boxModelData->getMaterialNodePointer(index)->getTevColor(0);
tevColor->r = 0;
tevColor->g = 0;
tevColor->b = 0;
}
dComIfGd_setList();
return 1;
}
int daObjBurnBox_c::Delete() {
dComIfG_resDelete(&mPhaseReq, l_arcName[getType()]);
return 1;
}
int daObjBurnBox_create1st(daObjBurnBox_c* i_this) {
fopAcM_ct(i_this, daObjBurnBox_c);
return i_this->create1st();
}
int daObjBurnBox_MoveBGDelete(daObjBurnBox_c* i_this) {
return i_this->MoveBGDelete();
}
int daObjBurnBox_MoveBGExecute(daObjBurnBox_c* i_this) {
return i_this->MoveBGExecute();
}
int daObjBurnBox_MoveBGDraw(daObjBurnBox_c* i_this) {
return i_this->MoveBGDraw();
}
actor_method_class daObjBurnBox_METHODS = {
(process_method_func) daObjBurnBox_create1st, (process_method_func)daObjBurnBox_MoveBGDelete,
(process_method_func) daObjBurnBox_MoveBGExecute, NULL,
(process_method_func) daObjBurnBox_MoveBGDraw,
};
actor_process_profile_definition g_profile_Obj_BurnBox = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 3,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_Obj_BurnBox_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daObjBurnBox_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_Obj_BurnBox_e,
/* Actor SubMtd */ &daObjBurnBox_METHODS,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
};
|