Skip to content

Commit

Permalink
d_map work
Browse files Browse the repository at this point in the history
  • Loading branch information
magcius committed Jul 27, 2024
1 parent 9f02379 commit 63aecb6
Show file tree
Hide file tree
Showing 5 changed files with 332 additions and 48 deletions.
8 changes: 8 additions & 0 deletions include/d/d_com_inf_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,14 @@ inline void dComIfGs_offCompleteCollectMap(int i_no) {
g_dComIfG_gameInfo.save.getPlayer().getMap().offCompleteMap(i_no - 1);
}

inline void dComIfGs_onSaveArriveGridForAgb(int i_no) {
g_dComIfG_gameInfo.save.getPlayer().getMap().onSaveArriveGridForAgb(i_no);
}

inline BOOL dComIfGs_isSaveArriveGridForAgb(int i_no) {
g_dComIfG_gameInfo.save.getPlayer().getMap().isSaveArriveGridForAgb(i_no);
}

inline u8 dComIfGs_getArrowNum() {
return g_dComIfG_gameInfo.save.getPlayer().getItemRecord().getArrowNum();
}
Expand Down
63 changes: 51 additions & 12 deletions include/d/d_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define D_MAP_H

#include "d/d_drawlist.h"
#include "JSystem/JUtility/JUTAssert.h"

