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
|
//
// Generated by dtk
// Translation Unit: d_a_mmusic.cpp
//
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_mmusic.h"
#include "d/d_com_inf_game.h"
#include "d/d_item_data.h"
#include "m_Do/m_Do_mtx.h"
namespace daMmusic {
namespace {
struct Attr_c {
/* 0x00 */ u16 field_0x00;
/* 0x02 */ u16 field_0x02;
/* 0x04 */ u16 field_0x04;
};
static const Attr_c L_attr = {
0, 120, 180,
};
inline const Attr_c & attr() { return L_attr; }
}
}
/* 00000078-0000009C .text solidHeapCB__Q28daMmusic5Act_cFP10fopAc_ac_c */
BOOL daMmusic::Act_c::solidHeapCB(fopAc_ac_c* i_this) {
return ((Act_c*)i_this)->create_heap();
}
/* 0000009C-000000A4 .text create_heap__Q28daMmusic5Act_cFv */
bool daMmusic::Act_c::create_heap() {
return true;
}
/* 000000A4-0000013C .text Macore_is_playing__Q28daMmusic5Act_cFv */
BOOL daMmusic::Act_c::Macore_is_playing() {
if (dComIfGs_isStageBossEnemy(dSv_save_c::STAGE_WT) ||
dComIfGs_isEventBit(dSv_event_flag_c::UNK_2910) ||
dComIfGs_isEventBit(dSv_event_flag_c::UNK_2E02) ||
dComIfGs_isEventBit(dSv_event_flag_c::UNK_1610) ||
!dComIfGs_checkGetItem(dItemNo_MASTER_SWORD_2_e))
return FALSE;
return TRUE;
}
/* 0000013C-000001A4 .text set_mtx__Q28daMmusic5Act_cFv */
void daMmusic::Act_c::set_mtx() {
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::ZXYrotM(shape_angle);
mDoMtx_copy(mDoMtx_stack_c::get(), mMtx);
}
/* 000001A4-00000268 .text _create__Q28daMmusic5Act_cFv */
cPhs_State daMmusic::Act_c::_create() {
fopAcM_ct(this, Act_c);
cPhs_State ret = cPhs_COMPLEATE_e;
if (ret == cPhs_COMPLEATE_e) {
if (fopAcM_entrySolidHeap(this, solidHeapCB, 0)) {
set_mtx();
fopAcM_SetMtx(this, mMtx);
field_0x298 = Macore_is_playing();
fopAcM_setCullSizeSphere(this, 0.0f, 0.0f, 0.0f, 300.0f);
init_se();
} else {
ret = cPhs_ERROR_e;
}
}
return ret;
}
/* 00000268-000002B4 .text _delete__Q28daMmusic5Act_cFv */
bool daMmusic::Act_c::_delete() {
if (mpEmitter != NULL) {
mpEmitter->becomeInvalidEmitter();
mpEmitter = NULL;
}
delete_se();
return true;
}
/* 000002B4-000002C0 .text init_se__Q28daMmusic5Act_cFv */
void daMmusic::Act_c::init_se() {
mTimer = 120;
}
/* 000002C0-000003D0 .text manage_se__Q28daMmusic5Act_cFi */
void daMmusic::Act_c::manage_se(int cull) {
if (!mDoAud_checkCbPracticePlay()) {
if (mTimer > 0)
mTimer--;
if (mTimer == 0) {
mDoAud_cbPracticePlay(¤t.pos);
mTimer = cM_rndF(1.0f) * 60.0f + 120.0f;
} else if (cull == 0 && field_0x29c == 1) {
mpEmitter->stopCreateParticle();
field_0x29c = 0;
}
} else {
if (cull == 0 && field_0x29c == 0) {
mpEmitter->playCreateParticle();
field_0x29c = 1;
}
}
}
/* 000003D0-000003FC .text delete_se__Q28daMmusic5Act_cFv */
void daMmusic::Act_c::delete_se() {
mDoAud_cbPracticeStop();
}
/* 000003FC-00000554 .text _execute__Q28daMmusic5Act_cFv */
bool daMmusic::Act_c::_execute() {
if (mpEmitter == NULL && field_0x298 == 1) {
set_mtx();
cXyz scale(1.0f, 1.0f, 1.0f);
JPABaseEmitter* emtr = dComIfGp_particle_set(dPa_name::ID_AK_SN_MACOREMUSIC00, ¤t.pos);
mpEmitter = emtr;
if (emtr != NULL) {
mpEmitter->setGlobalRTMatrix(mMtx);
field_0x298 = 0;
field_0x29c = 1;
}
} else if (mpEmitter != NULL) {
int cull = fopAcM_cullingCheck(this);
if (cull == 1) {
if (field_0x29c == 1) {
mpEmitter->stopCreateParticle();
field_0x29c = 0;
}
} else {
if (field_0x29c == 0) {
mpEmitter->playCreateParticle();
field_0x29c = 1;
}
}
manage_se(cull);
} else {
field_0x298 = Macore_is_playing();
}
return TRUE;
}
/* 00000554-0000055C .text _draw__Q28daMmusic5Act_cFv */
bool daMmusic::Act_c::_draw() {
return true;
}
namespace daMmusic {
namespace {
cPhs_State Mthd_Create(void* i_this) {
return ((Act_c*)i_this)->_create();
}
BOOL Mthd_Delete(void* i_this) {
return ((Act_c*)i_this)->_delete();
}
BOOL Mthd_Execute(void* i_this) {
return ((Act_c*)i_this)->_execute();
}
BOOL Mthd_Draw(void* i_this) {
return ((Act_c*)i_this)->_draw();
}
BOOL Mthd_IsDelete(void* i_this) {
return TRUE;
}
static actor_method_class Mthd_Table = {
(process_method_func)Mthd_Create,
(process_method_func)Mthd_Delete,
(process_method_func)Mthd_Execute,
(process_method_func)Mthd_IsDelete,
(process_method_func)Mthd_Draw,
};
}
}
actor_process_profile_definition g_profile_Mmusic = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 0x0007,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_Mmusic_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(daMmusic::Act_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_Mmusic_e,
/* Actor SubMtd */ &daMmusic::Mthd_Table,
/* Status */ fopAcStts_UNK40000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLSPHERE_CUSTOM_e,
};
|