diff --git a/include/JSystem/JParticle/JPABaseShape.h b/include/JSystem/JParticle/JPABaseShape.h index 738c2cfc4..58d0cdb58 100644 --- a/include/JSystem/JParticle/JPABaseShape.h +++ b/include/JSystem/JParticle/JPABaseShape.h @@ -9,17 +9,17 @@ class JKRHeap; class JPABaseShape { public: enum Type { - JPAType_Point, - JPAType_Line, - JPAType_Billboard, - JPAType_Direction, - JPAType_DirectionCross, - JPAType_Stripe, - JPAType_StripeCross, - JPAType_Rotation, - JPAType_RotationCross, - JPAType_DirBillboard, - JPAType_YBillboard, + /* 0 */ JPAType_Point, + /* 1 */ JPAType_Line, + /* 2 */ JPAType_Billboard, + /* 3 */ JPAType_Direction, + /* 4 */ JPAType_DirectionCross, + /* 5 */ JPAType_Stripe, + /* 6 */ JPAType_StripeCross, + /* 7 */ JPAType_Rotation, + /* 8 */ JPAType_RotationCross, + /* 9 */ JPAType_DirBillboard, + /* 10 */ JPAType_YBillboard, }; virtual ~JPABaseShape() {} @@ -34,19 +34,19 @@ public: virtual s16 getTexLoopOffset() = 0; virtual BOOL isEnableGlobalColAnm() = 0; virtual BOOL isEnableGlobalTexAnm() = 0; - virtual BOOL getListOrder() = 0; + virtual u32 getListOrder() = 0; virtual u32 getChildOrder() = 0; virtual GXTevColorArg* getTevColorArg() = 0; virtual GXTevAlphaArg* getTevAlphaArg() = 0; - virtual BOOL isEnableAlphaUpdate() = 0; + virtual GXBool isEnableAlphaUpdate() = 0; virtual GXBlendMode getBlendMode1() = 0; virtual GXBlendFactor getSrcBlendFactor1() = 0; virtual GXBlendFactor getDstBlendFactor1() = 0; virtual GXLogicOp getBlendOp1() = 0; - virtual BOOL isEnableZCmp() = 0; - virtual u32 getZCmpFunction() = 0; - virtual BOOL isEnableZCmpUpdate() = 0; - virtual u32 getZCompLoc() = 0; + virtual GXBool isEnableZCmp() = 0; + virtual GXCompare getZCmpFunction() = 0; + virtual GXBool isEnableZCmpUpdate() = 0; + virtual GXBool getZCompLoc() = 0; virtual GXCompare getAlphaCmpComp0() = 0; virtual GXCompare getAlphaCmpComp1() = 0; virtual GXAlphaOp getAlphaCmpOp() = 0; @@ -54,7 +54,7 @@ public: virtual u8 getAlphaCmpRef1() = 0; virtual u32 isEnableAnmTone() = 0; virtual u32 isEnableProjection() = 0; - virtual BOOL isClipOn() = 0; + virtual u32 isClipOn() = 0; virtual BOOL isEnableTextureAnm() = 0; virtual BOOL textureIsEmpty() = 0; virtual u8 getTextureAnmType() = 0; @@ -142,19 +142,19 @@ public: virtual s16 getTexLoopOffset() { return mTexLoopOffset; } virtual BOOL isEnableGlobalColAnm() { return mGlobalAnmFlags & 0x02; } virtual BOOL isEnableGlobalTexAnm() { return mGlobalAnmFlags & 0x01; } - virtual BOOL getListOrder() { return pBsd->mFlags & 0x200000; } + virtual u32 getListOrder() { return pBsd->mFlags & 0x200000; } virtual u32 getChildOrder() { return pBsd->mFlags & 0x400000; } virtual GXTevColorArg* getTevColorArg() { return stTevColorArg[(pBsd->mFlags >> 15) & 0x07]; } virtual GXTevAlphaArg* getTevAlphaArg() { return stTevAlphaArg[(pBsd->mFlags >> 18) & 0x01]; } - virtual BOOL isEnableAlphaUpdate() { return (pBsd->mBlendFlags >> 14) & 0x01; } + virtual GXBool isEnableAlphaUpdate() { return (pBsd->mBlendFlags >> 14) & 0x01; } virtual GXBlendMode getBlendMode1() { return stBlendMode[(pBsd->mBlendFlags >> 0) & 0x03]; } virtual GXBlendFactor getSrcBlendFactor1() { return stBlendFactor[(pBsd->mBlendFlags >> 2) & 0x0F]; } virtual GXBlendFactor getDstBlendFactor1() { return stBlendFactor[(pBsd->mBlendFlags >> 6) & 0x0F]; } virtual GXLogicOp getBlendOp1() { return stLogicOp[(pBsd->mBlendFlags >> 10) & 0x0F]; } - virtual BOOL isEnableZCmp() { return (pBsd->mZFlags >> 0) & 0x01; } - virtual u32 getZCmpFunction() { return stCompare[(pBsd->mZFlags >> 1) & 0x07]; } - virtual BOOL isEnableZCmpUpdate() { return (pBsd->mZFlags >> 4) & 0x01; } - virtual u32 getZCompLoc() { return (pBsd->mZFlags >> 5) & 0x01; } + virtual GXBool isEnableZCmp() { return (pBsd->mZFlags >> 0) & 0x01; } + virtual GXCompare getZCmpFunction() { return stCompare[(pBsd->mZFlags >> 1) & 0x07]; } + virtual GXBool isEnableZCmpUpdate() { return (pBsd->mZFlags >> 4) & 0x01; } + virtual GXBool getZCompLoc() { return (pBsd->mZFlags >> 5) & 0x01; } virtual GXCompare getAlphaCmpComp0() { return stCompare[(pBsd->mAlphaFlags >> 0) & 0x07]; } virtual GXCompare getAlphaCmpComp1() { return stCompare[(pBsd->mAlphaFlags >> 5) & 0x07]; } virtual GXAlphaOp getAlphaCmpOp() { return stAlphaOp[(pBsd->mAlphaFlags >> 3) & 0x03]; } @@ -162,7 +162,7 @@ public: virtual u8 getAlphaCmpRef1() { return pBsd->mAlphaCmpRef1; } virtual u32 isEnableAnmTone() { return pBsd->mFlags & 0x80000; } virtual u32 isEnableProjection() { return pBsd->mFlags & 0x100000; } - virtual BOOL isClipOn() { return pBsd->mFlags & 0x800000; } + virtual u32 isClipOn() { return pBsd->mFlags & 0x800000; } virtual BOOL isEnableTextureAnm() { return pBsd->mTextureFlags & 0x01; } virtual BOOL textureIsEmpty() { return !(pBsd->mTextureFlags & 0x02); } virtual u8 getTextureAnmType() { return (pBsd->mTextureFlags >> 2) & 0x07; } diff --git a/include/JSystem/JParticle/JPADraw.h b/include/JSystem/JParticle/JPADraw.h index d2fdaba1b..bbf7b66f7 100644 --- a/include/JSystem/JParticle/JPADraw.h +++ b/include/JSystem/JParticle/JPADraw.h @@ -14,13 +14,13 @@ public: JPADrawClipBoard() {} ~JPADrawClipBoard() {} - /* 0x00 */ JPADrawSetupTev field_0x0; - /* 0x04 */ f32 field_0x4; - /* 0x08 */ f32 field_0x8; - /* 0x0C */ f32 field_0xc; - /* 0x10 */ f32 field_0x10; + /* 0x00 */ JPADrawSetupTev mSetupTev; + /* 0x04 */ f32 mGlobalScaleX; + /* 0x08 */ f32 mGlobalScaleY; + /* 0x0C */ f32 mPivotX; + /* 0x10 */ f32 mPivotY; /* 0x14 */ JGeometry::TVec2 field_0x14[4]; - /* 0x34 */ MtxP field_0x34; + /* 0x34 */ MtxP mDrawMtx; /* 0x38 */ f32 field_0x38; /* 0x3C */ f32 field_0x3c; /* 0x40 */ f32 field_0x40; @@ -34,8 +34,8 @@ public: /* 0x60 */ f32 field_0x60; /* 0x64 */ f32 field_0x64; /* 0x68 */ Mtx field_0x68; - /* 0x98 */ GXColor field_0x98; - /* 0x9C */ GXColor field_0x9c; + /* 0x98 */ GXColor mPrmColor; + /* 0x9C */ GXColor mEnvColor; /* 0xA0 */ void* field_0xa0; /* 0xA4 */ u8 field_0xa4[0xb4 - 0xa4]; }; diff --git a/include/JSystem/JParticle/JPADrawVisitor.h b/include/JSystem/JParticle/JPADrawVisitor.h index 95208e2b7..8ac0d7337 100644 --- a/include/JSystem/JParticle/JPADrawVisitor.h +++ b/include/JSystem/JParticle/JPADrawVisitor.h @@ -454,70 +454,70 @@ public: class JPADrawVisitorContainer { public: - /* 0x000 */ JPADrawExecGenPrjMtx field_0x0; - /* 0x004 */ JPADrawExecGenPrjTexMtx field_0x4; - /* 0x008 */ JPADrawExecGenTexMtx0 field_0x8; - /* 0x00C */ JPADrawExecGenIdtMtx field_0xc; - /* 0x010 */ JPADrawExecSetTexMtx field_0x10; - /* 0x018 */ JPADrawExecSetPointSize field_0x18; - /* 0x01C */ JPADrawExecSetLineWidth field_0x1c; - /* 0x020 */ JPADrawExecRegisterColorEmitterPE field_0x20; - /* 0x024 */ JPADrawExecRegisterColorEmitterP field_0x24; - /* 0x028 */ JPADrawExecRegisterColorEmitterE field_0x28; - /* 0x02C */ JPADrawExecRegisterColorChildPE field_0x2c; - /* 0x030 */ JPADrawExecRegisterPrmColorAnm field_0x30; - /* 0x034 */ JPADrawExecRegisterPrmAlphaAnm field_0x34; - /* 0x038 */ JPADrawExecRegisterEnvColorAnm field_0x38; - /* 0x03C */ JPADrawExecRegisterPrmCEnv field_0x3c; - /* 0x040 */ JPADrawExecRegisterPrmAEnv field_0x40; - /* 0x044 */ JPADrawExecLoadDefaultTexture field_0x44; - /* 0x048 */ JPADrawExecLoadTexture field_0x48; - /* 0x050 */ JPADrawExecLoadExTex field_0x50; - /* 0x054 */ JPADrawExecBillBoard field_0x54; - /* 0x058 */ JPADrawExecRotBillBoard field_0x58; - /* 0x05C */ JPADrawExecYBillBoard field_0x5c; - /* 0x060 */ JPADrawExecRotYBillBoard field_0x60; - /* 0x064 */ JPADrawExecDirectional field_0x64; - /* 0x068 */ JPADrawExecRotDirectional field_0x68; - /* 0x06C */ JPADrawExecDirectionalCross field_0x6c; - /* 0x070 */ JPADrawExecRotDirectionalCross field_0x70; - /* 0x074 */ JPADrawExecDirBillBoard field_0x74; - /* 0x078 */ JPADrawExecRotation field_0x78; - /* 0x07C */ JPADrawExecRotationCross field_0x7c; - /* 0x080 */ JPADrawExecPoint field_0x80; - /* 0x084 */ JPADrawExecLine field_0x84; - /* 0x088 */ JPADrawExecStripe field_0x88; - /* 0x08C */ JPADrawExecStripeCross field_0x8c; - /* 0x090 */ JPADrawExecCallBack field_0x90; - /* 0x098 */ JPADrawCalcScaleX field_0x98; - /* 0x09C */ JPADrawCalcScaleXBySpeed field_0x9c; - /* 0x0A0 */ JPADrawCalcScaleY field_0xa0; - /* 0x0A4 */ JPADrawCalcScaleYBySpeed field_0xa4; - /* 0x0A8 */ JPADrawCalcScaleCopyX2Y field_0xa8; - /* 0x0AC */ JPADrawCalcScaleAnmTimingNormal field_0xac; - /* 0x0B0 */ JPADrawCalcScaleAnmTimingRepeatX field_0xb0; - /* 0x0B4 */ JPADrawCalcScaleAnmTimingRepeatY field_0xb4; - /* 0x0B8 */ JPADrawCalcScaleAnmTimingReverseX field_0xb8; - /* 0x0BC */ JPADrawCalcScaleAnmTimingReverseY field_0xbc; - /* 0x0C0 */ JPADrawCalcColorPrm field_0xc0; - /* 0x0C8 */ JPADrawCalcColorEnv field_0xc8; - /* 0x0D0 */ JPADrawCalcColorCopyFromEmitter field_0xd0; - /* 0x0D4 */ JPADrawCalcColorAnmFrameNormal field_0xd4; - /* 0x0DC */ JPADrawCalcColorAnmFrameRepeat field_0xdc; - /* 0x0E4 */ JPADrawCalcColorAnmFrameReverse field_0xe4; - /* 0x0EC */ JPADrawCalcColorAnmFrameMerge field_0xec; - /* 0x0F4 */ JPADrawCalcColorAnmFrameRandom field_0xf4; - /* 0x0FC */ JPADrawCalcAlpha field_0xfc; - /* 0x100 */ JPADrawCalcAlphaFlickNrmSin field_0x100; - /* 0x104 */ JPADrawCalcAlphaFlickAddSin field_0x104; - /* 0x108 */ JPADrawCalcAlphaFlickMultSin field_0x108; - /* 0x10C */ JPADrawCalcTextureAnmIndexNormal field_0x10c; - /* 0x114 */ JPADrawCalcTextureAnmIndexRepeat field_0x114; - /* 0x11C */ JPADrawCalcTextureAnmIndexReverse field_0x11c; - /* 0x124 */ JPADrawCalcTextureAnmIndexMerge field_0x124; - /* 0x12C */ JPADrawCalcTextureAnmIndexRandom field_0x12c; - /* 0x134 */ JPADrawCalcChildAlphaOut field_0x134; - /* 0x138 */ JPADrawCalcChildScaleOut field_0x138; + /* 0x000 */ JPADrawExecGenPrjMtx mGenPrjMtx; + /* 0x004 */ JPADrawExecGenPrjTexMtx mGenPrjTexMtx; + /* 0x008 */ JPADrawExecGenTexMtx0 mGenTexMtx0; + /* 0x00C */ JPADrawExecGenIdtMtx mGenIdtMtx; + /* 0x010 */ JPADrawExecSetTexMtx mSetTexMtx; + /* 0x018 */ JPADrawExecSetPointSize mSetPointSize; + /* 0x01C */ JPADrawExecSetLineWidth mSetLineWidth; + /* 0x020 */ JPADrawExecRegisterColorEmitterPE mRegisterColorPrmEnv; + /* 0x024 */ JPADrawExecRegisterColorEmitterP mRegisterColorPrm; + /* 0x028 */ JPADrawExecRegisterColorEmitterE mRegisterColorEnv; + /* 0x02C */ JPADrawExecRegisterColorChildPE mRegisterColorChildPrmEnv; + /* 0x030 */ JPADrawExecRegisterPrmColorAnm mRegisterPrmColorAnm; + /* 0x034 */ JPADrawExecRegisterPrmAlphaAnm mRegisterPrmAlphaAnm; + /* 0x038 */ JPADrawExecRegisterEnvColorAnm mRegisterEnvColorAnm; + /* 0x03C */ JPADrawExecRegisterPrmCEnv mRegisterPrmColor; + /* 0x040 */ JPADrawExecRegisterPrmAEnv mRegisterPrmAlpha; + /* 0x044 */ JPADrawExecLoadDefaultTexture mLoadDefaultTexture; + /* 0x048 */ JPADrawExecLoadTexture mLoadTexture; + /* 0x050 */ JPADrawExecLoadExTex mLoadExTexture; + /* 0x054 */ JPADrawExecBillBoard mExecBillBoard; + /* 0x058 */ JPADrawExecRotBillBoard mExecRotBillBoard; + /* 0x05C */ JPADrawExecYBillBoard mExecYBillBoard; + /* 0x060 */ JPADrawExecRotYBillBoard mExecRotYBillBoard; + /* 0x064 */ JPADrawExecDirectional mExecDirectional; + /* 0x068 */ JPADrawExecRotDirectional mExecRotDirectional; + /* 0x06C */ JPADrawExecDirectionalCross mExecDirectionalCross; + /* 0x070 */ JPADrawExecRotDirectionalCross mExecRotDirectionalCross; + /* 0x074 */ JPADrawExecDirBillBoard mExecDirBillBoard; + /* 0x078 */ JPADrawExecRotation mExecRotation; + /* 0x07C */ JPADrawExecRotationCross mExecRotationCross; + /* 0x080 */ JPADrawExecPoint mExecPoint; + /* 0x084 */ JPADrawExecLine mExecLine; + /* 0x088 */ JPADrawExecStripe mExecStripe; + /* 0x08C */ JPADrawExecStripeCross mExecStripeCross; + /* 0x090 */ JPADrawExecCallBack mExecCallBack; + /* 0x098 */ JPADrawCalcScaleX mCalcScaleX; + /* 0x09C */ JPADrawCalcScaleXBySpeed mCalcScaleXBySpeed; + /* 0x0A0 */ JPADrawCalcScaleY mCalcScaleY; + /* 0x0A4 */ JPADrawCalcScaleYBySpeed mCalcScaleYBySpeed; + /* 0x0A8 */ JPADrawCalcScaleCopyX2Y mCalcScaleCopyX2Y; + /* 0x0AC */ JPADrawCalcScaleAnmTimingNormal mCalcScaleAnmTimingNormal; + /* 0x0B0 */ JPADrawCalcScaleAnmTimingRepeatX mCalcScaleAnmTimingRepeatX; + /* 0x0B4 */ JPADrawCalcScaleAnmTimingRepeatY mCalcScaleAnmTimingRepeatY; + /* 0x0B8 */ JPADrawCalcScaleAnmTimingReverseX mCalcScaleAnmTimingReverseX; + /* 0x0BC */ JPADrawCalcScaleAnmTimingReverseY mCalcScaleAnmTimingReverseY; + /* 0x0C0 */ JPADrawCalcColorPrm mCalcColorPrm; + /* 0x0C8 */ JPADrawCalcColorEnv mCalcColorEnv; + /* 0x0D0 */ JPADrawCalcColorCopyFromEmitter mCalcColorCopyFromEmitter; + /* 0x0D4 */ JPADrawCalcColorAnmFrameNormal mCalcColorAnmFrameNormal; + /* 0x0DC */ JPADrawCalcColorAnmFrameRepeat mCalcColorAnmFrameRepeat; + /* 0x0E4 */ JPADrawCalcColorAnmFrameReverse mCalcColorAnmFrameReverse; + /* 0x0EC */ JPADrawCalcColorAnmFrameMerge mCalcColorAnmFrameMerge; + /* 0x0F4 */ JPADrawCalcColorAnmFrameRandom mCalcColorAnmFrameRandom; + /* 0x0FC */ JPADrawCalcAlpha mCalcAlpha; + /* 0x100 */ JPADrawCalcAlphaFlickNrmSin mCalcAlphaFlickNrmSin; + /* 0x104 */ JPADrawCalcAlphaFlickAddSin mCalcAlphaFlickAddSin; + /* 0x108 */ JPADrawCalcAlphaFlickMultSin mCalcAlphaFlickMultSin; + /* 0x10C */ JPADrawCalcTextureAnmIndexNormal mCalcTextureAnmIndexNormal; + /* 0x114 */ JPADrawCalcTextureAnmIndexRepeat mCalcTextureAnmIndexRepeat; + /* 0x11C */ JPADrawCalcTextureAnmIndexReverse mCalcTextureAnmIndexReverse; + /* 0x124 */ JPADrawCalcTextureAnmIndexMerge mCalcTextureAnmIndexMerge; + /* 0x12C */ JPADrawCalcTextureAnmIndexRandom mCalcTextureAnmIndexRandom; + /* 0x134 */ JPADrawCalcChildAlphaOut mCalcChildAlphaOut; + /* 0x138 */ JPADrawCalcChildScaleOut mCalcChildScaleOut; }; #endif /* JPADRAWVISITOR_H */ diff --git a/include/JSystem/JParticle/JPAParticle.h b/include/JSystem/JParticle/JPAParticle.h index 371e264a5..a821cf5f1 100644 --- a/include/JSystem/JParticle/JPAParticle.h +++ b/include/JSystem/JParticle/JPAParticle.h @@ -62,7 +62,7 @@ public: /* 0xB4 */ int mLoopOffset; /* 0xB8 */ GXColor mPrmColor; /* 0xBC */ GXColor mEnvColor; - /* 0xC0 */ s16 mRotateAngle; + /* 0xC0 */ u16 mRotateAngle; /* 0xC2 */ s16 mRotateSpeed; /* 0xC4 */ u8 field_0xC4[0xC6 - 0xC4]; /* 0xC6 */ u16 mTexIdx; diff --git a/include/JSystem/JParticle/JPAResourceManager.h b/include/JSystem/JParticle/JPAResourceManager.h index 75a006fa9..52091a00e 100644 --- a/include/JSystem/JParticle/JPAResourceManager.h +++ b/include/JSystem/JParticle/JPAResourceManager.h @@ -14,6 +14,10 @@ public: JPATextureResource(u32, JKRHeap*); void registration(JPATexture*); + inline void load(u16 id, GXTexMapID texMap) { + pTexResArray[id]->load(texMap); + } + public: /* 0x00 */ JPADefaultTexture defaultTex; /* 0x24 */ u32 registNum; diff --git a/include/JSystem/JParticle/JPASweepShape.h b/include/JSystem/JParticle/JPASweepShape.h index 05ccc8b52..6d223a994 100644 --- a/include/JSystem/JParticle/JPASweepShape.h +++ b/include/JSystem/JParticle/JPASweepShape.h @@ -54,8 +54,8 @@ public: virtual u8 getTextureIndex() = 0; virtual f32 getScaleX() = 0; virtual f32 getScaleY() = 0; - virtual u32 getPrm() = 0; - virtual u32 getEnv() = 0; + virtual GXColor getPrm() = 0; + virtual GXColor getEnv() = 0; virtual u8 getPrmAlpha() = 0; virtual u8 getEnvAlpha() = 0; virtual f32 getRotateSpeed() = 0; @@ -93,8 +93,8 @@ public: virtual u8 getTextureIndex() { return mpData->mTextureIndex; } virtual f32 getScaleX() { return mpData->mScaleX; } virtual f32 getScaleY() { return mpData->mScaleY; } - virtual u32 getPrm() { return mpData->mPrm; } - virtual u32 getEnv() { return mpData->mEnv; } + virtual GXColor getPrm() { return mpData->mPrm; } + virtual GXColor getEnv() { return mpData->mEnv; } virtual u8 getPrmAlpha() { return mpData->mPrm.a; } virtual u8 getEnvAlpha() { return mpData->mEnv.a; } virtual f32 getRotateSpeed() { return mpData->mRotateSpeed; } diff --git a/src/JSystem/JParticle/JPADraw.cpp b/src/JSystem/JParticle/JPADraw.cpp index da41b52e7..b02a110c0 100644 --- a/src/JSystem/JParticle/JPADraw.cpp +++ b/src/JSystem/JParticle/JPADraw.cpp @@ -82,10 +82,10 @@ bool JPADraw::initialize(JPABaseEmitter* emtr, JPATextureResource* texRes) { setDrawExecVisitorsBeforeCB(flags); - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x90; - mpExecEmtrCVis[execEmtrCVisNum++] = &vc.field_0x90; - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x90; - mpExecChldVis[execChldVisNum++] = &vc.field_0x90; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mExecCallBack; + mpExecEmtrCVis[execEmtrCVisNum++] = &vc.mExecCallBack; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecCallBack; + mpExecChldVis[execChldVisNum++] = &vc.mExecCallBack; setDrawExecVisitorsAfterCB(flags); setDrawCalcVisitors(flags); @@ -102,7 +102,7 @@ bool JPADraw::initialize(JPABaseEmitter* emtr, JPATextureResource* texRes) { } /* 80268634-802688D4 .text draw__7JPADrawFPA4_f */ -void JPADraw::draw(MtxP param_1) { +void JPADraw::draw(MtxP drawMtx) { GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); @@ -116,19 +116,18 @@ void JPADraw::draw(MtxP param_1) { GXSetCoPlanar(GX_DISABLE); GXSetChanCtrl(GX_COLOR0A0, GX_DISABLE, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE); GXSetChanCtrl(GX_COLOR1A1, GX_DISABLE, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE); - GXSetBlendMode(dc.pbsp->getBlendMode1(), dc.pbsp->getSrcBlendFactor1(), - dc.pbsp->getDstBlendFactor1(), dc.pbsp->getBlendOp1()); - cb.field_0x98 = dc.pbe->mGlobalPrmColor; - cb.field_0x9c = dc.pbe->mGlobalEnvColor; - cb.field_0x34 = param_1; - cb.field_0x0.setupTev(dc.pbsp, dc.petx); + GXSetBlendMode(dc.pbsp->getBlendMode1(), dc.pbsp->getSrcBlendFactor1(), dc.pbsp->getDstBlendFactor1(), dc.pbsp->getBlendOp1()); + cb.mPrmColor = dc.pbe->mGlobalPrmColor; + cb.mEnvColor = dc.pbe->mGlobalEnvColor; + cb.mDrawMtx = drawMtx; + cb.mSetupTev.setupTev(dc.pbsp, dc.petx); for (int i = 0; i < execEmtrVisNum; i++) { mpExecEmtrVis[i]->exec(&dc); } if (dc.pbsp->isEnableAnmTone()) { zDraw(); } - field_0xc2 &= 0xfe; + field_0xc2 &= ~0x01; if (dc.pbsp->getChildOrder() && dc.pssp) { drawChild(); } @@ -141,411 +140,468 @@ void JPADraw::draw(MtxP param_1) { /* 802688D4-80268940 .text calc__7JPADrawFv */ void JPADraw::calc() { - /* Nonmatching */ + for (s32 i = 0; i < calcEmtrVisNum; i++) + mpCalcEmtrVis[i]->calc(&dc); } /* 80268940-802689C4 .text calcParticle__7JPADrawFP15JPABaseParticle */ -void JPADraw::calcParticle(JPABaseParticle*) { - /* Nonmatching */ +void JPADraw::calcParticle(JPABaseParticle* ptcl) { + ptcl->mRotateAngle += ptcl->mRotateSpeed; + for (s32 i = 0; i < calcPtclVisNum; i++) + mpCalcPtclVis[i]->calc(&dc, ptcl); } /* 802689C4-80268A48 .text calcChild__7JPADrawFP15JPABaseParticle */ -void JPADraw::calcChild(JPABaseParticle*) { - /* Nonmatching */ +void JPADraw::calcChild(JPABaseParticle* ptcl) { + ptcl->mRotateAngle += ptcl->mRotateSpeed; + for (s32 i = 0; i < calcChldVisNum; i++) + mpCalcChldVis[i]->calc(&dc, ptcl); } /* 80268A48-80268F28 .text initParticle__7JPADrawFP15JPABaseParticle */ -void JPADraw::initParticle(JPABaseParticle*) { +void JPADraw::initParticle(JPABaseParticle* ptcl) { /* Nonmatching */ } /* 80268F28-802692A4 .text initChild__7JPADrawFP15JPABaseParticleP15JPABaseParticle */ -void JPADraw::initChild(JPABaseParticle*, JPABaseParticle*) { +void JPADraw::initChild(JPABaseParticle* ptcl, JPABaseParticle* chld) { /* Nonmatching */ + chld->mAxis.set(ptcl->mAxis); + chld->mAlphaOut = 1.0f; + if (dc.pssp->isInheritedRGB()) { + f32 ratio = dc.pssp->getInheritRGB(); + chld->mPrmColor.r = ptcl->mPrmColor.r * ratio; + chld->mPrmColor.g = ptcl->mPrmColor.g * ratio; + chld->mPrmColor.b = ptcl->mPrmColor.b * ratio; + chld->mEnvColor.r = ptcl->mEnvColor.r * ratio; + chld->mEnvColor.g = ptcl->mEnvColor.g * ratio; + chld->mEnvColor.b = ptcl->mEnvColor.b * ratio; + } else { + chld->mPrmColor = dc.pssp->getPrm(); + chld->mEnvColor = dc.pssp->getEnv(); + } + + if (dc.pssp->isInheritedAlpha()) { + f32 ratio = dc.pssp->getInheritAlpha() * ptcl->mAlphaOut; + chld->mPrmColor.a = ptcl->mPrmColor.a * ratio; + chld->mEnvColor.a = ptcl->mEnvColor.a * ratio; + } else { + chld->mPrmColor.a = dc.pssp->getPrmAlpha(); + chld->mEnvColor.a = dc.pssp->getEnvAlpha(); + } + + if (dc.pssp->isInheritedScale()) { + f32 ratio = dc.pssp->getInheritScale(); + chld->mScaleX = chld->mScaleOut = ratio * ptcl->mScaleX; + chld->mScaleY = chld->mAlphaWaveRandom = ratio * ptcl->mScaleY; + } else { + chld->mAlphaWaveRandom = 1.0f; + chld->mScaleY = 1.0f; + chld->mScaleOut = 1.0f; + chld->mScaleX = 1.0f; + } + + chld->mRotateAngle = ptcl->mRotateAngle; + if (dc.pssp->isEnableRotate()) { + chld->mRotateSpeed = dc.pssp->getRotateSpeed() * 32768.0f; + } else { + chld->mRotateSpeed = 0; + } } /* 802692A4-80269358 .text loadTexture__7JPADrawFUc11_GXTexMapID */ bool JPADraw::loadTexture(u8 tex_no, GXTexMapID texMap) { JUT_ASSERT(0x17e, dc.pbe->getEmitterDataBlockInfoPtr()->getTextureNum() > tex_no); - JPATexture * tex = dc.mpTextureResource->pTexResArray[dc.pTexIdx[tex_no]]; - tex->load(texMap); - return TRUE; + dc.mpTextureResource->load(dc.pTexIdx[tex_no], texMap); + return true; } /* 80269358-80269C08 .text setDrawExecVisitorsBeforeCB__7JPADrawFRCQ27JPADraw22JPADrawVisitorDefFlags */ -void JPADraw::setDrawExecVisitorsBeforeCB(const JPADraw::JPADrawVisitorDefFlags& param_1) { - /* Nonmatching */ - if (dc.petx) { - mpExecEmtrVis[execEmtrVisNum++] = &vc.field_0x50; +void JPADraw::setDrawExecVisitorsBeforeCB(const JPADrawVisitorDefFlags& flags) { + if (dc.petx) { + mpExecEmtrVis[execEmtrVisNum++] = &vc.mLoadExTexture; } - if (param_1.mbIsPointOrLine) { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0xc; + if (flags.mbIsPointOrLine) { + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mGenIdtMtx; } else if (dc.pbsp->isEnableProjection()) { if (dc.pbsp->isEnableTexScrollAnm()) { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x4; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mGenPrjTexMtx; } else { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x0; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mGenPrjMtx; } } else if (dc.pbsp->isEnableTexScrollAnm()) { - if (param_1.mbIsStripe) { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x10; + if (flags.mbIsStripe) { + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mSetTexMtx; } else { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x8; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mGenTexMtx0; } } else { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0xc; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mGenIdtMtx; } if (dc.pbsp->isEnableGlobalColAnm()) { - if (param_1.mbIsStripe || param_1.mbIsEnableAlpha == 0) { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x20; - } else if (param_1.mbIsEnableAlpha) { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x28; + if (flags.mbIsStripe || flags.mbIsEnableAlpha == 0) { + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mRegisterColorPrmEnv; + } else if (flags.mbIsEnableAlpha) { + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mRegisterColorEnv; } - } else if ((!dc.pbsp->isEnablePrm() || !dc.pbsp->isEnablePrmAnm()) && param_1.mbIsEnableAlpha == 0) { + } else if ((!dc.pbsp->isEnablePrm() || !dc.pbsp->isEnablePrmAnm()) && flags.mbIsEnableAlpha == 0) { if (!dc.pbsp->isEnableEnv() || !dc.pbsp->isEnableEnvAnm()) { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x20; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mRegisterColorPrmEnv; } else { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x24; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mRegisterColorPrm; } } else if (!dc.pbsp->isEnableEnv() || !dc.pbsp->isEnableEnvAnm()) { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x28; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mRegisterColorEnv; } if (!dc.pbsp->textureIsEmpty() && (!dc.pbsp->isEnableTextureAnm() || dc.pbsp->isEnableGlobalTexAnm())) { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x48; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mLoadTexture; } else if (dc.pbsp->textureIsEmpty()) { - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x44; + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mLoadDefaultTexture; } if (dc.pssp && !dc.pssp->isEnableAlphaOut() && !dc.pssp->isInheritedAlpha() && !dc.pssp->isInheritedRGB()) { - mpExecEmtrCVis[execEmtrCVisNum++] = &vc.field_0x2c; + mpExecEmtrCVis[execEmtrCVisNum++] = &vc.mRegisterColorChildPrmEnv; } if (!dc.pbsp->isEnableGlobalColAnm()) { - if (param_1.mbHasPrmAnm) { - if (param_1.mbHasEnvAnm) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x3c; + if (flags.mbHasPrmAnm) { + if (flags.mbHasEnvAnm) { + mpExecPtclVis[execPtclVisNum++] = &vc.mRegisterPrmColor; } else { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x30; + mpExecPtclVis[execPtclVisNum++] = &vc.mRegisterPrmColorAnm; } - } else if (param_1.mbIsEnableAlpha) { - if (param_1.mbHasEnvAnm) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x40; + } else if (flags.mbIsEnableAlpha) { + if (flags.mbHasEnvAnm) { + mpExecPtclVis[execPtclVisNum++] = &vc.mRegisterPrmAlpha; } else { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x34; + mpExecPtclVis[execPtclVisNum++] = &vc.mRegisterPrmAlphaAnm; } - } else if (param_1.mbHasEnvAnm) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x38; + } else if (flags.mbHasEnvAnm) { + mpExecPtclVis[execPtclVisNum++] = &vc.mRegisterEnvColorAnm; } - } else if (param_1.mbIsEnableAlpha && !param_1.mbIsStripe) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x34; + } else if (flags.mbIsEnableAlpha && !flags.mbIsStripe) { + mpExecPtclVis[execPtclVisNum++] = &vc.mRegisterPrmAlphaAnm; } if (!dc.pbsp->textureIsEmpty() && dc.pbsp->isEnableTextureAnm() && !dc.pbsp->isEnableGlobalTexAnm()) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x48; + mpExecPtclVis[execPtclVisNum++] = &vc.mLoadTexture; } switch (dc.pbsp->getType()) { - case 0: + case JPABaseShape::JPAType_Point: if (dc.pesp && dc.pesp->isEnableScale()) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x18; + mpExecPtclVis[execPtclVisNum++] = &vc.mSetPointSize; } break; - case 1: + case JPABaseShape::JPAType_Line: if (dc.pesp && dc.pesp->isEnableScale()) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x1c; + mpExecPtclVis[execPtclVisNum++] = &vc.mSetLineWidth; } break; - case 5: - case 6: + case JPABaseShape::JPAType_Stripe: + case JPABaseShape::JPAType_StripeCross: break; - case 7: - case 8: - case 9: - case 10: + case JPABaseShape::JPAType_Billboard: + case JPABaseShape::JPAType_Direction: + case JPABaseShape::JPAType_DirectionCross: + case JPABaseShape::JPAType_Rotation: + case JPABaseShape::JPAType_RotationCross: + case JPABaseShape::JPAType_DirBillboard: + case JPABaseShape::JPAType_YBillboard: if (dc.pbsp->isEnableTexScrollAnm() && !dc.pbsp->isEnableProjection()) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x10; + mpExecPtclVis[execPtclVisNum++] = &vc.mSetTexMtx; } break; } if (dc.pssp) { if (dc.pssp->isEnableAlphaOut() || dc.pssp->isInheritedAlpha() || dc.pssp->isInheritedRGB()) { - mpExecChldVis[execChldVisNum++] = &vc.field_0x3c; + mpExecChldVis[execChldVisNum++] = &vc.mRegisterPrmColor; } switch (dc.pssp->getType()) { - case 0: - mpExecChldVis[execChldVisNum++] = &vc.field_0x18; + case JPABaseShape::JPAType_Point: + mpExecChldVis[execChldVisNum++] = &vc.mSetPointSize; break; - case 1: - mpExecChldVis[execChldVisNum++] = &vc.field_0x1c; + case JPABaseShape::JPAType_Line: + mpExecChldVis[execChldVisNum++] = &vc.mSetLineWidth; break; } } } /* 80269C08-8026A2EC .text setDrawExecVisitorsAfterCB__7JPADrawFRCQ27JPADraw22JPADrawVisitorDefFlags */ -void JPADraw::setDrawExecVisitorsAfterCB(const JPADraw::JPADrawVisitorDefFlags& param_1) { - if (param_1.mbIsEnableDrawParent) { +void JPADraw::setDrawExecVisitorsAfterCB(const JPADrawVisitorDefFlags& flags) { + if (flags.mbIsEnableDrawParent) { switch (dc.pbsp->getType()) { - case 0: - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x80; + case JPABaseShape::JPAType_Point: + mpExecPtclVis[execPtclVisNum++] = &vc.mExecPoint; break; - case 1: - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x84; + case JPABaseShape::JPAType_Line: + mpExecPtclVis[execPtclVisNum++] = &vc.mExecLine; break; - case 2: + case JPABaseShape::JPAType_Billboard: if (dc.pesp && dc.pesp->isEnableRotate()) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x58; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecRotBillBoard; } else { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x54; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecBillBoard; } break; - case 3: + case JPABaseShape::JPAType_Direction: if (dc.pesp && dc.pesp->isEnableRotate()) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x68; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecRotDirectional; } else { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x64; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecDirectional; } break; - case 4: + case JPABaseShape::JPAType_DirectionCross: if (dc.pesp && dc.pesp->isEnableRotate()) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x70; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecRotDirectionalCross; } else { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x6c; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecDirectionalCross; } break; - case 10: + case JPABaseShape::JPAType_YBillboard: if (dc.pesp && dc.pesp->isEnableRotate()) { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x60; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecRotYBillBoard; } else { - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x5c; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecYBillBoard; } break; - case 7: - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x78; + case JPABaseShape::JPAType_Rotation: + mpExecPtclVis[execPtclVisNum++] = &vc.mExecRotation; break; - case 8: - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x7c; + case JPABaseShape::JPAType_RotationCross: + mpExecPtclVis[execPtclVisNum++] = &vc.mExecRotationCross; break; case 9: - mpExecPtclVis[execPtclVisNum++] = &vc.field_0x74; + mpExecPtclVis[execPtclVisNum++] = &vc.mExecDirBillBoard; break; - case 5: - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x88; + case JPABaseShape::JPAType_Stripe: + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mExecStripe; break; - case 6: - mpExecEmtrPVis[execEmtrPVisNum++] = &vc.field_0x8c; + case JPABaseShape::JPAType_StripeCross: + mpExecEmtrPVis[execEmtrPVisNum++] = &vc.mExecStripeCross; break; } } if (dc.pssp) { switch (dc.pssp->getType()) { - case 0: - mpExecChldVis[execChldVisNum++] = &vc.field_0x80; + case JPABaseShape::JPAType_Point: + mpExecChldVis[execChldVisNum++] = &vc.mExecPoint; break; - case 1: - mpExecChldVis[execChldVisNum++] = &vc.field_0x84; + case JPABaseShape::JPAType_Line: + mpExecChldVis[execChldVisNum++] = &vc.mExecLine; break; - case 2: + case JPABaseShape::JPAType_Billboard: if ((dc.pesp && dc.pesp->isEnableRotate()) || dc.pssp->isEnableRotate()) { - mpExecChldVis[execChldVisNum++] = &vc.field_0x58; + mpExecChldVis[execChldVisNum++] = &vc.mExecRotBillBoard; } else { - mpExecChldVis[execChldVisNum++] = &vc.field_0x54; + mpExecChldVis[execChldVisNum++] = &vc.mExecBillBoard; } break; - case 3: + case JPABaseShape::JPAType_Direction: if ((dc.pesp && dc.pesp->isEnableRotate()) || dc.pssp->isEnableRotate()) { - mpExecChldVis[execChldVisNum++] = &vc.field_0x68; + mpExecChldVis[execChldVisNum++] = &vc.mExecRotDirectional; } else { - mpExecChldVis[execChldVisNum++] = &vc.field_0x64; + mpExecChldVis[execChldVisNum++] = &vc.mExecDirectional; } break; - case 4: + case JPABaseShape::JPAType_DirectionCross: if ((dc.pesp && dc.pesp->isEnableRotate()) || dc.pssp->isEnableRotate()) { - mpExecChldVis[execChldVisNum++] = &vc.field_0x70; + mpExecChldVis[execChldVisNum++] = &vc.mExecRotDirectionalCross; } else { - mpExecChldVis[execChldVisNum++] = &vc.field_0x6c; + mpExecChldVis[execChldVisNum++] = &vc.mExecDirectionalCross; } break; - case 10: + case JPABaseShape::JPAType_YBillboard: if ((dc.pesp && dc.pesp->isEnableRotate()) || dc.pssp->isEnableRotate()) { - mpExecChldVis[execChldVisNum++] = &vc.field_0x60; + mpExecChldVis[execChldVisNum++] = &vc.mExecRotYBillBoard; } else { - mpExecChldVis[execChldVisNum++] = &vc.field_0x5c; + mpExecChldVis[execChldVisNum++] = &vc.mExecYBillBoard; } break; - case 7: - mpExecChldVis[execChldVisNum++] = &vc.field_0x78; + case JPABaseShape::JPAType_Rotation: + mpExecChldVis[execChldVisNum++] = &vc.mExecRotation; break; - case 8: - mpExecChldVis[execChldVisNum++] = &vc.field_0x7c; + case JPABaseShape::JPAType_RotationCross: + mpExecChldVis[execChldVisNum++] = &vc.mExecRotationCross; break; - case 9: - mpExecChldVis[execChldVisNum++] = &vc.field_0x74; + case JPABaseShape::JPAType_DirBillboard: + mpExecChldVis[execChldVisNum++] = &vc.mExecDirBillBoard; break; - case 5: - mpExecEmtrCVis[execEmtrCVisNum++] = &vc.field_0x88; + case JPABaseShape::JPAType_Stripe: + mpExecEmtrCVis[execEmtrCVisNum++] = &vc.mExecStripe; break; - case 6: - mpExecEmtrCVis[execEmtrCVisNum++] = &vc.field_0x8c; + case JPABaseShape::JPAType_StripeCross: + mpExecEmtrCVis[execEmtrCVisNum++] = &vc.mExecStripeCross; break; } } } +enum { + JPACalcType_Normal, + JPACalcType_Repeat, + JPACalcType_Reverse, + JPACalcType_Merge, + JPACalcType_Random, +}; + +enum { + JPAAlphaWaveType_Nrm, + JPAAlphaWaveType_Add, + JPAAlphaWaveType_Mult, +}; + /* 8026A2EC-8026ADB0 .text setDrawCalcVisitors__7JPADrawFRCQ27JPADraw22JPADrawVisitorDefFlags */ -void JPADraw::setDrawCalcVisitors(const JPADraw::JPADrawVisitorDefFlags& param_1) { - if (dc.pbsp->isEnableGlobalColAnm() && (param_1.mbHasPrmAnm || param_1.mbHasEnvAnm)) { +void JPADraw::setDrawCalcVisitors(const JPADraw::JPADrawVisitorDefFlags& flags) { + if (dc.pbsp->isEnableGlobalColAnm() && (flags.mbHasPrmAnm || flags.mbHasEnvAnm)) { switch (dc.pbsp->getColorRegAnmType()) { - case 0: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0xd4; + case JPACalcType_Normal: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcColorAnmFrameNormal; break; - case 1: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0xdc; + case JPACalcType_Repeat: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcColorAnmFrameRepeat; break; - case 2: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0xe4; + case JPACalcType_Reverse: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcColorAnmFrameReverse; break; - case 3: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0xec; + case JPACalcType_Merge: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcColorAnmFrameMerge; break; - case 4: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0xf4; + case JPACalcType_Random: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcColorAnmFrameRandom; break; } - if (param_1.mbHasPrmAnm) { - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0xc0; + if (flags.mbHasPrmAnm) { + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcColorPrm; } - if (param_1.mbHasEnvAnm) { - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0xc8; + if (flags.mbHasEnvAnm) { + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcColorEnv; } } - if (!dc.pbsp->textureIsEmpty() && dc.pbsp->isEnableTextureAnm() && - dc.pbsp->isEnableGlobalTexAnm()) - { + if (!dc.pbsp->textureIsEmpty() && dc.pbsp->isEnableTextureAnm() && dc.pbsp->isEnableGlobalTexAnm()) { switch (dc.pbsp->getTextureAnmType()) { - case 0: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0x10c; + case JPACalcType_Normal: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcTextureAnmIndexNormal; break; - case 1: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0x114; + case JPACalcType_Repeat: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcTextureAnmIndexRepeat; break; - case 2: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0x11c; + case JPACalcType_Reverse: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcTextureAnmIndexReverse; break; - case 3: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0x124; + case JPACalcType_Merge: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcTextureAnmIndexMerge; break; - case 4: - mpCalcEmtrVis[calcEmtrVisNum++] = &vc.field_0x12c; + case JPACalcType_Random: + mpCalcEmtrVis[calcEmtrVisNum++] = &vc.mCalcTextureAnmIndexRandom; break; } } if (dc.pesp && dc.pesp->isEnableScale()) { if (dc.pesp->isEnableScaleAnmX()) { if (dc.pesp->getAnmTypeX()) { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xb8; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleAnmTimingReverseX; } else { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xb0; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleAnmTimingRepeatX; } } else { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xac; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleAnmTimingNormal; } - if (dc.pesp->isEnableScaleBySpeedX() && dc.pbsp->getType() != 1) { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x9c; + if (dc.pesp->isEnableScaleBySpeedX() && dc.pbsp->getType() != JPABaseShape::JPAType_Line) { + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleXBySpeed; } else { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x98; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleX; } - if (dc.pbsp->getType() != 0) { + if (dc.pbsp->getType() != JPABaseShape::JPAType_Point) { if (!dc.pesp->isDiffXY()) { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xa8; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleCopyX2Y; } else { if (dc.pesp->isEnableScaleAnmY()) { if (dc.pesp->getAnmTypeY()) { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xbc; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleAnmTimingReverseY; } else { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xb4; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleAnmTimingRepeatY; } } else if (dc.pesp->isEnableScaleAnmX()) { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xac; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleAnmTimingNormal; } if (dc.pesp->isEnableScaleBySpeedY()) { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xa4; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleYBySpeed; } else { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xa0; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcScaleY; } } } } if (!dc.pbsp->isEnableGlobalColAnm()) { - if (param_1.mbHasPrmAnm || param_1.mbHasEnvAnm) { + if (flags.mbHasPrmAnm || flags.mbHasEnvAnm) { switch (dc.pbsp->getColorRegAnmType()) { - case 0: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xd4; + case JPACalcType_Normal: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcColorAnmFrameNormal; break; - case 1: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xdc; + case JPACalcType_Repeat: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcColorAnmFrameRepeat; break; - case 2: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xe4; + case JPACalcType_Reverse: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcColorAnmFrameReverse; break; - case 3: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xec; + case JPACalcType_Merge: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcColorAnmFrameMerge; break; - case 4: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xf4; + case JPACalcType_Random: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcColorAnmFrameRandom; break; } - if (param_1.mbHasPrmAnm) { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xc0; + if (flags.mbHasPrmAnm) { + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcColorPrm; } - if (param_1.mbHasEnvAnm) { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xc8; + if (flags.mbHasEnvAnm) { + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcColorEnv; } } } else { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xd0; + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcColorCopyFromEmitter; } - if (param_1.mbIsEnableAlpha && !param_1.mbIsStripe) { - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0xfc; + if (flags.mbIsEnableAlpha && !flags.mbIsStripe) { + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcAlpha; if (dc.pesp->isEnableSinWave()) { switch (dc.pesp->getAlphaWaveType()) { - case 0: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x100; + case JPAAlphaWaveType_Nrm: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcAlphaFlickNrmSin; break; - case 1: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x104; + case JPAAlphaWaveType_Add: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcAlphaFlickAddSin; break; - case 2: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x108; + case JPAAlphaWaveType_Mult: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcAlphaFlickMultSin; break; } } } - if (!dc.pbsp->textureIsEmpty() && dc.pbsp->isEnableTextureAnm() && - !dc.pbsp->isEnableGlobalTexAnm()) - { + if (!dc.pbsp->textureIsEmpty() && dc.pbsp->isEnableTextureAnm() && !dc.pbsp->isEnableGlobalTexAnm()) { switch (dc.pbsp->getTextureAnmType()) { - case 0: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x10c; + case JPACalcType_Normal: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcTextureAnmIndexNormal; break; - case 1: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x114; + case JPACalcType_Repeat: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcTextureAnmIndexRepeat; break; - case 2: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x11c; + case JPACalcType_Reverse: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcTextureAnmIndexReverse; break; - case 3: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x124; + case JPACalcType_Merge: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcTextureAnmIndexMerge; break; - case 4: - mpCalcPtclVis[calcPtclVisNum++] = &vc.field_0x12c; + case JPACalcType_Random: + mpCalcPtclVis[calcPtclVisNum++] = &vc.mCalcTextureAnmIndexRandom; break; } } if (dc.pssp) { if (dc.pssp->isEnableAlphaOut()) { - mpCalcChldVis[calcChldVisNum++] = &vc.field_0x134; + mpCalcChldVis[calcChldVisNum++] = &vc.mCalcChildAlphaOut; } if (dc.pssp->isEnableScaleOut()) { - mpCalcChldVis[calcChldVisNum++] = &vc.field_0x138; + mpCalcChldVis[calcChldVisNum++] = &vc.mCalcChildScaleOut; } } } @@ -562,12 +618,94 @@ void JPADraw::setChildClipBoard() { /* 8026B938-8026BC2C .text drawParticle__7JPADrawFv */ void JPADraw::drawParticle() { - /* Nonmatching */ + /* Nonmatching - regalloc */ + field_0xc2 &= ~0x02; + setParticleClipBoard(); + dc.mpActiveParticles = &dc.pbe->mActiveParticles; + GXSetPointSize(cb.mGlobalScaleX, GX_TO_ONE); + GXSetLineWidth(cb.mGlobalScaleX, GX_TO_ONE); + GXSetZMode(dc.pbsp->isEnableZCmp(), dc.pbsp->getZCmpFunction(), dc.pbsp->isEnableZCmpUpdate()); + GXSetZCompLoc(dc.pbsp->getZCompLoc()); + GXSetAlphaCompare(dc.pbsp->getAlphaCmpComp0(), dc.pbsp->getAlphaCmpRef0(), dc.pbsp->getAlphaCmpOp(), dc.pbsp->getAlphaCmpComp1(), dc.pbsp->getAlphaCmpRef1()); + GXSetAlphaUpdate(dc.pbsp->isEnableAlphaUpdate()); + GXSetColorUpdate(GX_TRUE); + GXSetCullMode(GX_CULL_NONE); + if (dc.pbsp->isClipOn()) { + GXSetClipMode(GX_CLIP_ENABLE); + GXSetMisc(1, 8); + } else { + GXSetClipMode(GX_CLIP_DISABLE); + } + + for (s32 i = 0; i < execEmtrPVisNum; i++) + mpExecEmtrPVis[i]->exec(&dc); + + JPABaseEmitter * emtr = dc.pbe; + if (dc.pbsp->getListOrder() == 0) { + for (JSULink * link = emtr->mActiveParticles.getFirst(); link != NULL; link = link->getNext()) { + JPABaseParticle * ptcl = link->getObject(); + for (s32 i = 0; i < execPtclVisNum; i++) + mpExecPtclVis[i]->exec(&dc, ptcl); + } + } else { + for (JSULink * link = emtr->mActiveParticles.getLast(); link != NULL; link = link->getPrev()) { + JPABaseParticle * ptcl = link->getObject(); + for (s32 i = 0; i < execPtclVisNum; i++) + mpExecPtclVis[i]->exec(&dc, ptcl); + } + } + + GXSetMisc(1, 0); } /* 8026BC2C-8026BF88 .text drawChild__7JPADrawFv */ void JPADraw::drawChild() { - /* Nonmatching */ + /* Nonmatching - regalloc */ + field_0xc2 |= 0x02; + setChildClipBoard(); + dc.mpActiveParticles = &dc.pbe->mChildParticles; + GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY); + GXEnableTexOffsets(GX_TEXCOORD0, GX_TRUE, GX_TRUE); + + if (dc.pbsp->textureIsEmpty()) { + GXLoadTexObj(&dc.mpTextureResource->defaultTex.mTexObj, GX_TEXMAP0); + } else { + dc.mpTextureResource->load(dc.pTexIdx[dc.pssp->getTextureIndex()], GX_TEXMAP0); + } + + GXSetZMode(dc.pbsp->isEnableZCmp(), dc.pbsp->getZCmpFunction(), dc.pbsp->isEnableZCmpUpdate()); + GXSetZCompLoc(dc.pbsp->getZCompLoc()); + GXSetAlphaCompare(dc.pbsp->getAlphaCmpComp0(), dc.pbsp->getAlphaCmpRef0(), dc.pbsp->getAlphaCmpOp(), dc.pbsp->getAlphaCmpComp1(), dc.pbsp->getAlphaCmpRef1()); + GXSetAlphaUpdate(dc.pbsp->isEnableAlphaUpdate()); + GXSetColorUpdate(GX_TRUE); + GXSetCullMode(GX_CULL_NONE); + + if (dc.pssp->isClipOn()) { + GXSetClipMode(GX_CLIP_ENABLE); + GXSetMisc(1, 8); + } else { + GXSetClipMode(GX_CLIP_DISABLE); + } + + for (s32 i = 0; i < execEmtrCVisNum; i++) + mpExecEmtrCVis[i]->exec(&dc); + + JPABaseEmitter * emtr = dc.pbe; + if (dc.pbsp->getListOrder() == 0) { + for (JSULink * link = emtr->mChildParticles.getFirst(); link != NULL; link = link->getNext()) { + JPABaseParticle * ptcl = link->getObject(); + for (s32 i = 0; i < execChldVisNum; i++) + mpExecChldVis[i]->exec(&dc, ptcl); + } + } else { + for (JSULink * link = emtr->mChildParticles.getLast(); link != NULL; link = link->getPrev()) { + JPABaseParticle * ptcl = link->getObject(); + for (s32 i = 0; i < execChldVisNum; i++) + mpExecChldVis[i]->exec(&dc, ptcl); + } + } + + GXSetMisc(1, 0); } /* 8026BF88-8026C024 .text zDraw__7JPADrawFv */