struct ResTIMG;
struct dmap_dmap_tlut_s;
Expand Down Expand Up @@ -63,22 +64,55 @@ class dMap_RoomInfo_c {
public:
dMap_RoomInfo_c();
~dMap_RoomInfo_c();
void getRoomDspFloorNo(u8, int);
u32 getRoomDspFloorNo(u8, int);
void init(dMap_RoomInfo_c*, int);
void getRoomImage(int, u8, int, ResTIMG**, ResTIMG**, map_dt_c**, stage_map_info_class**, u8*);
void makeRoomDspFloorNoTbl(int);
void roomEntryRoom(int, u8, int, u8, dMap_RoomInfo_c*, s16, s16, f32);
u32 roomEntryRoom(int, u8, int, u8, dMap_RoomInfo_c*, s16, s16, f32);
void Changeimage(u8, u8, int, s16, s16, f32);
void deleteRoom();
BOOL deleteRoom();
void enlagementSizeTextureCordCalc(f32*, f32*, f32*, f32*, f32, f32, f32, f32, f32, f32);
void roomDrawRoomEnlargementSize(int, int, int, int, f32, f32, f32, f32, u8);
void roomDrawRoomRealSize(int, int, int, int, f32, f32, f32, f32, f32, f32, u8);

/* 0x00 */ u8 field_0x0;
inline void clrUseRoom() {}
inline void setUseRoom() {}
inline void checkUseRoom() {}
inline void getEnableFlg() {}
inline void getStageMapInfoPE() {}
inline void getStageMapInfoCmPDot() {}
inline void getStageMapInfoMap0_X0() {}
inline void getStageMapInfoMap0_X1() {}
inline void getStageMapInfoMap0_Z0() {}
inline void getStageMapInfoMap0_Z1() {}
inline void getStageMapInfoMap0_XC() {}
inline void getStageMapInfoMap0_ZC() {}
inline void getStageMapInfoMap1_X0() {}
inline void getStageMapInfoMap1_X1() {}
inline void getStageMapInfoMap1_Z0() {}
inline void getStageMapInfoMap1_Z1() {}
inline void getStageMapInfoMap1_ZC() {}
inline void getStageMapInfoMap1_XC() {}
inline void getStageMapInfoAlpha() {}
inline void getMapDtP() {}
inline void getNowDspFloorNo() {}
inline void getMapDtSize() {}
inline void getMap0ScaleX() {}
inline void getMap0ScaleZ() {}
inline void getMap1ScaleX() {}
inline void getMap1ScaleZ() {}
inline void getMap1Width() {}
inline void getMap1Height() {}

inline u8 getRoomNo() { return m_no; }
inline stage_map_info_class* getStageMapInfoP() { JUT_ASSERT(0x467, mStageMapInfoP != NULL); return mStageMapInfoP; }
inline dMap_RoomInfo_c* getNextRoomInfoP() { return m_next; }

/* 0x00 */ u8 m_exist;
/* 0x01 */ u8 field_0x1;
/* 0x02 */ u8 field_0x2[10];
/* 0x0C */ u8 field_0xc;
/* 0x10 */ int field_0x10;
/* 0x10 */ int m_no;
/* 0x14 */ int field_0x14;
/* 0x18 */ f32 field_0x18;
/* 0x1C */ f32 field_0x1c;
Expand All @@ -87,22 +121,27 @@ class dMap_RoomInfo_c {
/* 0x28 */ f32 field_0x28;
/* 0x2C */ f32 field_0x2c;
/* 0x30 */ dMap_2DMtMapSpcl_c field_0x30;
/* 0x44 */ dMap_2DMtMapSpcl_tex_c field_0x44[1];
/* 0x44 */ dMap_2DMtMapSpcl_tex_c field_0x44;
/* 0x8C */ dMap_2DAGBScrDsp_c field_0x8c;
/* 0xE4 */ dMap_RoomInfo_c* field_0xe4;
/* 0xE8 */ void* field_0xe8;
/* 0xC4 */ u32 field_0xc4[0x08];
/* 0xE4 */ dMap_RoomInfo_c* m_next;
/* 0xE8 */ stage_map_info_class* mStageMapInfoP;
};

class dMap_RoomInfoCtrl_c {
public:
void roomExistenceCheck(int, dMap_RoomInfo_c**);
void getNextRoomP(dMap_RoomInfo_c*);
void ctrlEntryRoom(int, u8, int, u8, s16, s16, f32);
void deleteRoom(int);
bool roomExistenceCheck(int, dMap_RoomInfo_c**);
dMap_RoomInfo_c* getNextRoomP(dMap_RoomInfo_c*);
dMap_RoomInfo_c* ctrlEntryRoom(int, u8, int, u8, s16, s16, f32);
bool deleteRoom(int);
void ctrlDrawRoomEnlargementSize(int, int, int, int, int, f32, f32, f32, f32, u8);
void ctrlDrawRoomRealSize(int, int, int, int, int, f32, f32, f32, f32, f32, f32, u8);
void init();
void checkFloorMoveImageChangeRoom(u8, u8, int, s16, s16, f32);

public:
/* 0x00 */ s32 m_num;
/* 0x04 */ dMap_RoomInfo_c *m_info;
};

class dMap_2DSQ_c : public dDlst_base_c {
Expand Down
28 changes: 25 additions & 3 deletions include/d/d_stage.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ class stage_map_info_class {
/* 0x1C */ f32 field_0x1C;
/* 0x20 */ f32 field_0x20;
/* 0x24 */ f32 field_0x24;
/* 0x28 */ u8 field_0x28[0x35 - 0x28];
/* 0x28 */ u32 field_0x28;
/* 0x2C */ u32 field_0x2c;
/* 0x30 */ f32 field_0x30;
/* 0x34 */ u8 field_0x34;
/* 0x35 */ u8 field_0x35;
/* 0x36 */ u8 mOceanXZ;
/* 0x37 */ u8 field_0x37[0x38 - 0x37];
Expand Down Expand Up @@ -276,7 +279,16 @@ struct dStage_dPnt_c {
/* 0x4 */ cXyz m_position;
}; // Size: 0x10

struct dStage_FloorInfo_c {};
struct dStage_FloorInfo_entry_c {
/* 0x00 */ int field_0x00;
/* 0x04 */ u8 floorNo;
/* 0x05 */ s8 field_0x05[14];
}; // Size: 0x14

struct dStage_FloorInfo_c {
/* 0x00 */ int num;
/* 0x04 */ dStage_FloorInfo_entry_c* entry;
};

struct dStage_Lbnk_c {
/* 0x00 */ u32 m_num;
Expand All @@ -293,7 +305,17 @@ struct dStage_MemoryConfig_c {
/* 0x4 */ dStage_MemoryConfig_data* m_entries;
};

struct dStage_DMap_c {};
struct dStage_DMap_entry_c {
/* 0x00 */ int field_0x00;
/* 0x04 */ int field_0x04;
/* 0x08 */ int field_0x08;
/* 0x0C */ float offsetY;
};

struct dStage_DMap_c {
/* 0x00 */ int num;
/* 0x04 */ dStage_DMap_entry_c* entry;
};

struct dStage_Event_dt_c {
/* 0x00 */ u8 field_0x0;
Expand Down
3 changes: 2 additions & 1 deletion src/d/d_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ u32 dLib_getIplDaysFromSaveTime() {
return 0;

OSTime curTime = OSGetTime();
return (curTime - dateIpl);
u32 seconds = OSTicksToSeconds(curTime - dateIpl);
return seconds;
}

/* 80058834-80058910 .text dLib_get_QuatFromTriangle__FP4cXyzP4cXyzP4cXyz */
Expand Down
Loading

0 comments on commit 63aecb6

Please sign in to comment.