d_camera improvements (part 1) (#2623)

* Rename several dCamera_c fields

* Refactor mWork to generic buffer instead of union

* d_camera match improvements

* Implement several dCamera_c functions

* Remove d_camera.h from PCH

The symbol names in d_camera indicate that this header wasn't
included in the PCH (as they're compiled directly in d_camera.cpp).
This commit is contained in:
Max Roncace
2025-09-03 03:32:02 -04:00
committed by GitHub
parent 2fa0c3947a
commit 30afae62d1
121 changed files with 3468 additions and 3150 deletions
+1
View File
@@ -12,6 +12,7 @@
#include "d/d_particle_copoly.h"
#include "d/d_save.h"
#include "f_op/f_op_actor_mng.h"
#include "f_op/f_op_camera_mng.h"
class J2DAnmColorKey;
class J2DAnmTransformKey;
+4 -4
View File
@@ -221,11 +221,11 @@ public:
/* 80844590 */ int draw();
/* 8084478C */ ~daHorse_c();
/* 80182D04 */ bool getLashDashStart() const { return checkResetStateFlg0(RFLG0_LASH_DASH_START); }
/* 80182D04 */ BOOL getLashDashStart() const { return checkResetStateFlg0(RFLG0_LASH_DASH_START); }
bool checkNoBombProc() const { return m_procID == PROC_WAIT_e || m_procID == PROC_MOVE_e; }
bool checkResetStateFlg0(daHorse_RFLG0 flag) const { return m_resetStateFlg0 & flag; }
BOOL checkResetStateFlg0(daHorse_RFLG0 flag) const { return m_resetStateFlg0 & flag; }
bool checkEndResetStateFlg0(daHorse_ERFLG0 flag) const { return m_endResetStateFlg0 & flag; }
u32 checkStateFlg0(daHorse_FLG0 flag) const { return m_stateFlg0 & flag; }
f32 getNormalMaxSpeedF() { return m_normalMaxSpeedF; }
@@ -258,7 +258,7 @@ public:
void setZeldaActor(fopAc_ac_c* i_actor) { m_zeldaActorKeep.setData(i_actor); }
bool checkTurnStandCamera() const { return checkResetStateFlg0(RFLG0_TURN_STAND_CAMERA); }
bool checkTurnStand() const { return checkResetStateFlg0(RFLG0_TURN_STAND); }
BOOL checkTurnStand() const { return checkResetStateFlg0(RFLG0_TURN_STAND); }
u32 checkRodeoMode() const { return checkStateFlg0(FLG0_RODEO_MODE); }
bool checkCutTurnCancel() const { return checkEndResetStateFlg0(ERFLG0_CUT_TURN_CANCEL); }
bool checkTurnCancelKeep() const { return checkStateFlg0(FLG0_TURN_CANCEL_KEEP); }
@@ -270,7 +270,7 @@ public:
bool checkWait() const { return m_procID == PROC_WAIT_e; }
bool checkLand() const { return m_procID == PROC_LAND_e && field_0x171a == 0; }
bool checkGetOff() const { return fabsf(speedF) < 3.0f; }
bool checkEnemySearch() { return checkResetStateFlg0(RFLG0_ENEMY_SEARCH); }
BOOL checkEnemySearch() { return checkResetStateFlg0(RFLG0_ENEMY_SEARCH); }
bool checkOriginalDemo() const { return field_0x16b8 == 3; }
bool checkHorseDemoMode() { return field_0x16b8 != 0; }
s16 checkCowHit() const { return m_cowHit; }
+3 -2
View File
@@ -371,8 +371,9 @@ public:
void resetRatBody() {}
bool checkFlyWaitAnime() const {
return mBckHeap[0].getIdx() == 0x1CB || mBckHeap[0].getIdx() == 0x1C7
|| mBckHeap[0].getIdx() == 0x1C8 || mBckHeap[0].getIdx() == 0x1C9;
// fakematch (doesn't match in debug)
return (u16)mBckHeap[0].getIdx() == 0x1CB || ((u16)mBckHeap[0].getIdx() == 0x1C7
|| (u16)mBckHeap[0].getIdx() == 0x1C8 || (u16)mBckHeap[0].getIdx() == 0x1C9);
}
void onForceMorfCancel() { onEndResetStateFlg0(ERFLG0_FORCE_MORF_CANCEL); }
+1
View File
@@ -4,6 +4,7 @@
#include "d/actor/d_a_npc.h"
#include "d/d_cc_uty.h"
#include "d/d_path.h"
#include "d/d_spline_path.h"
struct cXyz;
class daNpc_Hanjo_c;
+1 -1
View File
@@ -703,7 +703,7 @@ public:
cXyz* getLeftFootPosP() { return &mLeftFootPos; }
cXyz getLeftFootPos() const { return mLeftFootPos; }
cXyz getRightFootPos() const { return mRightFootPos; }
BOOL checkCopyRodThrowAfter() const { return checkNoResetFlg3(FLG3_COPY_ROD_THROW_AFTER); }
u32 checkCopyRodThrowAfter() const { return checkNoResetFlg3(FLG3_COPY_ROD_THROW_AFTER); }
u32 checkRide() const { return checkHorseRide() || checkBoarRide() || checkSpinnerRide() || checkCanoeRide() || checkBoardRide(); }
cXyz getRightHandPos() const { return mRightHandPos; }
const cXyz getLeftHandPos() const { return mLeftHandPos; }
+3
View File
@@ -96,6 +96,9 @@ public:
/* 80182CD0 */ f32 Val(s32 param_0, int param_1) {
return mCamStyleData[param_0].field_0x8[param_1];
}
void SetVal(s32 param_0, int param_1, f32 i_value) {
mCamStyleData[param_0].field_0x8[param_1] = i_value;
}
/* 0x00 */ u8 mMapToolFovy;
/* 0x01 */ u8 mMapToolArg0;
+679 -616
View File
File diff suppressed because it is too large Load Diff
+6 -3
View File
@@ -9,7 +9,9 @@
#include "d/d_resorce.h"
#include "d/d_save.h"
#include "d/d_vibration.h"
#include "f_op/f_op_camera_mng.h"
#include "d/d_drawlist.h"
#include "d/d_stage.h"
#include "f_op/f_op_actor.h"
#include "global.h"
#include "m_Do/m_Do_controller_pad.h"
@@ -45,6 +47,7 @@ public:
/* 0x4 */ JKRHeap* mpHeap;
};
class camera_class;
class dComIfG_camera_info_class {
public:
dComIfG_camera_info_class() {}
@@ -4106,10 +4109,10 @@ inline view_port_class* dComIfGd_getViewport() {
}
inline MtxP dComIfGd_getViewRotMtx() {
return ((camera_process_class*)g_dComIfG_gameInfo.drawlist.getView())->viewMtxNoTrans;
return g_dComIfG_gameInfo.drawlist.getView()->viewMtxNoTrans;
}
inline MtxP dComIfGd_getViewMtx() {
return ((camera_process_class*)g_dComIfG_gameInfo.drawlist.getView())->viewMtx;
return g_dComIfG_gameInfo.drawlist.getView()->viewMtx;
}
inline J3DDrawBuffer* dComIfGd_getListFilter() {
+1 -1
View File
@@ -1362,7 +1362,7 @@ inline u16 dStage_stagInfo_GetStageTitleNo(stage_stag_info_class* pstag) {
return pstag->mStageTitleNo;
}
inline u8 dStage_stagInfo_DefaultCameraType(stage_stag_info_class* pstag) {
inline int dStage_stagInfo_DefaultCameraType(stage_stag_info_class* pstag) {
return pstag->mCameraType;
}