Skip to content

Commit

Permalink
J3DGraphBase progress (w/ lots of help from tww)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrkol committed Feb 6, 2025
1 parent 762f3c7 commit 3baa9ba
Show file tree
Hide file tree
Showing 12 changed files with 1,212 additions and 33 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def MatchingFor(*versions):
Object(Matching, "JSystem/J3D/J3DGraphBase/J3DVertex.cpp"),
Object(Matching, "JSystem/J3D/J3DGraphBase/J3DPacket.cpp"),
Object(NonMatching, "JSystem/J3D/J3DGraphBase/J3DTevs.cpp"),
Object(NonMatching, "JSystem/J3D/J3DGraphBase/J3DDrawBuffer.cpp"),
Object(Matching, "JSystem/J3D/J3DGraphBase/J3DDrawBuffer.cpp"),
# J3DGraphAnimator
Object(NonMatching, "JSystem/J3D/J3DGraphAnimator/J3DCluster.cpp"),
Object(NonMatching, "JSystem/J3D/J3DGraphAnimator/J3DJoint.cpp"),
Expand Down
9 changes: 7 additions & 2 deletions include/JSystem/J3D/J3DGraphBase/J3DMaterial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define J3D_MATERIAL_HPP

#include <types.h>
#include <JSystem/J3d/J3DGraphBase/J3DTevBlocks.hpp>

class J3DMaterialAnm;

Expand All @@ -24,8 +25,12 @@ class J3DMaterial {

~J3DMaterial();

char padding[0x38];
J3DMaterialAnm* unk38;
u16 getTexNo(u32 idx) { return mTevBlock->getTexNo(idx); }

/* 0x0 */ char unk0[0x28];
/* 0x28 */ J3DTevBlock* mTevBlock;
/* 0x2C */ char unk2C[0xC];
/* 0x38 */ J3DMaterialAnm* unk38;
};

#endif
17 changes: 16 additions & 1 deletion include/JSystem/J3D/J3DGraphBase/J3DPacket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class J3DMatPacket;
class J3DDrawBuffer;
class J3DShape;
class J3DMaterial;
class J3DMaterialAnm;
class J3DShapePacket;
class J3DTexture;

Expand Down Expand Up @@ -42,6 +43,16 @@ class J3DPacket {

virtual ~J3DPacket() {};

void drawClear()
{
unk4 = nullptr;
unk8 = nullptr;
}

J3DPacket* getNextPacket() const { return unk4; }
void setNextPacket(J3DPacket* packet) { unk4 = packet; }

public:
J3DPacket* unk4;
J3DPacket* unk8;
u32 unkC;
Expand Down Expand Up @@ -97,11 +108,15 @@ class J3DMatPacket : public J3DDrawPacket {
void addShapePacket(J3DShapePacket* packet);
IDK isHideAllShapePacket_();

J3DShapePacket* getShapePacket() const { return unk34; }
J3DMaterial* getMaterial() const { return unk38; }

public:
J3DShapePacket* unk34; // TODO: might be part of DrawPacket
J3DMaterial* unk38;
u32 unk3C; // TODO: unk3C is something weird, probably not u32
J3DTexture* unk40;
u32 unk44;
J3DMaterialAnm* unk44;
};

class J3DShapePacket : public J3DCallBackPacket {
Expand Down
5 changes: 4 additions & 1 deletion include/JSystem/J3D/J3DGraphBase/J3DStruct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ struct J3DTevStageInfo {
};

struct J3DIndTevStageInfo {
/* 0x0 */ u8 mIndStage __attribute__((aligned(4)));
/* 0x0 */ u8 mIndStage;
/* 0x1 */ u8 mIndFormat;
/* 0x2 */ u8 mBiasSel;
/* 0x3 */ u8 mMtxSel;
Expand All @@ -196,6 +196,9 @@ struct J3DIndTevStageInfo {
/* 0x6 */ u8 mPrev;
/* 0x7 */ u8 mLod;
/* 0x8 */ u8 mAlphaSel;
/* 0x9 */ u8 unk9; // TODO: are these really here? tww used alignment...
/* 0xA */ u8 unkA;
/* 0xB */ u8 unkB;
};

struct J3DTexCoordInfo {
Expand Down
2 changes: 2 additions & 0 deletions include/JSystem/J3D/J3DGraphBase/J3DSys.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class J3DSys {

void setNBTScale(Vec* scale) { mNBTScale = scale; }

MtxPtr getViewMtx() { return mViewMtx; }

public:
/* 0x0 */ Mtx mViewMtx;
/* 0x30 */ char pad_000[0x4];
Expand Down
Loading

0 comments on commit 3baa9ba

Please sign in to comment.