Add camera profiles, fix camera struct sizes

This commit is contained in:
LagoLunatic
2026-07-24 11:57:07 -04:00
parent 26d9efe3b6
commit 5faa15219c
4 changed files with 59 additions and 5 deletions
+4 -3
View File
@@ -418,7 +418,9 @@ public:
/* 0x5FC */ int mTrimSize;
/* 0x600 */ int mTrimTypeForce;
/* 0x604 */ f32 mWindowAspectRatio;
#if VERSION > VERSION_DEMO
/* 0x608 */ f32 m608;
#endif
/* 0x60C */ dCamSetup_c mCamSetup;
/* 0x750 */ dCamParam_c mCamParam;
/* 0x75C */ int mCamTypeField;
@@ -429,7 +431,9 @@ public:
/* 0x770 */ int mCamTypeBoatBattle;
/* 0x774 */ int mCamTypeSubject;
/* 0x778 */ int mCamTypeKeep;
#if VERSION > VERSION_DEMO
/* 0x77C */ int mCamTypeRestrict;
#endif
/* 0x780 */ u8 m780;
/* 0x781 */ u8 m781;
/* 0x782 */ u8 m782;
@@ -442,7 +446,6 @@ public:
/* 0x789 */ u8 m789;
/* 0x78A */ u8 m78A;
/* 0x78B */ u8 m78B;
/* 0x78C */ u8 m78C[0x800 - 0x78C];
public:
dCamera_c(camera_class*);
@@ -623,8 +626,6 @@ public:
static const char* mvBGTypes[];
};
STATIC_ASSERT(sizeof(dCamera_c) == 0x800);
bool dCam_isManual(camera_class* i_this);
s16 dCam_getAngleY(camera_class*);
s16 dCam_getAngleX(camera_class*);
+1 -1
View File
@@ -25,11 +25,11 @@ public:
/* 0x23C */ request_of_phase_process_class phase_request;
/* 0x244 */ dCamera_c mCamera;
}; // size = 0xA44
STATIC_ASSERT(sizeof(camera_class) == 0xA44);
struct camera_process_profile_definition {
/* 0x00 */ view_process_profile_definition base;
/* 0x3C */ leafdraw_method_class* sub_method; // Subclass methods
/* 0x40 */ u32 unk40;
};
extern leafdraw_method_class g_fopCam_Method;
-1
View File
@@ -9,7 +9,6 @@ struct view_process_profile_definition {
/* 0x00 */ leaf_process_profile_definition base;
/* 0x24 */ leafdraw_method_class* sub_method; // Subclass methods
/* 0x28 */ u8 unk28;
/* 0x29 */ u8 unk29[3]; // pad
/* 0x2C */ u32 unk2C;
/* 0x30 */ u32 unk30;
/* 0x34 */ u32 unk34;
+54
View File
@@ -221,7 +221,9 @@ void dCamera_c::initialize(camera_class* camera, fopAc_ac_c* playerActor, u32 ca
mCamTypeSubject = GetCameraTypeFromCameraName("Subject");
mCamTypeBoat = GetCameraTypeFromCameraName("Boat");
mCamTypeBoatBattle = GetCameraTypeFromCameraName("BoatBattle");
#if VERSION > VERSION_DEMO
mCamTypeRestrict = GetCameraTypeFromCameraName("Restrict");
#endif
mCamTypeKeep = GetCameraTypeFromCameraName("Keep");
mCurType = mMapToolType = mCamTypeField;
@@ -283,7 +285,9 @@ void dCamera_c::initialize(camera_class* camera, fopAc_ac_c* playerActor, u32 ca
m368 = 0.0f;
m354 = -G_CM3D_F_INF;
mRoomMapToolCameraIdx = 0xFF;
#if VERSION > VERSION_DEMO
m608 = mCamSetup.mBGChk.WallUpDistance();
#endif
if (!strcmp(dComIfGp_getStartStageName(), "sea")) {
m780 = 1;
@@ -5720,3 +5724,53 @@ bool dCamForcusLine::Off() {
m49 = 0;
return m49 == 0;
}
static leafdraw_method_class method = {
(process_method_func)camera_create,
(process_method_func)camera_delete,
(process_method_func)camera_execute,
(process_method_func)is_camera_delete,
(process_method_func)camera_draw,
};
camera_process_profile_definition g_profile_CAMERA = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 0x000B,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_CAMERA_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(camera_class),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopVw_Method,
/* Draw Prio */ fpcDwPi_CAMERA_e,
/* View SubMtd */ &g_fopCam_Method,
/* View unk28 */ 0,
/* View unk2C */ 0,
/* View unk30 */ 0,
/* View unk34 */ 0,
/* View unk38 */ 0,
/* Camera SubMtd */ &method,
/* Camera unk40 */ 0,
};
camera_process_profile_definition g_profile_CAMERA2 = {
/* Layer ID */ fpcLy_CURRENT_e,
/* List ID */ 0x000B,
/* List Prio */ fpcPi_CURRENT_e,
/* Proc Name */ fpcNm_CAMERA2_e,
/* Proc SubMtd */ &g_fpcLf_Method.base,
/* Size */ sizeof(camera_class),
/* Size Other */ 0,
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopVw_Method,
/* Draw Prio */ fpcDwPi_CAMERA2_e,
/* View SubMtd */ &g_fopCam_Method,
/* View unk28 */ 0,
/* View unk2C */ 0,
/* View unk30 */ 0,
/* View unk34 */ 0,
/* View unk38 */ 0,
/* Camera SubMtd */ &method,
/* Camera unk40 */ 0,
};