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
|
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_k_wpillar.h"
#include "d/d_com_inf_game.h"
#include "f_pc/f_pc_name.h"
#include "f_op/f_op_actor_mng.h"
static const char l_arcName[] = "Always";
int dkWpillar_c::create() {
new (this) dkWpillar_c();
int roomNo;
u8 envrOverride;
if (fopAcM_gc_c::gndCheck(&pos)) {
roomNo = fopAcM_gc_c::getRoomId();
envrOverride = fopAcM_gc_c::getPolyColor();
} else {
roomNo = dComIfGp_roomControl_getStayNo();
envrOverride = 0xFF;
}
dKy_tevstr_init(&mTevstr, roomNo, envrOverride);
g_env_light.settingTevStruct(0x10, &pos, &mTevstr);
dComIfGp_particle_set(0x1BD, &pos, &mTevstr, NULL, &scale, 255, NULL, roomNo, NULL, NULL,
NULL);
if ((int)parameters != 3) {
dComIfGp_particle_set(0x1BE, &pos, &mTevstr, NULL, &scale, 255, NULL, roomNo, NULL, NULL,
NULL);
}
if ((int)parameters == 1) {
return cPhs_ERROR_e;
}
BOOL var_r30;
mpHeap = mDoExt_createSolidHeapFromGameToCurrent(0x2200, 0x20);
if (mpHeap != NULL) {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 0x1C);
JUT_ASSERT(96, modelData);
mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000284);
J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 0xB);
JUT_ASSERT(106, bckAnm);
var_r30 = mBck.init(bckAnm, TRUE, J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1, false);
J3DAnmTextureSRTKey* btkAnm = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x3B);
var_r30 &= mBtk.init(modelData, btkAnm, FALSE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1);
J3DAnmTevRegKey* brkAnm = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 0x2E);
var_r30 &= mBrk.init(modelData, brkAnm, FALSE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1);
mDoExt_restoreCurrentHeap();
mDoExt_adjustSolidHeap(mpHeap);
} else {
return cPhs_ERROR_e;
}
if (mpModel == NULL || !var_r30) {
return cPhs_ERROR_e;
}
if ((int)parameters == 2) {
scale.set(0.5f, 0.25f, 0.5f);
}
mpModel->setBaseScale(scale);
mDoMtx_stack_c::transS(pos.x, pos.y, pos.z);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
return cPhs_COMPLEATE_e;
}
static int dkWpillar_Create(kankyo_class* i_this) {
return static_cast<dkWpillar_c*>(i_this)->create();
}
dkWpillar_c::~dkWpillar_c() {
if (mpHeap != NULL) {
mDoExt_destroySolidHeap(mpHeap);
}
}
static int dkWpillar_Delete(dkWpillar_c* i_this) {
i_this->~dkWpillar_c();
return 1;
}
int dkWpillar_c::execute() {
mBck.play();
if (mBck.isStop()) {
fopKyM_Delete(this);
} else {
f32 sp8;
if (fopAcM_getWaterY(&pos, &sp8) != 0) {
mpModel->getBaseTRMtx()[1][3] = sp8;
pos.y = sp8;
}
}
return 1;
}
static int dkWpillar_Execute(dkWpillar_c* i_this) {
return i_this->execute();
}
int dkWpillar_c::draw() {
g_env_light.settingTevStruct(0x10, &pos, &mTevstr);
g_env_light.setLightTevColorType_MAJI(mpModel, &mTevstr);
dComIfGd_setListIndScreen();
mBck.entry(mpModel->getModelData());
mBtk.entry(mpModel->getModelData(), mBck.getFrame());
mBrk.entry(mpModel->getModelData(), mBck.getFrame());
mDoExt_modelUpdateDL(mpModel);
dComIfGd_setList();
return 1;
}
static int dkWpillar_Draw(dkWpillar_c* i_this) {
return i_this->draw();
}
static leafdraw_method_class l_dkWpillar_Method = {
(process_method_func)dkWpillar_Create, (process_method_func)dkWpillar_Delete,
(process_method_func)dkWpillar_Execute, (process_method_func)NULL,
(process_method_func)dkWpillar_Draw,
};
kankyo_process_profile_definition g_profile_WPILLAR = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 9,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_WPILLAR_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(dkWpillar_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopKy_Method,
/* Draw Prio */ fpcDwPi_WPILLAR_e,
/* Kankyo SubMtd */ &l_dkWpillar_Method,
};
|