Started work on pushable boxes (#32)

* Started work on pushable boxes

* Minor fixes

* Fix inlines

* Comment GetHomeRoomNo
This commit is contained in:
LagoLunatic
2023-09-14 18:42:57 -04:00
committed by GitHub
parent b0eb3c4f2b
commit c754cf4e2a
11 changed files with 936 additions and 687 deletions
+15 -1
View File
@@ -2,6 +2,7 @@
#define D_A_OBJ
#include "f_op/f_op_actor_mng.h"
#include "d/d_cc_d.h"
namespace daObj {
template <typename T>
@@ -9,8 +10,21 @@ namespace daObj {
u32 param = fopAcM_GetParam(actor);
return ((1 << width) - 1) & (param >> shift);
}
void make_land_effect(fopAc_ac_c*, dBgS_GndChk*, float);
void get_wind_spd(fopAc_ac_c*, float);
void get_path_spd(cBgS_PolyInfo&, float);
void posMoveF_stream(fopAc_ac_c*, const cXyz*, const cXyz*, float, float);
void posMoveF_grade(fopAc_ac_c*, const cXyz*, const cXyz*, float, float, const cXyz*, float, float, const cXyz*);
void quat_rotBaseY(Quaternion*, const cXyz&);
void quat_rotBaseY2(Quaternion*, const cXyz&);
void quat_rotBaseZ(Quaternion*, const cXyz&);
void quat_rotVec(Quaternion*, const cXyz&, const cXyz&);
void SetCurrentRoomNo(fopAc_ac_c*, dBgS_GndChk*);
void HitSeStart(const cXyz*, int, const dCcD_GObjInf*, unsigned long);
void HitEff_sub_kikuzu(const cXyz*, const cXyz*, const dKy_tevstr_c*);
void HitEff_kikuzu(const fopAc_ac_c*, const dCcD_Cyl*);
void HitEff_hibana(const cXyz*, const cXyz*);
void HitEff_hibana(const fopAc_ac_c*, const dCcD_Cyl*);
};
+6 -3
View File
@@ -5,8 +5,11 @@
#include "f_op/f_op_actor_mng.h"
class dBgW;
typedef void (*MoveBGActor_SetFunc)(dBgW*, void*, cBgS_PolyInfo&, bool, cXyz*, csXyz*,
csXyz*);
typedef void (*MoveBGActor_SetFunc)(dBgW*, void*, cBgS_PolyInfo&, bool, cXyz*, csXyz*, csXyz*);
void dBgS_MoveBGProc_Typical(dBgW*, void*, cBgS_PolyInfo&, bool, cXyz*, csXyz*, csXyz*);
void dBgS_MoveBGProc_RotY(dBgW*, void*, cBgS_PolyInfo&, bool, cXyz*, csXyz*, csXyz*);
void dBgS_MoveBGProc_TypicalRotY(dBgW*, void*, cBgS_PolyInfo&, bool, cXyz*, csXyz*, csXyz*);
void dBgS_MoveBGProc_Trans(dBgW*, void*, cBgS_PolyInfo&, bool, cXyz*, csXyz*, csXyz*);
class dBgS_MoveBgActor : public fopAc_ac_c {
public:
@@ -15,7 +18,7 @@ public:
dBgS_MoveBgActor();
int MoveBGCreateHeap();
int MoveBGCreate(char const*, int, MoveBGActor_SetFunc, u32);
int MoveBGCreate(char const* resName, int resIndex, MoveBGActor_SetFunc callback, u32 resSize);
int MoveBGDelete();
int MoveBGExecute();
+2 -2
View File
@@ -759,8 +759,8 @@ inline void* dComIfG_getObjectRes(const char* arcName, const char* resName) {
return g_dComIfG_gameInfo.mResControl.getObjectRes(arcName, resName);
}
inline void* dComIfG_getObjectRes(const char* arcName, int param_1) {
return g_dComIfG_gameInfo.mResControl.getObjectRes(arcName, param_1);
inline void* dComIfG_getObjectRes(const char* arcName, int index) {
return g_dComIfG_gameInfo.mResControl.getObjectRes(arcName, index);
}
inline void* dComIfG_getObjectIDRes(const char* arcName, int id) {
+30
View File
@@ -0,0 +1,30 @@
#ifndef D_PATH_H
#define D_PATH_H
#include "d/d_bg_s.h"
#include "dolphin/types.h"
struct dPath__Point {
/* 0x00 */ u8 mArg0;
/* 0x01 */ u8 mArg1;
/* 0x02 */ u8 mArg2;
/* 0x03 */ u8 mArg3;
/* 0x04 */ cXyz mPos;
};
struct dPath {
/* 0x00 */ u16 mNum;
/* 0x02 */ u16 mNextPathId;
/* 0x04 */ u8 mArg0;
/* 0x05 */ u8 mLoops;
/* 0x06 */ u8 field4_0x6;
/* 0x07 */ u8 field5_0x7;
/* 0x08 */ dPath__Point* mpPnt;
};
dPath__Point* dPath_GetPnt(dPath*, int);
dPath* dPath_GetRoomPath(int, int);
void dPath_GetNextRoomPath(dPath*, int);
void dPath_GetPolyRoomPathVec(cBgS_PolyInfo&, cXyz*, int*);
#endif /* D_PATH_H */
+2 -2
View File
@@ -68,8 +68,8 @@ public:
return getRes(arcName, resName, &mObjectInfo[0], ARRAY_SIZE(mObjectInfo));
}
void* getObjectRes(const char* arcName, s32 param_1) {
return getRes(arcName, param_1, &mObjectInfo[0], ARRAY_SIZE(mObjectInfo));
void* getObjectRes(const char* arcName, s32 index) {
return getRes(arcName, index, &mObjectInfo[0], ARRAY_SIZE(mObjectInfo));
}
void* getObjectIDRes(const char* arcName, u16 id) {
+6 -7
View File
@@ -337,16 +337,16 @@ inline void dComIfGs_offSwitch(int i_no, int i_roomNo);
inline BOOL dComIfGs_isSwitch(s32 i_no, s32 i_roomNo);
inline void dComIfGs_offActor(int i_no, int i_roomNo);
inline void i_fopAcM_onSwitch(const fopAc_ac_c* pActor, int sw) {
return dComIfGs_onSwitch(sw, fopAcM_GetHomeRoomNo(pActor));
inline void fopAcM_onSwitch(const fopAc_ac_c* pActor, int sw) {
return dComIfGs_onSwitch(sw, pActor->orig.roomNo); // Should use fopAcM_GetHomeRoomNo, but that breaks regalloc?
}
inline void i_fopAcM_offSwitch(const fopAc_ac_c* pActor, int sw) {
return dComIfGs_offSwitch(sw, fopAcM_GetHomeRoomNo(pActor));
inline void fopAcM_offSwitch(const fopAc_ac_c* pActor, int sw) {
return dComIfGs_offSwitch(sw, pActor->orig.roomNo); // Should use fopAcM_GetHomeRoomNo, but that breaks regalloc?
}
inline BOOL i_fopAcM_isSwitch(const fopAc_ac_c* item, int sw) {
return dComIfGs_isSwitch(sw, fopAcM_GetHomeRoomNo(item));
inline BOOL fopAcM_isSwitch(const fopAc_ac_c* pActor, int sw) {
return dComIfGs_isSwitch(sw, pActor->orig.roomNo); // Should use fopAcM_GetHomeRoomNo, but that breaks regalloc?
}
inline fopAc_ac_c* i_fopAcM_SearchByName(s16 proc_id) {
@@ -487,7 +487,6 @@ s32 fopAcM_orderTreasureEvent(fopAc_ac_c*, fopAc_ac_c*, u16, u16);
fopAc_ac_c* fopAcM_getTalkEventPartner(const fopAc_ac_c*);
fopAc_ac_c* fopAcM_getItemEventPartner(const fopAc_ac_c*);
fopAc_ac_c* fopAcM_getEventPartner(const fopAc_ac_c*);
static void fopAcM_onSwitch(fopAc_ac_c const* param_0, int param_1);
s32 fopAcM_createItemForPresentDemo(cXyz const* p_pos, int i_itemNo, u8 param_2, int i_itemBitNo,
int i_roomNo, csXyz const* p_angle, cXyz const* p_scale);
+1 -1
View File
@@ -242,7 +242,7 @@ public:
static void ZXYrotS(s16 x, s16 y, s16 z) { mDoMtx_ZXYrotS(now, x, y, z); }
/**
* Rotates the `now` matrix by the given X, Y, and Z values in the order X, Y, Z
* Rotates the `now` matrix by the given X, Y, and Z values in the order Z, X, Y
* @param x The x-axis rotation value
* @param y The y-axis rotation value
* @param z The z-axis rotation value
+1 -1
View File
@@ -82,7 +82,7 @@ static void event_start_check(andsw0_class* i_this) {
switch (i_this->mEventState) {
case 0:
default:
if (i_this->mEventIdx != -1 && i_fopAcM_isSwitch(i_this, i_this->mSwitchToSet)) {
if (i_this->mEventIdx != -1 && fopAcM_isSwitch(i_this, i_this->mSwitchToSet)) {
if (i_this->mEvtInfo.i_checkCommandDemoAccrpt()) {
i_this->mEventState++;
} else {
+1 -1
View File
@@ -166,7 +166,7 @@ void daItem_c::CreateInit() {
}
mSwitchId = (fpcM_GetParam(this) & 0x00FF0000) >> 0x10;
if (mSwitchId != 0xFF && i_fopAcM_isSwitch(this, mSwitchId)) {
if (mSwitchId != 0xFF && fopAcM_isSwitch(this, mSwitchId)) {
hide();
mStatusFlags |= 2;
}
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -3,16 +3,16 @@
// Translation Unit: d_path.cpp
//
#include "d_path.h"
#include "d/d_path.h"
#include "dolphin/types.h"
/* 80080018-8008010C .text dPath_GetPnt__FP5dPathi */
void dPath_GetPnt(dPath*, int) {
dPath__Point* dPath_GetPnt(dPath*, int) {
/* Nonmatching */
}
/* 8008010C-80080218 .text dPath_GetRoomPath__Fii */
void dPath_GetRoomPath(int, int) {
dPath* dPath_GetRoomPath(int, int) {
/* Nonmatching */
}