summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2026-07-24 11:57:07 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2026-07-24 11:57:07 -0400
commit5faa15219c6c94622d5ed08b162fed09b85b8ffc (patch)
tree914f13c3d69b4de95a185f7f5f1407edfc958387
parent26d9efe3b63ac38960f8b0c5afe461c4b96b0eb5 (diff)
Add camera profiles, fix camera struct sizes
-rw-r--r--include/d/d_camera.h7
-rw-r--r--include/f_op/f_op_camera.h2
-rw-r--r--include/f_op/f_op_view.h1
-rw-r--r--src/d/d_camera.cpp54
4 files changed, 59 insertions, 5 deletions
diff --git a/include/d/d_camera.h b/include/d/d_camera.h
index d7a7913b..483d15ac 100644
--- a/include/d/d_camera.h
+++ b/include/d/d_camera.h
@@ -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*);
diff --git a/include/f_op/f_op_camera.h b/include/f_op/f_op_camera.h
index 1b6cdf6d..61eaabb5 100644
--- a/include/f_op/f_op_camera.h
+++ b/include/f_op/f_op_camera.h
@@ -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;
diff --git a/include/f_op/f_op_view.h b/include/f_op/f_op_view.h
index 0dcb5b73..6fabaee5 100644
--- a/include/f_op/f_op_view.h
+++ b/include/f_op/f_op_view.h
@@ -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;
diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp
index cbc9808c..a5a13fed 100644
--- a/src/d/d_camera.cpp
+++ b/src/d/d_camera.cpp
@@ -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,
+};