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
|
/**
* d_a_e_bi_leaf.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_e_bi_leaf.h"
#include "d/d_com_inf_game.h"
static int daE_BI_LEAF_Draw(e_bi_leaf_class* i_this) {
if (i_this->type == 1) {
return 1;
}
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
g_env_light.setLightTevColorType_MAJI(i_this->model, &i_this->tevStr);
mDoExt_modelUpdateDL(i_this->model);
return 1;
}
static void action(e_bi_leaf_class* i_this) {
switch (i_this->action) {
case 0:
if (i_this->timer == 0) {
fopAc_ac_c* parent_p = fopAcM_SearchByID(i_this->parentActorID);
if (parent_p == NULL) {
OS_REPORT("//////////////LEAF ID 2 %d\n", i_this->parentActorID);
if (fopAcM_GetRoomNo(i_this) == 50) {
i_this->timer = 90;
} else {
i_this->timer = 60;
}
i_this->action = 1;
}
}
break;
case 1:
if (i_this->timer == 0) {
i_this->action = 0;
i_this->parentActorID =
fopAcM_createChild(fpcNm_E_BI_e, fopAcM_GetID(i_this), (i_this->type << 8) | 1,
&i_this->current.pos, fopAcM_GetRoomNo(i_this),
&i_this->current.angle, NULL, -1, NULL);
i_this->timer = 20;
}
break;
}
}
static int daE_BI_LEAF_Execute(e_bi_leaf_class* i_this) {
if (i_this->timer != 0) {
i_this->timer--;
}
action(i_this);
if (i_this->type == 1) {
return 1;
}
mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z);
mDoMtx_stack_c::YrotM(i_this->shape_angle.y);
i_this->model->setBaseTRMtx(mDoMtx_stack_c::get());
return 1;
}
static int daE_BI_LEAF_IsDelete(e_bi_leaf_class* i_this) {
return 1;
}
static int daE_BI_LEAF_Delete(e_bi_leaf_class* i_this) {
dComIfG_resDelete(&i_this->phase, "E_BI");
return 1;
}
static int useHeapInit(fopAc_ac_c* actor) {
e_bi_leaf_class* i_this = static_cast<e_bi_leaf_class*>(actor);
if (i_this->type != 1) {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_BI", 15);
JUT_ASSERT(0, modelData != NULL);
i_this->model = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
if (i_this->model == NULL) {
return 0;
}
}
return 1;
}
static int daE_BI_LEAF_Create(fopAc_ac_c* actor) {
e_bi_leaf_class* i_this = static_cast<e_bi_leaf_class*>(actor);
fopAcM_ct(i_this, e_bi_leaf_class);
int phase_state = dComIfG_resLoad(&i_this->phase, "E_BI");
if (phase_state == cPhs_COMPLEATE_e) {
i_this->type = fopAcM_GetParam(i_this) & 0xFF;
OS_REPORT("E_BI_LEAF//////////////E_BI_LEAF SET 1 !!\n");
if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0xA00)) {
OS_REPORT("//////////////E_BI_LEAF SET NON !!\n");
return cPhs_ERROR_e;
}
OS_REPORT("//////////////E_BI_LEAF SET 2 !!\n");
fopAcM_SetMtx(i_this, i_this->model->getBaseTRMtx());
daE_BI_LEAF_Execute(i_this);
}
return phase_state;
}
static actor_method_class l_daE_BI_LEAF_Method = {
(process_method_func)daE_BI_LEAF_Create, (process_method_func)daE_BI_LEAF_Delete,
(process_method_func)daE_BI_LEAF_Execute, (process_method_func)daE_BI_LEAF_IsDelete,
(process_method_func)daE_BI_LEAF_Draw,
};
actor_process_profile_definition g_profile_E_BI_LEAF = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 9,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_E_BI_LEAF_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(e_bi_leaf_class),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_E_BI_LEAF_e,
/* Actor SubMtd */ &l_daE_BI_LEAF_Method,
/* Status */ fopAcStts_UNK_0x40000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_0_e,
};
|