m_Do cleanup, d_resource, drawlist stuff (#145)

* d_resource / some d_stage

* setup dDlst_list_c / d_select_icon OK

* JUTXfb / some JUTVideo + various

* some J2D classes / JUTVideo/Fader attempts

* bunch of m_Do cleanup + matches / f_ap_game OK

* mDoLib_clipper::setup OK

* most of d_meter_HIO OK

* pane_class / kantera_icon_meter
This commit is contained in:
TakaRikka
2021-09-24 08:11:10 -07:00
committed by GitHub
parent 6dcfdaf8a3
commit 7374f5f2f7
261 changed files with 6757 additions and 10882 deletions
@@ -15,6 +15,7 @@ typedef void (*J3DDrawBuffer_DrawFunc)(const J3DDrawBuffer* this_);
class J3DDrawBuffer {
public:
J3DDrawBuffer() { initialize(); }
~J3DDrawBuffer();
void initialize();
J3DError allocBuffer(u32);
+6
View File
@@ -39,6 +39,12 @@ public:
class J3DPacket {
public:
J3DPacket() {
mpNextSibling = NULL;
mpFirstChild = NULL;
mpUserData = NULL;
}
void addChildPacket(J3DPacket* pChild);
inline void clear() {
+67
View File
@@ -1,6 +1,73 @@
#ifndef J3DSHAPE_H
#define J3DSHAPE_H
#include "JSystem/J3DGraphBase/J3DShapeDraw.h"
#include "JSystem/J3DGraphBase/J3DShapeMtx.h"
#include "dolphin/gx/GX.h"
#include "dolphin/mtx/mtxvec.h"
#include "dolphin/types.h"
class J3DCurrentMtxInfo {
public:
u32 mMtxIdxRegA;
u32 mMtxIdxRegB;
};
class J3DCurrentMtx : public J3DCurrentMtxInfo {
public:
u32 getMtxIdxRegA() const { return mMtxIdxRegA; }
u32 getMtxIdxRegB() const { return mMtxIdxRegB; }
};
class J3DMaterial;
class J3DVertexData;
class J3DDrawMtxData;
class J3DShape {
public:
/* 80314B48 */ void initialize();
/* 80314BB8 */ void addTexMtxIndexInDL(_GXAttr, u32);
/* 80314CBC */ void addTexMtxIndexInVcd(_GXAttr);
/* 80314DA8 */ void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]);
/* 80314E28 */ void countBumpMtxNum() const;
/* 80314EEC */ void loadVtxArray() const;
/* 80314F5C */ void isSameVcdVatCmd(J3DShape*);
/* 80314F98 */ void makeVtxArrayCmd();
/* 80315260 */ void makeVcdVatCmd();
/* 80315300 */ void loadPreDrawSetting() const;
/* 80315398 */ void setArrayAndBindPipeline() const;
/* 803155E0 */ virtual void draw() const;
/* 8031544C */ virtual void drawFast() const;
/* 80315628 */ virtual void simpleDraw() const;
/* 803156AC */ virtual void simpleDrawCache() const;
static void resetVcdVatCache() { sOldVcdVatCmd = NULL; }
static void* sOldVcdVatCmd;
private:
/* 0x04 */ J3DMaterial* mMaterial;
/* 0x08 */ u16 mIndex;
/* 0x0A */ u16 mMtxGroupNum;
/* 0x0C */ u32 mFlags;
/* 0x10 */ f32 mRadius;
/* 0x14 */ Vec mMin;
/* 0x20 */ Vec mMax;
/* 0x2C */ void* mVcdVatCmd;
/* 0x30 */ _GXAttr* mVtxDesc;
/* 0x34 */ bool mHasNBT;
/* 0x38 */ J3DShapeMtx* mShapeMtx;
/* 0x3C */ J3DShapeDraw* mShapeDraw;
/* 0x40 */ J3DCurrentMtx mCurrentMtx;
/* 0x48 */ bool mHasPNMTXIdx;
/* 0x4C */ J3DVertexData* mVertexData;
/* 0x50 */ J3DDrawMtxData* mDrawMtxData;
/* 0x54 */ u8* mScaleFlagArray;
/* 0x58 */ Mtx* mDrawMtx;
/* 0x5C */ Mtx* mNrmMtx;
/* 0x60 */ u32* mCurrentViewNo;
/* 0x64 */ u32 mBumpMtxOffset;
};
#endif /* J3DSHAPE_H */
@@ -3,4 +3,18 @@
#include "dolphin/types.h"
class J3DShapeDraw {
public:
/* 80314924 */ void countVertex(u32);
/* 80314974 */ void addTexMtxIndexInDL(u32, u32, u32);
/* 80314ABC */ J3DShapeDraw(u8 const*, u32);
/* 80314AD4 */ void draw() const;
/* 80314B00 */ virtual ~J3DShapeDraw();
private:
/* 0x04 */ u32 mDisplayListSize;
/* 0x08 */ void* mDisplayList;
};
#endif /* J3DSHAPEDRAW_H */
@@ -1,6 +1,32 @@
#ifndef J3DSHAPEMTX_H
#define J3DSHAPEMTX_H
#include "dolphin/mtx/mtxvec.h"
#include "dolphin/types.h"
class J3DShapeMtx {
public:
/* 803130A8 */ void resetMtxLoadCache();
/* 803130E4 */ void loadMtxIndx_PNGP(int, u16) const;
/* 80313128 */ void loadMtxIndx_PCPU(int, u16) const;
/* 80313188 */ void loadMtxIndx_NCPU(int, u16) const;
/* 803131D4 */ void loadMtxIndx_PNCPU(int, u16) const;
/* 80314798 */ virtual ~J3DShapeMtx();
/* 803147E0 */ virtual void getType() const;
/* 80273E08 */ virtual bool getUseMtxNum() const;
/* 8031459C */ virtual void getUseMtxIndex(u16) const;
/* 80313B94 */ virtual void load() const;
/* 80313BF0 */ virtual void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]);
static u8 sMtxLoadPipeline[48];
static u8 sMtxLoadCache[20 + 4 /* padding */];
static u8 sCurrentPipeline[4];
static u8 sCurrentScaleFlag[4];
static u8 sTexMtxLoadType[4];
private:
/* 0x04 */ u16 mUseMtxIndex;
};
#endif /* J3DSHAPEMTX_H */
+32 -4
View File
@@ -12,9 +12,28 @@ enum J3DError {
struct _GXTexCacheSize {};
class J3DMtxCalc;
class J3DModel;
class J3DMatPacket;
class J3DShapePacket;
class J3DShape;
class J3DDrawBuffer;
class J3DTexture;
struct J3DSys {
Mtx mMtx;
u8 _30[0x11C - 0x30];
/* 0x00 */ Mtx mMtx;
/* 0x30 */ J3DMtxCalc* mMtxCalc;
/* 0x34 */ u32 mFlags;
/* 0x38 */ J3DModel* mModel;
/* 0x3C */ J3DMatPacket* mMatPacket;
/* 0x40 */ J3DShapePacket* mShapePacket;
/* 0x44 */ J3DShape* mShape;
/* 0x48 */ J3DDrawBuffer* mDrawBuffer[2];
/* 0x50 */ u32 mDrawMode;
/* 0x54 */ u32 mMaterialMode;
/* 0x58 */ J3DTexture* mTexture;
u8 field_0x5c[0x11C - 0x5C];
/* 8030FDE8 */ J3DSys();
/* 8030FEC0 */ void loadPosMtxIndx(int, u16) const;
/* 8030FEE4 */ void loadNrmMtxIndx(int, u16) const;
@@ -29,10 +48,19 @@ struct J3DSys {
/* 80310D44 */ void reinitIndStages();
/* 80310E3C */ void reinitPixelProc();
static u8 mCurrentMtx[48];
enum DrawMode {
/* 0x3 */ OPA_TEX_EDGE = 3,
/* 0x4 */ XLU,
};
void setDrawModeOpaTexEdge() { mDrawMode = OPA_TEX_EDGE; }
void setDrawModeXlu() { mDrawMode = XLU; }
static Mtx mCurrentMtx;
static f32 mCurrentS[3];
static f32 mParentS[3];
static u8 sTexCoordScaleTable[64 + 4 /* padding */];
static u16 sTexCoordScaleTable[34];
};
extern J3DSys j3dSys;