summaryrefslogtreecommitdiff
path: root/src/d/map/d_map_path_fmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/d/map/d_map_path_fmap.cpp')
-rw-r--r--src/d/map/d_map_path_fmap.cpp716
1 files changed, 519 insertions, 197 deletions
diff --git a/src/d/map/d_map_path_fmap.cpp b/src/d/map/d_map_path_fmap.cpp
index 1a97f3dbe7..329e6f1911 100644
--- a/src/d/map/d_map_path_fmap.cpp
+++ b/src/d/map/d_map_path_fmap.cpp
@@ -106,7 +106,7 @@ bool dMenu_Fmap_room_data_c::isArrival() {
/* 8003D868-8003D92C 0381A8 00C4+00 1/1 0/0 0/0 .text
* buildTresTypeGroup__22dMenu_Fmap_room_data_cFiii */
-void dMenu_Fmap_room_data_c::buildTresTypeGroup(int param_0, int param_1, int param_2) {
+void dMenu_Fmap_room_data_c::buildTresTypeGroup(int i_stageNo, int i_roomIndex, int i_roomNo) {
dTres_c::list_class* tresure_p = mp_fmapData->getTresure();
if (tresure_p != NULL) {
int num = tresure_p->field_0x0;
@@ -117,7 +117,7 @@ void dMenu_Fmap_room_data_c::buildTresTypeGroup(int param_0, int param_1, int pa
}
for (int i = 0; i < num; i++) {
- data_p->mRoomNo = param_2;
+ data_p->mRoomNo = i_roomNo;
u8 typeGroupNo = dTres_c::getTypeToTypeGroupNo(data_p->mType);
mp_fmpTresTypeGroupDataListAll->addTypeGroupData(typeGroupNo, data_p);
data_p++;
@@ -127,97 +127,78 @@ void dMenu_Fmap_room_data_c::buildTresTypeGroup(int param_0, int param_1, int pa
/* 8003D92C-8003D95C 03826C 0030+00 1/1 0/0 0/0 .text
* buildFmapRoomData__22dMenu_Fmap_room_data_cFiiffff */
-void dMenu_Fmap_room_data_c::buildFmapRoomData(int param_0, int param_1, f32 param_2, f32 param_3,
- f32 param_4, f32 param_5) {
+void dMenu_Fmap_room_data_c::buildFmapRoomData(int i_stageNo, int i_index, f32 i_regionOffsetX,
+ f32 i_regionOffsetZ, f32 i_stageOffsetX,
+ f32 i_stageOffsetZ) {
int roomNo = m_roomNo;
if (mp_fmapData != NULL) {
- buildTresTypeGroup(param_0, param_1, roomNo);
+ buildTresTypeGroup(i_stageNo, i_index, roomNo);
}
}
/* 8003D95C-8003D9D8 03829C 007C+00 1/1 0/0 0/0 .text isArrival__23dMenu_Fmap_stage_data_cFv */
-#ifdef NONMATCHING
bool dMenu_Fmap_stage_data_c::isArrival() {
bool is_arrival = false;
-
dMenu_Fmap_room_data_c* room = mp_roomTop;
- u8 table_no = mpStageArc->getVisitedRoomSaveTableNo();
+ int table_no = mpStageArc->getVisitedRoomSaveTableNo();
for (; !is_arrival && room != NULL; room = room->getNextData()) {
- is_arrival = dComIfGs_isSaveVisitedRoom(table_no, room->getRoomNo()) != false;
+ // fakematch: should be room->getRoomNo()
+ is_arrival = dComIfGs_isSaveVisitedRoom(table_no, room->m_roomNo) != false;
}
return is_arrival;
}
-#else
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm bool dMenu_Fmap_stage_data_c::isArrival() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/isArrival__23dMenu_Fmap_stage_data_cFv.s"
-}
-#pragma pop
-#endif
-
-/* ############################################################################################## */
-/* 80451E20-80451E28 000420 0004+04 5/5 0/0 0/0 .sdata2 @3894 */
-SECTION_SDATA2 static f32 lit_3894[1 + 1 /* padding */] = {
- 0.0f,
- /* padding */
- 0.0f,
-};
/* 8003D9D8-8003DB48 038318 0170+00 1/1 0/0 0/0 .text
* buildFmapStageData__23dMenu_Fmap_stage_data_cFiff */
-int dMenu_Fmap_stage_data_c::buildFmapStageData(int param_0, f32 param_1, f32 param_2) {
+int dMenu_Fmap_stage_data_c::buildFmapStageData(int i_stageNo, f32 i_regionOffsetX,
+ f32 i_regionOffsetZ) {
dMenu_Fmap_room_data_c* room = mp_roomTop;
- f32 fvar3 = FLT_MAX;
- f32 fvar4 = FLT_MAX;
- f32 fvar5 = -FLT_MAX;
- f32 fvar6 = -FLT_MAX;
- int ivar = 0;
-
- for (; room != NULL; room = room->getNextData()) {
- room->buildFmapRoomData(param_0, ivar, param_1, param_2, m_offsetX, m_offsetZ);
- f32 min_x = room->getFileList2MinX();
- f32 min_z = room->getFileList2MinZ();
- f32 max_x = room->getFileList2MaxX();
- f32 max_z = room->getFileList2MaxZ();
-
- if (min_x < fvar3) {
- fvar3 = min_x;
+ f32 stage_min_x = FLT_MAX;
+ f32 stage_min_z = FLT_MAX;
+ f32 stage_max_x = -FLT_MAX;
+ f32 stage_max_z = -FLT_MAX;
+ int room_no = 0;
+
+ for (; room != NULL; room_no++, room = room->getNextData()) {
+ room->buildFmapRoomData(i_stageNo, room_no, i_regionOffsetX, i_regionOffsetZ,
+ m_offsetX, m_offsetZ);
+ f32 room_min_x = room->getFileList2MinX();
+ f32 room_min_z = room->getFileList2MinZ();
+ f32 room_max_x = room->getFileList2MaxX();
+ f32 room_max_z = room->getFileList2MaxZ();
+
+ if (room_min_x < stage_min_x) {
+ stage_min_x = room_min_x;
}
- if (min_z < fvar4) {
- fvar4 = min_z;
+ if (room_min_z < stage_min_z) {
+ stage_min_z = room_min_z;
}
- if (max_x > fvar5) {
- fvar5 = max_x;
+ if (room_max_x > stage_max_x) {
+ stage_max_x = room_max_x;
}
- if (max_z > fvar6) {
- fvar6 = max_z;
+ if (room_max_z > stage_max_z) {
+ stage_max_z = room_max_z;
}
-
- ivar++;
}
- if (ivar > 0) {
- m_stageMinX = fvar3;
- m_stageMinZ = fvar4;
- m_stageMaxX = fvar5;
- m_stageMaxZ = fvar6;
+ if (room_no > 0) {
+ m_stageMinX = stage_min_x;
+ m_stageMinZ = stage_min_z;
+ m_stageMaxX = stage_max_x;
+ m_stageMaxZ = stage_max_z;
} else {
- f32 tmp_0 = lit_3894[0];
- m_stageMinX = tmp_0;
- m_stageMinZ = tmp_0;
- m_stageMaxX = tmp_0;
- m_stageMaxZ = tmp_0;
+ m_stageMinX = 0.0f;
+ m_stageMinZ = 0.0f;
+ m_stageMaxX = 0.0f;
+ m_stageMaxZ = 0.0f;
}
- return ivar;
+ return room_no;
}
/* 8003DB48-8003DB70 038488 0028+00 0/0 1/1 0/0 .text
@@ -233,158 +214,428 @@ dMenu_Fmap_stage_data_c* dMenu_Fmap_region_data_c::getMenuFmapStageData(int para
/* 8003DB70-8003DEE0 0384B0 0370+00 0/0 1/1 0/0 .text
* getPointStagePathInnerNo__24dMenu_Fmap_region_data_cFffiPiPi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenu_Fmap_region_data_c::getPointStagePathInnerNo(f32 param_0, f32 param_1, int param_2,
- int* param_3, int* param_4) {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/getPointStagePathInnerNo__24dMenu_Fmap_region_data_cFffiPiPi.s"
+int dMenu_Fmap_region_data_c::getPointStagePathInnerNo(f32 i_pointX, f32 i_pointZ, int i_stageNo,
+ int* o_stageNo, int* o_roomNo) {
+ int line_num, group_num, floor_num;
+ f32* point;
+ u16* point_index;
+ dDrawPath_c::line_class* line;
+ dDrawPath_c::group_class* group;
+ dDrawPath_c::floor_class* floor;
+ f32* points;
+ dMenu_Fmap_room_data_c* room;
+ dMenu_Fmap_stage_data_c* stage;
+ int point_num, point_no;
+ int stage_no = 0;
+ bool outside, found;
+ int floor_no, group_no, line_no;
+ int found_stage_no = -1;
+ int dir, prev_dir;
+ int found_room_no = -1;
+ cXyz vec1, vec2, cross;
+ vec1.y = 0.0f;
+ vec2.y = 0.0f;
+
+ stage = mpMenuFmapStageDataTop;
+ for(; stage != NULL; stage = stage->getNextData(), stage_no++) {
+ if (stage->getStageArc() == NULL) continue;
+ int save_table_no = stage->getStageArc()->getVisitedRoomSaveTableNo();
+
+ room = stage->getFmapRoomDataTop();
+ for (; room != NULL; room = room->getNextData()) {
+ if (!(i_stageNo == stage_no || stage->isArrival())) continue;
+ // fakematch: should be room->getRoomNo()
+ if (!dComIfGs_isSaveVisitedRoom(save_table_no, room->m_roomNo)) continue;
+
+ f32 offsetX = mRegionOffsetX + stage->getOffsetX();
+ f32 offsetZ = mRegionOffsetZ + stage->getOffsetZ();
+
+ dMenu_Fmap_data_c* map_data = room->getFmapData();
+ if (map_data == NULL) continue;
+
+ dDrawPath_c::room_class* path = map_data->getMapPath();
+ if (path == NULL) continue;
+
+ floor = path->mpFloor;
+ points = path->mpFloatData;
+ if (floor == NULL) continue;
+
+ found = false;
+ floor_num = path->mFloorNum;
+ for (floor_no = 0; !found && floor_no < floor_num; floor_no++, floor++) {
+ group_num = floor->mGroupNum;
+ group = floor->mpGroup;
+ if (group == NULL) continue;
+ for (group_no = 0; !found && group_no < group_num; group_no++, group++) {
+ line_num = group->mLineNum;
+ if (line_num <= 0) continue;
+ line = group->mpLine;
+ if (line == NULL) continue;
+ for (line_no = 0; !found && line_no < line_num; line_no++, line++) {
+ if (line->field_0x1 != 3) continue;
+ point_num = line->mDataNum;
+ if (!(point_num >= 3)) continue;
+
+ outside = false;
+ point_index = line->mpData;
+ f32* prev_point = &points[point_index[0] * 2];
+ point = &points[point_index[1] * 2];
+ point_no = 2;
+ point_index += 2;
+
+ do {
+ vec1.x = prev_point[0] + offsetX - i_pointX;
+ vec1.z = prev_point[1] + offsetZ - i_pointZ;
+ vec2.x = point[0] + offsetX - i_pointX;
+ vec2.z = point[1] + offsetZ - i_pointZ;
+
+ PSVECCrossProduct(&vec1, &vec2, &cross);
+ if (cross.y >= 0.0f) {
+ dir = 0;
+ } else {
+ dir = -1;
+ }
+
+ if (point_no > 2 && dir != prev_dir) {
+ outside = true;
+ break;
+ }
+
+ prev_dir = dir;
+ prev_point = point;
+ point = &points[*point_index * 2];
+ point_no++;
+ point_index++;
+ } while (point_no <= point_num);
+
+ if (!outside) {
+ found = true;
+ found_stage_no = stage_no;
+ found_room_no = room->getRoomNo();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (o_stageNo != NULL) {
+ *o_stageNo = found_stage_no;
+ }
+ if (o_roomNo != NULL) {
+ *o_roomNo = found_room_no;
+ }
+
+ return 1;
}
-#pragma pop
/* 8003DEE0-8003E028 038820 0148+00 0/0 1/1 0/0 .text
* buildFmapRegionData__24dMenu_Fmap_region_data_cFi */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenu_Fmap_region_data_c::buildFmapRegionData(int param_0) {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/buildFmapRegionData__24dMenu_Fmap_region_data_cFi.s"
+int dMenu_Fmap_region_data_c::buildFmapRegionData(int param_0) {
+ f32 region_min_x = FLT_MAX;
+ f32 region_min_z = FLT_MAX;
+ f32 region_max_x = -FLT_MAX;
+ f32 region_max_z = -FLT_MAX;
+
+ dMenu_Fmap_stage_data_c* stage = mpMenuFmapStageDataTop;
+ int stage_no = 0;
+
+ for (; stage != NULL; stage_no++, stage = stage->getNextData()) {
+ stage->buildFmapStageData(stage_no, mRegionOffsetX, mRegionOffsetZ);
+ f32 stage_min_x = stage->getStageMinX() + stage->getOffsetX();
+ f32 stage_min_z = stage->getStageMinZ() + stage->getOffsetZ();
+ f32 stage_max_x = stage->getStageMaxX() + stage->getOffsetX();
+ f32 stage_max_z = stage->getStageMaxZ() + stage->getOffsetZ();
+
+ if (stage_min_x < region_min_x) {
+ region_min_x = stage_min_x;
+ }
+ if (stage_min_z < region_min_z) {
+ region_min_z = stage_min_z;
+ }
+ if (stage_max_x > region_max_x) {
+ region_max_x = stage_max_x;
+ }
+ if (stage_max_z > region_max_z) {
+ region_max_z = stage_max_z;
+ }
+ }
+
+ if (stage_no > 0) {
+ mRegionMinX = region_min_x;
+ mRegionMinZ = region_min_z;
+ mRegionMaxX = region_max_x;
+ mRegionMaxZ = region_max_z;
+ } else {
+ mRegionMinX = 0.0f;
+ mRegionMaxX = 0.0f;
+ mRegionMinZ = 0.0f;
+ mRegionMaxZ = 0.0f;
+ }
+
+ return stage_no;
}
-#pragma pop
/* 8003E028-8003E04C 038968 0024+00 0/0 1/1 0/0 .text
* create__23dMenu_Fmap_world_data_cFP24dMenu_Fmap_region_data_c */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenu_Fmap_world_data_c::create(dMenu_Fmap_region_data_c* param_0) {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/create__23dMenu_Fmap_world_data_cFP24dMenu_Fmap_region_data_c.s"
+void dMenu_Fmap_world_data_c::create(dMenu_Fmap_region_data_c* i_regionData) {
+ mp_fmapRegionData = i_regionData;
+ buildFmapWorldData();
}
-#pragma pop
/* 8003E04C-8003E114 03898C 00C8+00 1/1 0/0 0/0 .text
* buildFmapWorldData__23dMenu_Fmap_world_data_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenu_Fmap_world_data_c::buildFmapWorldData() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/buildFmapWorldData__23dMenu_Fmap_world_data_cFv.s"
+int dMenu_Fmap_world_data_c::buildFmapWorldData() {
+ f32 min_x = FLT_MAX;
+ f32 min_z = FLT_MAX;
+ f32 max_x = -FLT_MAX;
+ f32 max_z = -FLT_MAX;
+
+ dMenu_Fmap_region_data_c* region = mp_fmapRegionData;
+ int region_no = 0;
+
+ for (; region != NULL; region_no++, region = region->getNextData()) {
+ f32 region_min_x = region->getRegionMinX() + region->getRegionOffsetX();
+ f32 region_min_z = region->getRegionMinZ() + region->getRegionOffsetZ();
+ f32 region_max_x = region->getRegionMaxX() + region->getRegionOffsetX();
+ f32 region_max_z = region->getRegionMaxZ() + region->getRegionOffsetZ();
+
+ if (region_min_x < min_x) {
+ min_x = region_min_x;
+ }
+ if (region_min_z < min_z) {
+ min_z = region_min_z;
+ }
+ if (region_max_x > max_x) {
+ max_x = region_max_x;
+ }
+ if (region_max_z > max_z) {
+ max_z = region_max_z;
+ }
+ }
+
+ if (region_no > 0) {
+ m_worldMinX = min_x;
+ m_worldMinZ = min_z;
+ m_worldMaxX = max_x;
+ m_worldMaxZ = max_z;
+ } else {
+ m_worldMinX = 0.0f;
+ m_worldMaxX = 0.0f;
+ m_worldMinZ = 0.0f;
+ m_worldMaxZ = 0.0f;
+ }
+
+ return region_no;
}
-#pragma pop
/* 8003E114-8003E1C0 038A54 00AC+00 0/0 3/3 0/0 .text
* init__22dMenuFmapIconPointer_cFP24dMenu_Fmap_region_data_cP23dMenu_Fmap_stage_data_cUcii */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconPointer_c::init(dMenu_Fmap_region_data_c* param_0,
- dMenu_Fmap_stage_data_c* param_1, u8 param_2, int param_3,
- int param_4) {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/init__22dMenuFmapIconPointer_cFP24dMenu_Fmap_region_data_cP23dMenu_Fmap_stage_data_cUcii.s"
+bool dMenuFmapIconPointer_c::init(dMenu_Fmap_region_data_c* i_regionData,
+ dMenu_Fmap_stage_data_c* i_stageData, u8 i_typeGroupNo,
+ int i_stayStageNo, int i_stayRoomNo) {
+ stage_stag_info_class* stag_info = dComIfGp_getStage()->getStagInfo();
+ if (stag_info == NULL) {
+ return false;
+ }
+
+ mSaveTbl = i_dStage_stagInfo_GetSaveTbl(stag_info);
+ mpRegionData = i_regionData;
+ mpStageData = i_stageData;
+ mType = dTres_c::getTypeGroupNoToType(i_typeGroupNo);
+ mTypeGroupNo = i_typeGroupNo;
+ mStayStageNo = i_stayStageNo;
+ mStayRoomNo = i_stayRoomNo;
+ mStageNo = 0;
+ getFirstRoomData();
+ return true;
}
-#pragma pop
/* 8003E1C0-8003E2BC 038B00 00FC+00 2/2 0/0 0/0 .text getFirstData__22dMenuFmapIconPointer_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconPointer_c::getFirstData() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/getFirstData__22dMenuFmapIconPointer_cFv.s"
+bool dMenuFmapIconPointer_c::getFirstData() {
+ bool ret = false;
+ if (!strcmp(mpStageData->getStageName(), dComIfGp_getStartStageName())) {
+ mpTresTypeGroupData = dTres_c::getFirstData(mTypeGroupNo);
+ mpTresData = mpTresTypeGroupData->getConstDataPointer();
+ } else {
+ mpFmpTresTypeGroupDataList = NULL;
+ mpFmpTresTypeGroupData = NULL;
+ mpTresData = NULL;
+ mpFmpTresTypeGroupDataListAll = mpRoomData->getTypeGroupDataListAll();
+ if (mpFmpTresTypeGroupDataListAll != NULL) {
+ mpFmpTresTypeGroupDataList =
+ mpFmpTresTypeGroupDataListAll->getTypeGroupDataList(mTypeGroupNo);
+ if (mpFmpTresTypeGroupDataList != NULL) {
+ mpFmpTresTypeGroupData = mpFmpTresTypeGroupDataList->getTypeGroupDataHead();
+ if (mpFmpTresTypeGroupData != NULL) {
+ do {
+ mpTresData = mpFmpTresTypeGroupData->getTresData();
+ if (mpTresData != NULL) {
+ ret = true;
+ break;
+ }
+ mpFmpTresTypeGroupData = mpFmpTresTypeGroupData->getNextData();
+ } while (mpTresData != NULL); // !@bug presumably supposed to be mpFmpTresTypeGroupData != NULL
+ }
+ }
+ }
+ }
+ return ret;
}
-#pragma pop
/* 8003E2BC-8003E350 038BFC 0094+00 1/1 0/0 0/0 .text getData__22dMenuFmapIconPointer_cFv
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconPointer_c::getData() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/getData__22dMenuFmapIconPointer_cFv.s"
+bool dMenuFmapIconPointer_c::getData() {
+ bool ret = false;
+ if (!strcmp(mpStageData->getStageName(), dComIfGp_getStartStageName())) {
+ if (mpTresTypeGroupData != NULL
+ && mpRoomData->getRoomNo() == mpTresTypeGroupData->getRoomNo())
+ {
+ mpTresData = mpTresTypeGroupData->getConstDataPointer();
+ ret = true;
+ }
+ } else {
+ if (mpTresData != NULL) {
+ ret = true;
+ }
+ }
+ return ret;
}
-#pragma pop
/* 8003E350-8003E37C 038C90 002C+00 2/2 0/0 0/0 .text getFirstRoomData__22dMenuFmapIconPointer_cFv
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconPointer_c::getFirstRoomData() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/getFirstRoomData__22dMenuFmapIconPointer_cFv.s"
+void dMenuFmapIconPointer_c::getFirstRoomData() {
+ mpRoomData = mpStageData->getFmapRoomDataTop();
+ getFirstData();
}
-#pragma pop
/* 8003E37C-8003E3A4 038CBC 0028+00 1/1 0/0 0/0 .text getNextRoomData__22dMenuFmapIconPointer_cFv
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconPointer_c::getNextRoomData() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/getNextRoomData__22dMenuFmapIconPointer_cFv.s"
+bool dMenuFmapIconPointer_c::getNextRoomData() {
+ bool ret = false;
+ mpRoomData = mpRoomData->getNextData();
+ if (mpRoomData == NULL) {
+ ret = true;
+ }
+ return ret;
}
-#pragma pop
/* 8003E3A4-8003E3D8 038CE4 0034+00 1/1 0/0 0/0 .text getNextStageData__22dMenuFmapIconPointer_cFv
*/
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconPointer_c::getNextStageData() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/getNextStageData__22dMenuFmapIconPointer_cFv.s"
+bool dMenuFmapIconPointer_c::getNextStageData() {
+ bool ret = false;
+ mStageNo++;
+ mpStageData = mpStageData->getNextData();
+ if (mpStageData == NULL) {
+ ret = true;
+ }
+ return ret;
}
-#pragma pop
/* 8003E3D8-8003E490 038D18 00B8+00 1/1 0/0 0/0 .text getNextData__22dMenuFmapIconPointer_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconPointer_c::getNextData() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/getNextData__22dMenuFmapIconPointer_cFv.s"
+bool dMenuFmapIconPointer_c::getNextData() {
+ bool ret = true;
+ if (!strcmp(mpStageData->getStageName(), dComIfGp_getStartStageName())) {
+ if (mpTresTypeGroupData != NULL) {
+ mpTresTypeGroupData = dTres_c::getNextData(mpTresTypeGroupData);
+ if (mpTresTypeGroupData != NULL) {
+ mpTresData = mpTresTypeGroupData->getConstDataPointer();
+ ret = false;
+ }
+ }
+ } else {
+ if (mpFmpTresTypeGroupData != NULL) {
+ mpFmpTresTypeGroupData = mpFmpTresTypeGroupData->getNextData();
+ if (mpFmpTresTypeGroupData != NULL) {
+ mpTresData = mpFmpTresTypeGroupData->getTresData();
+ if (mpTresData != NULL) {
+ ret = false;
+ }
+ }
+ }
+ }
+ return ret;
}
-#pragma pop
/* 8003E490-8003E510 038DD0 0080+00 1/1 3/3 0/0 .text nextData__22dMenuFmapIconPointer_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconPointer_c::nextData() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/nextData__22dMenuFmapIconPointer_cFv.s"
+bool dMenuFmapIconPointer_c::nextData() {
+ bool ret = false;
+ if (getNextData()) {
+ if (getNextRoomData()) {
+ if (getNextStageData()) {
+ ret = true;
+ } else {
+ getFirstRoomData();
+ }
+ } else {
+ getFirstData();
+ }
+ }
+ return ret;
}
-#pragma pop
/* 8003E510-8003E578 038E50 0068+00 0/0 3/3 0/0 .text getValidData__22dMenuFmapIconPointer_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconPointer_c::getValidData() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/getValidData__22dMenuFmapIconPointer_cFv.s"
+bool dMenuFmapIconPointer_c::getValidData() {
+ bool iVar1, iVar2 = false;
+ do {
+ iVar1 = getData();
+ if (!iVar1) {
+ iVar2 = nextData();
+ }
+ } while (!iVar2 && !iVar1);
+ return iVar2;
}
-#pragma pop
/* 8003E578-8003E6E8 038EB8 0170+00 0/0 3/3 0/0 .text
* getPosition__19dMenuFmapIconDisp_cFPiPiPfPfPPCQ27dTres_c6data_s */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dMenuFmapIconDisp_c::getPosition(int* param_0, int* param_1, f32* param_2, f32* param_3,
- dTres_c::data_s const** param_4) {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/getPosition__19dMenuFmapIconDisp_cFPiPiPfPfPPCQ27dTres_c6data_s.s"
+bool dMenuFmapIconDisp_c::getPosition(int* o_stageNo, int* o_roomNo, f32* o_posX, f32* o_posZ,
+ dTres_c::data_s const** o_tresData) {
+ f32 offset_x = mpRegionData->getRegionOffsetX() + mpStageData->getOffsetX();
+ f32 offset_z = mpRegionData->getRegionOffsetZ() + mpStageData->getOffsetZ();
+
+ if (o_posX != NULL) {
+ *o_posX = 0.0f;
+ }
+ if (o_posZ != NULL) {
+ *o_posZ = 0.0f;
+ }
+ if (o_stageNo != NULL) {
+ *o_stageNo = mStageNo;
+ }
+ if (o_roomNo != NULL) {
+ *o_roomNo = mpRoomData->getRoomNo();
+ }
+
+ if (!strcmp(mpStageData->getStageName(), dComIfGp_getStartStageName())) {
+ if (mpTresTypeGroupData != NULL) {
+ if (o_tresData != NULL) {
+ *o_tresData = mpTresTypeGroupData->getConstDataPointer();
+ }
+ if (o_posX != NULL) {
+ *o_posX = offset_x + mpTresTypeGroupData->getPos()->x;
+ }
+ if (o_posZ != NULL) {
+ *o_posZ = offset_z + mpTresTypeGroupData->getPos()->z;
+ }
+ }
+ } else {
+ if (mpTresData != NULL) {
+ if (o_tresData != NULL) {
+ *o_tresData = mpTresData;
+ }
+ if (o_posX != NULL) {
+ *o_posX = offset_x + mpTresData->mPos.x;
+ }
+ if (o_posZ != NULL) {
+ *o_posZ = offset_z + mpTresData->mPos.z;
+ }
+ }
+ }
+
+ return false;
}
-#pragma pop
+#ifndef NONMATCHING
/* ############################################################################################## */
/* 803A7D38-803A7D74 -00001 003C+00 1/1 0/0 0/0 .data @4467 */
SECTION_DATA static void* lit_4467[15] = {
@@ -404,52 +655,123 @@ SECTION_DATA static void* lit_4467[15] = {
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x388),
(void*)(((char*)isDrawDisp__19dMenuFmapIconDisp_cFv) + 0x388),
};
+#endif
/* 8003E6E8-8003EB10 039028 0428+00 2/0 3/3 0/0 .text isDrawDisp__19dMenuFmapIconDisp_cFv
*/
+#ifdef NONMATCHING
+//? regalloc
+bool dMenuFmapIconDisp_c::isDrawDisp() {
+ bool ret;
+
+ dMenu_Fmap_stage_arc_data_c* stage_arc = mpStageData->getStageArc();
+ if (stage_arc == NULL) {
+ return false;
+ }
+
+ u8 save_table_no = stage_arc->getSaveTableNo();
+ int room_no = mpRoomData->getRoomNo();
+ bool bVar2 = (mStayStageNo == mStageNo && mStayRoomNo == room_no) || mpRoomData->isArrival();
+ ret = false;
+ bool bVar1;
+
+ switch (mTypeGroupNo) {
+ case 1:
+ case 8:
+ if (save_table_no == mSaveTbl) {
+ ret = bVar2 && (mpTresData->mSwBit == 0xff ||
+ (mpTresData->mSwBit != 0xff && dComIfGs_isSwitch(mpTresData->mSwBit, room_no)));
+ } else {
+ ret = bVar2 && (mpTresData->mSwBit == 0xff ||
+ (mpTresData->mSwBit != 0xff && mpTresData->mSwBit < 0x80
+ && dComIfGs_isStageSwitch(save_table_no, mpTresData->mSwBit)));
+ }
+ break;
+
+ case 4:
+ bVar1 = false;
+ if (dComIfGp_isLightDropMapVisible()) {
+ if (dComIfGp_getStartStageDarkArea() == 2) {
+ int tres_no = mpTresData->mNo;
+ if (tres_no == 0x33 || tres_no == 0x34 || tres_no == 0x35) {
+ if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[119])) {
+ bVar1 = true;
+ }
+ } else {
+ bVar1 = true;
+ }
+ } else {
+ bVar1 = true;
+ }
+ }
+ if (bVar1 && mpTresData->mNo != 0xff && !dComIfGs_isStageTbox(save_table_no, mpTresData->mNo)) {
+ ret = true;
+ }
+ break;
+
+ case 5:
+ if (save_table_no == mSaveTbl) {
+ ret = (mpTresData->mNo == 0xff ||
+ (mpTresData->mNo != 0xff && !dComIfGs_isTbox(mpTresData->mNo)))
+ && (mpTresData->mSwBit == 0xff || (mpTresData->mSwBit != 0xff
+ && dComIfGs_isSwitch(mpTresData->mSwBit, room_no)));
+ } else {
+ ret = (mpTresData->mNo == 0xff || (mpTresData->mNo != 0xff
+ && !dComIfGs_isStageTbox(save_table_no, mpTresData->mNo)))
+ && (mpTresData->mSwBit == 0xff ||
+ (mpTresData->mSwBit != 0xff && mpTresData->mSwBit < 0x80 &&
+ dComIfGs_isStageSwitch(save_table_no, mpTresData->mSwBit)));
+ }
+ break;
+
+ case 6:
+ if (save_table_no == mSaveTbl) {
+ ret = dComIfGs_isSwitch(mpTresData->mSwBit, room_no) ? true : false;
+ } else {
+ if (mpTresData->mSwBit < 0x80) {
+ ret = dComIfGs_isStageSwitch(save_table_no, mpTresData->mSwBit) ? true : false;
+ }
+ }
+ break;
+
+ case 10:
+ ret = mpTresData->mNo != 0xff && dComIfGs_isStageTbox(save_table_no, mpTresData->mNo);
+ break;
+
+ case 13:
+ case 14:
+ if (save_table_no == mSaveTbl) {
+ ret = mpTresData->mSwBit == 0xff ||
+ (mpTresData->mSwBit != 0xff && dComIfGs_isSwitch(mpTresData->mSwBit, room_no));
+ } else {
+ ret = mpTresData->mSwBit == 0xff || (mpTresData->mSwBit < 0x80
+ && dComIfGs_isStageSwitch(save_table_no, mpTresData->mSwBit));
+ }
+ break;
+ }
+
+ return ret;
+}
+#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
-asm void dMenuFmapIconDisp_c::isDrawDisp() {
+asm bool dMenuFmapIconDisp_c::isDrawDisp() {
nofralloc
#include "asm/d/map/d_map_path_fmap/isDrawDisp__19dMenuFmapIconDisp_cFv.s"
}
#pragma pop
+#endif
/* 8003EB10-8003EB70 039450 0060+00 1/1 1/1 0/0 .text __dt__26fmpTresTypeGroupDataList_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm fmpTresTypeGroupDataList_c::~fmpTresTypeGroupDataList_c() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/__dt__26fmpTresTypeGroupDataList_cFv.s"
-}
-#pragma pop
-
-/* 8003EB70-8003EC90 0394B0 0120+00 1/1 0/0 0/0 .text __dt__22fmpTresTypeGroupData_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm fmpTresTypeGroupData_c::~fmpTresTypeGroupData_c() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/__dt__22fmpTresTypeGroupData_cFv.s"
+fmpTresTypeGroupDataList_c::~fmpTresTypeGroupDataList_c() {
+ if (mpTypeGroupDataHead != NULL) {
+ delete mpTypeGroupDataHead;
+ }
}
-#pragma pop
/* 8003EC90-8003ECA0 0395D0 0010+00 1/1 0/0 0/0 .text __ct__26fmpTresTypeGroupDataList_cFv */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm fmpTresTypeGroupDataList_c::fmpTresTypeGroupDataList_c() {
- nofralloc
-#include "asm/d/map/d_map_path_fmap/__ct__26fmpTresTypeGroupDataList_cFv.s"
+fmpTresTypeGroupDataList_c::fmpTresTypeGroupDataList_c() {
+ mpTypeGroupDataHead = NULL;
+ mpNextData = NULL;
}
-#pragma pop
-
-/* ############################################################################################## */
-/* 803A7D74-803A7D80 004E94 000C+00 0/0 3/3 0/0 .data __vt__19dMenuFmapIconDisp_c */
-SECTION_DATA extern void* __vt__19dMenuFmapIconDisp_c[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)isDrawDisp__19dMenuFmapIconDisp_cFv,
-};