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
|
/**
* d_a_vrbox.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_vrbox.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "f_op/f_op_actor_mng.h"
static int daVrbox_color_set(vrbox_class* i_this);
static int daVrbox_Draw(vrbox_class* i_this) {
J3DModel* soraModel_p = i_this->mpSoraModel;
f32 fvar = 0.0f;
dStage_FileList_dt_c* filelist_p = NULL;
daVrbox_color_set(i_this);
if (g_env_light.hide_vrbox) {
return 1;
}
if (dComIfGp_roomControl_getStayNo() >= 0) {
s32 stayNo = dComIfGp_roomControl_getStayNo();
filelist_p = dComIfGp_roomControl_getStatusRoomDt(stayNo)->getFileListInfo();
}
if (filelist_p != NULL) {
fvar = dStage_FileList_dt_SeaLevel(filelist_p);
}
if (dComIfGd_getView() != NULL) {
fvar = (dComIfGd_getInvViewMtx()[1][3] - fvar) * 0.09f;
} else {
fvar = 0.0f;
}
mDoMtx_stack_c::transS(dComIfGd_getInvViewMtx()[0][3], dComIfGd_getInvViewMtx()[1][3] - fvar,
dComIfGd_getInvViewMtx()[2][3]);
soraModel_p->setBaseTRMtx(mDoMtx_stack_c::get());
dKy_GxFog_set();
// these casts look like fake matches, but this ptr is used as both J3DModel and J3DModelData?
for (int i = ((J3DModelData*)soraModel_p)->getMaterialNum() - 1; i >= 0; i--) {
J3DMaterial* material_p = ((J3DModelData*)soraModel_p)->getMaterialNodePointer(i);
J3DFogInfo* fogInfo_p;
if (material_p != NULL) {
fogInfo_p = material_p->getFog()->getFogInfo();
}
fogInfo_p->mType = 2;
}
dComIfGd_setListSky();
mDoExt_modelUpdateDL(soraModel_p);
dComIfGd_setList();
return 1;
}
static int daVrbox_color_set(vrbox_class* i_this) {
if ((g_env_light.vrbox_kasumi_outer_col.r + g_env_light.vrbox_kasumi_outer_col.g +
g_env_light.vrbox_kasumi_outer_col.b + g_env_light.vrbox_sky_col.r + g_env_light.vrbox_sky_col.g +
g_env_light.vrbox_sky_col.b + g_env_light.vrbox_kumo_top_col.r + g_env_light.vrbox_kumo_top_col.g +
g_env_light.vrbox_kumo_top_col.b) == 0)
{
g_env_light.hide_vrbox = true;
return 1;
}
g_env_light.hide_vrbox = false;
J3DModelData* modelData = i_this->mpSoraModel->getModelData();
J3DGXColorS10 color;
J3DMaterial* material_0 = modelData->getMaterialNodePointer(0);
if (material_0 != NULL) {
material_0->setCullMode(0);
material_0->change();
color.r = g_env_light.vrbox_sky_col.r;
color.g = g_env_light.vrbox_sky_col.g;
color.b = g_env_light.vrbox_sky_col.b;
color.a = 255;
material_0->setTevColor(0, &color);
}
J3DMaterial* material_1 = modelData->getMaterialNodePointer(1);
if (material_1 != NULL) {
material_1->setCullMode(0);
material_1->change();
color.r = g_env_light.vrbox_kasumi_inner_col.r;
color.g = g_env_light.vrbox_kasumi_inner_col.g;
color.b = g_env_light.vrbox_kasumi_inner_col.b;
color.a = g_env_light.vrbox_kasumi_inner_col.a;
material_1->setTevColor(0, &color);
}
return 1;
}
static int daVrbox_Execute(vrbox_class* i_this) {
return 1;
}
static int daVrbox_IsDelete(vrbox_class* i_this) {
return 1;
}
static int daVrbox_Delete(vrbox_class* i_this) {
return 1;
}
static int daVrbox_solidHeapCB(fopAc_ac_c* i_this) {
vrbox_class* this_ = (vrbox_class*)i_this;
J3DModelData* modelData = (J3DModelData*)dComIfG_getStageRes("vrbox_sora.bmd");
this_->mpSoraModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11020202);
return modelData != NULL && this_->mpSoraModel != NULL;
}
static int daVrbox_Create(fopAc_ac_c* i_this) {
fopAcM_ct(i_this, vrbox_class);
vrbox_class* this_ = (vrbox_class*)i_this;
this_->field_0x574 = 0;
int phase = cPhs_COMPLEATE_e;
if (fopAcM_entrySolidHeap(this_, daVrbox_solidHeapCB, 0xC60)) {
dComIfGp_onStatus(1);
g_env_light.hide_vrbox = false;
} else {
phase = cPhs_ERROR_e;
}
return phase;
}
static actor_method_class l_daVrbox_Method = {
(process_method_func)daVrbox_Create, (process_method_func)daVrbox_Delete,
(process_method_func)daVrbox_Execute, (process_method_func)daVrbox_IsDelete,
(process_method_func)daVrbox_Draw,
};
actor_process_profile_definition g_profile_VRBOX = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 7,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_VRBOX_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(vrbox_class),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Draw Prio */ fpcDwPi_VRBOX_e,
/* Actor SubMtd */ &l_daVrbox_Method,
/* Status */ fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e,
/* Group */ fopAc_ACTOR_e,
/* Cull Type */ fopAc_CULLBOX_0_e,
};
|