Skip to content

Commit

Permalink
d_a_lod_bg work
Browse files Browse the repository at this point in the history
  • Loading branch information
magcius committed Aug 3, 2024
1 parent 2a20bc8 commit c99b5bd
Show file tree
Hide file tree
Showing 5 changed files with 357 additions and 43 deletions.
4 changes: 2 additions & 2 deletions include/JSystem/J3DGraphAnimator/J3DModelData.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ class J3DModelData {
mJointTree.makeHierarchy(joint, hierarchy, &mMaterialTable, mShapeTable.mShapeNodePointer);
initShapeNodes();
}
const void* getBinary() { return mBinary; }

// TODO
void getBasicMtxCalc() {}
void getBinary() {}
void getRootNode() {}
void setMatColorAnimator(J3DAnmColor*, J3DMatColorAnm*) {}
void setTexNoAnimator(J3DAnmTexPattern*, J3DTexNoAnm*) {}

private:
friend class J3DModelLoader;

/* 0x04 */ const void* mpRawData;
/* 0x04 */ const void* mBinary;
/* 0x08 */ u32 mFlags;
/* 0x0C */ u16 mbHasBumpArray;
/* 0x0E */ u16 mbHasBillboard;
Expand Down
46 changes: 25 additions & 21 deletions include/d/actor/d_a_lod_bg.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,40 @@ class JKRExpHeap;

class daLodbg_c : public fopAc_ac_c {
public:
inline void createHeap();
inline BOOL draw();
daLodbg_c();
~daLodbg_c();
BOOL createHeap();
BOOL draw();
inline BOOL execute();
void setExecute(int (daLodbg_c::*)()) {}
inline s32 getRoomNo(); // fake, debug maps are old but some inline here appears to be there
void setExecute(BOOL (daLodbg_c::*func)()) { mExecuteFunc = func; }

void deleteModelData();
void loadModelData(const char*, J3DModelData*&, JKRSolidHeap*&, unsigned long&);
void createModelData();
void execCreateWait();
void execReadWait();
void execDeleteWait();
BOOL loadModelData(const char*, J3DModelData*&, JKRSolidHeap*&, unsigned long&);
BOOL createModelData();
BOOL execCreateWait();
BOOL execReadWait();
BOOL execDeleteWait();

static s32 sObjectCount;
static JKRExpHeap* sLocalHeap;
static const char LodAllPath[];

public:
/* 0x290 */ int (daLodbg_c::*mExecFunc)();
/* 0x29C */ J3DModel* mpModel;
/* 0x2A0 */ J3DModel* mpModel2[2];
/* 0x290 */ BOOL (daLodbg_c::*mExecuteFunc)();
/* 0x29C */ J3DModel* mModel;
/* 0x2A0 */ J3DModel* mModel2[2];
/* 0x2A8 */ u8 mAlpha;
/* 0x2A9 */ u8 mDrawModel2;
/* 0x2A9 */ bool mDrawModel2;
/* 0x2AA */ u8 m2AA[0x2AC - 0x2AA];
/* 0x2AC */ J3DModelData* mpModelData;
/* 0x2B0 */ J3DModelData* mpModelData2;
/* 0x2B4 */ mDoDvdThd_mountXArchive_c* mpMountCommand;
/* 0x2B8 */ JKRArchive* mpArchive;
/* 0x2BC */ u32 m2BC;
/* 0x2C0 */ u32 m2C0;
/* 0x2C4 */ JKRSolidHeap* mpHeap;
/* 0x2C8 */ JKRSolidHeap* mpHeap2;
/* 0x2AC */ J3DModelData* mModelData;
/* 0x2B0 */ J3DModelData* mModelData2;
/* 0x2B4 */ mDoDvdThd_mountXArchive_c* mMountCommand;
/* 0x2B8 */ JKRArchive* mArchive;
/* 0x2BC */ u32 mDataSize;
/* 0x2C0 */ u32 mDataSize2;
/* 0x2C4 */ JKRSolidHeap* mDataHeap;
/* 0x2C8 */ JKRSolidHeap* mDataHeap2;
};

#endif /* D_A_LOD_BG_H */
2 changes: 1 addition & 1 deletion include/d/actor/d_a_obj_light.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace daObjLight {
BOOL _execute();
BOOL _draw();

static BOOL renew_light_angle();
static bool renew_light_angle();
static s16 get_light_angle();
static s16 get_light_dif_angle();
static BOOL set_light_dif_angle_LOD(s16);
Expand Down
4 changes: 2 additions & 2 deletions src/JSystem/J3DGraphLoader/J3DModelLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ J3DModelData* J3DModelLoader::load(const void* i_data, u32 i_flags) {
JKRGetCurrentHeap()->getTotalFreeSize();
mpModelData = new J3DModelData();
mpModelData->clear();
mpModelData->mpRawData = i_data;
mpModelData->mBinary = i_data;
mpModelData->setModelDataType(0);
mpMaterialTable = &mpModelData->mMaterialTable;
const JUTDataFileHeader* data = (JUTDataFileHeader*)i_data;
Expand Down Expand Up @@ -149,7 +149,7 @@ J3DMaterialTable* J3DModelLoader::loadMaterialTable(const void* i_data) {
J3DModelData* J3DModelLoader::loadBinaryDisplayList(const void* i_data, u32 i_flags) {
mpModelData = new J3DModelData();
mpModelData->clear();
mpModelData->mpRawData = i_data;
mpModelData->mBinary = i_data;
mpModelData->setModelDataType(1);
mpMaterialTable = &mpModelData->mMaterialTable;
const JUTDataFileHeader* data = (JUTDataFileHeader*)i_data;
Expand Down
Loading

0 comments on commit c99b5bd

Please sign in to comment.