Skip to content

Commit

Permalink
Started work on pushable boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Sep 14, 2023
1 parent f1d8c41 commit 7cded3c
Show file tree
Hide file tree
Showing 11 changed files with 936 additions and 687 deletions.
16 changes: 15 additions & 1 deletion include/d/d_a_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@
#define D_A_OBJ

#include "f_op/f_op_actor_mng.h"
#include "d/d_cc_d.h"

namespace daObj {
template <typename T>
int PrmAbstract(const fopAc_ac_c* actor, T width, T shift) {
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*);
};

Expand Down
9 changes: 6 additions & 3 deletions include/d/d_bg_s_movebg_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -15,7 +18,7 @@ class dBgS_MoveBgActor : public fopAc_ac_c {

dBgS_MoveBgActor();
int MoveBGCreateHeap();
int MoveBGCreate(char const*, int, MoveBGActor_SetFunc, u32);
int MoveBGCreate(char const* resName, int resIndex, MoveBGActor_SetFunc callback, u32 size);
int MoveBGDelete();
int MoveBGExecute();

Expand Down
4 changes: 2 additions & 2 deletions include/d/d_com_inf_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
30 changes: 30 additions & 0 deletions include/d/d_path.h
Original file line number Diff line number Diff line change
@@ -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 */
4 changes: 2 additions & 2 deletions include/d/d_resorce.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class dRes_control_c {
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) {
Expand Down
13 changes: 6 additions & 7 deletions include/f_op/f_op_actor_mng.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

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);
}

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);
}

inline fopAc_ac_c* i_fopAcM_SearchByName(s16 proc_id) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion include/m_Do/m_Do_mtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class mDoMtx_stack_c {
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
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_andsw0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading

0 comments on commit 7cded3c

Please sign in to comment.