Files
tp/include/d/d_map_path_dmap.h
T

188 lines
5.9 KiB
C++
Raw Normal View History

2021-03-28 22:49:05 +02:00
#ifndef D_MAP_D_MAP_PATH_DMAP_H
#define D_MAP_D_MAP_PATH_DMAP_H
2022-02-07 15:27:50 -08:00
#include "d/d_tresure.h"
2024-10-10 07:29:58 -07:00
#include "d/d_map_path.h"
2021-03-28 22:49:05 +02:00
2023-05-12 12:10:14 -07:00
class dStage_FileList2_dt_c;
struct stage_tgsc_data_class;
2021-12-27 05:15:35 -08:00
class dMpath_c {
public:
2025-11-30 14:23:42 -08:00
static bool isExistMapPathData();
static int getTopBottomFloorNo(s8*, s8*);
static void createWork();
static void setPointer(s8, void*, int);
static int setPointer(dDrawPath_c::room_class*, s8*, s8*);
static void create();
static void reset();
static void remove();
2023-06-09 11:55:15 +03:00
static dDrawPath_c::room_class* getRoomPointer(int layerNo, int roomNo) {
2024-10-08 01:32:29 +03:00
return mLayerList->mRooms[layerNo][roomNo];
2023-06-09 11:55:15 +03:00
}
2021-12-27 05:15:35 -08:00
2024-02-17 11:47:45 -08:00
static f32 getMinX() { return mMinX; }
static f32 getMinZ() { return mMinZ; }
static f32 getMaxX() { return mMaxX; }
static f32 getMaxZ() { return mMaxZ; }
static f32 getSizeX() { return mAllSizeX; }
static f32 getSizeZ() { return mAllSizeZ; }
static f32 getCenterX() { return mAllCenterX; }
static f32 getCenterZ() { return mAllCenterZ; }
2024-10-08 01:32:29 +03:00
static dDrawPath_c::layer_data* mLayerList; // this doesn't seem right, but can't figure it out atm
2021-12-27 05:15:35 -08:00
static f32 mMinX;
static f32 mMaxX;
static f32 mMinZ;
static f32 mMaxZ;
static f32 mAllCenterX;
static f32 mAllCenterZ;
static f32 mAllSizeX;
static f32 mAllSizeZ;
2023-01-29 21:00:46 -08:00
static s8 mBottomFloorNo;
static s8 mTopFloorNo;
2021-12-27 05:15:35 -08:00
};
struct dMapInfo_n {
2025-11-30 14:23:42 -08:00
static bool chkGetCompass();
static bool chkGetMap();
static bool isVisitedRoom(int);
static void correctionOriginPos(s8, Vec*);
static void offsetPlus(dStage_FileList2_dt_c const*, Vec*);
static void rotAngle(dStage_FileList2_dt_c const*, Vec*);
static Vec getMapPlayerPos();
static s16 getMapPlayerAngleY();
static const dTres_c::typeGroupData_c* getConstRestartIconPointer();
static Vec getMapRestartPos();
static s16 getMapRestartAngleY();
static void getRoomCenter(int, f32*, f32*);
static void getRoomMinMaxXZ(int, f32*, f32*, f32*, f32*);
static void getFloorParameter(f32, s8*, f32*, f32*, f32*, f32*);
2023-01-29 21:00:46 -08:00
};
class dMapInfo_c {
public:
2025-11-30 14:23:42 -08:00
static s8 calcFloorNo(f32, bool, int);
static s8 calcNowStayFloorNo(f32, bool);
static void move(int, f32);
static void init();
static void reset();
static void create();
static void remove();
2023-01-29 21:00:46 -08:00
2024-02-17 11:47:45 -08:00
static s8 getNowStayFloorNo() {
JUT_ASSERT(0, mNowStayFloorNoDecisionFlg);
2024-02-17 11:47:45 -08:00
s8 floor_no = 0;
if (mNowStayFloorNoDecisionFlg) {
floor_no = mNowStayFloorNo;
}
return floor_no;
}
static u8 getNowStayFloorNoDecisionFlg() {
return mNowStayFloorNoDecisionFlg;
}
2024-02-17 11:47:45 -08:00
static void setNextRoomNoForMapPat0(int i_roomNo) { mNextRoomNo = i_roomNo; }
static int getNextRoomNoForMapPat0() { return mNextRoomNo; }
2023-01-29 21:00:46 -08:00
static int mNextRoomNo;
static int mNowStayRoomNo;
static s8 mNowStayFloorNo;
static u8 mNowStayFloorNoDecisionFlg;
2021-12-27 05:15:35 -08:00
};
class renderingDAmap_c : public dRenderingFDAmap_c {
public:
2023-01-29 21:00:46 -08:00
renderingDAmap_c() {
mRoomNo = 0;
field_0x28 = 0;
mRoomNoSingle = 0;
mRenderedFloor = 0;
mIsDraw = false;
}
2025-11-30 14:23:42 -08:00
s8 calcFloorNoForObjectByMapPathRend(f32, int) const;
void init(u8*, u16, u16, u16, u16);
void entry(f32, f32, f32, int, s8);
void setSingleRoomSetting();
int getFirstDrawRoomNo();
int getNextDrawRoomNo(int);
2021-12-27 06:17:37 -08:00
2025-11-30 14:23:42 -08:00
virtual void draw();
virtual ~renderingDAmap_c() {}
virtual bool isSwitch(dDrawPath_c::group_class const*);
virtual bool isRenderingFloor(int);
virtual dDrawPath_c::room_class* getFirstRoomPointer();
virtual dDrawPath_c::room_class* getNextRoomPointer();
virtual void preDrawPath();
virtual void postDrawPath();
virtual bool isDrawPath();
virtual const GXColor* getBackColor() const;
virtual int getFirstDrawLayerNo();
virtual int getNextDrawLayerNo(int);
2024-10-08 01:32:29 +03:00
2025-11-30 14:23:42 -08:00
virtual bool isDrawIconSingle(dTres_c::data_s const*, int, int, bool, bool,
2021-12-27 06:17:37 -08:00
Vec const*) const;
2025-11-30 14:23:42 -08:00
virtual int getIconGroupNumber(u8) const;
2023-01-29 21:00:46 -08:00
virtual bool hasMap() const = 0;
virtual bool isRendAllRoom() const = 0;
virtual bool isRendDoor() const = 0;
2021-12-27 05:15:35 -08:00
virtual bool isCheckFloor() const = 0;
2023-01-29 21:00:46 -08:00
virtual bool isDrawIconSingle2(dTres_c::data_s const*, bool, bool, int) const = 0;
2025-11-30 14:23:42 -08:00
virtual int getRoomNoSingle();
virtual bool isDrawRoom(int, int) const;
virtual bool isDrawRoomIcon(int, int) const;
2021-12-27 05:15:35 -08:00
2023-01-29 21:00:46 -08:00
bool isDraw() const { return mIsDraw; }
2021-12-27 05:15:35 -08:00
2023-01-29 21:00:46 -08:00
/* 0x24 */ int mRoomNo;
2021-12-27 05:15:35 -08:00
/* 0x28 */ int field_0x28;
/* 0x2C */ int mRoomNoSingle;
2023-01-29 21:00:46 -08:00
/* 0x30 */ s8 mRenderedFloor;
/* 0x31 */ bool mIsDraw;
2021-12-27 05:15:35 -08:00
}; // Size: 0x34
class stage_tgsc_data_class;
class renderingPlusDoor_c : public renderingDAmap_c {
2021-12-27 06:17:37 -08:00
public:
2024-02-17 11:47:45 -08:00
renderingPlusDoor_c() {}
2025-11-30 14:23:42 -08:00
void drawDoor1();
void drawDoor2();
void drawDoorCommon(stage_tgsc_data_class const*, int, bool);
bool checkDispDoorS(int, int, f32);
void drawNormalDoorS(stage_tgsc_data_class const*, int, int, bool);
2021-12-27 06:17:37 -08:00
2025-11-30 14:23:42 -08:00
virtual ~renderingPlusDoor_c() {}
virtual void beforeDrawPath();
virtual void afterDrawPath();
2021-12-27 05:15:35 -08:00
virtual bool isRendRestart() const = 0;
virtual bool isRendCursor() const = 0;
virtual bool isRendIcon() const = 0;
};
class renderingPlusDoorAndCursor_c : public renderingPlusDoor_c {
public:
2025-11-30 14:23:42 -08:00
void drawTreasure();
void drawTreasureAfterPlayer();
void drawIconSingle(Vec const&, f32, f32);
void drawCursor(Vec const&, s16, int, f32);
2024-02-17 11:47:45 -08:00
renderingPlusDoorAndCursor_c() {}
2021-12-27 05:15:35 -08:00
2025-11-30 14:23:42 -08:00
virtual ~renderingPlusDoorAndCursor_c() {}
virtual void afterDrawPath();
2023-01-29 21:00:46 -08:00
virtual f32 getIconSize(u8) const = 0;
2025-11-30 14:23:42 -08:00
virtual const Vec* getIconPosition(dTres_c::typeGroupData_c*) const;
virtual dTres_c::typeGroupData_c* getFirstData(u8);
virtual dTres_c::typeGroupData_c* getNextData(dTres_c::typeGroupData_c*);
2023-01-29 21:00:46 -08:00
virtual f32 getPlayerCursorSize() = 0;
virtual f32 getRestartCursorSize() = 0;
2021-12-27 05:15:35 -08:00
};
2021-03-28 22:49:05 +02:00
#endif /* D_MAP_D_MAP_PATH_DMAP_H */