summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMattias Blum <142374929+mattias-blum@users.noreply.github.com>2025-04-11 16:37:42 -0400
committerGitHub <noreply@github.com>2025-04-11 16:37:42 -0400
commit5f287fcaeebc6b728e5a94f7039b2d03ffc88c99 (patch)
tree2febd80425758cdb261ce2ae2fdf0a740e6c7a93 /include
parent6aeaaef643db58fd2ed26d78eada3a33666f6a3b (diff)
d_camera 28% (#732)
* initial progress * more progress * more progress * more progress * more progress * more progress * more progress * more progress * more progress * more progress * more progress * more progress * fix outdated member names * more progress * more progress * more progress * more progress * more progress * more progress * fixed deprecated member references * more progress * more progress * more progress * fix deprecated member references * more progress * more progress * more progress * more progress * more progress * check in for review * remove comment * initial PR changes * more PR changes * more PR changes * added anonymous struct as class member * reverted changes to `stage_camera2_data_class` * added `dCamera_event_data`, `dCamera_monitoring_things` and `dCamera_DMC_system` from debug maps * more progress * more progress * realmatch for `camera_draw` * PR changes * fix broken merge * formatting * Reverted change to `camSphChkdata` that caused `sph_chk_callback` match to regress * Reverted change to `BG` struct that caused ctor and dtor match to regress
Diffstat (limited to 'include')
-rw-r--r--include/SSystem/SComponent/c_angle.h17
-rw-r--r--include/SSystem/SComponent/c_bg_s_chk.h2
-rw-r--r--include/d/d_bg_s_gnd_chk.h9
-rw-r--r--include/d/d_bg_s_lin_chk.h7
-rw-r--r--include/d/d_bg_s_poly_pass_chk.h36
-rw-r--r--include/d/d_bg_s_roof_chk.h4
-rw-r--r--include/d/d_bg_s_sph_chk.h15
-rw-r--r--include/d/d_cam_param.h135
-rw-r--r--include/d/d_camera.h459
-rw-r--r--include/d/d_cc_s.h7
-rw-r--r--include/d/d_com_inf_game.h164
-rw-r--r--include/d/d_demo.h10
-rw-r--r--include/d/d_drawlist.h8
-rw-r--r--include/d/d_event_manager.h3
-rw-r--r--include/d/d_spline_path.h5
-rw-r--r--include/d/d_stage.h64
-rw-r--r--include/f_ap/f_ap_game.h3
-rw-r--r--include/f_op/f_op_camera.h3
-rw-r--r--include/f_op/f_op_camera_mng.h84
-rw-r--r--include/m_Do/m_Do_audio.h12
-rw-r--r--include/m_Do/m_Do_graphic.h1
-rw-r--r--include/m_Do/m_Do_mtx.h4
22 files changed, 728 insertions, 324 deletions
diff --git a/include/SSystem/SComponent/c_angle.h b/include/SSystem/SComponent/c_angle.h
index d18cc735..b6910aaa 100644
--- a/include/SSystem/SComponent/c_angle.h
+++ b/include/SSystem/SComponent/c_angle.h
@@ -19,7 +19,7 @@ public:
cSAngle(s16);
cSAngle(float);
s16 Val() const { return mAngle; }
- // void Set(s16 angle) { this->mAngle = angle; }
+ //void Set(s16 angle) { this->mAngle = angle; }
void Val(const cSAngle&);
void Val(s16);
void Val(float);
@@ -65,9 +65,15 @@ struct cAngle {
/* Converts Radian value into Degree value */
static f32 r2d(f32 r) { return Radian_to_Degree(r); }
+ /* Converts Degree value into Radian value */
+ static f32 d2r(f32 d) { return Degree_to_Radian(d); }
+
/* Converts Degree value to s16 angle */
static s16 d2s(f32 d) { return Degree_to_SAngle(d); }
+ /* Converts s16 angle to Degree value */
+ static f32 s2d(s16 a) { return SAngle_to_Degree(a); }
+
template <typename T>
static T Adjust(T f1, T f2, T f3);
};
@@ -112,6 +118,10 @@ public:
void Val(const cXyz&);
cXyz Xyz() const;
void Globe(class cSGlobe*) const;
+
+ void R(f32 i_radial) { mRadial = i_radial; }
+ void U(cSAngle const& i_angle) { mAngle2 = i_angle.Val(); }
+ void V(cSAngle const& i_angle) { mAngle1 = i_angle.Val(); }
};
class cSGlobe {
@@ -135,6 +145,11 @@ public:
float R() const { return mRadius; }
const cSAngle& V() const { return mAzimuth; }
const cSAngle& U() const { return mInclination; }
+
+ void R(f32 i_radius) { mRadius = i_radius; }
+ void U(cSAngle const& i_azimuth) { mAzimuth = i_azimuth.Val(); }
+ void V(cSAngle const& i_inclination) { mInclination = i_inclination.Val(); }
+
cXyz Xyz() const;
void Polar(cSPolar*) const;
cXyz Norm() const;
diff --git a/include/SSystem/SComponent/c_bg_s_chk.h b/include/SSystem/SComponent/c_bg_s_chk.h
index 3a336589..f1008d35 100644
--- a/include/SSystem/SComponent/c_bg_s_chk.h
+++ b/include/SSystem/SComponent/c_bg_s_chk.h
@@ -23,7 +23,7 @@ public:
cBgS_Chk() {
mPolyPassChk = NULL;
mGrpPassChk = NULL;
- mSameActorChk = 1;
+ mSameActorChk = true;
}
void SetExtChk(cBgS_Chk& other) {
mPolyPassChk = other.mPolyPassChk;
diff --git a/include/d/d_bg_s_gnd_chk.h b/include/d/d_bg_s_gnd_chk.h
index c311a722..4e9f073c 100644
--- a/include/d/d_bg_s_gnd_chk.h
+++ b/include/d/d_bg_s_gnd_chk.h
@@ -67,16 +67,19 @@ public:
class dBgS_CamGndChk : public dBgS_GndChk {
public:
- dBgS_CamGndChk() { /* SetCam(); */ }
+ dBgS_CamGndChk() { SetCam(); }
virtual ~dBgS_CamGndChk() {}
};
class dBgS_CamGndChk_Wtr : public dBgS_CamGndChk {
public:
- dBgS_CamGndChk_Wtr();
+ dBgS_CamGndChk_Wtr() {
+ OffNormalGrp();
+ OnWaterGrp();
+ };
- virtual ~dBgS_CamGndChk_Wtr();
+ virtual ~dBgS_CamGndChk_Wtr() {}
};
#endif /* D_BG_D_BG_S_GND_CHK_H */
diff --git a/include/d/d_bg_s_lin_chk.h b/include/d/d_bg_s_lin_chk.h
index 498f0d4b..96ef100f 100644
--- a/include/d/d_bg_s_lin_chk.h
+++ b/include/d/d_bg_s_lin_chk.h
@@ -77,9 +77,12 @@ public:
class dBgS_CamLinChk_NorWtr : public dBgS_CamLinChk {
public:
- dBgS_CamLinChk_NorWtr();
+ dBgS_CamLinChk_NorWtr() {
+ OnWaterGrp();
+ OnNormalGrp();
+ }
- virtual ~dBgS_CamLinChk_NorWtr();
+ virtual ~dBgS_CamLinChk_NorWtr() {}
};
class dBgS_MirLightLinChk : public dBgS_LinChk {
diff --git a/include/d/d_bg_s_poly_pass_chk.h b/include/d/d_bg_s_poly_pass_chk.h
index 56e9533a..0e2d626c 100644
--- a/include/d/d_bg_s_poly_pass_chk.h
+++ b/include/d/d_bg_s_poly_pass_chk.h
@@ -7,25 +7,25 @@ class cBgS_PolyPassChk {
public:
virtual ~cBgS_PolyPassChk() {}
- /* 0x4 */ u8 mbObjThrough;
- /* 0x5 */ u8 mbCamThrough;
- /* 0x6 */ u8 mbLinkThrough;
- /* 0x7 */ u8 mbArrowThrough; // Also light
- /* 0x8 */ u8 mbBombThrough;
- /* 0x9 */ u8 mbBoomerangThrough;
- /* 0xA */ u8 mbRopeThrough; // Actually Hookshot?
+ /* 0x4 */ bool mbObjThrough;
+ /* 0x5 */ bool mbCamThrough;
+ /* 0x6 */ bool mbLinkThrough;
+ /* 0x7 */ bool mbArrowThrough; // Also light
+ /* 0x8 */ bool mbBombThrough;
+ /* 0x9 */ bool mbBoomerangThrough;
+ /* 0xA */ bool mbRopeThrough; // Actually Hookshot?
};
class dBgS_PolyPassChk : public cBgS_PolyPassChk {
public:
dBgS_PolyPassChk() {
- mbObjThrough = 0;
- mbCamThrough = 0;
- mbLinkThrough = 0;
- mbArrowThrough = 0;
- mbBombThrough = 0;
- mbBoomerangThrough = 0;
- mbRopeThrough = 0;
+ mbObjThrough = false;
+ mbCamThrough = false;
+ mbLinkThrough = false;
+ mbArrowThrough = false;
+ mbBombThrough = false;
+ mbBoomerangThrough = false;
+ mbRopeThrough = false;
}
virtual ~dBgS_PolyPassChk() {}
@@ -36,6 +36,14 @@ public:
void SetBomb() { mbBombThrough = true; }
void SetBoomerang() { mbBoomerangThrough = true; }
void SetRope() { mbRopeThrough = true; }
+
+ void ClrObj() { mbObjThrough = false; }
+ void ClrCam() { mbCamThrough = false; }
+ void ClrLink() { mbLinkThrough = false; }
+ void ClrArrow() { mbArrowThrough = false; }
+ void ClrBomb() { mbBombThrough = false; }
+ void ClrBoomerang() { mbBoomerangThrough = false; }
+ void ClrRope() { mbRopeThrough = false; }
void SetPassChkInfo(dBgS_PolyPassChk& other) {
*this = other;
diff --git a/include/d/d_bg_s_roof_chk.h b/include/d/d_bg_s_roof_chk.h
index 483800d4..fe44ce6d 100644
--- a/include/d/d_bg_s_roof_chk.h
+++ b/include/d/d_bg_s_roof_chk.h
@@ -21,7 +21,7 @@ public:
virtual ~dBgS_RoofChk() {}
- void SetPos(cXyz& pos) { m_pos = pos; }
+ void SetPos(cXyz &pos) { m_pos = pos; }
cXyz* GetPosP() { return &m_pos; }
f32 GetNowY() { return m_now_y; }
void SetNowY(f32 y) { m_now_y = y; }
@@ -40,4 +40,4 @@ public:
virtual ~dBgS_LinkRoofChk() {}
}; // Size: 0x4C
-#endif /* D_BG_D_BG_S_ROOF_CHK_H */ \ No newline at end of file
+#endif /* D_BG_D_BG_S_ROOF_CHK_H */
diff --git a/include/d/d_bg_s_sph_chk.h b/include/d/d_bg_s_sph_chk.h
index 3b6e25a2..376c14e4 100644
--- a/include/d/d_bg_s_sph_chk.h
+++ b/include/d/d_bg_s_sph_chk.h
@@ -8,7 +8,14 @@
class dBgS_SphChk : public cM3dGSph, public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk {
public:
- dBgS_SphChk();
+ dBgS_SphChk() {
+ SetPolyPassChk(GetPolyPassChkInfo());
+ SetGrpPassChk(GetGrpPassChkInfo());
+ SetActorPid(fpcM_ERROR_PROCESS_ID_e);
+ Init();
+ SetCallback(NULL);
+ };
+
void Init() {
ClearPi();
}
@@ -22,4 +29,10 @@ public:
/* 0x4c */ SphChk_Callback mpCallback;
}; // Size: 0x50
+class dBgS_CamSphChk : public dBgS_SphChk {
+public:
+ dBgS_CamSphChk() { SetCam(); }
+ virtual ~dBgS_CamSphChk() {}
+};
+
#endif /* D_BG_D_BG_S_SPH_CHK_H */
diff --git a/include/d/d_cam_param.h b/include/d/d_cam_param.h
index ff8d5b8e..1d7e5959 100644
--- a/include/d/d_cam_param.h
+++ b/include/d/d_cam_param.h
@@ -6,7 +6,7 @@
struct dCamera__Style {
/* 0x00 */ u32 m00;
- /* 0x04 */ u32 m04;
+ /* 0x04 */ int engineIdx;
/* 0x08 */ u32 m08;
/* 0x0C */ u32 m0C;
/* 0x10 */ u32 m10;
@@ -57,25 +57,41 @@ class dCamBGChk_c {
public:
dCamBGChk_c();
+ // copied these from TP's implementation, may not be correct
+ f32 WallUpDistance() { return mWallUpDistance; }
+ f32 FwdDistance(s32 param_0) { return mChkInfo[param_0].mDistance; }
+ s16 FwdChkAngle(s32 param_0) { return cAngle::d2s(mChkInfo[param_0].mChkAngle); }
+ f32 FwdWeightH(s32 param_0) { return mChkInfo[param_0].mWeightH; }
+ f32 FwdWeightL(s32 param_0) { return mChkInfo[param_0].mWeightL; }
+ f32 FwdBackMargin() { return mFwdBackMargin; }
+ f32 FwdCushion() { return mFwdCushion; }
+ f32 GazeBackMargin() { return mGazeBackMargin; }
+ f32 WallCushion() { return mWallCushion; }
+ f32 WallBackCushion() { return mWallBackCushion; }
+ f32 CornerCushion() { return mCornerCushion; }
+ f32 CornerAngleMax() { return mCornerAngleMax; }
+ f32 FloorMargin() { return mFloorMargin; }
+
+ // name is a guess for now
+ struct ChkInfo {
+ /* 0x0 */ f32 mDistance;
+ /* 0x4 */ f32 mChkAngle;
+ /* 0x8 */ f32 mWeightH;
+ /* 0xC */ f32 mWeightL;
+ }; // Size: 0x10
+
public:
- /* 0x00 */ f32 m00;
- /* 0x04 */ f32 m04;
- /* 0x08 */ f32 m08;
- /* 0x0C */ f32 m0C;
- /* 0x10 */ f32 m10;
- /* 0x14 */ f32 m14;
- /* 0x18 */ f32 m18;
- /* 0x1C */ f32 m1C;
- /* 0x20 */ f32 m20;
- /* 0x24 */ f32 m24;
- /* 0x28 */ f32 m28;
+ /* 0x00 */ f32 mFloorMargin;
+ /* 0x04 */ ChkInfo mChkInfo[2];
+ /* 0x24 */ f32 mFwdBackMargin;
+ /* 0x28 */ f32 mFwdCushion;
/* 0x2C */ f32 m2C;
- /* 0x30 */ f32 m30;
- /* 0x34 */ f32 m34;
- /* 0x38 */ f32 m38;
- /* 0x3C */ f32 m3C;
- /* 0x40 */ f32 m40;
- /* 0x44 */ f32 m44;
+ /* 0x30 */ f32 mGazeBackMargin;
+ /* 0x34 */ f32 mCornerCushion;
+ /* 0x38 */ f32 mWallCushion;
+ /* 0x3C */ f32 mWallUpDistance;
+ /* 0x40 */ f32 mWallBackCushion;
+ /* 0x44 */ f32 mCornerAngleMax;
/* 0x48 */ f32 m48;
/* 0x4C */ f32 m4C;
/* 0x50 */ f32 m50;
@@ -86,57 +102,58 @@ public:
class dCamSetup_c {
public:
- /* 0x000 */ f32 m000;
- /* 0x004 */ f32 m004;
- /* 0x008 */ u16 m008;
- /* 0x00A */ u8 m00A[0x00C - 0x00A];
- /* 0x00C */ u32 m00C;
- /* 0x010 */ int m010;
- /* 0x014 */ u8 m014[0x01C - 0x014];
- /* 0x01C */ int m01C;
- /* 0x020 */ f32 m020;
+ /* 0x000 */ f32 mDrawNear;
+ /* 0x004 */ f32 mDrawFar;
+ /* 0x008 */ u16 mDebugFlags;
+ /* 0x00A */ u16 mFlags2;
+ /* 0x00C */ int m00C;
+ /* 0x010 */ int mModeSwitchType;
+ /* 0x014 */ void* mTypeTable;
+ /* 0x018 */ int mTypeNum;
+ /* 0x01C */ int mForceType;
+ /* 0x020 */ f32 mCusCus;
/* 0x024 */ f32 m024;
/* 0x028 */ f32 m028;
/* 0x02C */ f32 m02C;
/* 0x030 */ f32 m030;
/* 0x034 */ f32 m034;
- /* 0x038 */ f32 m038;
- /* 0x03C */ f32 m03C;
- /* 0x040 */ f32 m040;
+ /* 0x038 */ f32 mBaseCushion;
+ /* 0x03C */ f32 mJumpCushion;
+ /* 0x040 */ f32 mParallelDist;
/* 0x044 */ f32 m044;
/* 0x048 */ f32 m048;
- /* 0x04C */ f32 m04C;
+ /* 0x04C */ f32 mCurveWeight;
/* 0x050 */ f32 m050;
/* 0x054 */ f32 m054;
/* 0x058 */ f32 m058;
/* 0x05C */ f32 m05C;
/* 0x060 */ f32 m060;
- /* 0x064 */ f32 m064;
- /* 0x068 */ f32 m068;
+ /* 0x064 */ f32 mTrimVistaHeight;
+ /* 0x068 */ f32 mTrimCineScopeHeight;
/* 0x06C */ f32 m06C;
- /* 0x070 */ f32 m070;
- /* 0x074 */ u32 m074;
+ /* 0x070 */ f32 mForceLockOffDist;
+ /* 0x074 */ int mForceLockOffTimer;
/* 0x078 */ f32 m078;
/* 0x07C */ f32 m07C;
/* 0x080 */ f32 m080;
/* 0x084 */ f32 m084;
- /* 0x088 */ f32 m088;
- /* 0x08C */ f32 m08C;
- /* 0x090 */ u8 m090[0x094 - 0x090];
- /* 0x094 */ u32 m094;
+ /* 0x088 */ f32 mDMCValue;
+ /* 0x08C */ f32 mDMCAngle;
+ /* 0x090 */ f32 m090;
+ /* 0x094 */ int m094;
/* 0x098 */ f32 m098;
/* 0x09C */ f32 m09C;
/* 0x0A0 */ f32 m0A0;
/* 0x0A4 */ f32 m0A4;
- /* 0x0A8 */ u32 m0A8;
- /* 0x0AC */ f32 m0AC;
- /* 0x0B0 */ u32 m0B0;
- /* 0x0B4 */ f32 m0B4;
- /* 0x0B8 */ f32 m0B8;
- /* 0x0BC */ f32 m0BC;
+ /* 0x0A8 */ int m0A8;
+ /* 0x0AC */ f32 mChargeLatitude;
+ /* 0x0B0 */ int mChargeTimer;
+ /* 0x0B4 */ f32 mChargeBRatio;
+ /* 0x0B8 */ f32 mManualStartCThreshold;
+ /* 0x0BC */ f32 mManualEndVal;
/* 0x0C0 */ f32 m0C0;
- /* 0x0C4 */ f32 m0C4;
- /* 0x0C8 */ u32 m0C8;
+ /* 0x0C4 */ f32 mLockonChangeCushion;
+ /* 0x0C8 */ int mLockonChangeTimer;
public:
dCamSetup_c();
@@ -144,6 +161,27 @@ public:
bool CheckLatitudeRange(s16*);
f32 FanBank();
+ f32 PlayerHideDist();
+
+ bool CheckFlag2(u16 i_flag) { return (i_flag & mFlags2) != 0; }
+ f32 ChargeBRatio() { return mChargeBRatio; }
+ int ChargeTimer() { return mChargeTimer; }
+ f32 ChargeLatitude() { return mChargeLatitude; }
+
+ f32 ManualEndVal() { return mManualEndVal; }
+ f32 CinemaScopeTrimHeight() { return mTrimCineScopeHeight; }
+ f32 VistaTrimHeight() { return mTrimVistaHeight; }
+ f32 ForceLockOffTimer() { return mForceLockOffTimer; }
+ f32 ForceLockOffDist() { return mForceLockOffDist; }
+ f32 LockonChangeCushion() { return mLockonChangeCushion; }
+ int LockonChangeTimer() { return mLockonChangeTimer; }
+ f32 Cushion4Base() { return mBaseCushion; }
+ f32 Cushion4Jump() { return mJumpCushion; }
+ f32 CusCus() { return mCusCus; }
+ f32 ParallelDist() { return mParallelDist; }
+ f32 CurveWeight() { return mCurveWeight; }
+ f32 DMCAngle() { return mDMCAngle; }
+ f32 DMCValue() { return mDMCValue; }
public:
/* 0x0D0 */ dCstick_c mCstick;
@@ -175,6 +213,9 @@ public:
s16 LockonLatitude(f32);
f32 LockonFovy(f32);
f32 LockonCenterHeight(f32);
+ int Algorythmn(s32 i_style) { return mpStyle[i_style].engineIdx; }
+ int Algorythmn() { return mpStyle->engineIdx; }
+ bool CheckFlag(u16 flag) { return mpStyle->flag & flag; }
};
class dCamMath {
diff --git a/include/d/d_camera.h b/include/d/d_camera.h
index 6d9c208c..6660b2ba 100644
--- a/include/d/d_camera.h
+++ b/include/d/d_camera.h
@@ -2,15 +2,20 @@
#define D_CAMERA_H
#include "SSystem/SComponent/c_angle.h"
-#include "SSystem/SComponent/c_rnd.h"
#include "SSystem/SComponent/c_sxyz.h"
#include "SSystem/SComponent/c_xyz.h"
#include "f_pc/f_pc_base.h"
#include "d/d_cam_param.h"
+#include "d/d_bg_s_gnd_chk.h"
+#include "d/d_com_inf_game.h"
+#include "d/d_spline_path.h"
#include "global.h"
class camera_class;
+class camera_process_class;
class dBgS_LinChk;
+class dBgS_CamGndChk;
+class d2DBSplinePath;
class dStage_Event_dt_c;
class fopAc_ac_c;
@@ -33,50 +38,110 @@ struct dCamera__EventParam {
/* 0x10 */ int mValue;
};
-class d2DBSplinePath {
-public:
- ~d2DBSplinePath() {}
- /* 0x00 */ int mKeyframeCur;
- /* 0x04 */ int mTimer;
- /* 0x08 */ int mKeyframeNum;
- /* 0x0C */ int mState;
- /* 0x10 */ int m10;
- /* 0x14 */ int mKeyframeLast;
- /* 0x18 */ u8 m18[0x1C - 0x18];
- /* 0x1C */ f32 mTime;
- /* 0x20 */ u8 m20[0x24 - 0x20];
- /* 0x24 */ f32 mFrameWeight[3];
- /* 0x30 */ int mFrameIdx[3];
- /* 0x3C */ u8 m3C[0x40 - 0x3C];
- /* 0x40 */ void* vtbl;
+struct dCamera__Type {
+ /* 0x00 */ char name[24];
+ /* 0x18 */ s16 mStyles[2][10];
+}; // Size: 0x40
+
+struct dCamera_event_data {
+ /* 0x000 */ u8 field_0x00;
+ /* 0x001 */ u8 field_0x01[0x04 - 0x01];
+ /* 0x004 */ int field_0x04;
+ /* 0x008 */ int field_0x08;
+ /* 0x00C */ int field_0x0c;
+ /* 0x010 */ u8 field_0x10;
+ /* 0x011 */ u8 field_0x11[0x14 - 0x11];
+ /* 0x014 */ int field_0x14;
+ /* 0x018 */ int field_0x18;
+ /* 0x01C */ int field_0x1c;
+ /* 0x020 */ int field_0x20;
+ /* 0x024 */ int field_0x24;
+ /* 0x028 */ u8 field_0x28[0x2C - 0x28];
+ /* 0x02C */ dCamera__EventParam mEventParams[8];
+ /* 0x0EC */ dStage_Event_dt_c* field_0xec;
+ /* 0x0F0 */ d2DBSplinePath mSpline2DPath;
+}; // Size: 0x124
+
+struct camSphChkdata {
+ camSphChkdata(cXyz* i_center, f32 i_radius) {
+ field_0x0 = i_center;
+ field_0x8 = *i_center;
+ field_0x4 = i_radius;
+ }
+
+ ~camSphChkdata(){}
+ /* 0x00 */ cXyz* field_0x0;
+ /* 0x04 */ f32 field_0x4;
+ /* 0x08 */ cXyz field_0x8;
+ /* 0x14 */ cXyz field_0x14;
+};
+
+class dCamera_monitoring_things {
+ public:
+ dCamera_monitoring_things(){}
+ ~dCamera_monitoring_things(){}
+
+ /* 0x00 */ cXyz mPos;
+ /* 0x0C */ cXyz field_0x0C;
+ /* 0x10 */ int field_0x10;
+ /* 0x14 */ f32 field_0x14;
+};
+
+class dCamera_DMC_system {
+ public:
+ dCamera_DMC_system(){}
+ ~dCamera_DMC_system(){}
+
+ /* 0x0 */ u8 field_0x0;
+ /* 0x1 */ u8 field_0x1;
+ /* 0x2 */ cSAngle field_0x2;
+ /* 0x4 */ cSAngle field_0x4;
};
class dCamForcusLine {
public:
+ dCamForcusLine() { mEffectLine.initRnd(100, 100, 100); }
void Init();
void Draw();
- void Off();
+ bool Off();
- /* 0x00 */ void* vtbl;
- /* 0x04 */ cM_rnd_c mRnd;
- /* 0x10 */ u8 field_10[0x70 - 0x10];
+ /* 0x00 */ dDlst_effectLine_c mEffectLine;
+ /* 0x38 */ cXyz m38;
+ /* 0x44 */ GXColor m44;
+ /* 0x48 */ u8 m48;
+ /* 0x49 */ u8 m49;
+ /* 0x4C */ int m4C;
+ /* 0x50 */ int m50;
+ /* 0x54 */ int m54;
+ /* 0x58 */ u16 m58;
+ /* 0x5A */ u16 m5A;
+ /* 0x5C */ u16 m5C;
+ /* 0x5E */ u16 m5E;
+ /* 0x60 */ f32 m60;
+ /* 0x64 */ f32 m64;
+ /* 0x68 */ f32 m68;
+ /* 0x6C */ f32 m6C;
};
+class dCamera_c;
+typedef bool (dCamera_c::*engine_fn)(s32);
+
class dCamera_c {
public:
struct BG {
BG() {}
~BG() {}
- u8 temp[0xB0];
+ /* 0x00 */ u8 m00[0x04 - 0x00];
+ /* 0x04 */ dBgS_CamGndChk m04; // dBgS_CamGndChk might be too large by 4 bytes
+ /* 0x58 */ f32 m58;
+ /* 0x5C */ dBgS_CamGndChk m5C; // This offset is wrong, needs to be at 0x60
};
/* 0x000 */ camera_class* mpCamera;
/* 0x004 */ u8 m004;
/* 0x005 */ u8 m005;
- /* 0x006 */ u8 m006[0x008 - 0x006];
- /* 0x008 */ f32 m008;
- /* 0x00C */ s16 m00C;
- /* 0x00E */ cSAngle m00E;
+ /* 0x006 */ cSAngle m006;
+ /* 0x008 */ cSGlobe mDirection;
/* 0x010 */ cXyz mCenter;
/* 0x01C */ cXyz mEye;
/* 0x028 */ cXyz mUp;
@@ -86,25 +151,42 @@ public:
/* 0x03C */ cSGlobe m03C;
/* 0x044 */ cXyz m044;
/* 0x050 */ cXyz m050;
- /* 0x05C */ s16 m05C;
+ /* 0x05C */ cSAngle m05C;
/* 0x05E */ u8 m05E[0x060 - 0x05E];
/* 0x060 */ f32 m060;
- /* 0x064 */ u8 m064[0x068 - 0x064];
+ /* 0x064 */ f32 m064;
/* 0x068 */ int m068;
/* 0x06C */ cSAngle mAngleY;
- /* 0x06E */ u8 m06E[0x080 - 0x06E];
+ /* 0x06E */ u8 m06E[0x070 - 0x06E];
+ /* 0x070 */ cXyz m070;
+ /* 0x07C */ u32 m07C;
/* 0x080 */ u32 m080;
/* 0x084 */ cXyz m084;
/* 0x090 */ cXyz m090;
/* 0x09C */ f32 m09C;
- /* 0x0A0 */ f32 m0A0;
- // /* 0x0A4 */ @class$4017d_camera_cpp m0A4[2];
- /* 0x0A4 */ u8 m0A4[0x40];
+ /* 0x0A0 */ cSAngle m0A0;
+ /* 0x0A2 */ u8 m0A2[0x0A4 - 0x0A2];
+ struct {
+ struct {
+ /* 0x00 */ cXyz m00;
+ /* 0x0C */ int m0C;
+ /* 0x10 */ int m10;
+ /* 0x14 */ int m14;
+ /* 0x18 */ int m18;
+ /* 0x1C */ int m1C;
+ } field_0x00;
+ }
+ /* 0x0A4 */ m0A4[2];
/* 0x0E4 */ int mStageMapToolCameraIdx;
/* 0x0E8 */ int m0E8;
- /* 0x0EC */ u8 m0EC[0x108 - 0x0EC];
+ /* 0x0EC */ cXyz mExtendedPos;
+ /* 0x0F8 */ u8 m0F8[0x100 - 0x0F8];
+ /* 0x100 */ u8 m100;
+ /* 0x101 */ u8 m101;
+ /* 0x102 */ u8 m102;
+ /* 0x103 */ u8 m103[0x108 - 0x103];
/* 0x108 */ int m108;
- /* 0x10C */ u8 m10C[0x110 - 0x10C];
+ /* 0x10C */ int m10C;
/* 0x110 */ u8 m110;
/* 0x111 */ u8 m111[0x114 - 0x111];
/* 0x114 */ int m114;
@@ -114,9 +196,9 @@ public:
/* 0x124 */ int mPadId;
/* 0x128 */ fopAc_ac_c* mpPlayerActor;
/* 0x12C */ fopAc_ac_c* mpLockonTarget;
- /* 0x130 */ int m130;
- /* 0x134 */ u8 m134[0x138 - 0x134];
- /* 0x138 */ int m138;
+ /* 0x130 */ fpc_ProcID mLockOnActorId;
+ /* 0x134 */ fopAc_ac_c* mpLockonActor;
+ /* 0x138 */ int mForceLockTimer;
/* 0x13C */ int mCurMode;
/* 0x140 */ int mNextMode;
/* 0x144 */ int m144;
@@ -136,47 +218,59 @@ public:
/* 0x178 */ f32 mStickCPosXDelta;
/* 0x17C */ f32 mStickCPosYDelta;
/* 0x180 */ f32 mStickCValueDelta;
- /* 0x184 */ u8 m184[0x190 - 0x184];
+ /* 0x184 */ int m184;
+ /* 0x188 */ u32 m188;
+ /* 0x18C */ u32 m18C;
/* 0x190 */ f32 mTriggerLeftLast;
/* 0x194 */ f32 mTriggerLeftDelta;
- /* 0x198 */ u8 m198;
- /* 0x199 */ u8 m199;
+ /* 0x198 */ u8 mHoldLockL;
+ /* 0x199 */ u8 mTrigLockL;
/* 0x19A */ u8 m19A;
/* 0x19B */ u8 m19B;
/* 0x19C */ f32 mTriggerRightLast;
/* 0x1A0 */ f32 mTriggerRightDelta;
- /* 0x1A4 */ u8 m1A4;
- /* 0x1A5 */ u8 m1A5;
+ /* 0x1A4 */ u8 mHoldLockR;
+ /* 0x1A5 */ u8 mTrigLockR;
/* 0x1A6 */ u8 m1A6;
/* 0x1A7 */ u8 m1A7;
- /* 0x1A8 */ u8 m1A8;
- /* 0x1A9 */ u8 m1A9;
- /* 0x1AA */ u8 m1AA;
- /* 0x1AB */ u8 m1AB;
- /* 0x1AC */ u8 m1AC;
- /* 0x1AD */ u8 m1AD;
+ /* 0x1A8 */ u8 mHoldX;
+ /* 0x1A9 */ u8 mTrigX;
+ /* 0x1AA */ u8 mHoldY;
+ /* 0x1AB */ u8 mTrigY;
+ /* 0x1AC */ u8 mHoldZ;
+ /* 0x1AD */ u8 mTrigZ;
/* 0x1AE */ u8 m1AE;
- /* 0x1AF */ u8 m1AF[0x1B0 - 0x1AF];
+ /* 0x1AF */ u8 m1AF;
/* 0x1B0 */ dCamForcusLine mForcusLine;
- /* 0x220 */ u8 m220[0x228 - 0x220];
- /* 0x228 */ cXyz mMonitorPos;
- /* 0x234 */ f32 m234;
- /* 0x238 */ f32 m238;
- /* 0x23C */ f32 m23C;
- /* 0x240 */ int m240;
- /* 0x244 */ f32 m244;
- /* 0x248 */ u8 m248[0x254 - 0x248];
+ /* 0x220 */ dCamera_DMC_system mDMCSystem;
+ /* 0x226 */ u8 m226[0x228 - 0x226];
+ /* 0x228 */ dCamera_monitoring_things mMonitoringThings;
+ /* 0x248 */ int m248[3];
/* 0x254 */ int m254;
- /* 0x258 */ u8 m258[0x25C - 0x258];
+ /* 0x258 */ int m258;
/* 0x25C */ BG mBG;
- /* 0x30C */ u8 m30C[0x31D - 0x30C];
+ /* 0x30C */ int m30C;
+ /* 0x310 */ f32 m310;
+ /* 0x314 */ int m314;
+ /* 0x318 */ f32 m318;
+ /* 0x31C */ u8 m31C;
/* 0x31D */ u8 m31D;
- /* 0x31E */ u8 m31E[0x350 - 0x31E];
+ /* 0x31E */ u8 m31E[0x320 - 0x31E];
+ /* 0x320 */ cXyz m320;
+ /* 0x32C */ cXyz m32C;
+ /* 0x338 */ cSAngle m338;
+ /* 0x33A */ cSAngle m33A;
+ /* 0x33C */ fopAc_ac_c* m33C;
+ /* 0x340 */ u8 m340[0x350 - 0x340];
/* 0x350 */ int m350;
- /* 0x354 */ u8 m354[0x358 - 0x354];
+ /* 0x354 */ f32 m354;
/* 0x358 */ int mRoomNo;
/* 0x35C */ int mRoomMapToolCameraIdx;
- /* 0x360 */ u8 m360[0x394 - 0x360];
+ /* 0x360 */ u8 m360;
+ /* 0x361 */ u8 m361[0x364 - 0x361];
+ /* 0x364 */ u32 m364;
+ /* 0x368 */ f32 m368;
+ /* 0x36C */ u8 m36C[0x394 - 0x36C];
/* 0x394 */ f32 mEvFovy;
/* 0x398 */ f32 mEvBank;
/* 0x39C */ fopAc_ac_c* mpEvRelActor;
@@ -185,18 +279,8 @@ public:
/* 0x3A8 */ u8 m3A8;
/* 0x3A9 */ u8 m3A9[0x3AC - 0x3A9];
/* 0x3AC */ cXyz mEvBasePos;
- /* 0x3B8 */ u8 m3B8[0x3FC - 0x3B8];
- /* 0x3FC */ int mStaffIdx;
- /* 0x400 */ int m400;
- /* 0x404 */ int m404;
- /* 0x408 */ u8 m408;
- /* 0x409 */ u8 m409[0x40C - 0x409];
- /* 0x40C */ int m40C;
- /* 0x410 */ int m410;
- /* 0x414 */ u8 m414[0x424 - 0x414];
- /* 0x424 */ dCamera__EventParam mEventParams[8];
- /* 0x4C4 */ dStage_Event_dt_c* m4C4;
- /* 0x4C8 */ d2DBSplinePath mSpline2DPath;
+ /* 0x3B8 */ u8 m3B8[0x3F8 - 0x3B8];
+ /* 0x3F8 */ dCamera_event_data mEventData;
/* 0x50C */ u32 mEventFlags;
/* 0x510 */ int mCurStyle;
/* 0x514 */ int m514;
@@ -204,21 +288,27 @@ public:
/* 0x51C */ int mNextType;
/* 0x520 */ int mMapToolType;
/* 0x524 */ int m524;
- /* 0x528 */ int m528;
+ /* 0x528 */ fopAc_ac_c* m528;
/* 0x52C */ u8 m52C[0x530 - 0x52C];
/* 0x530 */ int m530;
/* 0x534 */ s16 m534;
/* 0x536 */ s16 m536;
- /* 0x538 */ u8 m538[0x550 - 0x538];
+ /* 0x538 */ f32 m538;
+ /* 0x53C */ f32 m53C;
+ /* 0x540 */ f32 m540;
+ /* 0x544 */ u8 m544[0x550 - 0x544];
/* 0x550 */ int m550;
/* 0x554 */ int m554;
/* 0x558 */ u8 m558[0x568 - 0x558];
/* 0x568 */ cXyz mCenterShake;
/* 0x574 */ cXyz mEyeShake;
/* 0x580 */ f32 mFovYShake;
- /* 0x584 */ u8 m584[0x590 - 0x584];
+ /* 0x584 */ u8 m584[0x588 - 0x584];
+ /* 0x588 */ int m588;
+ /* 0x58C */ int m58C;
/* 0x590 */ int mBlureTimer;
- /* 0x594 */ u8 m594[0x59C - 0x594];
+ /* 0x594 */ csXyz m594;
+ /* 0x59A */ s16 m59A;
/* 0x59C */ int mBlurePositionType;
/* 0x5A0 */ cXyz mBlurePosition;
/* 0x5AC */ cXyz mBlureScale;
@@ -227,26 +317,38 @@ public:
/* 0x5C0 */ stage_camera__entry mCurRoomCamEntry;
/* 0x5D4 */ stage_arrow__entry mCurRoomArrowEntry;
/* 0x5E8 */ int mCurArrowIdx;
- /* 0x5EC */ f32 m5EC;
- /* 0x5F0 */ f32 m5F0;
- /* 0x5F4 */ u8 m5F4[0x5F8 - 0x5F4];
- /* 0x5F8 */ f32 m5F8;
- /* 0x5FC */ int m5FC;
- /* 0x600 */ u8 m600[0x604 - 0x600];
- /* 0x604 */ f32 m604;
- /* 0x608 */ u8 m608[0x60C - 0x608];
+ /* 0x5EC */ f32 mWindowWidth;
+ /* 0x5F0 */ f32 mWindowHeight;
+ /* 0x5F4 */ f32 m5F4;
+ /* 0x5F8 */ f32 mTrimHeight;
+ /* 0x5FC */ int mTrimSize;
+ /* 0x600 */ int mTrimTypeForce;
+ /* 0x604 */ f32 mWindowAspectRatio;
+ /* 0x608 */ f32 m608;
/* 0x60C */ dCamSetup_c mCamSetup;
/* 0x750 */ dCamParam_c mCamParam;
/* 0x75C */ int mCamTypeField;
/* 0x760 */ int mCamTypeEvent;
/* 0x764 */ int mCamTypeWater;
- /* 0x768 */ int mCamTypeSubject;
+ /* 0x768 */ int m768;
/* 0x76C */ int mCamTypeBoat;
/* 0x770 */ int mCamTypeBoatBattle;
- /* 0x774 */ int m774;
+ /* 0x774 */ int mCamTypeSubject;
/* 0x778 */ int mCamTypeKeep;
/* 0x77C */ int mCamTypeRestrict;
- /* 0x780 */ u8 field_780[0x800 - 0x780];
+ /* 0x780 */ u8 m780;
+ /* 0x781 */ u8 m781;
+ /* 0x782 */ u8 m782;
+ /* 0x783 */ u8 m783;
+ /* 0x784 */ u8 m784;
+ /* 0x785 */ u8 m785;
+ /* 0x786 */ u8 m786;
+ /* 0x787 */ u8 m787;
+ /* 0x788 */ u8 m788;
+ /* 0x789 */ u8 m789;
+ /* 0x78A */ u8 m78A;
+ /* 0x78B */ u8 m78B;
+ /* 0x78C */ u8 m78C[0x800 - 0x78C];;
public:
dCamera_c(camera_class*);
@@ -255,93 +357,99 @@ public:
void Start();
void Stop();
void Stay();
- void ChangeModeOK(s32);
+ bool ChangeModeOK(s32);
void initPad();
void updatePad();
void initMonitor();
void updateMonitor();
- void calcPeepAngle();
+ cSAngle calcPeepAngle();
void Att();
- void checkForceLockTarget();
- void Run();
- void NotRun();
- void SetTrimSize(s32);
- void SetTrimTypeForce(s32);
+ void SetWindow(f32 window_width, f32 window_height) {
+ mWindowWidth = window_width;
+ mWindowHeight = window_height;
+ mWindowAspectRatio = window_width / window_height;
+ }
+ bool checkForceLockTarget();
+ bool Run();
+ bool NotRun();
+ bool SetTrimSize(s32);
+ bool SetTrimTypeForce(s32);
void CalcTrimSize();
- void Draw();
- void nextMode(s32);
- void onModeChange(s32, s32);
- void nextType(s32);
- void onTypeChange(s32, s32);
+ bool Draw();
+ int nextMode(s32);
+ bool onModeChange(s32, s32);
+ int nextType(s32);
+ bool onTypeChange(s32, s32);
void SetTypeForce(char*, fopAc_ac_c*);
- void SetTypeForce(s32, fopAc_ac_c*);
- void onStyleChange(s32, s32);
- void GetCameraTypeFromMapToolID(s32, s32);
- void GetCameraTypeFromCameraName(const char*);
+ bool SetTypeForce(s32, fopAc_ac_c*);
+ bool onStyleChange(s32, s32);
+ int GetCameraTypeFromMapToolID(s32, s32);
+ int GetCameraTypeFromCameraName(const char*);
void pushPos();
- void directionOf(fopAc_ac_c*);
- void positionOf(fopAc_ac_c*);
- void attentionPos(fopAc_ac_c*);
- void relationalPos(fopAc_ac_c*, cXyz*);
- void relationalPos(fopAc_ac_c*, cXyz*, cSAngle);
- void relationalPos(fopAc_ac_c*, fopAc_ac_c*, cXyz*, f32);
+ cSAngle directionOf(fopAc_ac_c*);
+ cXyz positionOf(fopAc_ac_c*);
+ cXyz attentionPos(fopAc_ac_c*);
+ cXyz relationalPos(fopAc_ac_c*, cXyz*);
+ cXyz relationalPos(fopAc_ac_c*, cXyz*, cSAngle);
+ cXyz relationalPos(fopAc_ac_c*, fopAc_ac_c*, cXyz*, f32);
void setDMCAngle();
- void getDMCAngle(cSAngle);
- void pointInSight(cXyz*);
- void radiusActorInSight(fopAc_ac_c*, fopAc_ac_c*);
- void radiusActorInSight(fopAc_ac_c*, fopAc_ac_c*, cXyz*, cXyz*, f32, s16);
- void groundHeight(cXyz*);
- void lineBGCheck(cXyz*, cXyz*, dBgS_LinChk*, u32);
- void lineBGCheck(cXyz*, cXyz*, cXyz*, u32);
- void lineBGCheck(cXyz*, cXyz*, u32);
- void lineBGCheckBack(cXyz*, cXyz*, u32);
- void lineBGCheckBoth(cXyz*, cXyz*, dBgS_LinChk*, u32);
- void lineCollisionCheckBush(cXyz*, cXyz*);
- void compWallMargin(cXyz*, f32);
- void defaultTriming();
+ cSAngle getDMCAngle(cSAngle);
+ bool pointInSight(cXyz*);
+ f32 radiusActorInSight(fopAc_ac_c*, fopAc_ac_c*);
+ f32 radiusActorInSight(fopAc_ac_c*, fopAc_ac_c*, cXyz*, cXyz*, f32, s16);
+ f32 groundHeight(cXyz*);
+ bool lineBGCheck(cXyz*, cXyz*, dBgS_LinChk*, u32);
+ bool lineBGCheck(cXyz*, cXyz*, cXyz*, u32);
+ bool lineBGCheck(cXyz*, cXyz*, u32);
+ bool lineBGCheckBack(cXyz*, cXyz*, u32);
+ bool lineBGCheckBoth(cXyz*, cXyz*, dBgS_LinChk*, u32);
+ BOOL lineCollisionCheckBush(cXyz*, cXyz*);
+ cXyz compWallMargin(cXyz*, f32);
+ int defaultTriming();
void setView(f32, f32, f32, f32);
- void forwardCheckAngle();
+ cSAngle forwardCheckAngle();
void bumpCheck(u32);
- void getWaterSurfaceHeight(cXyz*);
+ f32 getWaterSurfaceHeight(cXyz*);
void checkSpecialArea();
void checkGroundInfo();
- void followCamera2(s32);
- void followCamera(s32);
- void eyePos(fopAc_ac_c*);
- void heightOf(fopAc_ac_c*);
- void lockonCamera(s32);
- void getMsgCmdSpeaker();
- void getMsgCmdCut();
- void talktoCamera(s32);
+ bool followCamera2(s32);
+ bool followCamera(s32);
+ cXyz eyePos(fopAc_ac_c*);
+ f32 heightOf(fopAc_ac_c*);
+ bool lockonCamera(s32);
+ fopAc_ac_c* getMsgCmdSpeaker();
+ int getMsgCmdCut();
+ bool talktoCamera(s32);
void CalcSubjectAngle(s16*, s16*);
- void subjectCamera(s32);
- void towerCamera(s32);
- void crawlCamera(s32);
- void hookshotCamera(s32);
- void tornadoCamera(s32);
- void rideCamera(s32);
- void hungCamera(s32);
- void vomitCamera(s32);
- void shieldCamera(s32);
- void manualCamera(s32);
- void nonOwnerCamera(s32);
- void fixedFrameCamera(s32);
- void fixedPositionCamera(s32);
- void eventCamera(s32);
- void demoCamera(s32);
- void letCamera(s32);
- void Set(cXyz, cXyz);
- void Set(cXyz, cXyz, f32, s16);
- void Set(cXyz, cXyz, s16, f32);
- void Reset(cXyz, cXyz, f32, s16);
- void Reset(cXyz, cXyz);
- void Reset();
+ bool subjectCamera(s32);
+ bool towerCamera(s32);
+ bool crawlCamera(s32);
+ bool hookshotCamera(s32);
+ bool tornadoCamera(s32);
+ bool rideCamera(s32);
+ bool hungCamera(s32);
+ bool vomitCamera(s32);
+ bool shieldCamera(s32);
+ bool manualCamera(s32);
+ bool nonOwnerCamera(s32);
+ bool fixedFrameCamera(s32);
+ bool fixedPositionCamera(s32);
+ bool eventCamera(s32);
+ bool demoCamera(s32);
+ bool letCamera(s32);
+ bool Set(cXyz, cXyz);
+ bool Set(cXyz, cXyz, f32, s16);
+ bool Set(cXyz, cXyz, s16, f32);
+ bool Reset(cXyz, cXyz, f32, s16);
+ bool Reset(cXyz, cXyz);
+ bool Reset();
void ResetView();
- void Chtyp(s32);
- void U2();
+ bool Chtyp(s32);
+ s16 U2();
+ //void U2(s16 i_val) { mAngleY = cSAngle(i_val); }
void shakeCamera();
void StartShake(s32, u8*, s32, cXyz);
- void StopShake();
+ bool StopShake();
void ResetBlure(int);
void SetBlureAlpha(f32);
void SetBlureScale(f32, f32, f32);
@@ -349,16 +457,17 @@ public:
void SetBlurePosition(f32, f32, f32);
void SetBlurePositionType(int);
void SetBlureTimer(s32);
- void SubjectLockOn(fopAc_ac_c*);
- void SubjectLockOff();
- void GetForceLockOnActor();
- void ForceLockOn(fpc_ProcID);
- void ForceLockOff(fpc_ProcID);
- void SetExtendedPosition(cXyz*);
- void ScopeViewMsgModeOff();
+ bool SubjectLockOn(fopAc_ac_c*);
+ bool SubjectLockOff();
+ fopAc_ac_c* GetForceLockOnActor();
+ bool ForceLockOn(fpc_ProcID);
+ bool ForceLockOff(fpc_ProcID);
+ bool SetExtendedPosition(cXyz*);
+ bool ScopeViewMsgModeOff();
- void Bank() {}
- void Up() {}
+ f32 Fovy() { return mFovY + mFovYShake; }
+ cSAngle Bank() {}
+ cXyz Up() {}
cXyz Center() { return mCenter + mCenterShake; }
void StartEventCamera(int, int, ...);
@@ -401,22 +510,26 @@ public:
void bSplineEvCamera();
void twoActor0EvCamera();
+ void Pause() { if (g_dComIfG_gameInfo.play.mDemo->getObject()->getActiveCamera()) ResetView(); }
+ void Active() { if (m004 && !m005) Run(); else NotRun(); }
void CStickUse() { clrFlag(0x800000); }
void CStickUseless() { setFlag(0x800000); }
cXyz Eye() { return mEye + mEyeShake; }
void StickUse() { clrFlag(0x1000000); }
void StickUseless() { setFlag(0x1000000); }
void setFlag(u32 flag) { mEventFlags |= flag; }
- bool chkFlag(u32 flag) { return mEventFlags & flag; }
+ bool chkFlag(u32 flag) { return (mEventFlags & flag) ? true : false; }
void clrFlag(u32 flag) { mEventFlags &= ~flag; }
+
+ static engine_fn engine_tbl[];
+ static const int type_num;
+ static dCamera__Type types[63];
+ static const int mvBGType_num;
+ static char* mvBGTypes[34];
};
STATIC_ASSERT(sizeof(dCamera_c) == 0x800);
-class dBgS_CamSphChk {
- ~dBgS_CamSphChk();
-};
-
s16 dCam_getAngleY(camera_class*);
s16 dCam_getAngleX(camera_class*);
s16 dCam_getControledAngleY(camera_class*);
diff --git a/include/d/d_cc_s.h b/include/d/d_cc_s.h
index 18cadda8..b977b2f0 100644
--- a/include/d/d_cc_s.h
+++ b/include/d/d_cc_s.h
@@ -44,18 +44,19 @@ public:
return mMass_Mng.Chk(p_xyz, p_actor, p_hitInf);
}
void SetMass(cCcD_Obj* i_obj, u8 i_priority) { mMass_Mng.Set(i_obj, i_priority); }
+
void PrepareMass() { mMass_Mng.Prepare(); }
void SetMassAttr(f32 radius, f32 height, u8 param_2, u8 param_3) {
mMass_Mng.SetAttr(radius, height, param_2, param_3);
}
void ChkActor(fopAc_ac_c*) {}
- void GetMassCamTopPos(Vec*) {}
- void GetMassResultCam() {}
+ void GetMassCamTopPos(Vec* o_pos) { mMass_Mng.GetCamTopPos(o_pos); }
+ u32 GetMassResultCam() { return mMass_Mng.GetResultCam(); }
void OffMassAllTimer() {}
void OnMassAllTimer() {}
void SetMassAreaChk(cCcD_Obj*, u8, void (*)(fopAc_ac_c*, cXyz*, u32)) {}
- void SetMassCam(cM3dGCps&) {}
+ void SetMassCam(cM3dGCps& i_cps) { mMass_Mng.SetCam(i_cps); }
// /* 0x0000 */ cCcS mCCcS;
/* 0x2854 */ dCcMassS_Mng mMass_Mng;
diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h
index 8b94f168..e15cc6e8 100644
--- a/include/d/d_com_inf_game.h
+++ b/include/d/d_com_inf_game.h
@@ -180,14 +180,17 @@ public:
~dComIfG_camera_info_class() {}
/* 0x00 */ camera_class* mpCamera;
- /* 0x04 */ u8 mDlstWindowIdx;
- /* 0x05 */ u8 mCamIdx;
- /* 0x06 */ s8 field_0x06;
+ /* 0x04 */ s8 mDlstWindowIdx;
+ /* 0x05 */ s8 mCamP1Id;
+ /* 0x06 */ s8 mCamP2Id;
/* 0x07 */ u8 field_0x07;
/* 0x08 */ u32 mCameraAttentionStatus;
/* 0x0C */ f32 mCameraZoomScale;
/* 0x10 */ f32 mCameraZoomForcus;
- /* 0x14 */ u8 field_0x14[0x34 - 0x14];
+ /* 0x14 */ cXyz mCameraPos;
+ /* 0x20 */ cXyz mCameraTarget;
+ /* 0x2C */ f32 mCameraFovy;
+ /* 0x30 */ s16 mCameraBank;
};
STATIC_ASSERT(sizeof(dComIfG_camera_info_class) == 0x34);
@@ -200,6 +203,13 @@ struct ItemTableList {
u8 mItemTables[0x1E][0x10];
};
+class dComIfG_MesgCamInfo_c {
+public:
+ /* 0x00 */ int mID;
+ /* 0x04 */ int mBasicID;
+ /* 0x08 */ fopAc_ac_c* mActor[10];
+};
+
class dComIfG_play_c {
public:
#if VERSION == VERSION_JPN
@@ -240,6 +250,44 @@ public:
BOOL checkCameraAttentionStatus(int idx, u32 flag) {
return mCameraInfo[idx].mCameraAttentionStatus & flag;
}
+ u32 getCameraAttentionStatus(int i) { return mCameraInfo[i].mCameraAttentionStatus; }
+ void setCameraAttentionStatus(int i, u32 flag) { mCameraInfo[i].mCameraAttentionStatus = flag; }
+ void onCameraAttentionStatus(int i, u32 flag) { mCameraInfo[i].mCameraAttentionStatus |= flag; }
+ void offCameraAttentionStatus(int i, u32 flag) {
+ mCameraInfo[i].mCameraAttentionStatus &= ~flag;
+ }
+
+ void setCamera(int i, camera_class* cam) { mCameraInfo[i].mpCamera = cam; }
+ void setCameraInfo(int idx, camera_class* camera_p, int dlst_window_idx, int player1_camera_id, int player2_camera_id) {
+ mCameraInfo[idx].mpCamera = camera_p;
+ mCameraInfo[idx].mDlstWindowIdx = dlst_window_idx;
+ mCameraInfo[idx].mCamP1Id = player1_camera_id;
+ mCameraInfo[idx].mCamP2Id = player2_camera_id;
+ setCameraAttentionStatus(0, 0);
+ }
+
+ f32 getCameraZoomForcus(int i_no) { return mCameraInfo[i_no].mCameraZoomForcus; }
+ void setCameraZoomForcus(int i_no, f32 i_focus) { mCameraInfo[i_no].mCameraZoomForcus = i_focus; }
+
+ f32 getCameraZoomScale(int i_no) { return mCameraInfo[i_no].mCameraZoomScale; }
+ void setCameraZoomScale(int i_no, f32 i_scale) { mCameraInfo[i_no].mCameraZoomScale = i_scale; }
+
+ void saveCameraPosition(int i, cXyz* i_pos, cXyz* i_target, f32 i_fovy, s16 i_bank) {
+ mCameraInfo[i].mCameraPos = *i_pos;
+ mCameraInfo[i].mCameraTarget = *i_target;
+ mCameraInfo[i].mCameraFovy = i_fovy;
+ mCameraInfo[i].mCameraBank = i_bank;
+ }
+
+ void loadCameraPosition(int i, cXyz* o_pos, cXyz* o_target, f32* o_fovy, s16* o_bank) {
+ *o_pos = mCameraInfo[i].mCameraPos;
+ *o_target = mCameraInfo[i].mCameraTarget;
+ *o_fovy = mCameraInfo[i].mCameraFovy;
+ *o_bank = mCameraInfo[i].mCameraBank;
+ }
+ void setMesgCamInfoBasicID(int id) { mMesgCamInfo.mBasicID = id; }
+ dComIfG_MesgCamInfo_c* getMesgCamInfo() { return &mMesgCamInfo; }
+ void setMesgCamInfoID(int param_0) { mMesgCamInfo.mID = param_0; }
~dComIfG_play_c() {}
@@ -293,10 +341,13 @@ public:
void setGameoverStatus(u8 stts) { mGameoverStatus = stts; }
fopAc_ac_c* getPlayerPtr(int idx) { return (fopAc_ac_c*)mpPlayerPtr[idx]; }
- fopAc_ac_c* getPlayer(int idx) { return (fopAc_ac_c*)mpPlayer[idx]; }
+ fopAc_ac_c* getPlayer(int idx) { return (fopAc_ac_c*)mpPlayer[idx * 2]; }
void setPlayer(int idx, fopAc_ac_c* player) { mpPlayer[idx] = (daPy_py_c*)player; }
void setPlayerPtr(int idx, fopAc_ac_c* playerPtr) { mpPlayerPtr[idx] = playerPtr; }
s8 getPlayerCameraID(int idx) { return mCurCamera[idx]; }
+ int getCameraPlayer1ID(int i) { return mCameraInfo[i].mCamP1Id; }
+ int getCameraPlayer2ID(int i) { return mCameraInfo[i].mCamP2Id; }
+ int getCameraWinID(int i) { return mCameraInfo[i].mDlstWindowIdx; }
void setPlayerInfo(int idx, fopAc_ac_c* player, int cam) {
mpPlayer[idx] = (daPy_py_c*)player;
mCurCamera[idx] = cam;
@@ -456,16 +507,6 @@ public:
u8 getScopeMesgStatus() { return mbCamOverrideFarPlane; }
void setScopeMesgStatus(u8 status) { mbCamOverrideFarPlane = status; }
- void setCameraInfo(int idx, camera_class* camera_p, int dlst_window_idx, int cam_idx, int p5) {
- mCameraInfo[idx].mpCamera = camera_p;
- mCameraInfo[idx].mDlstWindowIdx = dlst_window_idx;
- mCameraInfo[idx].mCamIdx = cam_idx;
- mCameraInfo[idx].field_0x06 = p5;
- setCameraAttentionStatus(0, 0);
- }
- void setCameraAttentionStatus(int idx, u32 stts) {
- mCameraInfo[idx].mCameraAttentionStatus = stts;
- }
void setCurrentGrafPort(J2DOrthoGraph* i_graf) { mCurrentGrafPort = i_graf; }
void setCurrentWindow(dDlst_window_c* i_window) { mCurrentWindow = i_window; }
void setCurrentView(view_class* i_view) { mCurrentView = i_view; }
@@ -751,9 +792,7 @@ public:
/* 0x497A */ u8 field_0x497a;
/* 0x497B */ u8 field_0x497B[0x497C - 0x497B];
/* 0x497C */ JKRExpHeap* mpExpHeap2D;
- /* 0x4980 */ int mMesgCameraTagInfo;
- /* 0x4984 */ int field_0x4984;
- /* 0x4988 */ int field_0x4988[10];
+ /* 0x4980 */ dComIfG_MesgCamInfo_c mMesgCamInfo;
/* 0x49B0 */ u8 mPlayerInfoBuffer[sizeof(dSv_player_status_c_c)];
/* 0x4A20 */ u8 mPlayerInfoBufferStageNo;
/* 0x4A24 */ daAgb_c* mpAgb;
@@ -2207,6 +2246,22 @@ inline daPy_lk_c* daPy_getPlayerLinkActorClass() {
return (daPy_lk_c*)dComIfGp_getLinkPlayer();
}
+inline void dComIfGp_setWindowNum(int num) {
+ g_dComIfG_gameInfo.play.setWindowNum(num);
+}
+
+inline int dComIfGp_getCameraPlayer1ID(int idx) {
+ return g_dComIfG_gameInfo.play.getCameraPlayer1ID(idx);
+}
+
+inline int dComIfGp_getCameraPlayer2ID(int idx) {
+ return g_dComIfG_gameInfo.play.getCameraPlayer2ID(idx);
+}
+
+inline int dComIfGp_getCameraWinID(int idx) {
+ return g_dComIfG_gameInfo.play.getCameraWinID(idx);
+}
+
inline int dComIfGp_getPlayerCameraID(int idx) {
return g_dComIfG_gameInfo.play.getPlayerCameraID(idx);
}
@@ -2215,6 +2270,50 @@ inline u32 dComIfGp_checkCameraAttentionStatus(int idx, u32 flag) {
return g_dComIfG_gameInfo.play.checkCameraAttentionStatus(idx, flag);
}
+inline void dComIfGp_onCameraAttentionStatus(int i, u32 flag) {
+ g_dComIfG_gameInfo.play.onCameraAttentionStatus(i, flag);
+}
+
+inline void dComIfGp_offCameraAttentionStatus(int i, u32 flag) {
+ g_dComIfG_gameInfo.play.offCameraAttentionStatus(i, flag);
+}
+
+inline void dComIfGp_setCamera(int i, camera_class* cam) {
+ g_dComIfG_gameInfo.play.setCamera(i, cam);
+}
+
+inline void dComIfGp_setCameraInfo(int idx, camera_class* camera, int dlst, int cam, int p5) {
+ g_dComIfG_gameInfo.play.setCameraInfo(idx, camera, dlst, cam, p5);
+}
+
+inline void dComIfGp_setCameraZoomScale(int i_no, f32 i_scale) {
+ g_dComIfG_gameInfo.play.setCameraZoomScale(i_no, i_scale);
+}
+
+inline f32 dComIfGp_getCameraZoomScale(int i_no) {
+ return g_dComIfG_gameInfo.play.getCameraZoomScale(i_no);
+}
+
+inline void dComIfGp_setCameraZoomForcus(int i_no, f32 i_focus) {
+ g_dComIfG_gameInfo.play.setCameraZoomForcus(i_no, i_focus);
+}
+
+inline f32 dComIfGp_getCameraZoomForcus(int i_no) {
+ return g_dComIfG_gameInfo.play.getCameraZoomForcus(i_no);
+}
+
+inline u32 dComIfGp_getCameraAttentionStatus(int i_no) {
+ return g_dComIfG_gameInfo.play.getCameraAttentionStatus(i_no);
+}
+
+inline void dComIfGp_saveCameraPosition(int i, cXyz* i_pos, cXyz* i_target, f32 i_fovy, s16 i_bank) {
+ g_dComIfG_gameInfo.play.saveCameraPosition(i, i_pos, i_target, i_fovy, i_bank);
+}
+
+inline void dComIfGp_loadCameraPosition(int i, cXyz* o_pos, cXyz* o_target, f32* o_fovy, s16* o_bank) {
+ g_dComIfG_gameInfo.play.loadCameraPosition(i, o_pos, o_target, o_fovy, o_bank);
+}
+
inline int dComIfGp_getItemRupeeCount() {
return g_dComIfG_gameInfo.play.getItemRupeeCount();
}
@@ -2525,9 +2624,6 @@ inline void dComIfGp_plusMiniGameRupee(s16 count) {
g_dComIfG_gameInfo.play.plusMiniGameRupee(count);
}
-inline void dComIfGp_setCameraInfo(int idx, camera_class* camera, int dlst, int cam, int p5) {
- g_dComIfG_gameInfo.play.setCameraInfo(idx, camera, dlst, cam, p5);
-}
inline s32 dComIfGp_getWindowNum() { return g_dComIfG_gameInfo.play.getWindowNum(); }
inline void dComIfGp_setWindowNum(u8 num) { g_dComIfG_gameInfo.play.setWindowNum(num); }
inline dDlst_window_c * dComIfGp_getWindow(int idx) { return g_dComIfG_gameInfo.play.getWindow(idx); }
@@ -2626,6 +2722,19 @@ inline u8 dComIfGp_getMesgStatus() {
return g_dComIfG_gameInfo.play.getMesgStatus();
}
+
+inline void dComIfGp_setMesgCameraTagInfo(int id) {
+ g_dComIfG_gameInfo.play.setMesgCamInfoID(id);
+}
+
+inline void dComIfGp_setMesgCameraAttrInfo(int param_1) {
+ g_dComIfG_gameInfo.play.setMesgCamInfoBasicID(param_1);
+}
+
+inline dComIfG_MesgCamInfo_c* dComIfGp_getMesgCameraInfo() {
+ return g_dComIfG_gameInfo.play.getMesgCamInfo();
+}
+
inline u8 dComIfGp_checkMesgBgm() {
return g_dComIfG_gameInfo.play.checkMesgBgm();
}
@@ -3027,6 +3136,10 @@ inline u8 dComIfGp_evmng_getEventEndSound(s16 eventIdx) {
return g_dComIfG_gameInfo.play.getEvtManager().getEventEndSound(eventIdx);
}
+inline int dComIfGp_evmng_cameraPlay() {
+ return dComIfGp_getPEvtManager()->cameraPlay();
+}
+
/**
* === DEMO ===
*/
@@ -3063,6 +3176,9 @@ inline dDemo_actor_c* dComIfGp_demo_getActor(u8 id) {
return g_dComIfG_gameInfo.play.getDemo()->getObject()->getActor(id);
}
+stage_camera_class* dComIfGp_getRoomCamera(int i_roomNo);
+stage_arrow_class* dComIfGp_getRoomArrow(int i_roomNo);
+
/**
* === DRAWLIST ===
*/
@@ -3626,6 +3742,10 @@ inline void dComIfGp_att_chkEnemySound() {
* === MAP ===
*/
+ inline void dComIfGp_map_draw(f32 x, f32 z, int roomNo, f32 y) {
+ dMap_c::draw(x, z, roomNo, y);
+}
+
inline void dComIfGp_map_mapBufferSendAGB(int param_0) {
dMap_c::mapBufferSendAGB(param_0);
}
@@ -3710,4 +3830,6 @@ BOOL dComIfG_resetToOpening(scene_class* i_scene);
int dComIfG_changeOpeningScene(scene_class* i_scene, s16 i_procName);
+
+
#endif /* D_COM_D_COM_INF_GAME_H */
diff --git a/include/d/d_demo.h b/include/d/d_demo.h
index 70fa356f..51b3939b 100644
--- a/include/d/d_demo.h
+++ b/include/d/d_demo.h
@@ -181,11 +181,11 @@ public:
bool checkEnable(u8 mask) { return mFlags & mask; }
void onEnable(u8 flag) { mFlags |= flag; }
- void getFovy() {}
- void getRoll() {}
- void getTarget() {}
- void getTrans() {}
- void getUp() {}
+ f32 getFovy() { return mFovy; }
+ f32 getRoll() { return mRoll; }
+ cXyz& getTarget() { return mTargetPosition; }
+ cXyz& getTrans() { return mViewPosition; }
+ cXyz& getUp() { return mUpVector; }
private:
/* 0x04 */ u8 mFlags;
diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h
index 2ac32e5b..d90d57d8 100644
--- a/include/d/d_drawlist.h
+++ b/include/d/d_drawlist.h
@@ -210,6 +210,13 @@ public:
void update(cXyz&, GXColor&, u16, u16, u16, u16, f32, f32, f32, f32);
virtual void draw();
+ f32 getRndFX(f32 param_0) { return mRnd.getFX(param_0); }
+ f32 getRndValue(f32 param_0, f32 param_1) { return mRnd.getValue(param_0, param_1); }
+
+ void initRnd(int r0, int r1, int r2) {
+ mRnd.init(r0, r1, r2);
+ }
+
public:
/* 0x04 */ cM_rnd_c mRnd;
/* 0x10 */ cXyz mPos;
@@ -238,6 +245,7 @@ public:
void setScissor(f32, f32, f32, f32);
view_port_class* getViewPort() { return &mViewport; }
+ scissor_class* getScissor() { return &mViewport.mScissor; }
int getCameraID() { return mCameraID; }
void setCameraID(int id) { mCameraID = id; }
void setMode(int mode) { mMode = mode; }
diff --git a/include/d/d_event_manager.h b/include/d/d_event_manager.h
index f066495e..679f3bfd 100644
--- a/include/d/d_event_manager.h
+++ b/include/d/d_event_manager.h
@@ -67,7 +67,8 @@ public:
int setStartDemo(int eventInfoIdx) { return mException.setStartDemo(eventInfoIdx); }
void cancelStartDemo() { /* TODO */ }
- void setCameraPlay(u32 v) { mCameraPlay = v; }
+ void setCameraPlay(int v) { mCameraPlay = v; }
+ int cameraPlay() { return mCameraPlay; }
/* 0x000 */ dEvDtBase_c mList;
/* 0x020 */ u32 mCameraPlay;
diff --git a/include/d/d_spline_path.h b/include/d/d_spline_path.h
index 51253d3a..57a1dace 100644
--- a/include/d/d_spline_path.h
+++ b/include/d/d_spline_path.h
@@ -27,7 +27,10 @@ public:
/* 0x24 */ f32 mCurveWeight[3];
/* 0x30 */ s32 mCurveKey[3];
/* 0x3C */ void* mUser;
- /* 0x40 */ void* vtbl; // XXX
+ /* 0x40 */ //void* vtbl; // XXX
+
+ d2DBSplinePath() { Init(0, 0); }
+ virtual ~d2DBSplinePath(){};
};
#endif /* D_SPLINE_PATH_H */
diff --git a/include/d/d_stage.h b/include/d/d_stage.h
index c73fe6c6..9a4ed6e3 100644
--- a/include/d/d_stage.h
+++ b/include/d/d_stage.h
@@ -59,13 +59,13 @@ public:
};
struct stage_stag_info_class {
- /* 0x00 */ f32 field_0x0;
- /* 0x04 */ f32 field_0x4;
- /* 0x08 */ u8 mDefaultCameraType;
- /* 0x09 */ u8 field_0x09;
- /* 0x0A */ u16 field_0x0a;
- /* 0x0C */ u32 field_0x0c;
- /* 0x10 */ u32 field_0x10;
+ /* 0x00 */ f32 mNearPlane;
+ /* 0x04 */ f32 mFarPlane;
+ /* 0x08 */ u8 mCameraMapToolID;
+ /* 0x09 */ u8 mProp;
+ /* 0x0A */ u16 mParticleSceneNo;
+ /* 0x0C */ u32 mStageTypeAndSchbit;
+ /* 0x10 */ u32 mSchbitEnableAndFarPlane; // High 16 bits are the schbit enable, low 16 bits are the far plane
/* 0x14 */ u32 field_0x14;
/* 0x18 */ u32 field_0x18;
/* 0x1C */ u32 field_0x1c;
@@ -156,31 +156,33 @@ public:
};
struct stage_camera2_data_class {
- /* 0x00 */ int field_0x0;
- /* 0x04 */ f32 field_0x4;
- /* 0x08 */ f32 field_0x8;
- /* 0x0C */ f32 field_0xc;
- /* 0x10 */ u8 field_0x10;
- /* 0x11 */ u8 field_0x11;
- /* 0x12 */ u8 field_0x12;
- /* 0x13 */ u8 field_0x13;
- /* 0x14 */ u16 field_0x14;
- /* 0x16 */ u16 field_0x16;
+ /* 0x00 */ int m00;
+ /* 0x04 */ f32 m04;
+ /* 0x08 */ f32 m08;
+ /* 0x0C */ f32 m0C;
+ /* 0x10 */ u8 mArrowIdx;
+ /* 0x11 */ u8 m11;
+ /* 0x12 */ u8 m12;
+ /* 0x13 */ u8 m13;
}; // Size: 0x18
struct stage_camera_class {
/* 0x0 */ int num;
- /* 0x4 */ stage_camera2_data_class* m_entries;
+ /* 0x4 */ stage_camera2_data_class* mEntries;
};
struct stage_arrow_data_class {
- /* 0x00 */ cXyz mPosition;
- /* 0x0C */ csXyz mAngle;
+ struct {
+ /* 0x00 */ cXyz mPosition;
+ /* 0x0C */ csXyz mAngle;
+ /* 0x12 */ s16 m12;
+ }
+ /* 0x00 */ m00;
}; // Size: 0x14
struct stage_arrow_class {
/* 0x00 */ int num;
- /* 0x04 */ stage_arrow_data_class* m_entries;
+ /* 0x04 */ stage_arrow_data_class* mEntries;
};
class stage_actor_data_class {
@@ -1009,43 +1011,43 @@ const char* dStage_getName2(s16 i_procName, s8 i_subtype);
inline u8 dStage_stagInfo_DefaultCameraType(stage_stag_info_class* p_info) {
- return p_info->mDefaultCameraType;
+ return p_info->mCameraMapToolID;
}
inline s32 dStage_stagInfo_ChkKeyDisp(stage_stag_info_class* i_stagInfo) {
- return i_stagInfo->field_0x09 & 1;
+ return i_stagInfo->mProp & 1;
}
inline s32 dStage_stagInfo_GetSaveTbl(stage_stag_info_class* i_stagInfo) {
- return (i_stagInfo->field_0x09 >> 1) & 0x7F;
+ return (i_stagInfo->mProp >> 1) & 0x7F;
}
inline u32 dStage_stagInfo_GetSTType(stage_stag_info_class* i_stagInfo) {
- return (i_stagInfo->field_0x0c >> 16) & 7;
+ return (i_stagInfo->mStageTypeAndSchbit >> 16) & 7;
}
inline u8 dStage_stagInfo_GetUpButton(stage_stag_info_class* i_stagInfo) {
- return i_stagInfo->field_0x0a & 3;
+ return i_stagInfo->mParticleSceneNo & 3;
}
inline u8 dStage_stagInfo_GetParticleNo(stage_stag_info_class* i_stagInfo) {
- return (i_stagInfo->field_0x0a >> 0x3) & 0xFF;
+ return (i_stagInfo->mParticleSceneNo >> 0x3) & 0xFF;
}
inline s8 dStage_stagInfo_GetTimeH(stage_stag_info_class* p_info) {
- return (p_info->field_0x0c >> 8) & 0xFF;
+ return (p_info->mStageTypeAndSchbit >> 8) & 0xFF;
}
inline u16 dStage_stagInfo_GetCullPoint(stage_stag_info_class* p_info) {
- return p_info->field_0x10 & 0xFFFF;
+ return p_info->mSchbitEnableAndFarPlane & 0xFFFF;
}
inline u8 dStage_stagInfo_getStartSch(stage_stag_info_class* p_info) {
- return (p_info->field_0x10 >> 0x10) & 0xFF;
+ return (p_info->mSchbitEnableAndFarPlane >> 0x10) & 0xFF;
}
inline u8 dStage_stagInfo_GetSchSec(stage_stag_info_class* p_info) {
- return p_info->field_0x0c & 0xFF;
+ return p_info->mStageTypeAndSchbit & 0xFF;
}
// TODO:
diff --git a/include/f_ap/f_ap_game.h b/include/f_ap/f_ap_game.h
index daf4ccae..c50bcdc5 100644
--- a/include/f_ap/f_ap_game.h
+++ b/include/f_ap/f_ap_game.h
@@ -24,7 +24,7 @@ public:
/* 0x09 */ u8 field_0x09;
/* 0x0A */ u8 field_0x0a;
/* 0x0B */ u8 field_0x0b;
- /* 0x0C */ f32 field_0x0c;
+ /* 0x0C */ f32 mAspectRatio;
/* 0x10 */ u8 field_0x10;
/* 0x11 */ u8 field_0x11;
/* 0x12 */ u8 field_0x12;
@@ -77,5 +77,6 @@ inline bool fapGmHIO_isMenu() { return !!(g_HIO.mDisplayFlag & 0x02); }
inline bool fapGmHIO_getMeter() { return g_HIO.mDisplayMeter; }
inline s16 fapGmHIO_getFbWidth() { return g_HIO.mFbWidth; }
inline s16 fapGmHIO_getEfbHeight() { return g_HIO.mEfbHeight; }
+inline f32 fapGmHIO_getAspectRatio() { return g_HIO.mAspectRatio; }
#endif /* F_AP_GAME_H */
diff --git a/include/f_op/f_op_camera.h b/include/f_op/f_op_camera.h
index 39111e37..250a10a7 100644
--- a/include/f_op/f_op_camera.h
+++ b/include/f_op/f_op_camera.h
@@ -21,8 +21,7 @@ public:
class camera_class : public camera_process_class {
public:
- /* 0x23C */ int field_0x23c;
- /* 0x240 */ int field_0x244;
+ /* 0x23C */ request_of_phase_process_class phase_request;
/* 0x244 */ dCamera_c mCamera;
};
diff --git a/include/f_op/f_op_camera_mng.h b/include/f_op/f_op_camera_mng.h
index 2ad98168..6638255d 100644
--- a/include/f_op/f_op_camera_mng.h
+++ b/include/f_op/f_op_camera_mng.h
@@ -5,42 +5,96 @@
#include "SSystem/SComponent/c_sxyz.h"
#include "f_op/f_op_camera.h"
-/* void fopCamM_SetNear(camera_class* cam, f32 near) {
- cam->mNear = near;
+
+inline void fopCamM_SetAngleX(camera_class* i_camera, s16 angleX) {
+ i_camera->mAngle.x = angleX;
+}
+
+inline void fopCamM_SetAngleY(camera_class* i_camera, s16 angleY) {
+ i_camera->mAngle.y = angleY;
+}
+
+inline void fopCamM_SetAngleZ(camera_class* i_camera, s16 angleZ) {
+ i_camera->mAngle.z = angleZ;
+}
+
+inline void fopCamM_SetNear(camera_class* i_this, f32 near) {
+ i_this->mNear = near;
}
-void fopCamM_SetFar(camera_class* cam, f32 far) {
- cam->mFar = far;
+inline void fopCamM_SetFar(camera_class* i_this, f32 far) {
+ i_this->mFar = far;
}
-void fopCamM_SetFovy(camera_class* cam, f32 fovy) {
- cam->mFovy = fovy;
+inline void fopCamM_SetFovy(camera_class* i_this, f32 fovy) {
+ i_this->mFovy = fovy;
}
-void fopCamM_SetAspect(camera_class* cam, f32 aspect) {
- cam->mAspect = aspect;
+inline void fopCamM_SetAspect(camera_class* i_this, f32 aspect) {
+ i_this->mAspect = aspect;
}
-void fopCamM_SetEye(camera_class* cam, f32 x, f32 y, f32 z) {
- cam->field_0xd8.mEye.set(x, y, z);
+inline void fopCamM_SetEye(camera_class* i_this, f32 x, f32 y, f32 z) {
+ i_this->mLookat.mEye.set(x, y, z);
}
-void fopCamM_SetCenter(camera_class* cam, f32 x, f32 y, f32 z) {
- cam->field_0xd8.mCenter.set(x, y, z);
+inline void fopCamM_SetCenter(camera_class* i_this, f32 x, f32 y, f32 z) {
+ i_this->mLookat.mCenter.set(x, y, z);
}
-void fopCamM_SetBank(camera_class* cam, s16 bank) {
- cam->mBank = bank;
-} */
+inline void fopCamM_SetUp(camera_class* i_this, f32 x, f32 y, f32 z) {
+ i_this->mLookat.mUp.set(x, y, z);
+}
+
+inline void fopCamM_SetBank(camera_class* i_this, s16 bank) {
+ i_this->mBank = bank;
+}
+
+inline void fopCamM_SetPrm1(camera_class* i_this, int prm1) {
+ i_this->mPrm1 = prm1;
+}
+
+inline void fopCamM_SetPrm2(camera_class* i_this, int prm2) {
+ i_this->mPrm2 = prm2;
+}
+
+inline void fopCamM_SetPrm3(camera_class* i_this, int prm3) {
+ i_this->mPrm3 = prm3;
+}
+
+inline s16 fopCamM_GetAngleX(camera_class* i_camera) {
+ return i_camera->mAngle.x;
+}
inline s16 fopCamM_GetAngleY(camera_class* i_camera) {
return i_camera->mAngle.y;
}
+inline s16 fopCamM_GetAngleZ(camera_class* i_camera) {
+ return i_camera->mAngle.z;
+}
+
inline f32 fopCamM_GetFovy(camera_class* i_camera) {
return i_camera->mFovy;
}
+inline cXyz* fopCamM_GetEye_p(camera_class* i_camera) {
+ return &i_camera->mLookat.mEye;
+}
+
+inline cXyz* fopCamM_GetCenter_p(camera_class* i_camera) {
+ return &i_camera->mLookat.mCenter;
+}
+
+inline cXyz* fopCamM_GetUp_p(camera_class* i_camera) {
+ return &i_camera->mLookat.mUp;
+}
+
+
+inline s16 fopCamM_GetBank(camera_class* i_camera) {
+ return i_camera->mBank;
+}
+
fpc_ProcID fopCamM_Create(int i_cameraIdx, s16 pProcName, void* i_append);
void fopCamM_Management(void);
u32 fopCamM_GetParam(camera_class* pCamera);
diff --git a/include/m_Do/m_Do_audio.h b/include/m_Do/m_Do_audio.h
index 3bf52896..44139212 100644
--- a/include/m_Do/m_Do_audio.h
+++ b/include/m_Do/m_Do_audio.h
@@ -167,6 +167,18 @@ inline void mDoAud_linkVoiceStart(u32 param_0, Vec* i_sePos, u8 param_3, s8 para
mDoAud_zelAudio_c::getInterface()->linkVoiceStart(param_0, i_sePos, param_3, param_4);
}
+inline void mDoAud_getCameraMapInfo(u32 param_0) {
+ mDoAud_zelAudio_c::getInterface()->getCameraMapInfo(param_0);
+}
+
+inline void mDoAud_setCameraGroupInfo(u8 param_0) {
+ mDoAud_zelAudio_c::getInterface()->setCameraGroupInfo(param_0);
+}
+
+inline void mDoAud_getCameraInfo(Vec* param_0, MtxP param_1, u32 param_2) {
+ mDoAud_zelAudio_c::getInterface()->getCameraInfo(param_0, param_1, param_2);
+}
+
inline void mDoAud_setLinkGroupInfo(u8 param_0) {
mDoAud_zelAudio_c::getInterface()->setLinkGroupInfo(param_0);
}
diff --git a/include/m_Do/m_Do_graphic.h b/include/m_Do/m_Do_graphic.h
index f595f4ea..762a9791 100644
--- a/include/m_Do/m_Do_graphic.h
+++ b/include/m_Do/m_Do_graphic.h
@@ -40,6 +40,7 @@ public:
static u8 getBlureRate() { return mBlureRate; }
static MtxP getBlureMtx() { return mBlureMtx; }
static void offAutoForcus() { mAutoForcus = false; }
+ static void onAutoForcus() { mAutoForcus = true; }
static BOOL isAutoForcus() { return mAutoForcus; }
static void setTickRate(u32 rate) { JFWDisplay::getManager()->setTickRate(rate); }
static void waitBlanking(int wait) { JFWDisplay::getManager()->waitBlanking(wait); }
diff --git a/include/m_Do/m_Do_mtx.h b/include/m_Do/m_Do_mtx.h
index 69f3ff75..f0320557 100644
--- a/include/m_Do/m_Do_mtx.h
+++ b/include/m_Do/m_Do_mtx.h
@@ -143,6 +143,10 @@ inline void cMtx_inverseTranspose(const Mtx a, Mtx b) {
mDoMtx_inverseTranspose(a, b);
}
+inline void cMtx_concatProjView(const Mtx a, const Mtx b, Mtx c) {
+ mDoMtx_concatProjView(a, b, c);
+}
+
class mDoMtx_stack_c {
public:
mDoMtx_stack_c() {