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
|
/**
* @file d_a_obj_fmobj.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_obj_fmobj.h"
#include "d/d_bg_w.h"
#include "d/d_com_inf_game.h"
#include "f_pc/f_pc_name.h"
#include "d/d_s_play.h"
#include "SSystem/SComponent/c_math.h"
#include "f_op/f_op_actor_mng.h"
static int daObj_Fmobj_Draw(obj_fmobj_class* i_this) {
fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->mActor;
J3DModel* model_p = i_this->mpModel;
g_env_light.settingTevStruct(0x40, &a_this->current.pos, &i_this->mActor.tevStr);
g_env_light.setLightTevColorType_MAJI(model_p, &a_this->tevStr);
mDoExt_modelUpdateDL(model_p);
return 1;
}
static int daObj_Fmobj_Execute(obj_fmobj_class* i_this) {
fopAc_ac_c* actor = &i_this->mActor;
i_this->field_0x578++;
for (int i = 0; i < 2; i++) {
if (i_this->field_0x57e[i] != 0) {
i_this->field_0x57e[i]--;
}
}
return 1;
}
static int daObj_Fmobj_IsDelete(obj_fmobj_class* i_this) {
return 1;
}
static int daObj_Fmobj_Delete(obj_fmobj_class* i_this) {
fopAc_ac_c* actor = &i_this->mActor;
fopAcM_RegisterDeleteID(i_this, "Obj_Fmobj");
dComIfG_resDelete(&i_this->mPhase, "Obj_Fmobj");
dComIfG_Bgsp().Release(i_this->mpBgW);
return 1;
}
static int useHeapInit(fopAc_ac_c* i_this) {
obj_fmobj_class* a_this = (obj_fmobj_class*)i_this;
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Obj_Fmobj", 4);
JUT_ASSERT(213, modelData != NULL);
a_this->mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
if (a_this->mpModel == NULL) {
return 0;
}
a_this->mpBgW = new dBgW();
if (a_this->mpBgW == NULL) {
return 0;
}
if (a_this->mpBgW->Set((cBgD_t*)dComIfG_getObjectRes("Obj_Fmobj", 7), cBgW::MOVE_BG_e, &a_this->mBgMtx) == 1) {
return 0;
}
a_this->mpBgW->SetCrrFunc(dBgS_MoveBGProc_Typical);
return 1;
}
static int daObj_Fmobj_Create(fopAc_ac_c* i_this) {
obj_fmobj_class* a_this = (obj_fmobj_class*)i_this;
fopAcM_ct(&a_this->mActor, obj_fmobj_class);
int phase;
phase = dComIfG_resLoad(&a_this->mPhase, "Obj_Fmobj");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("OBJ_FMOBJ PARAM %x\n", fopAcM_GetParam(i_this));
a_this->field_0x570 = fopAcM_GetParam(i_this) & 0xFF;
if (dComIfGs_isStageBossEnemy()) {
return cPhs_ERROR_e;
}
OS_REPORT("OBJ_FMOBJ//////////////OBJ_FMOBJ SET 1 !!\n");
if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x4B000)) {
OS_REPORT("//////////////OBJ_FMOBJ SET NON !!\n");
return cPhs_ERROR_e;
}
OS_REPORT("//////////////OBJ_FMOBJ SET 2 !!\n");
if (dComIfG_Bgsp().Regist(a_this->mpBgW, &a_this->mActor)) {
return cPhs_ERROR_e;
}
fopAcM_SetMtx(i_this, a_this->mpModel->getBaseTRMtx());
i_this->shape_angle.y = cM_rndF(65536.0f);
mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z);
mDoMtx_stack_c::YrotM((s16)i_this->shape_angle.y);
a_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
mDoMtx_stack_c::transM(0.0f, YREG_F(9) + -30.0f, 0.0f);
MTXCopy(mDoMtx_stack_c::get(), a_this->mBgMtx);
a_this->mpBgW->Move();
}
return phase;
}
static actor_method_class l_daObj_Fmobj_Method = {
(process_method_func)daObj_Fmobj_Create, (process_method_func)daObj_Fmobj_Delete,
(process_method_func)daObj_Fmobj_Execute, (process_method_func)daObj_Fmobj_IsDelete,
(process_method_func)daObj_Fmobj_Draw,
};
actor_process_profile_definition g_profile_OBJ_FMOBJ = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 3,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_OBJ_FMOBJ_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(obj_fmobj_class),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_OBJ_FMOBJ_e,
/* Actor SubMtd */ &l_daObj_Fmobj_Method,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_CULL_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_7_e,
};
|