mirror of
https://github.com/TwilitRealm/dusklight.git
synced 2026-05-13 12:28:06 -07:00
b289dece80
* fix kankyo UB
* Fix TEV Stage DL writing
BE issue
* BE Fixes in materials/shapes
* Move to Aurora GD impl
* JUTDataFileHeader
* j3d: load vertex and texture not through GD
* Endian swap vertex data (mostly)
* Just exit(0) when closing the game
Fix crashes :godo:
* fix fopAcM_ct_placement and remove memcpy
* J3D: track vertex arrays correctly, swap work
* fix visibility, turn off overridden new/delete when we call into aurora
* event: cut name be
* Default window improvements
Double size, allow OS to decide position
* survive TParse::parseHeader_next
* color swap fix
* swap endian/fixes oob function pointer
* Remove GXGetViewportv stub
Aurora has it now
* Set array pointers via GD again
Relies on https://github.com/encounter/aurora/pull/35
* Let Aurora decide graphics backend
* disable procbar drawing
* Fix TColor endianness conversion issues
Fixes the wrong color for the flashing logo
* cam param swap
* simplify vtx loading, mat/amb color fix
* endian swap stb/fvb data
* aurora stat changes
* fix storage buffer crash
dont unnecessarily reassign vertex buffers in a way that forces aurora to recache things
* set bgobj spec fix
* add camera debug, endian swap more stb data, d_a_bg_obj::spec_data_c swapped
* JKRExpHeap: fix bad allocator slowdown
* solid tex
* texture caching
* log level
* fix window aspect ratio, disable bloom, endian swap camera type data
camera is now actually playing opening cutscene!!!!
* add GXDestroyTexObj to a couple stack init'd GXTexObjs, remove some diag printfs
* endian swap joint weight envelope data
* move to dusk config
* verbose arg errors
* better stub logging (for now)
* less logging, more BE
* more stubbing, move logging stuff around
* move all logging to aurora logging
* fix STUB_LOG, __FUNCTION__ isn't a string literal, wasn't building as it
was.
* update aurora
* fix heap alignment mismatch and always head align for now
* prevent them from fucking up my shit
* forward jut warning to DuskLog
* remove report logging
* maybe and i must emphasize maybe fix JMessage parsing
* this was a dumb idea
* preserve negative alignment for JKRHeap
* use normal free on macos and linux
* ^
* fix JMAHermiteInterpolation c impl
* endian swap J2DScreen mColor (oops)
* swap more J3D anim data, remove weird pointer addr check in J3DMaterial getMaterialAnm
* typo fix
* Fix aligned_alloc() size issues on POSIX
aligned_alloc() requires its input size to be a multiple of alignment. This wasn't being upheld so there were allocation failures in init code that made the game fail to start outside Windows.
Also just cleaned up some of this code a bit and removed fallback cases that *shouldn't* get hit.
* _Exit instead of exit()
Seriously I don't want destructors to run. Let the OS reclaim that shit.
* Reapply "Isolate JKRHeap operator overloads" (#39)
This reverts commit 3623b27f37.
* Fix some oopsies
* Fix hardcoded pointer size in JUTCacheFont::allocArray
* More operator overload fixes
Add void template specialization for jkrDelete
Add new[] placement overload. Apparently.
* Fix delete macros on nullptr
TIL C++ allows that.
* fix delete[]
* fix new(std::nothrow) overload
* fix avoid ub
* swap remaining anim data needed for title logo
* get rid of op 7
* move aurora_end_frame to correct spot
* juttexture destroy tex
* j2d animation be
* shutdown crash
* link warp material fix
* mDoExt_3DlineMat1_c fix
* hacky keyboard controls
* endian swap J2DResReference, add kb_pad to files.cmake
* fix some missing endian swaps in J2D, remove addr alignment check
* Remove heap unsetting in aurora calls
Never worked properly and not the right solution even if it did
* Don't print in DC stubs
They're fine to never implement
* Fix alignment stuff again
* Compile GF from dolphin lib
Doesn't seem to break anything and shuts up some stub warnings
* j3dtexture tlut obj fix
* addTexMtxIndexInDL fix
* don't recreate null tex data every frame
* the actual fix i wanted to push
* its kinda fakematch city over here
* insert hte efb copy
* limited window size / viewport support
* IsDelete FIX
---------
Co-authored-by: madeline <qwertytrogi@gmail.com>
Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net>
Co-authored-by: Jeffrey Crowell <jeff@crowell.biz>
Co-authored-by: TakaRikka <takarikka@outlook.com>
Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com>
Co-authored-by: Lurs <2795933+Lurs@users.noreply.github.com>
306 lines
11 KiB
C++
306 lines
11 KiB
C++
#ifndef D_MAP_D_MAP_PATH_FMAP_H
|
|
#define D_MAP_D_MAP_PATH_FMAP_H
|
|
|
|
#include "d/d_map_path.h"
|
|
#include "d/d_tresure.h"
|
|
#include "d/d_stage.h"
|
|
|
|
class fmpTresTypeGroupData_c {
|
|
public:
|
|
fmpTresTypeGroupData_c() {
|
|
mpTresData = NULL;
|
|
mpNext = NULL;
|
|
}
|
|
|
|
~fmpTresTypeGroupData_c() {
|
|
if (mpNext != NULL) {
|
|
JKR_DELETE(mpNext);
|
|
}
|
|
}
|
|
|
|
void setTypeGroupNo(u8 i_no) { mTypeGroupNo = i_no; }
|
|
void setNextData(fmpTresTypeGroupData_c* i_next) { mpNext = i_next; }
|
|
void setTresData(const dTres_c::data_s* i_data) { mpTresData = i_data; }
|
|
const dTres_c::data_s* getTresData() { return mpTresData; }
|
|
fmpTresTypeGroupData_c* getNextData() { return mpNext; }
|
|
|
|
/* 0x0 */ const dTres_c::data_s* mpTresData;
|
|
/* 0x0 */ fmpTresTypeGroupData_c* mpNext;
|
|
/* 0x8 */ u8 mTypeGroupNo;
|
|
}; // Size: 0xC
|
|
|
|
class fmpTresTypeGroupDataList_c {
|
|
public:
|
|
void addTypeGroupData(u8, dTres_c::data_s const*);
|
|
~fmpTresTypeGroupDataList_c() {
|
|
if (mpTypeGroupDataHead != NULL) {
|
|
JKR_DELETE(mpTypeGroupDataHead);
|
|
}
|
|
}
|
|
fmpTresTypeGroupDataList_c() {
|
|
mpTypeGroupDataHead = NULL;
|
|
mpNextData = NULL;
|
|
}
|
|
|
|
fmpTresTypeGroupData_c* getTypeGroupDataHead() { return mpTypeGroupDataHead; }
|
|
|
|
/* 0x0 */ fmpTresTypeGroupData_c* mpTypeGroupDataHead;
|
|
/* 0x4 */ fmpTresTypeGroupData_c* mpNextData;
|
|
};
|
|
|
|
class fmpTresTypeGroupDataListAll_c {
|
|
public:
|
|
void addTypeGroupData(u8 i_typeGroupNo, const dTres_c::data_s* i_data) {
|
|
mpTypeGroupData[i_typeGroupNo].addTypeGroupData(i_typeGroupNo, i_data);
|
|
}
|
|
fmpTresTypeGroupDataList_c* getTypeGroupDataList(int i_typeGroupNo) {
|
|
return &mpTypeGroupData[i_typeGroupNo];
|
|
}
|
|
|
|
/* 0x0 */ fmpTresTypeGroupDataList_c mpTypeGroupData[17];
|
|
};
|
|
|
|
class dMenu_Fmap_data_c {
|
|
public:
|
|
dMenu_Fmap_data_c() {
|
|
mp_tresure = NULL;
|
|
m_fileList2 = NULL;
|
|
mp_mapPath = NULL;
|
|
mp_dzsData = NULL;
|
|
}
|
|
|
|
dTres_c::list_class* getTresure() { return mp_tresure; }
|
|
f32 getFilelist2MinX() { return m_fileList2->mLeftRmX; }
|
|
f32 getFilelist2MinZ() { return m_fileList2->mInnerRmZ; }
|
|
f32 getFilelist2MaxX() { return m_fileList2->mRightRmX; }
|
|
f32 getFilelist2MaxZ() { return m_fileList2->mFrontRmZ; }
|
|
dDrawPath_c::room_class* getMapPath() { return mp_mapPath; }
|
|
void* getDzsData() { return mp_dzsData; }
|
|
|
|
void setFileList2(dStage_FileList2_dt_c* i_fileList) { m_fileList2 = i_fileList; }
|
|
void setTresure(dTres_c::list_class* i_list) { mp_tresure = i_list; }
|
|
void setMapPath(dDrawPath_c::room_class* i_path) { mp_mapPath = i_path; }
|
|
void setDzsData(void* i_dzsData) { mp_dzsData = i_dzsData; }
|
|
|
|
/* 0x0 */ dTres_c::list_class* mp_tresure;
|
|
/* 0x4 */ dStage_FileList2_dt_c* m_fileList2;
|
|
/* 0x8 */ dDrawPath_c::room_class* mp_mapPath;
|
|
/* 0xC */ void* mp_dzsData;
|
|
};
|
|
|
|
class dMenu_Fmap_stage_data_c;
|
|
class dMenu_Fmap_room_data_c {
|
|
public:
|
|
bool isArrival();
|
|
void buildTresTypeGroup(int, int, int);
|
|
void buildFmapRoomData(int, int, f32, f32, f32, f32);
|
|
|
|
dMenu_Fmap_room_data_c(u8 i_roomNo, dMenu_Fmap_stage_data_c* i_stageData,
|
|
dMenu_Fmap_data_c* i_data) {
|
|
mp_fmapData = i_data;
|
|
mp_fmpTresTypeGroupDataListAll = NULL;
|
|
mp_nextData = NULL;
|
|
mp_parentStage = i_stageData;
|
|
m_roomNo = i_roomNo;
|
|
}
|
|
|
|
~dMenu_Fmap_room_data_c() {
|
|
if (mp_fmpTresTypeGroupDataListAll != NULL) {
|
|
JKR_DELETE(mp_fmpTresTypeGroupDataListAll);
|
|
}
|
|
}
|
|
|
|
fmpTresTypeGroupDataListAll_c* getTypeGroupDataListAll() { return mp_fmpTresTypeGroupDataListAll; }
|
|
f32 getFileList2MinX() { return mp_fmapData->getFilelist2MinX(); }
|
|
f32 getFileList2MinZ() { return mp_fmapData->getFilelist2MinZ(); }
|
|
f32 getFileList2MaxX() { return mp_fmapData->getFilelist2MaxX(); }
|
|
f32 getFileList2MaxZ() { return mp_fmapData->getFilelist2MaxZ(); }
|
|
dMenu_Fmap_room_data_c* getNextData() { return mp_nextData; }
|
|
dMenu_Fmap_data_c* getFmapData() { return mp_fmapData; }
|
|
int getRoomNo() { return m_roomNo; }
|
|
void setNextData(dMenu_Fmap_room_data_c* i_nextData) { mp_nextData = i_nextData; }
|
|
|
|
/* 0x00 */ dMenu_Fmap_data_c* mp_fmapData;
|
|
/* 0x04 */ fmpTresTypeGroupDataListAll_c* mp_fmpTresTypeGroupDataListAll;
|
|
/* 0x08 */ dMenu_Fmap_room_data_c* mp_nextData;
|
|
/* 0x0C */ dMenu_Fmap_stage_data_c* mp_parentStage;
|
|
/* 0x10 */ u8 m_roomNo;
|
|
};
|
|
|
|
class dMenu_Fmap_stage_arc_data_c {
|
|
public:
|
|
u8 getSaveTableNo() { return mSaveTableNo; }
|
|
u8 getVisitedRoomSaveTableNo() { return mVisitedRoomSaveTableNo; }
|
|
|
|
/* 0x0 */ u8 mSize;
|
|
/* 0x1 */ u8 mSaveTableNo;
|
|
/* 0x2 */ u8 mVisitedRoomSaveTableNo;
|
|
/* 0x3 */ u8 field_0x3;
|
|
/* 0x4 */ u8 mRoomNos[0];
|
|
};
|
|
|
|
class dMenu_Fmap_stage_data_c {
|
|
public:
|
|
bool isArrival();
|
|
int buildFmapStageData(int, f32, f32);
|
|
|
|
dMenu_Fmap_stage_data_c() {
|
|
mpStageArc = NULL;
|
|
mp_roomTop = NULL;
|
|
mpNextData = NULL;
|
|
m_stageMinX = 0.0f;
|
|
m_stageMinZ = 0.0f;
|
|
m_stageMaxX = 0.0f;
|
|
m_stageMaxZ = 0.0f;
|
|
m_offsetX = 0.0f;
|
|
m_offsetZ = 0.0f;
|
|
for (int i = 0; i < 8; i++) {
|
|
name[i] = '\0';
|
|
}
|
|
}
|
|
|
|
f32 getStageCenterX() { return (m_stageMaxX + m_stageMinX) * 0.5f; }
|
|
f32 getStageCenterZ() { return (m_stageMaxZ + m_stageMinZ) * 0.5f; }
|
|
f32 getStageCenterX_CoordRegion() { return m_offsetX + getStageCenterX(); }
|
|
f32 getStageCenterZ_CoordRegion() { return m_offsetZ + getStageCenterZ(); }
|
|
char* getStageName() { return name; }
|
|
dMenu_Fmap_stage_arc_data_c* getStageArc() { return mpStageArc; }
|
|
dMenu_Fmap_stage_data_c* getNextData() { return mpNextData; }
|
|
dMenu_Fmap_room_data_c* getFmapRoomDataTop() { return mp_roomTop; }
|
|
f32 getOffsetX() { return m_offsetX; }
|
|
f32 getOffsetZ() { return m_offsetZ; }
|
|
f32 getStageMinX() { return m_stageMinX; }
|
|
f32 getStageMinZ() { return m_stageMinZ; }
|
|
f32 getStageMaxX() { return m_stageMaxX; }
|
|
f32 getStageMaxZ() { return m_stageMaxZ; }
|
|
void setStageArc(dMenu_Fmap_stage_arc_data_c* i_stageArc) { mpStageArc = i_stageArc; }
|
|
void setFmapRoomDataTop(dMenu_Fmap_room_data_c* i_roomTop) { mp_roomTop = i_roomTop; }
|
|
void setNextData(dMenu_Fmap_stage_data_c* i_nextData) { mpNextData = i_nextData; }
|
|
void setStageCntNo(int i_no) { m_stageCntNo = i_no; }
|
|
void setOffsetX(f32 i_offsetX) { m_offsetX = i_offsetX; }
|
|
void setOffsetZ(f32 i_offsetZ) { m_offsetZ = i_offsetZ; }
|
|
|
|
void setName(char* i_name) {
|
|
for (int i = 0; i < 8; i++) {
|
|
name[i] = i_name[i];
|
|
}
|
|
}
|
|
|
|
/* 0x00 */ char name[8];
|
|
/* 0x08 */ dMenu_Fmap_stage_arc_data_c* mpStageArc;
|
|
/* 0x0C */ dMenu_Fmap_room_data_c* mp_roomTop;
|
|
/* 0x10 */ dMenu_Fmap_stage_data_c* mpNextData;
|
|
/* 0x14 */ f32 m_offsetX;
|
|
/* 0x18 */ f32 m_offsetZ;
|
|
/* 0x1C */ f32 m_stageMinX;
|
|
/* 0x20 */ f32 m_stageMinZ;
|
|
/* 0x24 */ f32 m_stageMaxX;
|
|
/* 0x28 */ f32 m_stageMaxZ;
|
|
/* 0x2C */ int m_stageCntNo;
|
|
};
|
|
|
|
class dMenu_Fmap_region_data_c {
|
|
public:
|
|
dMenu_Fmap_stage_data_c* getMenuFmapStageData(int);
|
|
int getPointStagePathInnerNo(f32, f32, int, int*, int*);
|
|
int buildFmapRegionData(int);
|
|
|
|
dMenu_Fmap_region_data_c(int i_no, dMenu_Fmap_stage_data_c* i_stageData,
|
|
f32 i_offsetX, f32 i_offsetZ) {
|
|
mpMenuFmapStageDataTop = i_stageData;
|
|
mpNextData = NULL;
|
|
mRegionOffsetX = i_offsetX;
|
|
mRegionOffsetZ = i_offsetZ;
|
|
mRegionMinX = 0.0f;
|
|
mRegionMaxX = 0.0f;
|
|
mRegionMinZ = 0.0f;
|
|
mRegionMaxZ = 0.0f;
|
|
mRegionNo = i_no;
|
|
buildFmapRegionData(0);
|
|
}
|
|
|
|
f32 getStageCenterX_CoordWorld(int i_stageNo) {
|
|
return mRegionOffsetX + getMenuFmapStageData(i_stageNo)->getStageCenterX_CoordRegion();
|
|
}
|
|
|
|
f32 getStageCenterZ_CoordWorld(int i_stageNo) {
|
|
return mRegionOffsetZ + getMenuFmapStageData(i_stageNo)->getStageCenterZ_CoordRegion();
|
|
}
|
|
|
|
dMenu_Fmap_stage_data_c* getMenuFmapStageDataTop() { return mpMenuFmapStageDataTop; }
|
|
dMenu_Fmap_region_data_c* getNextData() { return mpNextData; }
|
|
f32 getRegionOffsetX() { return mRegionOffsetX; }
|
|
f32 getRegionOffsetZ() { return mRegionOffsetZ; }
|
|
f32 getRegionMinX() { return mRegionMinX; }
|
|
f32 getRegionMaxX() { return mRegionMaxX; }
|
|
f32 getRegionMinZ() { return mRegionMinZ; }
|
|
f32 getRegionMaxZ() { return mRegionMaxZ; }
|
|
int getRegionNo() { return mRegionNo; }
|
|
void setNextData(dMenu_Fmap_region_data_c* i_data) { mpNextData = i_data; }
|
|
|
|
/* 0x00 */ dMenu_Fmap_stage_data_c* mpMenuFmapStageDataTop;
|
|
/* 0x04 */ dMenu_Fmap_region_data_c* mpNextData;
|
|
/* 0x08 */ f32 mRegionOffsetX;
|
|
/* 0x0C */ f32 mRegionOffsetZ;
|
|
/* 0x10 */ f32 mRegionMinX;
|
|
/* 0x14 */ f32 mRegionMaxX;
|
|
/* 0x18 */ f32 mRegionMinZ;
|
|
/* 0x1C */ f32 mRegionMaxZ;
|
|
/* 0x20 */ int mRegionNo;
|
|
};
|
|
|
|
class dMenu_Fmap_world_data_c {
|
|
public:
|
|
void create(dMenu_Fmap_region_data_c*);
|
|
int buildFmapWorldData();
|
|
|
|
dMenu_Fmap_world_data_c(dMenu_Fmap_region_data_c* i_regionData) { create(i_regionData); }
|
|
dMenu_Fmap_region_data_c* getMenuFmapRegionTop() { return mp_fmapRegionData; }
|
|
f32 getWorldMinX() { return m_worldMinX; }
|
|
f32 getWorldMinZ() { return m_worldMinZ; }
|
|
f32 getWorldMaxX() { return m_worldMaxX; }
|
|
f32 getWorldMaxZ() { return m_worldMaxZ; }
|
|
|
|
/* 0x00 */ dMenu_Fmap_region_data_c* mp_fmapRegionData;
|
|
/* 0x04 */ f32 m_worldMinX;
|
|
/* 0x08 */ f32 m_worldMinZ;
|
|
/* 0x0C */ f32 m_worldMaxX;
|
|
/* 0x10 */ f32 m_worldMaxZ;
|
|
};
|
|
|
|
class dMenuFmapIconPointer_c {
|
|
public:
|
|
bool init(dMenu_Fmap_region_data_c*, dMenu_Fmap_stage_data_c*, u8, int, int);
|
|
bool getFirstData();
|
|
bool getData();
|
|
void getFirstRoomData();
|
|
bool getNextRoomData();
|
|
bool getNextStageData();
|
|
bool getNextData();
|
|
bool nextData();
|
|
bool getValidData();
|
|
|
|
/* 0x00 */ int mStageNo;
|
|
/* 0x04 */ int mStayStageNo;
|
|
/* 0x08 */ int mStayRoomNo;
|
|
/* 0x0C */ int mSaveTbl;
|
|
/* 0x10 */ dMenu_Fmap_region_data_c* mpRegionData;
|
|
/* 0x14 */ dMenu_Fmap_stage_data_c* mpStageData;
|
|
/* 0x18 */ dMenu_Fmap_room_data_c* mpRoomData;
|
|
/* 0x1C */ fmpTresTypeGroupDataListAll_c* mpFmpTresTypeGroupDataListAll;
|
|
/* 0x20 */ fmpTresTypeGroupDataList_c* mpFmpTresTypeGroupDataList;
|
|
/* 0x24 */ fmpTresTypeGroupData_c* mpFmpTresTypeGroupData;
|
|
/* 0x28 */ dTres_c::typeGroupData_c* mpTresTypeGroupData;
|
|
/* 0x2C */ const dTres_c::data_s* mpTresData;
|
|
/* 0x30 */ u8 mTypeGroupNo;
|
|
/* 0x31 */ u8 mType;
|
|
};
|
|
|
|
class dMenuFmapIconDisp_c : public dMenuFmapIconPointer_c {
|
|
public:
|
|
bool getPosition(int*, int*, f32*, f32*, dTres_c::data_s const**);
|
|
virtual bool isDrawDisp();
|
|
};
|
|
|
|
#endif /* D_MAP_D_MAP_PATH_FMAP_H */
|