diff options
| author | Jasper St. Pierre <jstpierre@mecheye.net> | 2023-09-22 02:11:26 -0700 |
|---|---|---|
| committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2023-09-22 02:11:26 -0700 |
| commit | 54c8c9c4e99fa643950cecf35150c5245f2c9165 (patch) | |
| tree | 72f4c4c1c5057d3d3ca28f8cc5f2f25dca8ce46e /src/d/d_path.cpp | |
| parent | 0b034a877ef561872417d66a2b6874fc26a6c6f7 (diff) | |
d_point_wind match, d_path start
Diffstat (limited to 'src/d/d_path.cpp')
| -rw-r--r-- | src/d/d_path.cpp | 54 |
1 files changed, 47 insertions, 7 deletions
diff --git a/src/d/d_path.cpp b/src/d/d_path.cpp index 8e46db92..59c429b0 100644 --- a/src/d/d_path.cpp +++ b/src/d/d_path.cpp @@ -4,21 +4,61 @@ // #include "d/d_path.h" -#include "dolphin/types.h" +#include "d/d_com_inf_game.h" +#include "JSystem/JUtility/JUTAssert.h" /* 80080018-8008010C .text dPath_GetPnt__FP5dPathi */ -dPath__Point* dPath_GetPnt(dPath*, int) { - /* Nonmatching */ +dPath__Point* dPath_GetPnt(dPath* path, int pnt_index) { + JUT_ASSERT(14, path != 0); + JUT_ASSERT(15, 0 <= pnt_index && pnt_index < path->m_num); + + if (path == NULL || path->mpPnt == NULL || 0 > pnt_index || pnt_index >= path->m_num) + return NULL; + else + return &path->mpPnt[pnt_index]; } /* 8008010C-80080218 .text dPath_GetRoomPath__Fii */ -dPath* dPath_GetRoomPath(int, int) { - /* Nonmatching */ +dPath* dPath_GetRoomPath(int path_index, int room_no) { + dStage_dPath_c * pd; + if (room_no == -1) { + pd = dComIfGp_getStage().getPath2Inf(); + } else { + JUT_ASSERT(0x3d, 0 <= room_no && room_no < 64); + dStage_roomStatus_c * pRoom = dComIfGp_roomControl_getStatusRoomDt(room_no); + if (pRoom == NULL) + return NULL; + pd = pRoom->getPath2Inf(); + } + + if (pd == NULL || 0 > path_index || path_index >= pd->num) + return NULL; + else + return &pd->m_path[path_index]; } /* 80080218-80080340 .text dPath_GetNextRoomPath__FP5dPathi */ -void dPath_GetNextRoomPath(dPath*, int) { - /* Nonmatching */ +dPath* dPath_GetNextRoomPath(dPath* path, int room_no) { + dStage_dPath_c * pd; + if (room_no == -1) { + pd = dComIfGp_getStage().getPath2Inf(); + } else { + dStage_roomStatus_c * pRoom = dComIfGp_roomControl_getStatusRoomDt(room_no); + if (pRoom == NULL) + return NULL; + pd = pRoom->getPath2Inf(); + } + + s32 next_id = path->mNextPathId; + if (pd == NULL || (next_id & 0xFFFF) == 0xFFFF) { + return NULL; + } else { + JUT_ASSERT(0x72, 0 <= next_id && next_id < pd->num); + if (0 > next_id || next_id >= pd->num) + return NULL; + else + return &pd->m_path[next_id]; + } } /* 80080340-800804A4 .text dPath_GetPolyRoomPathVec__FR13cBgS_PolyInfoP4cXyzPi */ |
