diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2022-10-03 15:26:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-03 18:26:26 -0400 |
| commit | 4913395dbd1a33d794028ceb82579b4baffe954d (patch) | |
| tree | fde72809184e4365eae205b26b14d5fee5698dcd /include/JSystem | |
| parent | 03094905214e54b97414be8e6049abe491f3ff16 (diff) | |
d_camera / m_Do_ext / d_particle + minor various wip (#210)
Diffstat (limited to 'include/JSystem')
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DJoint.h | 1 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h | 1 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DModel.h | 11 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DModelData.h | 1 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h | 16 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DMaterial.h | 1 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DSys.h | 2 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DTexture.h | 5 | ||||
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DVertex.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRArchive.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRCompArchive.h | 10 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRExpHeap.h | 56 | ||||
| -rw-r--r-- | include/JSystem/JKernel/JKRHeap.h | 12 | ||||
| -rw-r--r-- | include/JSystem/JMath/JMath.h | 1 | ||||
| -rw-r--r-- | include/JSystem/JParticle/JPAParticle.h | 14 | ||||
| -rw-r--r-- | include/JSystem/JUtility/JUTFont.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JUtility/JUTNameTab.h | 8 | ||||
| -rw-r--r-- | include/JSystem/JUtility/JUTTexture.h | 8 |
18 files changed, 110 insertions, 43 deletions
diff --git a/include/JSystem/J3DGraphAnimator/J3DJoint.h b/include/JSystem/J3DGraphAnimator/J3DJoint.h index 78a6d04fab..0474f4eb5a 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJoint.h +++ b/include/JSystem/J3DGraphAnimator/J3DJoint.h @@ -63,6 +63,7 @@ public: Vec* getMax() { return &mMax; } Vec* getMin() { return &mMin; } void setCallBack(J3DJointCallBack callback) { mCallBack = callback; } + void setMtxCalc(J3DMtxCalc* i_mtxCalc) { mMtxCalc = i_mtxCalc; } static J3DMtxCalc* mCurrentMtxCalc; diff --git a/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h b/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h index d635b91979..2cbe551312 100644 --- a/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h +++ b/include/JSystem/J3DGraphAnimator/J3DMaterialAttach.h @@ -33,6 +33,7 @@ public: JUTNameTab* getTextureName() const { return mTextureName; } u16 getMaterialNum() const { return mMaterialNum; } + bool isLocked() const { return field_0x1c == 1; } private: /* 0x04 */ u16 mMaterialNum; diff --git a/include/JSystem/J3DGraphAnimator/J3DModel.h b/include/JSystem/J3DGraphAnimator/J3DModel.h index fcc391beea..931c225adb 100644 --- a/include/JSystem/J3DGraphAnimator/J3DModel.h +++ b/include/JSystem/J3DGraphAnimator/J3DModel.h @@ -28,12 +28,16 @@ typedef void (*J3DCalcCallBack)(J3DModel*, u32 timing); class J3DModel { public: + J3DModel() { + initialize(); + } + /* 800CFFF4 */ void setBaseTRMtx(f32 (*)[4]); /* 80327100 */ void initialize(); /* 80327184 */ s32 entryModelData(J3DModelData*, u32, u32); /* 80327300 */ s32 createShapePacket(J3DModelData*); /* 803273CC */ s32 createMatPacket(J3DModelData*, u32); - /* 803275FC */ void newDifferedDisplayList(u32); + /* 803275FC */ s32 newDifferedDisplayList(u32); /* 8032767C */ void lock(); /* 803276B4 */ void unlock(); /* 803279A0 */ void diff(); @@ -60,6 +64,9 @@ public: void onFlag(u32 flag) { mFlags |= flag; } void offFlag(u32 flag) { mFlags &= ~flag; } bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; } + + bool isCpuSkinningOn() const { return (mFlags & 4) && (mFlags & 8); } + Mtx& getBaseTRMtx() { return mBaseTransformMtx; } void i_setBaseTRMtx(Mtx m) { PSMTXCopy(m, mBaseTransformMtx); } u32 getMtxCalcMode() const { return mFlags & 0x03; } @@ -67,8 +74,10 @@ public: J3DShapePacket* getShapePacket(u16 idx) const { return &mShapePacket[idx]; } Mtx33* getBumpMtxPtr(int idx) const { return mMtxBuffer->getBumpMtxPtr(idx); } Mtx33* getNrmMtxPtr() const { return mMtxBuffer->getNrmMtxPtr(); } + Mtx* getDrawMtxPtr() const { return mMtxBuffer->getDrawMtxPtr(); } void setBaseScale(const Vec& scale) { mBaseScale = scale; } void setUserArea(u32 area) { mUserArea = area; } + u32 getUserArea() const { return mUserArea; } Vec* getBaseScale() { return &mBaseScale; } // is there a better way to handle inlines with same name as non-inlines? diff --git a/include/JSystem/J3DGraphAnimator/J3DModelData.h b/include/JSystem/J3DGraphAnimator/J3DModelData.h index 331fc0b347..5371f8113a 100644 --- a/include/JSystem/J3DGraphAnimator/J3DModelData.h +++ b/include/JSystem/J3DGraphAnimator/J3DModelData.h @@ -43,6 +43,7 @@ public: bool checkFlag(u32 flag) const { return !!(mFlags & flag); } bool checkBumpFlag() const { return mbHasBumpArray; } bool checkBBoardFlag() const { return mbHasBillboard == 1; } + bool isLocked() { return mMaterialTable.isLocked(); } void entryTexMtxAnimator(J3DAnmTextureSRTKey* anm) { mMaterialTable.entryTexMtxAnimator(anm); } void entryTevRegAnimator(J3DAnmTevRegKey* anm) { mMaterialTable.entryTevRegAnimator(anm); } int removeTexNoAnimator(J3DAnmTexPattern* anm) { diff --git a/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h b/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h index 8aab568306..1977afe281 100644 --- a/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h +++ b/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h @@ -30,11 +30,24 @@ public: u32* getCurrentViewNoPtr() { return &mCurrentViewNo; } u8* getScaleFlagArray() const { return mScaleFlagArray; } Mtx** getDrawMtxPtrPtr() const { return mpDrawMtxArr; } + Mtx* getDrawMtxPtr() const { return mpDrawMtxArr[mCurrentViewNo]; } Mtx33** getNrmMtxPtrPtr() const { return mpNrmMtxArr; } Mtx33* getNrmMtxPtr() const { return mpNrmMtxArr[mCurrentViewNo]; } Mtx33** getBumpMtxPtrPtr() const { return mpBumpMtxArr; } Mtx33* getBumpMtxPtr(int idx) const { return mpBumpMtxArr[idx]; } + void swapDrawMtx() { + Mtx* tmp = mpOldDrawMtxArr[mCurrentViewNo]; + mpOldDrawMtxArr[mCurrentViewNo] = mpDrawMtxArr[mCurrentViewNo]; + mpDrawMtxArr[mCurrentViewNo] = tmp; + } + + void swapNrmMtx() { + Mtx33* tmp = mpOldNrmMtxArr[mCurrentViewNo]; + mpOldNrmMtxArr[mCurrentViewNo] = mpNrmMtxArr[mCurrentViewNo]; + mpNrmMtxArr[mCurrentViewNo] = tmp; + } + static Mtx sNoUseDrawMtx; static Mtx33 sNoUseNrmMtx; static Mtx* sNoUseDrawMtxPtr; @@ -60,4 +73,7 @@ public: /* 803283B4 */ virtual ~J3DMtxBuffer(); }; +void J3DCalcViewBaseMtx(f32 (*param_0)[4], Vec const& param_1, f32 const (¶m_2)[3][4], + f32 (*param_3)[4]); + #endif /* J3DMTXBUFFER_H */ diff --git a/include/JSystem/J3DGraphBase/J3DMaterial.h b/include/JSystem/J3DGraphBase/J3DMaterial.h index 6814350795..c9c21cfd40 100644 --- a/include/JSystem/J3DGraphBase/J3DMaterial.h +++ b/include/JSystem/J3DGraphBase/J3DMaterial.h @@ -51,6 +51,7 @@ public: J3DTexGenBlock* getTexGenBlock() const { return mTexGenBlock; } J3DDisplayListObj* getSharedDisplayListObj() const { return mSharedDLObj; } J3DShape* getShape() { return mShape; } + J3DJoint* getJoint() { return mJoint; } J3DMaterialAnm* getMaterialAnm() const { if ((u32)mMaterialAnm < 0xC0000000) { return mMaterialAnm; diff --git a/include/JSystem/J3DGraphBase/J3DSys.h b/include/JSystem/J3DGraphBase/J3DSys.h index a4bded7e42..fd75fc48f7 100644 --- a/include/JSystem/J3DGraphBase/J3DSys.h +++ b/include/JSystem/J3DGraphBase/J3DSys.h @@ -123,6 +123,8 @@ struct J3DSys { void setViewMtx(Mtx m) { PSMTXCopy(m, mViewMtx); } + J3DModel* getModel() { return mModel; } + static Mtx mCurrentMtx; static Vec mCurrentS; static Vec mParentS; diff --git a/include/JSystem/J3DGraphBase/J3DTexture.h b/include/JSystem/J3DGraphBase/J3DTexture.h index 923bf225ed..e5559255ba 100644 --- a/include/JSystem/J3DGraphBase/J3DTexture.h +++ b/include/JSystem/J3DGraphBase/J3DTexture.h @@ -19,6 +19,11 @@ public: u16 getNum() const { return mNum; } ResTIMG* getResTIMG(u16 entry) const { return &mpRes[entry]; } + void setResTIMG(u16 entry, const ResTIMG& timg) { + mpRes[entry] = timg; + mpRes[entry].imageOffset = ((mpRes[entry].imageOffset - (u32)(mpRes + entry))) + (u32)&timg; + mpRes[entry].paletteOffset = ((mpRes[entry].paletteOffset - (u32)(mpRes + entry))) + (u32)&timg; + } }; struct J3DTextureSRTInfo { diff --git a/include/JSystem/J3DGraphBase/J3DVertex.h b/include/JSystem/J3DGraphBase/J3DVertex.h index 2e3e1430c0..309194628a 100644 --- a/include/JSystem/J3DGraphBase/J3DVertex.h +++ b/include/JSystem/J3DGraphBase/J3DVertex.h @@ -54,6 +54,8 @@ private: class J3DVertexBuffer { public: + J3DVertexBuffer() { init(); } + /* 80310F78 */ void setVertexData(J3DVertexData*); /* 80310FD8 */ void init(); /* 80311030 */ ~J3DVertexBuffer(); diff --git a/include/JSystem/JKernel/JKRArchive.h b/include/JSystem/JKernel/JKRArchive.h index 977a166ea8..c9767d3a7e 100644 --- a/include/JSystem/JKernel/JKRArchive.h +++ b/include/JSystem/JKernel/JKRArchive.h @@ -135,8 +135,6 @@ public: u32 getMountMode() const { return mMountMode; } SDIFileEntry* findNameResource(const char*) const; - -protected: bool isSameName(CArcName&, u32, u16) const; SDIDirEntry* findResType(u32) const; SDIDirEntry* findDirectory(const char*, u32) const; diff --git a/include/JSystem/JKernel/JKRCompArchive.h b/include/JSystem/JKernel/JKRCompArchive.h index f6c8d89388..3becd55f1f 100644 --- a/include/JSystem/JKernel/JKRCompArchive.h +++ b/include/JSystem/JKernel/JKRCompArchive.h @@ -22,7 +22,15 @@ public: private: /* 0x00 */ // vtable /* 0x04 */ // JKRArchive - u8 unk[36]; + /* 0x5C */ int field_0x5c; + /* 0x60 */ int field_0x60; + /* 0x64 */ int field_0x64; + /* 0x68 */ int field_0x68; + /* 0x6C */ int field_0x6c; + /* 0x70 */ JKRDvdFile* field_0x70; + /* 0x74 */ u32 mSizeOfMemPart; + /* 0x78 */ u32 mSizeOfAramPart; + /* 0x7C */ int field_0x7c; }; #endif /* JKRCOMPARCHIVE_H */ diff --git a/include/JSystem/JKernel/JKRExpHeap.h b/include/JSystem/JKernel/JKRExpHeap.h index d0ae61b76e..faccd6431c 100644 --- a/include/JSystem/JKernel/JKRExpHeap.h +++ b/include/JSystem/JKernel/JKRExpHeap.h @@ -6,6 +6,10 @@ class JKRExpHeap : public JKRHeap { public: + enum EAllocMode { + ALLOC_MODE_1 = 1, + }; + class CMemBlock { friend class JKRExpHeap; @@ -18,25 +22,25 @@ public: int free(JKRExpHeap* heap); static CMemBlock* getHeapBlock(void* ptr); - void newGroupId(u8 groupId) { this->mGroupId = groupId; } - bool isValid() const { return this->mMagic == 'HM'; } - bool _isTempMemBlock() const { return (this->mFlags & 0x80) ? true : false; } - int getAlignment() const { return this->mFlags & 0x7f; } + void newGroupId(u8 groupId) { mGroupId = groupId; } + bool isValid() const { return mMagic == 'HM'; } + bool _isTempMemBlock() const { return (mFlags & 0x80) ? true : false; } + int getAlignment() const { return mFlags & 0x7f; } void* getContent() const { return (void*)(this + 1); } - CMemBlock* getPrevBlock() const { return this->mPrev; } - CMemBlock* getNextBlock() const { return this->mNext; } - u32 getSize() const { return this->size; } - u8 getGroupId() const { return this->mGroupId; } + CMemBlock* getPrevBlock() const { return mPrev; } + CMemBlock* getNextBlock() const { return mNext; } + u32 getSize() const { return size; } + u8 getGroupId() const { return mGroupId; } static CMemBlock* getBlock(void* data) { return (CMemBlock*)((u32)data + -0x10); } private: - u16 mMagic; - u8 mFlags; // a|bbbbbbb a=temporary b=alignment - u8 mGroupId; - u32 size; - CMemBlock* mPrev; - CMemBlock* mNext; - }; + /* 0x0 */ u16 mMagic; + /* 0x2 */ u8 mFlags; // a|bbbbbbb a=temporary b=alignment + /* 0x3 */ u8 mGroupId; + /* 0x4 */ u32 size; + /* 0x8 */ CMemBlock* mPrev; + /* 0xC */ CMemBlock* mNext; + }; // Size: 0x10 friend class CMemBlock; protected: @@ -57,7 +61,11 @@ protected: public: s32 getUsedSize(u8 groupId) const; s32 getTotalUsedSize(void) const; + CMemBlock* getHeadUsedList() const { return mHeadUsedList; } + void setAllocationMode(EAllocMode mode) { + mAllocMode = mode; + } public: /* vt[04] */ virtual u32 getHeapType(); /* override */ @@ -81,17 +89,17 @@ public: /* vt[22] */ virtual bool state_compare(JKRHeap::TState const& r1, JKRHeap::TState const& r2) const; /* override */ - u8 field_0x6c; - u8 mCurrentGroupId; - bool field_0x6e; + /* 0x6C */ u8 mAllocMode; + /* 0x6D */ u8 mCurrentGroupId; + /* 0x6E */ bool field_0x6e; private: - void* field_0x70; - u32 field_0x74; - CMemBlock* mHeadFreeList; - CMemBlock* mTailFreeList; - CMemBlock* mHeadUsedList; - CMemBlock* mTailUsedList; + /* 0x70 */ void* field_0x70; + /* 0x74 */ u32 field_0x74; + /* 0x78 */ CMemBlock* mHeadFreeList; + /* 0x7C */ CMemBlock* mTailFreeList; + /* 0x80 */ CMemBlock* mHeadUsedList; + /* 0x84 */ CMemBlock* mTailUsedList; public: static JKRExpHeap* createRoot(int maxHeaps, bool errorFlag); diff --git a/include/JSystem/JKernel/JKRHeap.h b/include/JSystem/JKernel/JKRHeap.h index 38aba619a0..927ee8d6e8 100644 --- a/include/JSystem/JKernel/JKRHeap.h +++ b/include/JSystem/JKernel/JKRHeap.h @@ -14,12 +14,12 @@ class JKRHeap : public JKRDisposer { public: class TState { public: - u32 mUsedSize; - u32 mCheckCode; - u32 mBuf; - u32 field_0xc; - JKRHeap* mHeap; - u32 mId; + /* 0x00 */ u32 mUsedSize; + /* 0x04 */ u32 mCheckCode; + /* 0x08 */ u32 mBuf; + /* 0x0C */ u32 field_0xc; + /* 0x10 */ JKRHeap* mHeap; + /* 0x14 */ u32 mId; public: u32 getUsedSize() const { return mUsedSize; } diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index cb252d9aea..71bad19d43 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -5,6 +5,7 @@ #include "dolphin/types.h" void JMAMTXApplyScale(const Mtx, Mtx, f32, f32, f32); +void JMAEulerToQuat(s16 param_0, s16 param_1, s16 param_2, Quaternion* param_3); inline f32 JMAFastReciprocal(f32 value) { return __fres(value); diff --git a/include/JSystem/JParticle/JPAParticle.h b/include/JSystem/JParticle/JPAParticle.h index 91b256d6a8..979d41b3dd 100644 --- a/include/JSystem/JParticle/JPAParticle.h +++ b/include/JSystem/JParticle/JPAParticle.h @@ -207,6 +207,7 @@ enum { JPAEmtrStts_StopCalc = 0x02, JPAEmtrStts_FirstEmit = 0x10, JPAEmtrStts_RateStepEmit = 0x20, + JPAEmtrStts_Immortal = 0x40, }; class JPABaseEmitter { @@ -232,12 +233,25 @@ public: u8 getGroupID() const { return mGroupID; } u8 getDrawTimes() const { return mDrawTimes; } void setRate(f32 rate) { mRate = rate; } + void setEmitterCallBackPtr(JPAEmitterCallBack* ptr) { mpEmtrCallBack = ptr; } f32 get_r_f() { return mRndm.get_rndm_f(); } f32 get_r_zp() { return mRndm.get_rndm_zp(); } f32 get_r_zh() { return mRndm.get_rndm_zh(); } s16 get_r_ss() { return mRndm.get_rndm_ss(); } + void stopCreateParticle() { setStatus(JPAEmtrStts_StopEmit); } + void becomeImmortalEmitter() { setStatus(JPAEmtrStts_Immortal); } + void becomeContinuousParticle() { mMaxFrame = 0; } + void becomeInvalidEmitter() { + stopCreateParticle(); + mMaxFrame = 1; + } + + void quitImmortalEmitter() { clearStatus(JPAEmtrStts_Immortal); } + void stopCalcEmitter() { setStatus(JPAEmtrStts_StopCalc); } + void playCalcEmitter() { clearStatus(JPAEmtrStts_StopCalc); } + public: /* 0x00 */ Vec mLocalScl; /* 0x0C */ Vec mLocalTrs; diff --git a/include/JSystem/JUtility/JUTFont.h b/include/JSystem/JUtility/JUTFont.h index f297f75b6b..5aec4a6b0e 100644 --- a/include/JSystem/JUtility/JUTFont.h +++ b/include/JSystem/JUtility/JUTFont.h @@ -73,7 +73,7 @@ public: /* 0x20 */ virtual u16 getDescent() const = 0; /* 0x24 */ virtual s32 getHeight() const = 0; /* 0x28 */ virtual s32 getWidth() const = 0; - /* 0x2C */ virtual void getWidthEntry(int i_no, TWidth* width) const; + /* 0x2C */ virtual void getWidthEntry(int i_no, TWidth* width) const = 0; /* 0x30 */ virtual int getCellWidth() const; /* 0x34 */ virtual u16 getCellHeight() const; /* 0x38 */ virtual u16 getFontType() const = 0; diff --git a/include/JSystem/JUtility/JUTNameTab.h b/include/JSystem/JUtility/JUTNameTab.h index 7f9d62dfde..e539c6f08c 100644 --- a/include/JSystem/JUtility/JUTNameTab.h +++ b/include/JSystem/JUtility/JUTNameTab.h @@ -26,12 +26,12 @@ public: s32 getIndex(char const*) const; const char* getName(u16 index) const; u16 calcKeyCode(char const* pName) const; - const ResNTAB* getResNameTable() const { return mpNameTable; } + const ResNTAB* getResNameTable() const { return mNameTable; } private: - const ResNTAB* mpNameTable; - const char* mpStrData; - u16 mNameNum; + /* 0x4 */ const ResNTAB* mNameTable; + /* 0x8 */ const char* mpStrData; + /* 0xC */ u16 mNameNum; }; #endif /* JUTNAMETAB_H */ diff --git a/include/JSystem/JUtility/JUTTexture.h b/include/JSystem/JUtility/JUTTexture.h index 9dcd5cb859..c9ab2dd780 100644 --- a/include/JSystem/JUtility/JUTTexture.h +++ b/include/JSystem/JUtility/JUTTexture.h @@ -16,9 +16,9 @@ struct ResTIMG { /* 0x04 */ u16 height; /* 0x06 */ u8 wrapS; /* 0x07 */ u8 wrapT; - /* 0x08 */ u8 palettesEnabled; - /* 0x09 */ u8 paletteFormat; - /* 0x0A */ u16 paletteCount; + /* 0x08 */ u8 indexTexture; + /* 0x09 */ u8 colorFormat; + /* 0x0A */ u16 numColors; /* 0x0C */ u32 paletteOffset; /* 0x10 */ u8 mipmapEnabled; /* 0x11 */ u8 doEdgeLOD; @@ -31,7 +31,7 @@ struct ResTIMG { /* 0x18 */ u8 mipmapCount; /* 0x19 */ u8 unknown; /* 0x1A */ s16 LODBias; - /* 0x1C */ u32 texDataOffset; + /* 0x1C */ u32 imageOffset; }; // Size: 0x20 class JUTTexture { |
