diff --git a/include/JSystem/J3DGraphAnimator/J3DAnimation.h b/include/JSystem/J3DGraphAnimator/J3DAnimation.h index 8b4ec14ea..dd1aacaca 100644 --- a/include/JSystem/J3DGraphAnimator/J3DAnimation.h +++ b/include/JSystem/J3DGraphAnimator/J3DAnimation.h @@ -281,10 +281,8 @@ STATIC_ASSERT(sizeof(J3DAnmColorFullData) == 0x34); class J3DAnmBase { public: J3DAnmBase(s16 i_frameMax) { - mAttribute = 0; - field_0x5 = 0; - mFrameMax = i_frameMax; mFrame = 0.0f; + mFrameMax = i_frameMax; } virtual ~J3DAnmBase(); @@ -303,7 +301,12 @@ private: class J3DAnmTransform : public J3DAnmBase { public: - J3DAnmTransform(s16, f32*, s16*, f32*); + J3DAnmTransform(s16 i_frameMax, f32* p1, s16* p2, f32* p3) : J3DAnmBase(i_frameMax) { + field_0x10 = p2; + field_0x14 = p3; + field_0x18 = 0; + field_0xc = p1; + } virtual ~J3DAnmTransform(); virtual s32 getKind() const; @@ -313,17 +316,17 @@ private: /* 0x0C */ f32* field_0xc; /* 0x10 */ s16* field_0x10; /* 0x14 */ f32* field_0x14; - /* 0x18 */ s16 field_0x18; - /* 0x1A */ s16 field_0x1a; - /* 0x1C */ s16 field_0x1c; - /* 0x1E */ s16 field_0x1e; -}; // Size: 0x20 + /* 0x18 */ s32 field_0x18; + /* 0x1C */ s16 field_0x1a; + /* 0x1E */ s16 field_0x1c; + /* 0x20 */ s16 field_0x1e; +}; // Size: 0x22 class J3DAnmTransformKey : public J3DAnmTransform { public: J3DAnmTransformKey() : J3DAnmTransform(0, NULL, NULL, NULL) { - field_0x20 = 0; field_0x24 = 0; + field_0x28 = 0; } void calcTransform(f32, u16, J3DTransformInfo*) const; @@ -333,9 +336,9 @@ public: virtual void getTransform(u16, J3DTransformInfo*) const; private: - /* 0x20 */ int field_0x20; /* 0x24 */ int field_0x24; -}; // Size: 0x28 + /* 0x28 */ int field_0x28; +}; // Size: 0x2C class J3DAnmTransformFull : public J3DAnmTransform { public: diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 833e6c2e2..55992820b 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -217,7 +217,7 @@ public: void* getBas() { return mBas; } private: - /* 0x28 */ void* mBas; + /* 0x2C */ void* mBas; }; class mDoExt_MtxCalcOldFrame { diff --git a/src/d/d_resorce.cpp b/src/d/d_resorce.cpp index 0c0e51596..8f2d68922 100644 --- a/src/d/d_resorce.cpp +++ b/src/d/d_resorce.cpp @@ -91,7 +91,7 @@ static void setToonTex(J3DModelData* pModel) { J3DTevBlock * pTevBlock = pMaterial->getTevBlock(); if (pTevBlock != NULL) { - GXColorS10 * pTev3 = pTevBlock->getTevColor(3); + GXColorS10 * pTev3 = &pTevBlock->getTevColor(3)->mColor; if (pTev3 != NULL) pTev3->a = pTevBlock->getTevStageNum(); @@ -131,7 +131,7 @@ static void setToonTex(J3DMaterialTable* pMaterialTable) { J3DTevBlock * pTevBlock = pMaterial->getTevBlock(); if (pTevBlock != NULL) { - GXColorS10 * pTev3 = pTevBlock->getTevColor(3); + GXColorS10 * pTev3 = &pTevBlock->getTevColor(3)->mColor; if (pTev3 != NULL) pTev3->a = pTevBlock->getTevStageNum(); } @@ -142,8 +142,6 @@ static void setToonTex(J3DMaterialTable* pMaterialTable) { /* 8006DFD4-8006E7A4 .text loadResource__11dRes_info_cFv */ int dRes_info_c::loadResource() { - // nonmatching, missing mDoExt_transAnmBas anm case - JUT_ASSERT(0x254, mRes == 0); s32 fileNum = mpArchive->countFile(); @@ -317,8 +315,19 @@ int dRes_info_c::loadResource() { pRes = J3DClusterLoaderDataBase::load(pRes); if (pRes == NULL) return -1; - } else if (resType == 'BCKS' || resType == 'BCK') { - // TODO + } else if (resType == 'BCKS' || resType == 'BCK ') { + void *pBasData; + if (*((u32*)((char*)pRes + 0x1C)) != 0xFFFFFFFF) + pBasData = (void*)(*((u32*)((char*)pRes + 0x1C)) + ((u32)pRes)); + else + pBasData = NULL; + + mDoExt_transAnmBas *pAnm = new mDoExt_transAnmBas(pBasData); + if (pAnm == NULL) + return -1; + + J3DAnmLoaderDataBase::setResource(pAnm, pRes); + pRes = pAnm; } else if (resType == 'BTP ' || resType == 'BTK ' || resType == 'BPK ' || resType == 'BRK ' || resType == 'BLK ' || resType == 'BVA ') { pRes = J3DAnmLoaderDataBase::load(pRes); if (pRes == NULL)