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
|
/**
* @file d_a_obj_roten.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_obj_roten.h"
#include "SSystem/SComponent/c_math.h"
#include "d/d_com_inf_game.h"
void daObj_Roten_c::initBaseMtx() {
mModel->setBaseScale(scale);
setBaseMtx();
}
void daObj_Roten_c::setBaseMtx() {
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
mModel->setBaseTRMtx(mDoMtx_stack_c::get());
mDoMtx_stack_c::scaleM(scale.x, scale.y, scale.z);
MTXCopy(mDoMtx_stack_c::get(), mBgMtx);
}
int daObj_Roten_c::Create() {
initBaseMtx();
fopAcM_SetMtx(this, mModel->getBaseTRMtx());
cXyz minCull;
cXyz maxCull;
J3DJoint* pJoint = mModel->getModelData()->getJointNodePointer(0);
minCull.x = scale.x * pJoint->getMin()->x;
minCull.y = scale.y * pJoint->getMin()->y;
minCull.z = scale.z * pJoint->getMin()->z;
maxCull.x = scale.x * pJoint->getMax()->x;
maxCull.y = scale.y * pJoint->getMax()->y;
maxCull.z = scale.z * pJoint->getMax()->z;
fopAcM_setCullSizeBox(this, minCull.x, minCull.y, minCull.z, maxCull.x, maxCull.y,
maxCull.z);
fopAcM_setCullSizeFar(this, 10.0f);
for (int i = 0; i < 2; i++) {
mEmitters[i] = 0;
}
if (dComIfGs_getTime() >= 90.0f && dComIfGs_getTime() < 270.0f) {
mWithinTime = false;
} else {
mWithinTime = true;
}
mBossLightRefDist = 0.0f;
cXyz local_64(-80.0f, 177.0f, 110.0f);
cXyz local_70;
f32 dVar8 = cM_ssin(-shape_angle.y);
f32 dVar9 = cM_scos(-shape_angle.y);
local_70.x = (local_64.x * dVar9) - (local_64.z * dVar8);
local_70.y = local_64.y;
local_70.z = (local_64.x * dVar8) + (local_64.z * dVar9);
mParticlePos.set(current.pos.x + local_70.x, current.pos.y + (f32)(double)local_64.y,
current.pos.z + local_70.z);
if (mWithinTime) {
cXyz cStack_7c(cXyz(0.4f, 0.4f, 0.4f));
cXyz cStack_88(cXyz(0.25f, 0.25f, 0.25f));
if (mEmitters[0] == NULL) {
mEmitters[0] = dComIfGp_particle_set(0x3ad, &mParticlePos, ¤t.angle, &cStack_7c);
}
if (mEmitters[1] == NULL) {
mEmitters[1] = dComIfGp_particle_set(0x3af, &mParticlePos, ¤t.angle, &cStack_88);
}
}
return 1;
}
static char* l_resFileName = "Obj_roten";
static u32 l_bmdFileIdx = 4;
int daObj_Roten_c::CreateHeap() {
J3DModelData* mdlData_p = (J3DModelData*)dComIfG_getObjectRes(getResName(), l_bmdFileIdx);
JUT_ASSERT(156, mdlData_p != NULL);
mModel = mDoExt_J3DModel__create(mdlData_p, 0x80000, 0x11000084);
return mModel != NULL;
}
static u32 l_dzbFileIdx = 7;
int daObj_Roten_c::create() {
fopAcM_ct(this, daObj_Roten_c);
/* dSv_event_flag_c::M_031 - Goron Mines - Goron Mines clear */
if (!dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x40])) {
return cPhs_ERROR_e;
}
int rv = dComIfG_resLoad(&mPhase, getResName());
if (rv == cPhs_COMPLEATE_e) {
if (MoveBGCreate(getResName(), l_dzbFileIdx, dBgS_MoveBGProc_TypicalRotY, 0x1430, NULL) ==
cPhs_ERROR_e)
{
return cPhs_ERROR_e;
}
MoveBGExecute();
}
return rv;
}
int daObj_Roten_c::Execute(Mtx** ppMtx) {
if (mWithinTime) {
if (dComIfGp_roomControl_getStayNo() != 0) {
mDoAud_seStartLevel(Z2SE_OBJ_MYNA_LIGHT_BURNING, &mParticlePos, 0, dComIfGp_getReverb(dComIfGp_roomControl_getStayNo()));
} else {
mDoAud_seStartLevel(Z2SE_OBJ_MYNA_LIGHT_BURNING, &mParticlePos, 0, 0);
}
}
*ppMtx = &mBgMtx;
setBaseMtx();
return 1;
}
int daObj_Roten_c::Draw() {
if (mWithinTime) {
cLib_addCalc(&mBossLightRefDist, 1.0f, 0.5f, 0.1f, 0.0001f);
} else {
cLib_addCalc(&mBossLightRefDist, 0, 0.5f, 0.1f, 0.0001f);
}
if (mBossLightRefDist >= 1e-6f) {
GXColor bossLightColor = {0xbc, 0x66, 0x42, 0xff};
dKy_BossLight_set(&mParticlePos, &bossLightColor, mBossLightRefDist, 0);
}
g_env_light.settingTevStruct(0x10, ¤t.pos, &tevStr);
g_env_light.setLightTevColorType_MAJI(mModel, &tevStr);
dComIfGd_setListBG();
mDoExt_modelUpdateDL(mModel);
dComIfGd_setList();
return 1;
}
int daObj_Roten_c::Delete() {
for (int i = 0; i < 2; i = i + 1) {
if (mEmitters[i] != NULL) {
mEmitters[i]->quitImmortalEmitter();
mEmitters[i]->becomeInvalidEmitter();
mEmitters[i] = NULL;
}
}
dComIfG_resDelete(&mPhase, getResName());
return 1;
}
char* daObj_Roten_c::getResName() {
return l_resFileName;
}
static int daObj_Roten_Create(void* i_this) {
return static_cast<daObj_Roten_c*>(i_this)->create();
}
static int daObj_Roten_Delete(void* i_this) {
return static_cast<daObj_Roten_c*>(i_this)->MoveBGDelete();
}
static int daObj_Roten_Execute(void* i_this) {
return static_cast<daObj_Roten_c*>(i_this)->MoveBGExecute();
}
static int daObj_Roten_Draw(void* i_this) {
return static_cast<daObj_Roten_c*>(i_this)->Draw();
}
static int daObj_Roten_IsDelete(void* i_this) {
return 1;
}
daObj_Roten_c::~daObj_Roten_c() {
}
static actor_method_class daObj_Roten_MethodTable = {
(process_method_func)daObj_Roten_Create,
(process_method_func)daObj_Roten_Delete,
(process_method_func)daObj_Roten_Execute,
(process_method_func)daObj_Roten_IsDelete,
(process_method_func)daObj_Roten_Draw,
};
actor_process_profile_definition g_profile_OBJ_ROTEN = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 7,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_OBJ_ROTEN_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daObj_Roten_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_OBJ_ROTEN_e,
/* Actor SubMtd */ &daObj_Roten_MethodTable,
/* Status */ fopAcStts_UNK_0x40000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_CUSTOM_e,
};
|