Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions include/d/actor/d_a_npc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ struct daNpc_GetParam2 { // name unknown
/* 0x8 */ int arcIdx;
};

struct dPnt : public dStage_dPnt_c {};

class daNpcT_ActorMngr_c {
private:
/* 0x0 */ fpc_ProcID mActorID;
Expand Down Expand Up @@ -1165,7 +1163,7 @@ class daNpcF_SPCurve_c {
/* 0x02 */ u16 field_0x02;
/* 0x04 */ bool mIsReversed;
/* 0x05 */ bool mIsClosed;
/* 0x08 */ dStage_dPnt_c mPoints[96];
/* 0x08 */ dPnt mPoints[96];

public:
/* 80150870 */ void initialize(dPath*, int);
Expand Down
14 changes: 11 additions & 3 deletions include/d/d_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
#define D_D_PATH_H

#include "dolphin/types.h"
#include "mtx.h"

class cBgS_PolyInfo;
struct cXyz;
struct dStage_dPnt_c;

struct dPnt {
/* 0x0 */ u8 mArg1;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 mArg0;
/* 0x4 */ Vec m_position;
}; // Size: 0x10

struct dPath {
/* 0x0 */ u16 m_num;
Expand All @@ -14,14 +22,14 @@ struct dPath {
/* 0x5 */ bool m_closed;
/* 0x6 */ u8 field_0x6;
/* 0x7 */ u8 field_0x7;
/* 0x8 */ dStage_dPnt_c* m_points;
/* 0x8 */ dPnt* m_points;
};

inline BOOL dPath_ChkClose(dPath* i_path) { return i_path->m_closed & 1; }

dPath* dPath_GetRoomPath(int path_index, int room_no);
dPath* dPath_GetNextRoomPath(dPath const* i_path, int room_no);
dStage_dPnt_c* dPath_GetPnt(dPath const* i_path, int pnt_index);
dPnt* dPath_GetPnt(dPath const* i_path, int pnt_index);
u8 dPath_GetPolyRoomPathVec(cBgS_PolyInfo const& poly, cXyz* p_pathVec, int* param_2);

#endif /* D_D_PATH_H */
9 changes: 3 additions & 6 deletions include/d/d_stage.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,9 @@ class dStage_FileList_dt_c {

// PPNT
struct dStage_dPnt_c {
/* 0x0 */ u8 mArg1;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 mArg0;
/* 0x4 */ Vec m_position;
}; // Size: 0x10
/* 0x0 */ int num;
/* 0x4 */ u32 m_pnt_offset;
}; // Size: 0x8

struct dStage_FloorInfo_c {
// FLOR
Expand Down
2 changes: 1 addition & 1 deletion include/dolphin/mtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
extern "C" {
#endif

typedef struct {
typedef struct Vec {
f32 x, y, z;
} Vec, *VecPtr, Point3d, *Point3dPtr;

Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_alink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14992,7 +14992,7 @@ s16 daAlink_c::getSceneExitMoveAngle() {
return mDemo.getMoveAngle();
}

dStage_dPnt_c* var_r30 = &field_0x2f58->m_points[field_0x2fc2];
dPnt* var_r30 = &field_0x2f58->m_points[field_0x2fc2];
f32 dx = var_r30->m_position.x - current.pos.x;
f32 dz = var_r30->m_position.z - current.pos.z;

Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_b_ds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ void daB_DS_c::mCreateTrap(bool param_0) {

dPath* path = dPath_GetRoomPath(3, fopAcM_GetRoomNo(this));
if (path != NULL) {
dStage_dPnt_c& point = path->m_points[trap_create_id];
dPnt& point = path->m_points[trap_create_id];
pos = point.m_position;
vec = pos - current.pos;
if (vec.abs() <= 200.0f) {
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_cow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3151,7 +3151,7 @@ u8 daCow_c::initialize() {
mPath = dPath_GetRoomPath(prm1, fopAcM_GetRoomNo(this));
mPointIndex = 0;

dStage_dPnt_c* point = dPath_GetPnt(mPath, mPointIndex);
dPnt* point = dPath_GetPnt(mPath, mPointIndex);
current.pos = point->m_position;

setProcess(&daCow_c::action_crazy, false);
Expand Down
4 changes: 2 additions & 2 deletions src/d/actor/d_a_e_ba.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static BOOL path_check(e_ba_class* i_this) {
vec1 = i_this->current.pos;
vec1.y += 100.0f;
static bool check_index[255];
dStage_dPnt_c* point = i_this->mpPath->m_points;
dPnt* point = i_this->mpPath->m_points;
for (int i = 0; i < i_this->mpPath->m_num; i++, point++) {
vec2.x = point->m_position.x;
vec2.y = point->m_position.y + 100.0f;
Expand Down Expand Up @@ -507,7 +507,7 @@ static void e_ba_return(e_ba_class* i_this) {

/* 8068039C-806806B4 00179C 0318+00 1/1 0/0 0/0 .text e_ba_path_fly__FP10e_ba_class */
static void e_ba_path_fly(e_ba_class* i_this) {
dStage_dPnt_c* point;
dPnt* point;

switch (i_this->mMode) {
case 0:
Expand Down
4 changes: 2 additions & 2 deletions src/d/actor/d_a_e_pm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void daE_PM_c::SearchFarP() {
//! @bug best_distance is not initialized
f32 best_distance;
int best_index;
dStage_dPnt_c* pnt = dPath_GetPnt(mpPath, 0);
dPnt* pnt = dPath_GetPnt(mpPath, 0);
cXyz point(pnt->m_position.x, pnt->m_position.y, pnt->m_position.z);
for (int i = 0; i < mpPath->m_num; i++) {
pnt = dPath_GetPnt(mpPath, i);
Expand All @@ -343,7 +343,7 @@ void daE_PM_c::SearchFarP() {
/* 80742C94-80742E1C 000E94 0188+00 3/3 0/0 0/0 .text SearchNearP__8daE_PM_cFv */
void daE_PM_c::SearchNearP() {
//! @bug Whatever this function is supposed to do is almost certainly not what it actually does.
dStage_dPnt_c* pnt = dPath_GetPnt(mpPath, 0);
dPnt* pnt = dPath_GetPnt(mpPath, 0);
if (current.pos.absXZ(pnt->m_position) < 1.0e9f) {
mPoint = pnt->m_position;
}
Expand Down
6 changes: 3 additions & 3 deletions src/d/actor/d_a_e_rdy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ static BOOL path_check(e_rdy_class* i_this) {
cXyz start, end;
start = i_this->current.pos;
start.y += 10.0f;
dStage_dPnt_c* point = i_this->mpPath->m_points;
dPnt* point = i_this->mpPath->m_points;
for (int i = 0; i < i_this->mpPath->m_num; i++, point++) {
if (i < 0xff) {
end.x = point->m_position.x;
Expand Down Expand Up @@ -1258,7 +1258,7 @@ static s8 e_rdy_bow2(e_rdy_class* i_this) {
}

if (i_this->mpPath != NULL) {
dStage_dPnt_c* point = i_this->mpPath->m_points;
dPnt* point = i_this->mpPath->m_points;
i_this->mArrowTarget.x = point->m_position.x;
i_this->mArrowTarget.y = point->m_position.y;
i_this->mArrowTarget.z = point->m_position.z;
Expand Down Expand Up @@ -2851,7 +2851,7 @@ static void e_rdy_jyunkai(e_rdy_class* i_this) {
case 0: {
anm_init(i_this, ANM_WALK, 10.0f, J3DFrameCtrl::EMode_LOOP, 1.0f);
i_this->mMode = 1;
dStage_dPnt_c* point = &i_this->mpPath->m_points[i_this->mPathIndex];
dPnt* point = &i_this->mpPath->m_points[i_this->mPathIndex];
i_this->field_0x5bc = point->m_position;
// fallthrough
}
Expand Down
4 changes: 2 additions & 2 deletions src/d/actor/d_a_e_s1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static BOOL path_check(e_s1_class* i_this) {
start_pos = a_this->current.pos;
start_pos.y += WREG_F(0) + 10.0f;

dStage_dPnt_c* point = i_this->mpPath->m_points;
dPnt* point = i_this->mpPath->m_points;
for (int i = 0; i < i_this->mpPath->m_num; i++, point++) {
if (i < 255) {
end_pos.x = point->m_position.x;
Expand Down Expand Up @@ -754,7 +754,7 @@ static void e_s1_path(e_s1_class* i_this) {
}

{
dStage_dPnt_c* point = &i_this->mpPath->m_points[i_this->mCurrentPathPointNo];
dPnt* point = &i_this->mpPath->m_points[i_this->mCurrentPathPointNo];
i_this->mPathTargetPos.x = point->m_position.x;
i_this->mPathTargetPos.y = point->m_position.y;
i_this->mPathTargetPos.z = point->m_position.z;
Expand Down
4 changes: 2 additions & 2 deletions src/d/actor/d_a_e_yk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static int path_check(e_yk_class* i_this) {
cXyz path_point_pos;
current_keese_pos = i_this->current.pos;
current_keese_pos.y += 100.0f;
dStage_dPnt_c* points = i_this->mpPath->m_points;
dPnt* points = i_this->mpPath->m_points;

// Set/update check_index array based on whether or not path points
// were crossed
Expand Down Expand Up @@ -591,7 +591,7 @@ static void e_yk_path_fly(e_yk_class* i_this) {
case 2:
i_this->mActionPhase = 3;

dStage_dPnt_c* point = i_this->mpPath->m_points;
dPnt* point = i_this->mpPath->m_points;
point = &point[i_this->mPathPntIdx];

i_this->field_0x68c = 0.0f;
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_e_ym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2384,7 +2384,7 @@ void daE_YM_c::executeSwitch() {
field_0x6e6 = 0x5dc;
field_0x6e8 = 0;
} else {
dStage_dPnt_c* pnt = dPath_GetPnt(mpPath, mCurrentPntNo);
dPnt* pnt = dPath_GetPnt(mpPath, mCurrentPntNo);
mCurrentPntNo = 0;
++mCurrentPntNo;
old.pos = pnt->m_position;
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_kytag03.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void dEnvSe_getNearPathPos(cXyz* param_0, cXyz* param_1, dPath* i_path) {
f32 var_f31 = FLT_MAX;

int i;
dStage_dPnt_c* point_p = i_path->m_points;
dPnt* point_p = i_path->m_points;

cXyz sp3C[2];
cM3dGLin sp14;
Expand Down
6 changes: 3 additions & 3 deletions src/d/actor/d_a_kytag06.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ static dPath* set_path_info(fopAc_ac_c* i_this) {
}

/* 80857F8C-8085811C 00080C 0190+00 1/1 0/0 0/0 .text near_rail_get__FP13kytag06_classP4cXyz */
static dStage_dPnt_c* near_rail_get(kytag06_class* i_this, cXyz* i_pos) {
static dPnt* near_rail_get(kytag06_class* i_this, cXyz* i_pos) {
f32 nearest_dist = 100000000.0f;
dPath* path = i_this->mpPath;
dStage_dPnt_c* pnt;
dPnt* pnt;

for (int i = 0; i < path->m_num; i++) {
f32 pnt_dist = i_pos->abs(path->m_points[i].m_position);
Expand Down Expand Up @@ -1012,7 +1012,7 @@ static int daKytag06_Execute(kytag06_class* i_this) {
if (i_this->mpPath != NULL) {
int target1 = 0;
int target2 = 0;
dStage_dPnt_c* pnt = near_rail_get(i_this, &camera->lookat.eye);
dPnt* pnt = near_rail_get(i_this, &camera->lookat.eye);

if (pnt != NULL && pnt->mArg0 != 0xFF) {
dKy_change_colpat(pnt->mArg0);
Expand Down
12 changes: 6 additions & 6 deletions src/d/actor/d_a_npc_cd2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1959,7 +1959,7 @@ bool PathTrace_c::setPath(int param_1, int param_2, int param_3, cXyz* param_4,
f32 minDist = 1000000000.0f;
field_0x20 = 0;
for (int i = 0; i < mPath->m_num; i++) {
dStage_dPnt_c* pnt = dPath_GetPnt(mPath, i);
dPnt* pnt = dPath_GetPnt(mPath, i);
f32 dist = param_4->abs2(pnt->m_position);
if (dist < minDist) {
minDist = dist;
Expand All @@ -1973,7 +1973,7 @@ bool PathTrace_c::setPath(int param_1, int param_2, int param_3, cXyz* param_4,

/* 80159C14-80159DC0 154554 01AC+00 1/1 0/0 6/6 .text checkPoint__11PathTrace_cF4cXyzf */
bool PathTrace_c::checkPoint(cXyz param_1, f32 param_2) {
dStage_dPnt_c* pnt = dPath_GetPnt(mPath, field_0x20);
dPnt* pnt = dPath_GetPnt(mPath, field_0x20);
f32 dist = param_1.absXZ(pnt->m_position);
if (dist < param_2 || dist < 10.0f) {
return true;
Expand Down Expand Up @@ -2001,7 +2001,7 @@ bool PathTrace_c::checkPathEnd(cXyz param_1, f32 param_2) {
/* 80159E54-80159ECC 154794 0078+00 0/0 0/0 10/10 .text getTargetPoint__11PathTrace_cFP3Vec */
void PathTrace_c::getTargetPoint(Vec* targetPoint) {
if (mObstacle == NULL) {
dStage_dPnt_c* pnt = dPath_GetPnt(mPath, field_0x20);
dPnt* pnt = dPath_GetPnt(mPath, field_0x20);
*targetPoint = pnt->m_position;
} else {
getAvoidPoint(targetPoint);
Expand Down Expand Up @@ -2039,13 +2039,13 @@ void PathTrace_c::setNextPoint(cXyz& param_1) {

/* 8015A0D0-8015A264 154A10 0194+00 1/1 0/0 0/0 .text setNextPoint__11PathTrace_cFv */
void PathTrace_c::setNextPoint() {
dStage_dPnt_c* pnt1 = dPath_GetPnt(mPath, field_0x20);
dPnt* pnt1 = dPath_GetPnt(mPath, field_0x20);
if (field_0x24 > 0) {
field_0x20 = incIndex(field_0x20);
} else {
field_0x20 = decIndex(field_0x20);
}
dStage_dPnt_c* pnt2 = dPath_GetPnt(mPath, field_0x20);
dPnt* pnt2 = dPath_GetPnt(mPath, field_0x20);
cXyz acStack_28(pnt1->m_position);
field_0x18 = acStack_28.abs(pnt2->m_position);
mNextPoint = 1000000000.0f;
Expand Down Expand Up @@ -2111,7 +2111,7 @@ void PathTrace_c::checkObstacleSub(fopAc_ac_c* pObstacle) {
if (mMyself != pObstacle) {
JUT_ASSERT(1816, mPath != 0);
cXyz& newObstaclePos = fopAcM_GetPosition(pObstacle);
dStage_dPnt_c* pnt = dPath_GetPnt(mPath, field_0x20);
dPnt* pnt = dPath_GetPnt(mPath, field_0x20);
f32 local_38;
f32 local_3c;
f32 local_40;
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_npc_ne.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ static void npc_ne_pathwalk(npc_ne_class* i_this) {
i_this->mPathDir = 1;
i_this->mPathPointNo = 1;
}
dStage_dPnt_c* point = i_this->mpPath->m_points;
dPnt* point = i_this->mpPath->m_points;
point += i_this->mPathPointNo;
i_this->mTargetPos.x = point->m_position.x + cM_rndFX(50.0f);
i_this->mTargetPos.y = point->m_position.y;
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_npc_zra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ int daNpc_zrA_Path_c::getDstPosChase(u16 i_idx, cXyz i_pos, cXyz& o_pnt) {
/* 80B78E08-80B7956C 0009E8 0764+00 1/1 0/0 0/0 .text chkPassDst__16daNpc_zrA_Path_cFUs4cXyz */
f32 daNpc_zrA_Path_c::chkPassDst(u16 i_idx, cXyz i_pos) {
u16 prev_idx, next_idx;
dStage_dPnt_c* points = mpRoomPath->m_points;
dPnt* points = mpRoomPath->m_points;
u16 idx = mIdx;
u8 reversed = mIsReversed;
mIdx = i_idx;
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_obj_cblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int daObjCBlk_c::Create() {
} else {
pnt_index = 0;
}
dStage_dPnt_c* pnt = dPath_GetPnt(roomPath, pnt_index);
dPnt* pnt = dPath_GetPnt(roomPath, pnt_index);
JUT_ASSERT(284, pnt != 0)
current.pos = pnt->m_position;
}
Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_obj_digplace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int daObjDigpl_c::execute() {
attention_info.position.y = current.pos.y;
cXyz point_pos;

dStage_dPnt_c* point_p = mpDigPoints->m_points;
dPnt* point_p = mpDigPoints->m_points;
f32 dist_to_current_pnt = FLT_MAX;

for (int i = 0; i < mpDigPoints->m_num; i++, point_p++) {
Expand Down
4 changes: 2 additions & 2 deletions src/d/actor/d_a_obj_iceblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void daObjIceBlk_c::loadCurrentPos() {
if (mpPath != NULL) {
u16 point_no = getPointNo();
if (point_no != 0) {
dStage_dPnt_c* point = &mpPath->m_points[point_no - 1];
dPnt* point = &mpPath->m_points[point_no - 1];
home.pos = point->m_position;
old.pos = home.pos;
current.pos = home.pos;
Expand Down Expand Up @@ -148,7 +148,7 @@ int daObjIceBlk_c::saveCurrentPos() {
return current_pos;
}

dStage_dPnt_c* point = mpPath->m_points;
dPnt* point = mpPath->m_points;
f32 nearest_dist = 1000000.0f;
int nearest_point_no = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/d/actor/d_a_obj_lv4CandleDemoTag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void dalv4CandleDemoTag_c::init_modeEnemyCreate() {
dPath* path_p = dPath_GetRoomPath(mPathID, fopAcM_GetRoomNo(this));

for (int i = 0; i < path_p->m_num; i++) {
dStage_dPnt_c* pnt = &path_p->m_points[i];
dPnt* pnt = &path_p->m_points[i];

cXyz pos;
pos.x = pnt->m_position.x;
Expand Down
8 changes: 4 additions & 4 deletions src/d/actor/d_a_obj_lv8OptiLift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int daOptiLift_c::create() {
return cPhs_INIT_e;
}

dStage_dPnt_c* pointp = pathp->m_points;
dPnt* pointp = pathp->m_points;
current.pos.x = pointp->m_position.x;
current.pos.y = pointp->m_position.y;
current.pos.z = pointp->m_position.z;
Expand Down Expand Up @@ -416,7 +416,7 @@ void daOptiLift_c::modeInitSet2() {
/* 80C8B4D8-80C8B53C 0012B8 0064+00 2/2 0/0 0/0 .text liftReset__12daOptiLift_cFv */
void daOptiLift_c::liftReset() {
dPath* pathp = dPath_GetRoomPath(mPathID, fopAcM_GetRoomNo(this));
dStage_dPnt_c* pointp = pathp->m_points;
dPnt* pointp = pathp->m_points;

current.pos.x = pointp->m_position.x;
current.pos.y = pointp->m_position.y;
Expand Down Expand Up @@ -445,7 +445,7 @@ void daOptiLift_c::setNextPoint() {
mPathDirection = 1;
next_point = 1;
} else {
dStage_dPnt_c* pointp = &pathp->m_points[mCurrentPoint];
dPnt* pointp = &pathp->m_points[mCurrentPoint];
if (pointp->mArg0 == 0) {
next_point = mCurrentPoint;
}
Expand All @@ -455,7 +455,7 @@ void daOptiLift_c::setNextPoint() {
if (next_point != -1) {
mPrevTargetPos = mTargetPos;

dStage_dPnt_c* pointp = &pathp->m_points[next_point];
dPnt* pointp = &pathp->m_points[next_point];
mTargetPos.x = pointp->m_position.x;
mTargetPos.y = pointp->m_position.y;
mTargetPos.z = pointp->m_position.z;
Expand Down
Loading