Files
dusklight/src/d/d_kyeff.cpp
T
Huitzi 56890c32e8 Actor status consolidation & process profile definition editing (#3117)
* Consolidate fopAcM_STATUS into fopAc_Status_e

* Add _e suffix to fopAcStts enums

* Prepare for profile enumeration
* Correct typo in scene_process_profile_definition
* Manually handle g_profile_Obj_DamCps (inline preprocessing)
* Correct g_profile_TAG_LV5SOUP procname to enum
* Create d_priority.h

* Update process profile definitions
* Moved inline comments to the left
* Add missing fopAcStts enums
* Add d_priority.h include in f_pc_leaf.h
* Manually update d_a_obj_damCps profile

* Replace fopAcStts enums replacing and anticipatory profile size correction
* Changed profile size from literal to sizeof() in anticipation of PR #3116
* Provided putative names to staff-related status enums
* Replaced appropriate literals with fopAcStts enums

* Fix borked merge

* Rename item number enums and move to d_item_data.h

* Rename process profile name & draw priority enums

* Move process profile name & draw priority enums to appropriate files
* Moved fpcNm_ enums from d/d_procname.h to f_pc/f_pc_name.h
* Moved fpcDwPi_ enums from d/d_priority.h to f_pc/f_pc_draw_priority.h

* ACTUALLY (whoops) stage merge

* Correct item mistranslation

Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com>

---------

Co-authored-by: LagoLunatic <LagoLunatic@users.noreply.github.com>
2026-03-09 18:33:31 -07:00

159 lines
3.8 KiB
C++

/**
* d_kyeff.cpp
*
*/
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_kyeff.h"
#include "d/d_com_inf_game.h"
#include "d/d_kankyo_wether.h"
#include <cstring>
#if DEBUG
class dKyeff_HIO_c : public JORReflexible {
public:
dKyeff_HIO_c();
virtual ~dKyeff_HIO_c();
void genMessage(JORMContext*);
/* 0x04 */ cXyz camera_eye;
/* 0x10 */ cXyz camera_cnt;
/* 0x1C */ f32 wind_power;
/* 0x20 */ f32 time_speed;
/* 0x24 */ s8 id;
};
dKyeff_HIO_c g_kyeffHIO;
dKyeff_HIO_c::~dKyeff_HIO_c() {}
dKyeff_HIO_c::dKyeff_HIO_c() {
g_kyeffHIO.camera_eye.x = 9377.0f;
g_kyeffHIO.camera_eye.y = 0.0f;
g_kyeffHIO.camera_eye.z = 7644.0f;
g_kyeffHIO.camera_cnt.x = 4300.0f;
g_kyeffHIO.camera_cnt.y = 4800.0f;
g_kyeffHIO.camera_cnt.z = 1000.0f;
g_kyeffHIO.wind_power = 0.5f;
g_kyeffHIO.time_speed = 0.03f;
}
void dKyeff_HIO_c::genMessage(JORMContext* mctx) {
mctx->genSlider("時刻経過スピード", &time_speed, 0.0f, 100.0f);
mctx->genSlider("Camera Eye X", &camera_eye.x, -10000.0f, 10000.0f);
mctx->genSlider(" Y", &camera_eye.y, -10000.0f, 10000.0f);
mctx->genSlider(" Z", &camera_eye.z, -10000.0f, 10000.0f);
mctx->genSlider("Camera Cnt X", &camera_cnt.x, -10000.0f, 10000.0f);
mctx->genSlider(" Y", &camera_cnt.y, -10000.0f, 10000.0f);
mctx->genSlider(" Z", &camera_cnt.z, -10000.0f, 10000.0f);
mctx->genSlider("風力", &wind_power, 0.0f, 1.0f);
}
#endif
static int dKyeff_Draw(dKyeff_c* i_this) {
UNUSED(i_this);
dKyw_wether_draw();
return 1;
}
int dKyeff_c::execute() {
if (strcmp(dComIfGp_getStartStageName(), "Name") != 0) {
dKyw_wether_move();
}
dKyw_wether_move_draw();
dKy_FiveSenses_fullthrottle_dark();
mDoAud_mEnvse_framework();
return 1;
}
static int dKyeff_Execute(dKyeff_c* i_this) {
return i_this->execute();
}
static int dKyeff_IsDelete(dKyeff_c*) {
return 1;
}
static int dKyeff_Delete(dKyeff_c* i_this) {
UNUSED(i_this);
dKyw_wether_delete();
#if DEBUG
if (strcmp(dComIfGp_getStartStageName(), "Name") == 0) {
mDoHIO_deleteChild(g_kyeffHIO.id);
}
#endif
return 1;
}
// Helper functions to set float literal order
static f32 dummyLiteralOrder() {
return 0.0f;
}
static f32 dummyLiteralOrder2() {
return 1.0f;
}
static f32 dummyLiteralOrder3(s32 hours) {
return hours;
}
static int dKyeff_Create(kankyo_class* i_this) {
UNUSED(i_this);
OSCalendarTime calendar;
dKyw_wether_init();
if (strcmp(dComIfGp_getStartStageName(), "Name") == 0) {
camera_process_class* camera = dComIfGp_getCamera(0);
OSTime time = OSGetTime();
OSTicksToCalendarTime(time, &calendar);
g_env_light.global_wind_influence.vec.x = 1.0f;
g_env_light.global_wind_influence.vec.y = 0.0f;
g_env_light.global_wind_influence.vec.z = 0.0f;
g_env_light.global_wind_influence.pow = 0.7f;
g_env_light.daytime = calendar.hour * 15.0f;
#if DEBUG
g_kyeffHIO.id = mDoHIO_createChild("VR-BOX", &g_kyeffHIO);
#endif
}
return cPhs_COMPLEATE_e;
}
static leafdraw_method_class l_dKyeff_Method = {
(process_method_func)dKyeff_Create,
(process_method_func)dKyeff_Delete,
(process_method_func)dKyeff_Execute,
(process_method_func)dKyeff_IsDelete,
(process_method_func)dKyeff_Draw,
};
kankyo_process_profile_definition g_profile_KYEFF = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 12,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_KYEFF_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(dKyeff_c),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopKy_Method,
/* Draw Prio */ fpcDwPi_KYEFF_e,
/* Kankyo SubMtd */ &l_dKyeff_Method,
};