mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-03 08:23:08 -04:00
+22
-95
@@ -1,142 +1,70 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: d/d_envse
|
||||
//
|
||||
/**
|
||||
* d_envse.cpp
|
||||
* Environment Sound Effects handler
|
||||
*/
|
||||
|
||||
#include "d/d_envse.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/d_path.h"
|
||||
#include "dol2asm.h"
|
||||
#include "string.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" static bool dEnvSe_Draw__FP8dEnvSe_c();
|
||||
extern "C" static void dEnvSe_getNearPathPos__FP4cXyzP4cXyzP5dPath();
|
||||
extern "C" void execute_common__8dEnvSe_cFP18dStage_SoundInfo_cPScUc();
|
||||
extern "C" void execute__8dEnvSe_cFv();
|
||||
extern "C" static void dEnvSe_Execute__FP8dEnvSe_c();
|
||||
extern "C" static bool dEnvSe_IsDelete__FP8dEnvSe_c();
|
||||
extern "C" static bool dEnvSe_Delete__FP8dEnvSe_c();
|
||||
extern "C" static void dEnvSe_Create__FP8dEnvSe_c();
|
||||
extern "C" extern char const* const d_d_envse__stringBase0;
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void getStatusRoomDt__20dStage_roomControl_cFi();
|
||||
extern "C" void dComIfGp_getReverb__Fi();
|
||||
extern "C" void dPath_GetRoomPath__Fii();
|
||||
extern "C" void dPath_GetNextRoomPath__FPC5dPathi();
|
||||
extern "C" void Eye__9dCamera_cFv();
|
||||
extern "C" void cM3d_Len3dSqPntAndSegLine__FPC8cM3dGLinPC3VecP3VecPf();
|
||||
extern "C" void SetStartEnd__8cM3dGLinFRC3VecRC3Vec();
|
||||
extern "C" void initStaticEnvSe__10Z2EnvSeMgrFUcUcUcUcP3Vec();
|
||||
extern "C" void startStaticEnvSe__10Z2EnvSeMgrFSc();
|
||||
extern "C" void registWindowPos__10Z2EnvSeMgrFP3Vec();
|
||||
extern "C" void initRiverSe__10Z2EnvSeMgrFUcUcUcUc();
|
||||
extern "C" void registRiverSePos__10Z2EnvSeMgrFP3Vec();
|
||||
extern "C" void startRiverSe__10Z2EnvSeMgrFSc();
|
||||
extern "C" void initFallSe__10Z2EnvSeMgrFUcUcUcUc();
|
||||
extern "C" void registFallSePos__10Z2EnvSeMgrFP3Vec();
|
||||
extern "C" void startFallSe__10Z2EnvSeMgrFSc();
|
||||
extern "C" void initEtcSe__10Z2EnvSeMgrFUcUcUcUc();
|
||||
extern "C" void registEtcSePos__10Z2EnvSeMgrFP3Vec();
|
||||
extern "C" void startEtcSe__10Z2EnvSeMgrFSc();
|
||||
extern "C" void initLv3WaterSe__10Z2EnvSeMgrFUcUcUcUc();
|
||||
extern "C" void registLv3WaterSePos__10Z2EnvSeMgrFUcP3Vec();
|
||||
extern "C" void startLv3WaterSe__10Z2EnvSeMgrFSc();
|
||||
extern "C" void _savegpr_22();
|
||||
extern "C" void _savegpr_26();
|
||||
extern "C" void _savegpr_28();
|
||||
extern "C" void _restgpr_22();
|
||||
extern "C" void _restgpr_26();
|
||||
extern "C" void _restgpr_28();
|
||||
extern "C" extern void* __vt__8cM3dGLin[3];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 80182DD4-80182DDC 17D714 0008+00 1/0 0/0 0/0 .text dEnvSe_Draw__FP8dEnvSe_c */
|
||||
static int dEnvSe_Draw(dEnvSe_c* i_this) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80456B80-80456B84 000020 0004+00 1/1 0/0 0/0 .sbss2 @3752 */
|
||||
SECTION_SBSS2 static u8 lit_3752[4];
|
||||
|
||||
/* 80456B84-80456B88 000024 0004+00 1/1 0/0 0/0 .sbss2 None */
|
||||
SECTION_SBSS2 static u8 data_80456B84[4];
|
||||
|
||||
/* 80182DDC-80182FD8 17D71C 01FC+00 1/1 0/0 0/0 .text dEnvSe_getNearPathPos__FP4cXyzP4cXyzP5dPath
|
||||
*/
|
||||
// stack issues
|
||||
#ifdef NONMATCHING
|
||||
static void dEnvSe_getNearPathPos(cXyz* param_0, cXyz* param_1, dPath* i_path) {
|
||||
int var_r28 = 0;
|
||||
int var_r31 = 0;
|
||||
BOOL sp10[2] = {0, 0};
|
||||
f32 sp8;
|
||||
|
||||
f32 var_f31 = FLT_MAX;
|
||||
|
||||
int i;
|
||||
dStage_dPnt_c* point_p = i_path->m_points;
|
||||
|
||||
cXyz sp3C;
|
||||
cXyz sp30;
|
||||
cXyz sp3C[2];
|
||||
cM3dGLin sp14;
|
||||
|
||||
for (int i = 0; i < i_path->m_num; i++) {
|
||||
for (i = 0; i < i_path->m_num; i++) {
|
||||
sp8 = cM3d_LenSq(param_1, &point_p->m_position);
|
||||
if (var_f31 > sp8) {
|
||||
var_f31 = sp8;
|
||||
var_r28 = i;
|
||||
var_r31 = i;
|
||||
}
|
||||
|
||||
point_p++;
|
||||
}
|
||||
|
||||
dStage_dPnt_c* point2_p = &i_path->m_points[var_r28];
|
||||
if (var_r28 != 0) {
|
||||
sp14.set(point2_p[-1].m_position, point2_p[0].m_position);
|
||||
sp10[0] = cM3d_Len3dSqPntAndSegLine(&sp14, param_1, &sp30, &sp8);
|
||||
point_p = &i_path->m_points[var_r31];
|
||||
if (var_r31 != 0) {
|
||||
sp14.set(point_p[-1].m_position, point_p[0].m_position);
|
||||
sp10[0] = cM3d_Len3dSqPntAndSegLine(&sp14, param_1, &sp3C[0], &sp8);
|
||||
}
|
||||
|
||||
if (var_r28 != i_path->m_num - 1) {
|
||||
sp14.set(point2_p[0].m_position, point2_p[1].m_position);
|
||||
sp10[1] = cM3d_Len3dSqPntAndSegLine(&sp14, param_1, &sp3C, &sp8);
|
||||
if (var_r31 != i_path->m_num - 1) {
|
||||
sp14.set(point_p[0].m_position, point_p[1].m_position);
|
||||
sp10[1] = cM3d_Len3dSqPntAndSegLine(&sp14, param_1, &sp3C[1], &sp8);
|
||||
}
|
||||
|
||||
if (sp10[0]) {
|
||||
if (sp10[1]) {
|
||||
if (cM3d_LenSq(&sp3C, param_1) > sp8) {
|
||||
*param_0 = sp30;
|
||||
if (cM3d_LenSq(&sp3C[1], param_1) > sp8) {
|
||||
*param_0 = sp3C[0];
|
||||
} else {
|
||||
*param_0 = sp3C;
|
||||
*param_0 = sp3C[1];
|
||||
}
|
||||
} else {
|
||||
*param_0 = sp30;
|
||||
*param_0 = sp3C[0];
|
||||
}
|
||||
} else if (sp10[1]) {
|
||||
*param_0 = sp3C;
|
||||
*param_0 = sp3C[1];
|
||||
} else {
|
||||
param_0->set(point2_p[0].m_position);
|
||||
param_0->set(point_p[0].m_position);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void dEnvSe_getNearPathPos(cXyz* param_0, cXyz* param_1, dPath* param_2) {
|
||||
nofralloc
|
||||
#include "asm/d/d_envse/dEnvSe_getNearPathPos__FP4cXyzP4cXyzP5dPath.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 80182FD8-80183480 17D918 04A8+00 1/1 0/0 0/0 .text
|
||||
* execute_common__8dEnvSe_cFP18dStage_SoundInfo_cPScUc */
|
||||
@@ -309,7 +237,6 @@ static int dEnvSe_Create(dEnvSe_c* i_this) {
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803BA808-803BA81C -00001 0014+00 1/0 0/0 0/0 .data l_dEnvSe_Method */
|
||||
static leafdraw_method_class l_dEnvSe_Method = {
|
||||
(process_method_func)dEnvSe_Create, (process_method_func)dEnvSe_Delete,
|
||||
|
||||
Reference in New Issue
Block a user