mirror of
https://github.com/zeldaret/ss
synced 2026-07-12 06:57:50 -04:00
Merge pull request #156 from robojumper/jparticle
JParticle, EGG edition
This commit is contained in:
@@ -1759,45 +1759,62 @@ JSystem/JParticle/JPAResourceManager.cpp:
|
||||
|
||||
JSystem/JParticle/JPAResource.cpp:
|
||||
.text start:0x80316C10 end:0x803198A0 align:16
|
||||
.data start:0x80546D60 end:0x80546F80
|
||||
.sdata2 start:0x8057CE38 end:0x8057CE50
|
||||
|
||||
JSystem/JParticle/JPABaseShape.cpp:
|
||||
.text start:0x803198A0 end:0x8031D53C align:16
|
||||
.data start:0x80546F80 end:0x80547180
|
||||
.sdata start:0x80574008 end:0x80574010
|
||||
.sdata2 start:0x8057CE50 end:0x8057CE88
|
||||
|
||||
JSystem/JParticle/JPAExtraShape.cpp:
|
||||
.text start:0x8031D540 end:0x8031DB98 align:16
|
||||
.sdata2 start:0x8057CE88 end:0x8057CEB0
|
||||
|
||||
JSystem/JParticle/JPAChildShape.cpp:
|
||||
.text start:0x8031DBA0 end:0x8031DD48 align:16
|
||||
.sdata2 start:0x8057CEB0 end:0x8057CEB8
|
||||
|
||||
JSystem/JParticle/JPAExTexShape.cpp:
|
||||
.text start:0x8031DD50 end:0x8031E094 align:16
|
||||
.sdata2 start:0x8057CEB8 end:0x8057CED8
|
||||
|
||||
JSystem/JParticle/JPADynamicsBlock.cpp:
|
||||
.text start:0x8031E0A0 end:0x8031F020 align:16
|
||||
.sdata2 start:0x8057CED8 end:0x8057CF00
|
||||
|
||||
JSystem/JParticle/JPAFieldBlock.cpp:
|
||||
.text start:0x8031F020 end:0x80320410 align:16
|
||||
.data start:0x80547180 end:0x80547258
|
||||
.sdata2 start:0x8057CF00 end:0x8057CF10
|
||||
|
||||
JSystem/JParticle/JPAKeyBlock.cpp:
|
||||
.text start:0x80320410 end:0x803204B4 align:16
|
||||
.sdata2 start:0x8057CF10 end:0x8057CF18
|
||||
|
||||
JSystem/JParticle/JPATexture.cpp:
|
||||
.text start:0x803204C0 end:0x8032057C align:16
|
||||
.data start:0x80547258 end:0x80547268
|
||||
|
||||
JSystem/JParticle/JPAResourceLoader.cpp:
|
||||
.text start:0x80320580 end:0x80320980 align:16
|
||||
|
||||
JSystem/JParticle/JPAEmitterManager.cpp:
|
||||
.text start:0x80320980 end:0x80321444 align:16
|
||||
.sdata2 start:0x8057CF18 end:0x8057CF20
|
||||
|
||||
JSystem/JParticle/JPAEmitter.cpp:
|
||||
.text start:0x80321450 end:0x80321C74 align:16
|
||||
.sdata2 start:0x8057CF20 end:0x8057CF28
|
||||
|
||||
JSystem/JParticle/JPAParticle.cpp:
|
||||
.text start:0x80321C80 end:0x80323050 align:16
|
||||
.sdata2 start:0x8057CF28 end:0x8057CF48
|
||||
|
||||
JSystem/JParticle/JPAMath.cpp:
|
||||
.text start:0x80323050 end:0x80323704 align:16
|
||||
.sdata2 start:0x8057CF48 end:0x8057CF58
|
||||
|
||||
JSystem/JSupport/JSUList.cpp:
|
||||
.text start:0x80323710 end:0x80323A6C align:16
|
||||
|
||||
+227
-227
@@ -18414,220 +18414,220 @@ fn_80316820 = .text:0x80316820; // type:function size:0x98
|
||||
fn_803168C0 = .text:0x803168C0; // type:function size:0x144
|
||||
fn_80316A10 = .text:0x80316A10; // type:function size:0x8
|
||||
fn_80316A20 = .text:0x80316A20; // type:function size:0x8
|
||||
JParticle__JPAResourceManager__JPAResourceManager = .text:0x80316A30; // type:function size:0x58
|
||||
JParticle__JPAResourceManager__getResource = .text:0x80316A90; // type:function size:0x48
|
||||
JParticle__JPAResourceManager__swapTexture = .text:0x80316AE0; // type:function size:0xA0
|
||||
JParticle__JPAResourceManager__registRes = .text:0x80316B80; // type:function size:0x20
|
||||
JParticle__JPAResourceManager__registTex = .text:0x80316BA0; // type:function size:0x20
|
||||
JParticle__JPAResourceManager__getResUserWork = .text:0x80316BC0; // type:function size:0x44
|
||||
JParticle__JPAResource__JPAResource = .text:0x80316C10; // type:function size:0x70
|
||||
JParticle__JPAResource__init = .text:0x80316C80; // type:function size:0x1690
|
||||
JParticle__JPAResource__calc = .text:0x80318310; // type:function size:0x544
|
||||
fn_80318860 = .text:0x80318860; // type:function size:0x4
|
||||
JParticle__JPAResource__draw = .text:0x80318870; // type:function size:0xF0
|
||||
JPAResource__drawParent = .text:0x80318960; // type:function size:0x324
|
||||
JParticle__JPAResouce__drawChild = .text:0x80318C90; // type:function size:0x2E8
|
||||
JParticle__JPAResource__setParentTev = .text:0x80318F80; // type:function size:0x29C
|
||||
JParticle__JPAResource__setChildTev = .text:0x80319220; // type:function size:0x16C
|
||||
JParticle__JPAResource__calc_parent = .text:0x80319390; // type:function size:0x7C
|
||||
JParticle__JPAResource__calc_child = .text:0x80319410; // type:function size:0x7C
|
||||
JParticle__JPAResource__calcField = .text:0x80319490; // type:function size:0x7C
|
||||
JParticle__JPAResource__calcKey = .text:0x80319510; // type:function size:0x140
|
||||
JParticle__JPAResource__cakcWorkData_c = .text:0x80319650; // type:function size:0x1C4
|
||||
JParticle__JPAResource__calcWorkData_d = .text:0x80319820; // type:function size:0x80
|
||||
JParticle__JPASetPointSize = .text:0x803198A0; // type:function size:0x40
|
||||
JParticle__JPASetLineWidth = .text:0x803198E0; // type:function size:0x40
|
||||
JParticle__JPASetPointSize2 = .text:0x80319920; // type:function size:0x48
|
||||
JParticle__JPASetLineWidth2 = .text:0x80319970; // type:function size:0x48
|
||||
JParticle__JPARegistPrm = .text:0x803199C0; // type:function size:0x9C
|
||||
JParticle__JPARegistEnv = .text:0x80319A60; // type:function size:0x84
|
||||
JParticle__JPARegistPrmEnv = .text:0x80319AF0; // type:function size:0x118
|
||||
JParticle__JPARegistAlpha = .text:0x80319C10; // type:function size:0xAC
|
||||
JParticle__JPARegistPrmAlpha = .text:0x80319CC0; // type:function size:0xAC
|
||||
JParticle__JPARegistPrmAlphaEnv = .text:0x80319D70; // type:function size:0x128
|
||||
JParticle__JPARegistAlphaEnv = .text:0x80319EA0; // type:function size:0x128
|
||||
JParticle__JPARegistEnv2 = .text:0x80319FD0; // type:function size:0x84
|
||||
JParticle__JPACalcClrIdxNormal = .text:0x8031A060; // type:function size:0x2C
|
||||
JParticle__JPACalcClrIdxNormal2 = .text:0x8031A090; // type:function size:0x28
|
||||
JParticle__JPACalcClrIdxRepeat = .text:0x8031A0C0; // type:function size:0x30
|
||||
JParticle__JPACalcClrIdxRepeat2 = .text:0x8031A0F0; // type:function size:0x3C
|
||||
JParticle__JPACalcClrIdxReverse = .text:0x8031A130; // type:function size:0x40
|
||||
JParticle__JPACalcClrIdxReverse2 = .text:0x8031A170; // type:function size:0x4C
|
||||
JParticle__JPACalcClrIdxMerge = .text:0x8031A1C0; // type:function size:0xC
|
||||
JParticle__JPACalcClrIdxMerge2 = .text:0x8031A1D0; // type:function size:0x70
|
||||
JParticle__JPACalcClrIdxRandom = .text:0x8031A240; // type:function size:0xC
|
||||
JParticle__JPACalcClrIdxRandom2 = .text:0x8031A250; // type:function size:0x34
|
||||
JPartcle__JPACalcPrm = .text:0x8031A290; // type:function size:0x3C
|
||||
JParticle__JPACalcPrm = .text:0x8031A2D0; // type:function size:0x38
|
||||
JParticle__JPACalcEnv = .text:0x8031A310; // type:function size:0x3C
|
||||
JParticle__JPACalcEnv2 = .text:0x8031A350; // type:function size:0x38
|
||||
JParticle__JPACalcColorCopy = .text:0x8031A390; // type:function size:0x48
|
||||
JParticle__JPACGenTexCrdMtxIdt = .text:0x8031A3E0; // type:function size:0x1C
|
||||
JParticle__JPAGenTexCrdMtxAnm = .text:0x8031A400; // type:function size:0x1C
|
||||
JParticle__JPAGenTexCrdMtxPrj = .text:0x8031A420; // type:function size:0x1C
|
||||
JParticle__JPAGenCalcTexCrdMtxAnm = .text:0x8031A440; // type:function size:0x244
|
||||
JParticle__JPALoadCalcTexCrdMtxAnm = .text:0x8031A690; // type:function size:0x22C
|
||||
fn_8031A8C0 = .text:0x8031A8C0; // type:function size:0x4C
|
||||
JParticle__JPALoadTex = .text:0x8031A910; // type:function size:0x38
|
||||
JParticle__JPALoadTexAnm = .text:0x8031A950; // type:function size:0x34
|
||||
JParticle__JPALoadTexAnm2 = .text:0x8031A990; // type:function size:0x30
|
||||
JParticle__JPACalcTexIdxNormal = .text:0x8031A9C0; // type:function size:0x3C
|
||||
JParticle__JPACalcTexIdxNormal2 = .text:0x8031AA00; // type:function size:0x38
|
||||
JParticle__JPACalcTexIdxRepeat = .text:0x8031AA40; // type:function size:0x38
|
||||
JParticle__JPACalcIdxRepeat = .text:0x8031AA80; // type:function size:0x44
|
||||
JParticle__JPACalcTexIdxReverse = .text:0x8031AAD0; // type:function size:0x50
|
||||
JParticle__JPACalcTexIdxReverse2 = .text:0x8031AB20; // type:function size:0x5C
|
||||
JParticle__JPACalcTexIdxMerge = .text:0x8031AB80; // type:function size:0x1C
|
||||
JParticle__JPACalcTexIdxMerge2 = .text:0x8031ABA0; // type:function size:0x78
|
||||
JParticle__JPACalcTexIdxRandom = .text:0x8031AC20; // type:function size:0x1C
|
||||
JParticle__JPACalcTexIdxRandom2 = .text:0x8031AC40; // type:function size:0x3C
|
||||
JParticle__JPALoadPosMtxCam = .text:0x8031AC80; // type:function size:0xC
|
||||
JParticle__noLoadPrj = .text:0x8031AC90; // type:function size:0x4
|
||||
JParticle__loadPrj = .text:0x8031ACA0; // type:function size:0x38
|
||||
JParticle__loadPrjAnm = .text:0x8031ACE0; // type:function size:0x260
|
||||
JParticle__JPADrawBillboard = .text:0x8031AF40; // type:function size:0xE8
|
||||
JParticle__JPADrawRotBillboard = .text:0x8031B030; // type:function size:0x158
|
||||
JParticle__JPADrawYBillboard = .text:0x8031B190; // type:function size:0xFC
|
||||
JParticle__JPADrawRotYBillboard = .text:0x8031B290; // type:function size:0x170
|
||||
JParticle__dirTypeVel = .text:0x8031B400; // type:function size:0x1C
|
||||
JParticle__dirTypePos = .text:0x8031B420; // type:function size:0x1C
|
||||
JParticle__dirTypePosInv = .text:0x8031B440; // type:function size:0x48
|
||||
JParticle__dirTypeEmtrDir = .text:0x8031B490; // type:function size:0x1C
|
||||
JParticle__dirTypePrevPtcl = .text:0x8031B4B0; // type:function size:0xA8
|
||||
JParticle__rotTypeY = .text:0x8031B560; // type:function size:0x40
|
||||
JParticle__rotTypeX = .text:0x8031B5A0; // type:function size:0x40
|
||||
JParticle__rotTypeZ = .text:0x8031B5E0; // type:function size:0x40
|
||||
JParticle__rotTypeXYZ = .text:0x8031B620; // type:function size:0x5C
|
||||
JParticle__basePlaneXY = .text:0x8031B680; // type:function size:0x4C
|
||||
JParticle__basePlaneTypeXZ = .text:0x8031B6D0; // type:function size:0x4C
|
||||
JParticle__basePlaneTypeX = .text:0x8031B720; // type:function size:0x70
|
||||
JParticle__JPADrawDirection = .text:0x8031B790; // type:function size:0x278
|
||||
JParticle__JPADrawRotDirection = .text:0x8031BA10; // type:function size:0x31C
|
||||
JParticle__JPADrawDBillboard = .text:0x8031BD30; // type:function size:0x1D0
|
||||
JParticle__JPADrawRotation = .text:0x8031BF00; // type:function size:0x178
|
||||
JParticle__JPADrawPoint = .text:0x8031C080; // type:function size:0xA0
|
||||
JParticle__JPADrawLine = .text:0x8031C120; // type:function size:0x174
|
||||
JParticle__getNext = .text:0x8031C2A0; // type:function size:0x8
|
||||
JParticle__getPrev = .text:0x8031C2B0; // type:function size:0x8
|
||||
fn_8031C2C0 = .text:0x8031C2C0; // type:function size:0x4C
|
||||
JParticle__JPADrawStripe = .text:0x8031C310; // type:function size:0x4CC
|
||||
JParticle__JPADrawStripeX = .text:0x8031C7E0; // type:function size:0x844
|
||||
JParticle__JPADrawEmitterCallBackB = .text:0x8031D030; // type:function size:0x24
|
||||
JParticle__JPADrawParticleCallBack = .text:0x8031D060; // type:function size:0x2C
|
||||
JParticle__makeColorTable = .text:0x8031D090; // type:function size:0x250
|
||||
JParticle__JPABaseShape__JPABaseShape = .text:0x8031D2E0; // type:function size:0x110
|
||||
JParticle__JPABaseShape__setGX = .text:0x8031D3F0; // type:function size:0x14C
|
||||
JParticle__JPACalcScaleX = .text:0x8031D540; // type:function size:0x78
|
||||
JParticle__JPACalcScaleY = .text:0x8031D5C0; // type:function size:0x78
|
||||
JParticle__JPAScaleCopy = .text:0x8031D640; // type:function size:0xC
|
||||
JParticle__JPACalcScaleAnmNormal = .text:0x8031D650; // type:function size:0xC
|
||||
JParticle__JPACalcScaleAnmRepeatX = .text:0x8031D660; // type:function size:0x64
|
||||
JParticle__JPACalcScaleAnmRepeatY = .text:0x8031D6D0; // type:function size:0x64
|
||||
JParticle__JPACalcScaleAnmReverseX = .text:0x8031D740; // type:function size:0x94
|
||||
JParticle__JPACalcScaleAnmReverseY = .text:0x8031D7E0; // type:function size:0x94
|
||||
JParticle__JPACalcAlphaAnm = .text:0x8031D880; // type:function size:0x90
|
||||
JParticle__JPACalcAlphaFlickAnm = .text:0x8031D910; // type:function size:0x148
|
||||
JParticle__JPAExtraShape__JPAExtraShape = .text:0x8031DA60; // type:function size:0x34
|
||||
JParticle__JPAExtraShape__init = .text:0x8031DAA0; // type:function size:0xF8
|
||||
fn_8031DBA0 = .text:0x8031DBA0; // type:function size:0x18
|
||||
JParticle__JPARegistChildPrmEnv = .text:0x8031DBC0; // type:function size:0x114
|
||||
JParticle__JPACalcChildAlphaOut = .text:0x8031DCE0; // type:function size:0x30
|
||||
JParticle__JPACalcChildScaleOut = .text:0x8031DD10; // type:function size:0x28
|
||||
JParticle__JPAChildShape__JPAChildShape = .text:0x8031DD40; // type:function size:0x8
|
||||
JParticle__JPALoadExTex = .text:0x8031DD50; // type:function size:0x114
|
||||
JParticle__ExTexShape__ExTexShape = .text:0x8031DE70; // type:function size:0x8
|
||||
fn_8031DE80 = .text:0x8031DE80; // type:function size:0x214
|
||||
JParticle__JPAEmitterWorkData__JPAVolumePoint = .text:0x8031E0A0; // type:function size:0xD4
|
||||
JParticle__JPAEmitterData__JPAVolumeLine = .text:0x8031E180; // type:function size:0x114
|
||||
JParticle__JPAEmitterData__JPAVolumeCircle = .text:0x8031E2A0; // type:function size:0x204
|
||||
JParticle__JPAEmitterData__JPAVolumeCube = .text:0x8031E4B0; // type:function size:0x104
|
||||
JParticle__JPAEmitterData__JPAVolumeSphere = .text:0x8031E5C0; // type:function size:0x340
|
||||
JParticle__JPAEmitterData__JPAVolumeCylinder = .text:0x8031E900; // type:function size:0x1DC
|
||||
JParticle__JPAEmitterData__JPAVolumeTorus = .text:0x8031EAE0; // type:function size:0x238
|
||||
JParticle__JPADynamicsBlock__JPADynamicsBlock = .text:0x8031ED20; // type:function size:0x34
|
||||
JParticle__JPADynamicsBlock__init = .text:0x8031ED60; // type:function size:0xB4
|
||||
JParticle__JPADynamicsBlock__create = .text:0x8031EE20; // type:function size:0x200
|
||||
JPAFieldBase__calcAffect = .text:0x8031F020; // type:function size:0x150
|
||||
JPAFieldBase__calcFadeAffect = .text:0x8031F170; // type:function size:0x9C
|
||||
JPAFieldGravity__prepare = .text:0x8031F210; // type:function size:0xB4
|
||||
JPAFieldGravity__calc( = .text:0x8031F2D0; // type:function size:0xC
|
||||
JPAFieldAir__prepare = .text:0x8031F2E0; // type:function size:0xE0
|
||||
JPAFieldAir__calc = .text:0x8031F3C0; // type:function size:0xAC
|
||||
JPAFieldMagnet__prepare = .text:0x8031F470; // type:function size:0x6C
|
||||
JPAFieldMagnet__calc = .text:0x8031F4E0; // type:function size:0x94
|
||||
JPAFieldNewton__prepare = .text:0x8031F580; // type:function size:0x90
|
||||
JPAFieldNewton__calc = .text:0x8031F610; // type:function size:0xE0
|
||||
JPAFieldVortex__prepare = .text:0x8031F6F0; // type:function size:0x64
|
||||
JPAFieldVortex__calc = .text:0x8031F760; // type:function size:0x184
|
||||
JPAFieldConvection__prepare = .text:0x8031F8F0; // type:function size:0x118
|
||||
JPAFieldConvection__calc = .text:0x8031FA10; // type:function size:0x1DC
|
||||
JPAFieldRandom__calc = .text:0x8031FBF0; // type:function size:0x10C
|
||||
JPAFieldDrag__calc = .text:0x8031FD00; // type:function size:0x80
|
||||
JPAFieldSpin__prepare = .text:0x8031FD80; // type:function size:0xA4
|
||||
JParticle__JPAFieldSpin__calc = .text:0x8031FE30; // type:function size:0xE8
|
||||
JParticle__JPAFieldBlock__JPAFieldBlock = .text:0x8031FF20; // type:function size:0x38
|
||||
fn_8031FF60 = .text:0x8031FF60; // type:function size:0x26C
|
||||
fn_803201D0 = .text:0x803201D0; // type:function size:0x40
|
||||
fn_80320210 = .text:0x80320210; // type:function size:0x40
|
||||
fn_80320250 = .text:0x80320250; // type:function size:0x40
|
||||
fn_80320290 = .text:0x80320290; // type:function size:0x40
|
||||
fn_803202D0 = .text:0x803202D0; // type:function size:0x40
|
||||
fn_80320310 = .text:0x80320310; // type:function size:0x40
|
||||
fn_80320350 = .text:0x80320350; // type:function size:0x40
|
||||
fn_80320390 = .text:0x80320390; // type:function size:0x40
|
||||
fn_803203D0 = .text:0x803203D0; // type:function size:0x40
|
||||
JParticle__JPAKeyBlock__JPAKeyBlock = .text:0x80320410; // type:function size:0x10
|
||||
JParticle__JPAKeyBlock__calc = .text:0x80320420; // type:function size:0x94
|
||||
JParticle__JPATexture__JPATexture = .text:0x803204C0; // type:function size:0x60
|
||||
fn_80320520 = .text:0x80320520; // type:function size:0x5C
|
||||
JParticle__JPAResourceLoader__JPAResourceLoader = .text:0x80320580; // type:function size:0x40
|
||||
JParticle__JPAResourceLoader__load_jpc = .text:0x803205C0; // type:function size:0x3C0
|
||||
JParticle__JPAEmitterManager__JPAEmitterManager = .text:0x80320980; // type:function size:0x204
|
||||
JSUList_JPABaseEmitter__dt = .text:0x80320B90; // type:function size:0x58
|
||||
JParticle__JPABaseEmitter__JPABaseEmitter = .text:0x80320BF0; // type:function size:0x58
|
||||
JParticle__JPABaseEmitter___JPABaseEmitter = .text:0x80320C50; // type:function size:0x60
|
||||
JSUList_JPABaseEmiiter__ct = .text:0x80320CB0; // type:function size:0x30
|
||||
fn_80320CE0 = .text:0x80320CE0; // type:function size:0x10
|
||||
fn_80320CF0 = .text:0x80320CF0; // type:function size:0x40
|
||||
JParticle__JPAEmitterManager__createSimpleEmitterID = .text:0x80320D30; // type:function size:0xE4
|
||||
fn_80320E20 = .text:0x80320E20; // type:function size:0xB8
|
||||
JParticle__JPAEmitterManager__calc = .text:0x80320EE0; // type:function size:0x88
|
||||
JParticle__JPAEmitterManager__draw = .text:0x80320F70; // type:function size:0x204
|
||||
JParticle__JPAEmitterManager__forceDeleteAllEmitter = .text:0x80321180; // type:function size:0x58
|
||||
JParticle__JPAEmitterManager__forceDeleteGroupEmitter = .text:0x803211E0; // type:function size:0x5C
|
||||
JParticle__JPAEmitterManager__forceDeleteEmitter = .text:0x80321240; // type:function size:0x6C
|
||||
JParticle__JPAEmitterManager__entryResourceManager = .text:0x803212B0; // type:function size:0x10
|
||||
JParticle__JPAEmitterManager__clearResourceManager = .text:0x803212C0; // type:function size:0xA8
|
||||
JParticle__JPAEmitterManager__calcYBBCam = .text:0x80321370; // type:function size:0xD4
|
||||
JParticle__JPAEmitterCallBack___JPAEmitterCallBack = .text:0x80321450; // type:function size:0x40
|
||||
JParticle__JPABaseEmitter__init = .text:0x80321490; // type:function size:0x294
|
||||
JParticle__JPABaseEmitter__createParticle = .text:0x80321730; // type:function size:0x120
|
||||
JParticle__JPABaseEmitter__createChild = .text:0x80321850; // type:function size:0xFC
|
||||
JParticle__JPABaseEmitter__deleteAllParticle = .text:0x80321950; // type:function size:0x160
|
||||
JParticle__JPABaseEmitter__processTillStartFrame = .text:0x80321AB0; // type:function size:0x40
|
||||
JParticle__JPABaseEmitter__processTermination = .text:0x80321AF0; // type:function size:0x98
|
||||
JParticle__JPABaseEmitter__calcEmitterGlobalPosition = .text:0x80321B90; // type:function size:0x80
|
||||
JParticle__JPABaseEmitter__getCurrentCreateNumber = .text:0x80321C10; // type:function size:0x10
|
||||
JParticle__JPABaseEmitter__loadTexture = .text:0x80321C20; // type:function size:0x54
|
||||
JParticle__JPAParticleCallBack___JPAParticleCallBack = .text:0x80321C80; // type:function size:0x40
|
||||
JParticle__JPABaseParticle__init_c = .text:0x80321CC0; // type:function size:0x7B8
|
||||
JParticle__JPABaseParticle__init_c2 = .text:0x80322480; // type:function size:0x654
|
||||
JParticle__JPABaseParticle__calc_p = .text:0x80322AE0; // type:function size:0x28C
|
||||
JParticle__JPABaseParticle__calc_c = .text:0x80322D70; // type:function size:0x258
|
||||
JParticle__JPABaseParticle__canCreateChild = .text:0x80322FD0; // type:function size:0x80
|
||||
JParticle__JPAGetDirMtx = .text:0x80323050; // type:function size:0x13C
|
||||
JParticle__JPAGetYZRotateMtx = .text:0x80323190; // type:function size:0x128
|
||||
JParticle__JPAGetXYZRotateMtx = .text:0x803232C0; // type:function size:0x1B8
|
||||
JParticle__JPASetRMtxSTVecfromMtx = .text:0x80323480; // type:function size:0x1BC
|
||||
JParticle__JPACalcKeyAnmValue = .text:0x80323640; // type:function size:0xC4
|
||||
fn_80323710 = .text:0x80323710; // type:function size:0x18
|
||||
fn_80323730 = .text:0x80323730; // type:function size:0x64
|
||||
fn_803237A0 = .text:0x803237A0; // type:function size:0x70
|
||||
JSUPtrList__initiate = .text:0x80323810; // type:function size:0x14
|
||||
fn_80323830 = .text:0x80323830; // type:function size:0x24
|
||||
JSUList__append = .text:0x80323860; // type:function size:0xAC
|
||||
JSUPtrList__prepend = .text:0x80323910; // type:function size:0xAC
|
||||
JSUList__remove = .text:0x803239C0; // type:function size:0xAC
|
||||
__ct__18JPAResourceManagerFPCvPQ23EGG4Heap = .text:0x80316A30; // type:function size:0x58
|
||||
getResource__18JPAResourceManagerCFUs = .text:0x80316A90; // type:function size:0x48
|
||||
swapTexture__18JPAResourceManagerFPCQ23EGG7ResTIMGPCc = .text:0x80316AE0; // type:function size:0xA0
|
||||
registRes__18JPAResourceManagerFP11JPAResource = .text:0x80316B80; // type:function size:0x20
|
||||
registTex__18JPAResourceManagerFP10JPATexture = .text:0x80316BA0; // type:function size:0x20
|
||||
getResUserWork__18JPAResourceManagerCFUs = .text:0x80316BC0; // type:function size:0x44
|
||||
__ct__11JPAResourceFv = .text:0x80316C10; // type:function size:0x70
|
||||
init__11JPAResourceFPQ23EGG4Heap = .text:0x80316C80; // type:function size:0x1690
|
||||
calc__11JPAResourceFP18JPAEmitterWorkDataP14JPABaseEmitter = .text:0x80318310; // type:function size:0x544
|
||||
prepare__12JPAFieldBaseFP18JPAEmitterWorkDataP13JPAFieldBlock = .text:0x80318860; // type:function size:0x4
|
||||
draw__11JPAResourceFP18JPAEmitterWorkDataP14JPABaseEmitter = .text:0x80318870; // type:function size:0xF0
|
||||
drawP__11JPAResourceFP18JPAEmitterWorkData = .text:0x80318960; // type:function size:0x324
|
||||
drawC__11JPAResourceFP18JPAEmitterWorkData = .text:0x80318C90; // type:function size:0x2E8
|
||||
setPTev__11JPAResourceFv = .text:0x80318F80; // type:function size:0x29C
|
||||
setCTev__11JPAResourceFP18JPAEmitterWorkData = .text:0x80319220; // type:function size:0x16C
|
||||
calc_p__11JPAResourceFP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319390; // type:function size:0x7C
|
||||
calc_c__11JPAResourceFP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319410; // type:function size:0x7C
|
||||
calcField__11JPAResourceFP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319490; // type:function size:0x7C
|
||||
calcKey__11JPAResourceFP18JPAEmitterWorkData = .text:0x80319510; // type:function size:0x140
|
||||
calcWorkData_c__11JPAResourceFP18JPAEmitterWorkData = .text:0x80319650; // type:function size:0x1C4
|
||||
calcWorkData_d__11JPAResourceFP18JPAEmitterWorkData = .text:0x80319820; // type:function size:0x80
|
||||
JPASetPointSize__FP18JPAEmitterWorkData = .text:0x803198A0; // type:function size:0x40
|
||||
JPASetLineWidth__FP18JPAEmitterWorkData = .text:0x803198E0; // type:function size:0x40
|
||||
JPASetPointSize__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319920; // type:function size:0x48
|
||||
JPASetLineWidth__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319970; // type:function size:0x48
|
||||
JPARegistPrm__FP18JPAEmitterWorkData = .text:0x803199C0; // type:function size:0x9C
|
||||
JPARegistEnv__FP18JPAEmitterWorkData = .text:0x80319A60; // type:function size:0x84
|
||||
JPARegistPrmEnv__FP18JPAEmitterWorkData = .text:0x80319AF0; // type:function size:0x118
|
||||
JPARegistAlpha__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319C10; // type:function size:0xAC
|
||||
JPARegistPrmAlpha__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319CC0; // type:function size:0xAC
|
||||
JPARegistPrmAlphaEnv__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319D70; // type:function size:0x128
|
||||
JPARegistAlphaEnv__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319EA0; // type:function size:0x128
|
||||
JPARegistEnv__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80319FD0; // type:function size:0x84
|
||||
JPACalcClrIdxNormal__FP18JPAEmitterWorkData = .text:0x8031A060; // type:function size:0x2C
|
||||
JPACalcClrIdxNormal__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A090; // type:function size:0x28
|
||||
JPACalcClrIdxRepeat__FP18JPAEmitterWorkData = .text:0x8031A0C0; // type:function size:0x30
|
||||
JPACalcClrIdxRepeat__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A0F0; // type:function size:0x3C
|
||||
JPACalcClrIdxReverse__FP18JPAEmitterWorkData = .text:0x8031A130; // type:function size:0x40
|
||||
JPACalcClrIdxReverse__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A170; // type:function size:0x4C
|
||||
JPACalcClrIdxMerge__FP18JPAEmitterWorkData = .text:0x8031A1C0; // type:function size:0xC
|
||||
JPACalcClrIdxMerge__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A1D0; // type:function size:0x70
|
||||
JPACalcClrIdxRandom__FP18JPAEmitterWorkData = .text:0x8031A240; // type:function size:0xC
|
||||
JPACalcClrIdxRandom__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A250; // type:function size:0x34
|
||||
JPACalcPrm__FP18JPAEmitterWorkData = .text:0x8031A290; // type:function size:0x3C
|
||||
JPACalcPrm__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A2D0; // type:function size:0x38
|
||||
JPACalcEnv__FP18JPAEmitterWorkData = .text:0x8031A310; // type:function size:0x3C
|
||||
JPACalcEnv__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A350; // type:function size:0x38
|
||||
JPACalcColorCopy__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A390; // type:function size:0x48
|
||||
JPAGenTexCrdMtxIdt__FP18JPAEmitterWorkData = .text:0x8031A3E0; // type:function size:0x1C
|
||||
JPAGenTexCrdMtxAnm__FP18JPAEmitterWorkData = .text:0x8031A400; // type:function size:0x1C
|
||||
JPAGenTexCrdMtxPrj__FP18JPAEmitterWorkData = .text:0x8031A420; // type:function size:0x1C
|
||||
JPAGenCalcTexCrdMtxAnm__FP18JPAEmitterWorkData = .text:0x8031A440; // type:function size:0x244
|
||||
JPALoadCalcTexCrdMtxAnm__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A690; // type:function size:0x22C
|
||||
fn_8031A8C0__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A8C0; // type:function size:0x4C
|
||||
JPALoadTex__FP18JPAEmitterWorkData = .text:0x8031A910; // type:function size:0x38
|
||||
JPALoadTexAnm__FP18JPAEmitterWorkData = .text:0x8031A950; // type:function size:0x34
|
||||
JPALoadTexAnm__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031A990; // type:function size:0x30
|
||||
JPACalcTexIdxNormal__FP18JPAEmitterWorkData = .text:0x8031A9C0; // type:function size:0x3C
|
||||
JPACalcTexIdxNormal__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031AA00; // type:function size:0x38
|
||||
JPACalcTexIdxRepeat__FP18JPAEmitterWorkData = .text:0x8031AA40; // type:function size:0x38
|
||||
JPACalcTexIdxRepeat__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031AA80; // type:function size:0x44
|
||||
JPACalcTexIdxReverse__FP18JPAEmitterWorkData = .text:0x8031AAD0; // type:function size:0x50
|
||||
JPACalcTexIdxReverse__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031AB20; // type:function size:0x5C
|
||||
JPACalcTexIdxMerge__FP18JPAEmitterWorkData = .text:0x8031AB80; // type:function size:0x1C
|
||||
JPACalcTexIdxMerge__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031ABA0; // type:function size:0x78
|
||||
JPACalcTexIdxRandom__FP18JPAEmitterWorkData = .text:0x8031AC20; // type:function size:0x1C
|
||||
JPACalcTexIdxRandom__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031AC40; // type:function size:0x3C
|
||||
JPALoadPosMtxCam__FP18JPAEmitterWorkData = .text:0x8031AC80; // type:function size:0xC
|
||||
noLoadPrj__FPC18JPAEmitterWorkDataPA4_Cf = .text:0x8031AC90; // type:function size:0x4
|
||||
loadPrj__FPC18JPAEmitterWorkDataPA4_Cf = .text:0x8031ACA0; // type:function size:0x38
|
||||
loadPrjAnm__FPC18JPAEmitterWorkDataPA4_Cf = .text:0x8031ACE0; // type:function size:0x260
|
||||
JPADrawBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031AF40; // type:function size:0xE8
|
||||
JPADrawRotBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031B030; // type:function size:0x158
|
||||
JPADrawYBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031B190; // type:function size:0xFC
|
||||
JPADrawRotYBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031B290; // type:function size:0x170
|
||||
dirTypeVel__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ23EGG8Vector3f = .text:0x8031B400; // type:function size:0x1C
|
||||
dirTypePos__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ23EGG8Vector3f = .text:0x8031B420; // type:function size:0x1C
|
||||
dirTypePosInv__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ23EGG8Vector3f = .text:0x8031B440; // type:function size:0x48
|
||||
dirTypeEmtrDir__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ23EGG8Vector3f = .text:0x8031B490; // type:function size:0x1C
|
||||
dirTypePrevPtcl__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ23EGG8Vector3f = .text:0x8031B4B0; // type:function size:0xA8
|
||||
rotTypeY__FffRA3_A4_f = .text:0x8031B560; // type:function size:0x40
|
||||
rotTypeX__FffRA3_A4_f = .text:0x8031B5A0; // type:function size:0x40
|
||||
rotTypeZ__FffRA3_A4_f = .text:0x8031B5E0; // type:function size:0x40
|
||||
rotTypeXYZ__FffRA3_A4_f = .text:0x8031B620; // type:function size:0x5C
|
||||
basePlaneTypeXY__FPA4_fff = .text:0x8031B680; // type:function size:0x4C
|
||||
basePlaneTypeXZ__FPA4_fff = .text:0x8031B6D0; // type:function size:0x4C
|
||||
basePlaneTypeX__FPA4_fff = .text:0x8031B720; // type:function size:0x70
|
||||
JPADrawDirection__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031B790; // type:function size:0x278
|
||||
JPADrawRotDirection__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031BA10; // type:function size:0x31C
|
||||
JPADrawDBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031BD30; // type:function size:0x1D0
|
||||
JPADrawRotation__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031BF00; // type:function size:0x178
|
||||
JPADrawPoint__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031C080; // type:function size:0xA0
|
||||
JPADrawLine__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031C120; // type:function size:0x174
|
||||
getNext__FP26JPANode<15JPABaseParticle> = .text:0x8031C2A0; // type:function size:0x8
|
||||
getPrev__FP26JPANode<15JPABaseParticle> = .text:0x8031C2B0; // type:function size:0x8
|
||||
fn_8031C2C0__FP18JPAEmitterWorkData = .text:0x8031C2C0; // type:function size:0x4C
|
||||
JPADrawStripe__FP18JPAEmitterWorkData = .text:0x8031C310; // type:function size:0x4CC
|
||||
JPADrawStripeX__FP18JPAEmitterWorkData = .text:0x8031C7E0; // type:function size:0x844
|
||||
JPADrawEmitterCallBackB__FP18JPAEmitterWorkData = .text:0x8031D030; // type:function size:0x24
|
||||
JPADrawParticleCallBack__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D060; // type:function size:0x2C
|
||||
makeColorTable__FPP8_GXColorPC16JPAClrAnmKeyDataUcsPQ23EGG4Heap = .text:0x8031D090; // type:function size:0x250
|
||||
__ct__12JPABaseShapeFPCUcPQ23EGG4Heap = .text:0x8031D2E0; // type:function size:0x110
|
||||
setGX__12JPABaseShapeCFP18JPAEmitterWorkData = .text:0x8031D3F0; // type:function size:0x14C
|
||||
JPACalcScaleX__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D540; // type:function size:0x78
|
||||
JPACalcScaleY__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D5C0; // type:function size:0x78
|
||||
JPACalcScaleCopy__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D640; // type:function size:0xC
|
||||
JPACalcScaleAnmNormal__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D650; // type:function size:0xC
|
||||
JPACalcScaleAnmRepeatX__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D660; // type:function size:0x64
|
||||
JPACalcScaleAnmRepeatY__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D6D0; // type:function size:0x64
|
||||
JPACalcScaleAnmReverseX__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D740; // type:function size:0x94
|
||||
JPACalcScaleAnmReverseY__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D7E0; // type:function size:0x94
|
||||
JPACalcAlphaAnm__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D880; // type:function size:0x90
|
||||
JPACalcAlphaFlickAnm__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031D910; // type:function size:0x148
|
||||
__ct__13JPAExtraShapeFPCUc = .text:0x8031DA60; // type:function size:0x34
|
||||
init__13JPAExtraShapeFv = .text:0x8031DAA0; // type:function size:0xF8
|
||||
fn_8031DBA0__FP18JPAEmitterWorkData = .text:0x8031DBA0; // type:function size:0x18
|
||||
JPARegistChildPrmEnv__FP18JPAEmitterWorkData = .text:0x8031DBC0; // type:function size:0x114
|
||||
JPACalcChildAlphaOut__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031DCE0; // type:function size:0x30
|
||||
JPACalcChildScaleOut__FP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8031DD10; // type:function size:0x28
|
||||
__ct__13JPAChildShapeFPCUc = .text:0x8031DD40; // type:function size:0x8
|
||||
JPALoadExTex__FP18JPAEmitterWorkData = .text:0x8031DD50; // type:function size:0x114
|
||||
__ct__13JPAExTexShapeFPCUc = .text:0x8031DE70; // type:function size:0x8
|
||||
fn_8031DE80__13JPAExTexShapeCFPC12JPABaseShapef = .text:0x8031DE80; // type:function size:0x214
|
||||
JPAVolumePoint__FP18JPAEmitterWorkData = .text:0x8031E0A0; // type:function size:0xD4
|
||||
JPAVolumeLine__FP18JPAEmitterWorkData = .text:0x8031E180; // type:function size:0x114
|
||||
JPAVolumeCircle__FP18JPAEmitterWorkData = .text:0x8031E2A0; // type:function size:0x204
|
||||
JPAVolumeCube__FP18JPAEmitterWorkData = .text:0x8031E4B0; // type:function size:0x104
|
||||
JPAVolumeSphere__FP18JPAEmitterWorkData = .text:0x8031E5C0; // type:function size:0x340
|
||||
JPAVolumeCylinder__FP18JPAEmitterWorkData = .text:0x8031E900; // type:function size:0x1DC
|
||||
JPAVolumeTorus__FP18JPAEmitterWorkData = .text:0x8031EAE0; // type:function size:0x238
|
||||
__ct__16JPADynamicsBlockFPCUc = .text:0x8031ED20; // type:function size:0x34
|
||||
init__16JPADynamicsBlockFv = .text:0x8031ED60; // type:function size:0xB4
|
||||
create__16JPADynamicsBlockFP18JPAEmitterWorkData = .text:0x8031EE20; // type:function size:0x200
|
||||
calcAffect__12JPAFieldBaseFP13JPAFieldBlockP15JPABaseParticle = .text:0x8031F020; // type:function size:0x150
|
||||
calcFadeAffect__12JPAFieldBaseCFP13JPAFieldBlockf = .text:0x8031F170; // type:function size:0x9C
|
||||
prepare__15JPAFieldGravityFP18JPAEmitterWorkDataP13JPAFieldBlock = .text:0x8031F210; // type:function size:0xB4
|
||||
calc__15JPAFieldGravityFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle = .text:0x8031F2D0; // type:function size:0xC
|
||||
prepare__11JPAFieldAirFP18JPAEmitterWorkDataP13JPAFieldBlock = .text:0x8031F2E0; // type:function size:0xE0
|
||||
calc__11JPAFieldAirFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle = .text:0x8031F3C0; // type:function size:0xAC
|
||||
prepare__14JPAFieldMagnetFP18JPAEmitterWorkDataP13JPAFieldBlock = .text:0x8031F470; // type:function size:0x6C
|
||||
calc__14JPAFieldMagnetFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle = .text:0x8031F4E0; // type:function size:0x94
|
||||
prepare__14JPAFieldNewtonFP18JPAEmitterWorkDataP13JPAFieldBlock = .text:0x8031F580; // type:function size:0x90
|
||||
calc__14JPAFieldNewtonFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle = .text:0x8031F610; // type:function size:0xE0
|
||||
prepare__14JPAFieldVortexFP18JPAEmitterWorkDataP13JPAFieldBlock = .text:0x8031F6F0; // type:function size:0x64
|
||||
calc__14JPAFieldVortexFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle = .text:0x8031F760; // type:function size:0x184
|
||||
prepare__18JPAFieldConvectionFP18JPAEmitterWorkDataP13JPAFieldBlock = .text:0x8031F8F0; // type:function size:0x118
|
||||
calc__18JPAFieldConvectionFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle = .text:0x8031FA10; // type:function size:0x1DC
|
||||
calc__14JPAFieldRandomFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle = .text:0x8031FBF0; // type:function size:0x10C
|
||||
calc__12JPAFieldDragFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle = .text:0x8031FD00; // type:function size:0x80
|
||||
prepare__12JPAFieldSpinFP18JPAEmitterWorkDataP13JPAFieldBlock = .text:0x8031FD80; // type:function size:0xA4
|
||||
calc__12JPAFieldSpinFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle = .text:0x8031FE30; // type:function size:0xE8
|
||||
__ct__13JPAFieldBlockFPCUcPQ23EGG4Heap = .text:0x8031FF20; // type:function size:0x38
|
||||
init__13JPAFieldBlockFPQ23EGG4Heap = .text:0x8031FF60; // type:function size:0x26C
|
||||
__dt__12JPAFieldSpinFv = .text:0x803201D0; // type:function size:0x40
|
||||
__dt__18JPAFieldConvectionFv = .text:0x80320210; // type:function size:0x40
|
||||
__dt__12JPAFieldDragFv = .text:0x80320250; // type:function size:0x40
|
||||
__dt__14JPAFieldRandomFv = .text:0x80320290; // type:function size:0x40
|
||||
__dt__14JPAFieldVortexFv = .text:0x803202D0; // type:function size:0x40
|
||||
__dt__14JPAFieldNewtonFv = .text:0x80320310; // type:function size:0x40
|
||||
__dt__14JPAFieldMagnetFv = .text:0x80320350; // type:function size:0x40
|
||||
__dt__11JPAFieldAirFv = .text:0x80320390; // type:function size:0x40
|
||||
__dt__15JPAFieldGravityFv = .text:0x803203D0; // type:function size:0x40
|
||||
__ct__11JPAKeyBlockFPCUc = .text:0x80320410; // type:function size:0x10
|
||||
calc__11JPAKeyBlockFf = .text:0x80320420; // type:function size:0x94
|
||||
__ct__10JPATextureFPCUc = .text:0x803204C0; // type:function size:0x60
|
||||
__dt__10JPATextureFv = .text:0x80320520; // type:function size:0x5C
|
||||
__ct__17JPAResourceLoaderFPCUcP18JPAResourceManager = .text:0x80320580; // type:function size:0x40
|
||||
load_jpc__17JPAResourceLoaderFPCUcP18JPAResourceManager = .text:0x803205C0; // type:function size:0x3C0
|
||||
__ct__17JPAEmitterManagerFUlUlPQ23EGG4HeapUcUc = .text:0x80320980; // type:function size:0x204
|
||||
__dt__25JSUList<14JPABaseEmitter>Fv = .text:0x80320B90; // type:function size:0x58
|
||||
__ct__14JPABaseEmitterFv = .text:0x80320BF0; // type:function size:0x58
|
||||
__dt__14JPABaseEmitterFv = .text:0x80320C50; // type:function size:0x60
|
||||
__ct__25JSUList<14JPABaseEmitter>Fv = .text:0x80320CB0; // type:function size:0x30
|
||||
__ct__26JPANode<15JPABaseParticle>Fv = .text:0x80320CE0; // type:function size:0x10
|
||||
__dt__26JPANode<15JPABaseParticle>Fv = .text:0x80320CF0; // type:function size:0x40
|
||||
createSimpleEmitterID__17JPAEmitterManagerFRCQ23EGG8Vector3fUsUcUcP18JPAEmitterCallBackP19JPAParticleCallBack = .text:0x80320D30; // type:function size:0xE4
|
||||
fn_80320E20__17JPAEmitterManagerFUcff = .text:0x80320E20; // type:function size:0xB8
|
||||
calc__17JPAEmitterManagerFUc = .text:0x80320EE0; // type:function size:0x88
|
||||
draw__17JPAEmitterManagerFPC11JPADrawInfoUc = .text:0x80320F70; // type:function size:0x204
|
||||
forceDeleteAllEmitter__17JPAEmitterManagerFv = .text:0x80321180; // type:function size:0x58
|
||||
forceDeleteGroupEmitter__17JPAEmitterManagerFUc = .text:0x803211E0; // type:function size:0x5C
|
||||
forceDeleteEmitter__17JPAEmitterManagerFP14JPABaseEmitter = .text:0x80321240; // type:function size:0x6C
|
||||
entryResourceManager__17JPAEmitterManagerFP18JPAResourceManagerUc = .text:0x803212B0; // type:function size:0x10
|
||||
clearResourceManager__17JPAEmitterManagerFUc = .text:0x803212C0; // type:function size:0xA8
|
||||
calcYBBCam__17JPAEmitterManagerFv = .text:0x80321370; // type:function size:0xD4
|
||||
__dt__18JPAEmitterCallBackFv = .text:0x80321450; // type:function size:0x40
|
||||
init__14JPABaseEmitterFP17JPAEmitterManagerP11JPAResource = .text:0x80321490; // type:function size:0x294
|
||||
createParticle__14JPABaseEmitterFv = .text:0x80321730; // type:function size:0x120
|
||||
createChild__14JPABaseEmitterFP15JPABaseParticle = .text:0x80321850; // type:function size:0xFC
|
||||
deleteAllParticle__14JPABaseEmitterFv = .text:0x80321950; // type:function size:0x160
|
||||
processTillStartFrame__14JPABaseEmitterFv = .text:0x80321AB0; // type:function size:0x40
|
||||
processTermination__14JPABaseEmitterFv = .text:0x80321AF0; // type:function size:0x98
|
||||
calcEmitterGlobalPosition__14JPABaseEmitterCFPQ23EGG8Vector3f = .text:0x80321B90; // type:function size:0x80
|
||||
getCurrentCreateNumber__14JPABaseEmitterCFv = .text:0x80321C10; // type:function size:0x10
|
||||
loadTexture__14JPABaseEmitterFUc11_GXTexMapID = .text:0x80321C20; // type:function size:0x54
|
||||
__dt__19JPAParticleCallBackFv = .text:0x80321C80; // type:function size:0x40
|
||||
init_p__15JPABaseParticleFP18JPAEmitterWorkData = .text:0x80321CC0; // type:function size:0x7B8
|
||||
init_c__15JPABaseParticleFP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x80322480; // type:function size:0x654
|
||||
calc_p__15JPABaseParticleFP18JPAEmitterWorkData = .text:0x80322AE0; // type:function size:0x28C
|
||||
calc_c__15JPABaseParticleFP18JPAEmitterWorkData = .text:0x80322D70; // type:function size:0x258
|
||||
canCreateChild__15JPABaseParticleFP18JPAEmitterWorkData = .text:0x80322FD0; // type:function size:0x80
|
||||
JPAGetDirMtx__FRCQ23EGG8Vector3fPA4_f = .text:0x80323050; // type:function size:0x13C
|
||||
JPAGetYZRotateMtx__FssPA4_f = .text:0x80323190; // type:function size:0x128
|
||||
JPAGetXYZRotateMtx__FsssPA4_f = .text:0x803232C0; // type:function size:0x1B8
|
||||
JPASetRMtxSTVecfromMtx__FPA4_CfPA4_fPQ23EGG8Vector3fPQ23EGG8Vector3f = .text:0x80323480; // type:function size:0x1BC
|
||||
JPACalcKeyAnmValue__FfUsPCf = .text:0x80323640; // type:function size:0xC4
|
||||
__ct__10JSUPtrLinkFPv = .text:0x80323710; // type:function size:0x18
|
||||
__dt__10JSUPtrLinkFv = .text:0x80323730; // type:function size:0x64
|
||||
__dt__10JSUPtrListFv = .text:0x803237A0; // type:function size:0x70
|
||||
initiate__10JSUPtrListFv = .text:0x80323810; // type:function size:0x14
|
||||
setFirst__10JSUPtrListFP10JSUPtrLink = .text:0x80323830; // type:function size:0x24
|
||||
append__10JSUPtrListFP10JSUPtrLink = .text:0x80323860; // type:function size:0xAC
|
||||
prepend__10JSUPtrListFP10JSUPtrLink = .text:0x80323910; // type:function size:0xAC
|
||||
remove__10JSUPtrListFP10JSUPtrLink = .text:0x803239C0; // type:function size:0xAC
|
||||
LMSi_AnalyzeMessageHeader = .text:0x80323A70; // type:function size:0x68
|
||||
LMSi_AnalyzeMessageBlocks = .text:0x80323AE0; // type:function size:0xAC
|
||||
LMSi_AnalyzeMessageBinary = .text:0x80323B90; // type:function size:0x34
|
||||
@@ -36210,26 +36210,26 @@ lbl_80546548 = .data:0x80546548; // type:object size:0x200 data:4byte
|
||||
lbl_80546748 = .data:0x80546748; // type:object size:0x190
|
||||
lbl_805468D8 = .data:0x805468D8; // type:object size:0x3F0
|
||||
lbl_80546CC8 = .data:0x80546CC8; // type:object size:0x98
|
||||
lbl_80546D60 = .data:0x80546D60; // type:object size:0x160
|
||||
lbl_80546D60 = .data:0x80546D60; // type:object size:0x144
|
||||
JParticle__jpa_crd = .data:0x80546EC0; // type:object size:0x20
|
||||
jumptable_80546EE0 = .data:0x80546EE0; // type:object size:0x2C scope:local
|
||||
jumptable_80546F0C = .data:0x80546F0C; // type:object size:0x2C scope:local
|
||||
jumptable_80546F38 = .data:0x80546F38; // type:object size:0x48 scope:local
|
||||
jpa_dl = .data:0x80546F80; // type:object size:0x20
|
||||
jumptable_80546F38 = .data:0x80546F38; // type:object size:0x2C scope:local
|
||||
jpa_dl = .data:0x80546F80; // type:object size:0x20 align:32
|
||||
jpa_dl_x = .data:0x80546FA0; // type:object size:0x20
|
||||
p_prj = .data:0x80546FC0; // type:object size:0xC
|
||||
p_direction = .data:0x80546FCC; // type:object size:0x1B4
|
||||
jumptable_80547180 = .data:0x80547180; // type:object size:0x24 scope:local
|
||||
lbl_805471A4 = .data:0x805471A4; // type:object size:0x14
|
||||
lbl_805471B8 = .data:0x805471B8; // type:object size:0x14
|
||||
lbl_805471CC = .data:0x805471CC; // type:object size:0x14
|
||||
lbl_805471E0 = .data:0x805471E0; // type:object size:0x14
|
||||
lbl_805471F4 = .data:0x805471F4; // type:object size:0x14
|
||||
lbl_80547208 = .data:0x80547208; // type:object size:0x14
|
||||
lbl_8054721C = .data:0x8054721C; // type:object size:0x14
|
||||
lbl_80547230 = .data:0x80547230; // type:object size:0x14
|
||||
lbl_80547244 = .data:0x80547244; // type:object size:0x14
|
||||
lbl_80547258 = .data:0x80547258; // type:object size:0x10
|
||||
__vt__12JPAFieldSpin = .data:0x805471A4; // type:object size:0x14
|
||||
__vt__18JPAFieldConvection = .data:0x805471B8; // type:object size:0x14
|
||||
__vt__12JPAFieldDrag = .data:0x805471CC; // type:object size:0x14
|
||||
__vt__14JPAFieldRandom = .data:0x805471E0; // type:object size:0x14
|
||||
__vt__14JPAFieldVortex = .data:0x805471F4; // type:object size:0x14
|
||||
__vt__14JPAFieldNewton = .data:0x80547208; // type:object size:0x14
|
||||
__vt__14JPAFieldMagnet = .data:0x8054721C; // type:object size:0x14
|
||||
__vt__11JPAFieldAir = .data:0x80547230; // type:object size:0x14
|
||||
__vt__15JPAFieldGravity = .data:0x80547244; // type:object size:0x14
|
||||
lbl_80547258 = .data:0x80547258; // type:object size:0xC
|
||||
lbl_80547268 = .data:0x80547268; // type:object size:0x9 scope:local data:string
|
||||
lbl_80547278 = .data:0x80547278; // type:object size:0x9 scope:local data:string
|
||||
lbl_80547288 = .data:0x80547288; // type:object size:0x100
|
||||
|
||||
+22
-16
@@ -331,6 +331,7 @@ def JSystemLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
|
||||
# probably?
|
||||
"mw_version": "Wii/1.5",
|
||||
"cflags": cflags_framework,
|
||||
"scratch_preset_id": 169,
|
||||
"progress_category": "jsystem",
|
||||
"host": False,
|
||||
"objects": objects,
|
||||
@@ -1208,22 +1209,27 @@ config.libs = [
|
||||
JSystemLib(
|
||||
"JParticle",
|
||||
[
|
||||
Object(NonMatching, "JSystem/JParticle/JPAResourceManager.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAResource.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPABaseShape.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAExtraShape.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAChildShape.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAExTexShape.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPADynamicsBlock.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAFieldBlock.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAKeyBlock.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPATexture.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAResourceLoader.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAEmitterManager.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAEmitter.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAParticle.cpp"),
|
||||
Object(NonMatching, "JSystem/JParticle/JPAMath.cpp"),
|
||||
Object(NonMatching, "JSystem/JSupport/JSUList.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAResourceManager.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAResource.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPABaseShape.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAExtraShape.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAChildShape.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAExTexShape.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPADynamicsBlock.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAFieldBlock.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAKeyBlock.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPATexture.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAResourceLoader.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAEmitterManager.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAEmitter.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAParticle.cpp"),
|
||||
Object(Matching, "JSystem/JParticle/JPAMath.cpp"),
|
||||
],
|
||||
),
|
||||
JSystemLib(
|
||||
"JSupport",
|
||||
[
|
||||
Object(Matching, "JSystem/JSupport/JSUList.cpp"),
|
||||
],
|
||||
),
|
||||
JSystemLib(
|
||||
|
||||
@@ -0,0 +1,510 @@
|
||||
#ifndef JGEOMETRY_H
|
||||
#define JGEOMETRY_H
|
||||
|
||||
#include "common.h"
|
||||
#include "math.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
|
||||
// TODO - a lot of this has been moved to nw4r and egg. Kept for reference for now.
|
||||
|
||||
namespace JGeometry {
|
||||
|
||||
template<typename T>
|
||||
struct TUtil {
|
||||
static inline T clamp(T v, T min, T max) {
|
||||
if (v < min) {
|
||||
return min;
|
||||
}
|
||||
if (v > max) {
|
||||
return max;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct TUtil<f32> {
|
||||
static inline f32 clamp(f32 v, f32 min, f32 max) {
|
||||
if (v < min) {
|
||||
return min;
|
||||
}
|
||||
if (v > max) {
|
||||
return max;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
static inline f32 epsilon() { return 32.0f * FLT_EPSILON; }
|
||||
static inline f32 PI() { return 3.1415927f; }
|
||||
static inline f32 inv_sqrt(f32 x) {
|
||||
if (x <= 0.0f) {
|
||||
return x;
|
||||
}
|
||||
f32 root = __frsqrte(x);
|
||||
root = 0.5f * root * (3.0f - x * (root * root));
|
||||
return root;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct TUtil<double> {
|
||||
static inline double epsilon() { return 32.0f * FLT_EPSILON; }
|
||||
static inline double one() { return 1.0; }
|
||||
static inline double atan2(double x, double y) { return ::atan2(x, y); }
|
||||
static inline double asin(double x) { return ::asin(x); }
|
||||
static inline double halfPI() { return 1.5707963267948966; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TVec3 {
|
||||
T x;
|
||||
T y;
|
||||
T z;
|
||||
|
||||
void set(const TVec3& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TVec3<double> {
|
||||
double x, y, z;
|
||||
|
||||
void set(double x_, double y_, double z_) {
|
||||
x = x_;
|
||||
y = y_;
|
||||
z = z_;
|
||||
}
|
||||
|
||||
inline TVec3<double>& operator*=(double b) {
|
||||
scale(b);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void scale(double b) {
|
||||
x *= b;
|
||||
y *= b;
|
||||
z *= b;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TVec3<s16> {
|
||||
s16 x, y, z;
|
||||
|
||||
TVec3() {}
|
||||
|
||||
TVec3(s16 x, s16 y, s16 z) {
|
||||
set(x, y, z);
|
||||
}
|
||||
|
||||
TVec3& operator=(const TVec3& b) {
|
||||
// Force copies to use lwz/lha
|
||||
*((s32*)this) = *((s32*)&b);
|
||||
z = b.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void set(s16 x_, s16 y_, s16 z_) {
|
||||
x = x_;
|
||||
y = y_;
|
||||
z = z_;
|
||||
}
|
||||
};
|
||||
|
||||
inline void setTVec3f(const f32* vec_a, f32* vec_b) {
|
||||
const register f32* v_a = vec_a;
|
||||
register f32* v_b = vec_b;
|
||||
|
||||
register f32 a_x;
|
||||
register f32 b_x;
|
||||
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l a_x, 0(v_a), 0, 0
|
||||
lfs b_x, 8(v_a)
|
||||
psq_st a_x, 0(v_b), 0, 0
|
||||
stfs b_x, 8(v_b)
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
// Until we figure out TVec3 ctors
|
||||
inline void setTVec3f(const Vec& vec_a, Vec& vec_b) {
|
||||
setTVec3f(&vec_a.x, &vec_b.x);
|
||||
}
|
||||
|
||||
inline float fsqrt_step(float mag) {
|
||||
f32 root = __frsqrte(mag);
|
||||
return 0.5f * root * (3.0f - mag * (root * root));
|
||||
}
|
||||
|
||||
inline void mulInternal(register const f32* a, register const f32* b, register float* dst) {
|
||||
register f32 a_x_y;
|
||||
register f32 b_x_y;
|
||||
register f32 x_y;
|
||||
register f32 za;
|
||||
register f32 zb;
|
||||
register f32 z;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l a_x_y, 0(a), 0, 0
|
||||
psq_l b_x_y, 0(b), 0, 0
|
||||
ps_mul x_y, a_x_y, b_x_y
|
||||
psq_st x_y, 0(dst), 0, 0
|
||||
};
|
||||
dst[2] = a[2] * b[2];
|
||||
#endif
|
||||
}
|
||||
|
||||
template <>
|
||||
struct TVec3<f32> : public Vec {
|
||||
inline TVec3(const Vec& i_vec) {
|
||||
setTVec3f(&i_vec.x, &x);
|
||||
}
|
||||
|
||||
inline TVec3(const TVec3<f32>& i_vec) {
|
||||
setTVec3f(&i_vec.x, &x);
|
||||
}
|
||||
|
||||
template<class U>
|
||||
TVec3(U x, U y, U z) {
|
||||
set(x, y, z);
|
||||
}
|
||||
|
||||
TVec3() {}
|
||||
|
||||
operator Vec*() { return (Vec*)&x; }
|
||||
operator const Vec*() const { return (Vec*)&x; }
|
||||
|
||||
template<class U>
|
||||
void set(const TVec3<U>& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
}
|
||||
|
||||
void set(const Vec& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
}
|
||||
|
||||
template<class U>
|
||||
void set(U x_, U y_, U z_) {
|
||||
x = x_;
|
||||
y = y_;
|
||||
z = z_;
|
||||
}
|
||||
|
||||
inline void add(const TVec3<f32>& b) {
|
||||
JMathInlineVEC::C_VECAdd((Vec*)&x, (Vec*)&b.x, (Vec*)&x);
|
||||
}
|
||||
|
||||
void zero() { x = y = z = 0.0f; }
|
||||
|
||||
void mul(const TVec3<f32>& a, const TVec3<f32>& b) {
|
||||
mulInternal(&a.x, &b.x, &this->x);
|
||||
}
|
||||
|
||||
inline void mul(const TVec3<f32>& a) {
|
||||
mul(*this, a);
|
||||
}
|
||||
|
||||
inline TVec3<f32>& operator=(const Vec& b) {
|
||||
setTVec3f(&b.x, &this->x);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline TVec3<f32>& operator=(const TVec3<f32>& b) {
|
||||
set(b.x, b.y, b.z);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline TVec3<f32>& operator+=(const TVec3<f32>& b) {
|
||||
add(b);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline TVec3<f32> operator+(const TVec3<f32>& b) {
|
||||
TVec3<f32> a = *this;
|
||||
a += b;
|
||||
return a;
|
||||
}
|
||||
|
||||
// inline TVec3<f32> operator+(const TVec3<f32>& b) {
|
||||
// TVec3<f32> res(*(Vec*)this);
|
||||
// res += b;
|
||||
// return res;
|
||||
// }
|
||||
|
||||
f32 squared() const {
|
||||
return JMathInlineVEC::C_VECSquareMag((Vec*)&x);
|
||||
}
|
||||
|
||||
f32 normalize() {
|
||||
f32 sq = squared();
|
||||
if (sq <= TUtil<f32>::epsilon()) {
|
||||
return 0.0f;
|
||||
}
|
||||
f32 inv_norm = TUtil<f32>::inv_sqrt(sq);
|
||||
scale(inv_norm);
|
||||
return inv_norm * sq;
|
||||
}
|
||||
|
||||
void normalize(const TVec3<f32>& other) {
|
||||
f32 sq = other.squared();
|
||||
if (sq <= TUtil<f32>::epsilon()) {
|
||||
zero();
|
||||
return;
|
||||
}
|
||||
f32 norm;
|
||||
if (sq <= 0.0f) {
|
||||
norm = sq;
|
||||
} else {
|
||||
norm = fsqrt_step(sq);
|
||||
}
|
||||
scale(norm, other);
|
||||
}
|
||||
|
||||
f32 length() const {
|
||||
return VECMag((Vec*)this);
|
||||
}
|
||||
|
||||
void scale(register f32 sc) {
|
||||
register f32 z;
|
||||
register f32 x_y;
|
||||
register f32* dst = &x;
|
||||
register f32 zres;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l x_y, 0(dst), 0, 0
|
||||
psq_l z, 8(dst), 1, 0
|
||||
ps_muls0 x_y, x_y, sc
|
||||
psq_st x_y, 0(dst), 0, 0
|
||||
ps_muls0 zres, z, sc
|
||||
psq_st zres, 8(dst), 1, 0
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
void scale(register f32 sc, const TVec3<f32>& other) {
|
||||
register const f32* src = &other.x;
|
||||
register f32 z;
|
||||
register f32 x_y;
|
||||
register f32* dst = &x;
|
||||
register f32 zres;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l x_y, 0(src), 0, 0
|
||||
psq_l z, 8(src), 1, 0
|
||||
ps_muls0 x_y, x_y, sc
|
||||
psq_st x_y, 0(dst), 0, 0
|
||||
ps_muls0 zres, z, sc
|
||||
psq_st zres, 8(dst), 1, 0
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
void scaleAdd(register f32 sc, const TVec3<f32>& a, const TVec3<f32>& b) {
|
||||
JMAVECScaleAdd(&a, &b, this, sc);
|
||||
}
|
||||
|
||||
void negateInternal(TVec3<f32>* dst) {
|
||||
register f32* rdst = &dst->x;
|
||||
const register f32* src = &x;
|
||||
register f32 x_y;
|
||||
register f32 z;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l x_y, 0(src), 0, 0
|
||||
ps_neg x_y, x_y
|
||||
psq_st x_y, 0(rdst), 0, 0
|
||||
lfs z, 8(src)
|
||||
fneg z, z
|
||||
stfs z, 8(rdst)
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
void negate() {
|
||||
negateInternal(this);
|
||||
}
|
||||
|
||||
void sub(const TVec3<f32>& b) {
|
||||
JMathInlineVEC::C_VECSubtract((Vec*)&x, (Vec*)&b.x, (Vec*)&x);
|
||||
}
|
||||
|
||||
void sub(const TVec3<f32>& a, const TVec3<f32>& b) {
|
||||
JMathInlineVEC::C_VECSubtract((Vec*)&a.x, (Vec*)&b.x, (Vec*)&x);
|
||||
}
|
||||
|
||||
bool isZero() const {
|
||||
return squared() <= TUtil<f32>::epsilon();
|
||||
}
|
||||
|
||||
void cross(const TVec3<f32>& a, const TVec3<f32>& b) {
|
||||
VECCrossProduct(a, b, *this);
|
||||
}
|
||||
|
||||
f32 setLength(f32 len) {
|
||||
f32 sq = squared();
|
||||
if (sq <= TUtil<f32>::epsilon()) {
|
||||
return 0.0f;
|
||||
}
|
||||
f32 inv_norm = TUtil<f32>::inv_sqrt(sq);
|
||||
scale(inv_norm * len);
|
||||
return inv_norm * sq;
|
||||
}
|
||||
|
||||
f32 setLength(const TVec3<f32>& other, f32 len) {
|
||||
f32 sq = other.squared();
|
||||
if (sq <= TUtil<f32>::epsilon()) {
|
||||
zero();
|
||||
return 0.0f;
|
||||
}
|
||||
f32 inv_norm = TUtil<f32>::inv_sqrt(sq);
|
||||
scale(inv_norm * len, other);
|
||||
return inv_norm * sq;
|
||||
}
|
||||
|
||||
f32 dot(const TVec3<f32>& other) const {
|
||||
return JMathInlineVEC::C_VECDotProduct(this, &other);
|
||||
}
|
||||
|
||||
void cubic(const TVec3<f32>& param_1, const TVec3<f32>& param_2, const TVec3<f32>& param_3,
|
||||
const TVec3<f32>& param_4, f32 param_5) {
|
||||
f32 fVar5 = param_5 * param_5;
|
||||
f32 fVar6 = fVar5 * param_5;
|
||||
f32 fVar8 = 1.0f + (2.0f * fVar6 - 3.0f * fVar5);
|
||||
f32 fVar9 = -2.0f * fVar6 + 3.0f * fVar5;
|
||||
f32 fVar7 = param_5 + (fVar6 - 2.0f * fVar5);
|
||||
f32 fVar4 = fVar6 - fVar5;
|
||||
x = fVar8 * param_1.x + fVar9 * param_4.x + fVar7 * param_2.x + fVar4 * param_3.x;
|
||||
y = fVar8 * param_1.y + fVar9 * param_4.y + fVar7 * param_2.y + fVar4 * param_3.y;
|
||||
z = fVar8 * param_1.z + fVar9 * param_4.z + fVar7 * param_2.z + fVar4 * param_3.z;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TVec2 {
|
||||
TVec2() {}
|
||||
TVec2(T v) { set(v); }
|
||||
TVec2(T x, T y) { set(x, y); }
|
||||
|
||||
void set(T v) { y = x = v; }
|
||||
|
||||
void set(T x, T y) {
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
}
|
||||
|
||||
void set(const TVec2& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
}
|
||||
|
||||
void setMin(const TVec2<f32>& min) {
|
||||
if (x >= min.x)
|
||||
x = min.x;
|
||||
if (y >= min.y)
|
||||
y = min.y;
|
||||
}
|
||||
|
||||
void setMax(const TVec2<f32>& max) {
|
||||
if (x <= max.x)
|
||||
x = max.x;
|
||||
if (y <= max.y)
|
||||
y = max.y;
|
||||
}
|
||||
|
||||
void add(const TVec2<T>& other) {
|
||||
x += other.x;
|
||||
y += other.y;
|
||||
}
|
||||
|
||||
bool isAbove(const TVec2<T>& other) const {
|
||||
return (x >= other.x) && (y >= other.y) ? true : false;
|
||||
}
|
||||
|
||||
f32 dot(const TVec2<T>& other) const {
|
||||
return x * other.x + y * other.y;
|
||||
}
|
||||
|
||||
f32 squared() const {
|
||||
return dot(*this);
|
||||
}
|
||||
|
||||
f32 length() const {
|
||||
f32 sqr = squared();
|
||||
if (sqr <= 0.0f) {
|
||||
return sqr;
|
||||
}
|
||||
sqr *= fsqrt_step(sqr);
|
||||
return sqr;
|
||||
}
|
||||
|
||||
T x;
|
||||
T y;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct TBox {
|
||||
TBox() : i(), f() {}
|
||||
TBox(const TBox& other) : i(other.i), f(other.f) {}
|
||||
|
||||
T i, f;
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
template<> struct TBox<TVec2<f32> > {
|
||||
f32 getWidth() const { return f.x - i.x; }
|
||||
f32 getHeight() const { return f.y - i.y; }
|
||||
|
||||
bool isValid() const { return f.isAbove(i); }
|
||||
|
||||
void addPos(f32 x, f32 y) {
|
||||
addPos(TVec2<f32>(x, y));
|
||||
}
|
||||
|
||||
void addPos(const TVec2<f32>& pos) {
|
||||
i.add(pos);
|
||||
f.add(pos);
|
||||
}
|
||||
|
||||
bool intersect(const TBox<TVec2<f32> >& other) {
|
||||
i.setMax(other.i);
|
||||
f.setMin(other.f);
|
||||
return isValid();
|
||||
}
|
||||
|
||||
TVec2<f32> i, f;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TBox2 : TBox<TVec2<T> > {
|
||||
TBox2() {}
|
||||
TBox2(const TVec2<f32>& i, const TVec2<f32>& f) { set(i, f); }
|
||||
TBox2(f32 x0, f32 y0, f32 x1, f32 y1) { set(x0, y0, x1, y1); }
|
||||
|
||||
void absolute() {
|
||||
if (!this->isValid()) {
|
||||
TBox2<T> box(*this);
|
||||
this->i.setMin(box.i);
|
||||
this->i.setMin(box.f);
|
||||
this->f.setMax(box.i);
|
||||
this->f.setMax(box.f);
|
||||
}
|
||||
}
|
||||
|
||||
void set(const TBox2& other) { set(other.i, other.f); }
|
||||
void set(const TVec2<f32>& i, const TVec2<f32>& f) { this->i.set(i), this->f.set(f); }
|
||||
void set(f32 x0, f32 y0, f32 x1, f32 y1) { this->i.set(x0, y0); this->f.set(x1, y1); }
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
} // namespace JGeometry
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,136 @@
|
||||
#ifndef JMATRIGONOMETRIC_H
|
||||
#define JMATRIGONOMETRIC_H
|
||||
|
||||
#include "common.h"
|
||||
#include "utility.h"
|
||||
|
||||
template<typename T>
|
||||
struct TAngleConstant_;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jmath
|
||||
*
|
||||
*/
|
||||
template<>
|
||||
struct TAngleConstant_<f32> {
|
||||
static f32 RADIAN_DEG090() { return 1.5707964f; }
|
||||
static f32 RADIAN_DEG180() { return 3.1415927f; }
|
||||
static f32 RADIAN_DEG360() { return 6.2831855f; }
|
||||
static f32 RADIAN_TO_DEGREE_FACTOR() { return 180.0f / RADIAN_DEG180(); }
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jmath
|
||||
*
|
||||
*/
|
||||
template<int N, typename T>
|
||||
struct TSinCosTable {
|
||||
std::pair<T, T> table[1 << N];
|
||||
|
||||
T sinShort(s16 v) const { return table[(u16)v >> (16U - N)].first; }
|
||||
T cosShort(s16 v) const { return table[(u16)v >> (16U - N)].second; }
|
||||
|
||||
inline T sinLap(T v) {
|
||||
if (v < (T)0.0) {
|
||||
return -table[(u16)(-(T)(1 << N) * v) & ((1 << N) - 1)].first;
|
||||
}
|
||||
return table[(u16)((T)(1 << N) * v) & ((1 << N) - 1)].first;
|
||||
}
|
||||
|
||||
inline T sinDegree(T degree) {
|
||||
if (degree < (T)0.0) {
|
||||
return -table[(u16)(-((T)(1 << N) / (T)360.0) * degree) & ((1 << N) - 1)].first;
|
||||
}
|
||||
return table[(u16)(((T)(1 << N) / (T)360.0) * degree) & ((1 << N) - 1)].first;
|
||||
}
|
||||
|
||||
inline T cosDegree(T degree) {
|
||||
if (degree < (T)0.0) {
|
||||
degree = -degree;
|
||||
}
|
||||
return table[(u16)(((T)(1 << N) / (T)360.0) * degree) & ((1 << N) - 1)].second;
|
||||
}
|
||||
|
||||
inline T sinRadian(T radian) {
|
||||
if (radian < (T)0.0) {
|
||||
return -table[(u16)(-(T)(1 << N) / TAngleConstant_<T>::RADIAN_DEG360() * radian) & ((1 << N) - 1)].first;
|
||||
}
|
||||
return table[(u16)((T)(1 << N) / TAngleConstant_<T>::RADIAN_DEG360() * radian) & ((1 << N) - 1)].first;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jmath
|
||||
*
|
||||
*/
|
||||
struct TAtanTable {
|
||||
f32 table[1025];
|
||||
u8 pad[0x1C];
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jmath
|
||||
*
|
||||
*/
|
||||
struct TAsinAcosTable {
|
||||
f32 table[1025];
|
||||
u8 pad[0x1C];
|
||||
|
||||
f32 acos_(f32 x) {
|
||||
if (x >= 1.0f) {
|
||||
return 0.0f;
|
||||
} else if (x <= -1.0f) {
|
||||
return TAngleConstant_<f32>::RADIAN_DEG180();
|
||||
} else if (x < 0.0f) {
|
||||
return table[(u32)(-x * 1023.5f)] + TAngleConstant_<f32>::RADIAN_DEG090();
|
||||
} else {
|
||||
return TAngleConstant_<f32>::RADIAN_DEG090() - table[(u32)(x * 1023.5f)];
|
||||
}
|
||||
}
|
||||
|
||||
f32 acosDegree(f32 x) {
|
||||
return acos_(x) * TAngleConstant_<f32>::RADIAN_TO_DEGREE_FACTOR();
|
||||
}
|
||||
};
|
||||
|
||||
namespace JMath {
|
||||
extern TSinCosTable<13, f32> sincosTable_;
|
||||
extern TAtanTable atanTable_;
|
||||
extern TAsinAcosTable asinAcosTable_;
|
||||
|
||||
inline f32 acosDegree(f32 x) {
|
||||
return asinAcosTable_.acosDegree(x);
|
||||
}
|
||||
}; // namespace JMath
|
||||
|
||||
inline f32 JMASCosShort(s16 v) {
|
||||
return JMath::sincosTable_.cosShort(v);
|
||||
}
|
||||
inline f32 JMASinShort(s16 v) {
|
||||
return JMath::sincosTable_.sinShort(v);
|
||||
}
|
||||
|
||||
inline f32 JMASCos(s16 v) {
|
||||
return JMASCosShort(v);
|
||||
}
|
||||
inline f32 JMASSin(s16 v) {
|
||||
return JMASinShort(v);
|
||||
}
|
||||
|
||||
inline f32 JMASinLap(f32 v) {
|
||||
return JMath::sincosTable_.sinLap(v);
|
||||
}
|
||||
|
||||
inline f32 JMASinDegree(f32 degree) {
|
||||
return JMath::sincosTable_.sinDegree(degree);
|
||||
}
|
||||
|
||||
inline f32 JMACosDegree(f32 degree) {
|
||||
return JMath::sincosTable_.cosDegree(degree);
|
||||
}
|
||||
|
||||
inline f32 JMASinRadian(f32 radian) {
|
||||
return JMath::sincosTable_.sinRadian(radian);
|
||||
}
|
||||
|
||||
#endif /* JMATRIGONOMETRIC_H */
|
||||
@@ -0,0 +1,264 @@
|
||||
#ifndef JMATH_H
|
||||
#define JMATH_H
|
||||
|
||||
#include "common.h"
|
||||
#include "rvl/MTX.h"
|
||||
#include "math.h"
|
||||
|
||||
void JMAMTXApplyScale(const Mtx, Mtx, f32, f32, f32);
|
||||
void JMAEulerToQuat(s16 param_0, s16 param_1, s16 param_2, Quaternion* param_3);
|
||||
void JMAQuatLerp(const Quaternion*, const Quaternion*, f32, Quaternion*);
|
||||
void JMAFastVECNormalize(register const Vec* src, register Vec* dst);
|
||||
void JMAVECScaleAdd(register const Vec* vec1, register const Vec* vec2, register Vec* dst,
|
||||
register f32 scale);
|
||||
|
||||
inline int JMAAbs(int value) {
|
||||
return __abs(value);
|
||||
}
|
||||
|
||||
inline f32 JMAFastReciprocal(f32 value) {
|
||||
return __fres(value);
|
||||
}
|
||||
|
||||
inline float __frsqrtes(register double f) {
|
||||
register float out;
|
||||
// clang-format off
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
frsqrte out, f
|
||||
}
|
||||
#endif
|
||||
// clang-format on
|
||||
return out;
|
||||
}
|
||||
|
||||
inline f32 JMAFastSqrt(register f32 input) {
|
||||
if (input > 0.0f) {
|
||||
register f32 out;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
frsqrte out, input
|
||||
}
|
||||
#endif
|
||||
return out * input;
|
||||
} else {
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
||||
inline f32 JMAHermiteInterpolation(register f32 p1, register f32 p2, register f32 p3,
|
||||
register f32 p4, register f32 p5, register f32 p6,
|
||||
register f32 p7) {
|
||||
register f32 ff25;
|
||||
register f32 ff31;
|
||||
register f32 ff30;
|
||||
register f32 ff29;
|
||||
register f32 ff28;
|
||||
register f32 ff27;
|
||||
register f32 ff26;
|
||||
// clang-format off
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
fsubs ff31, p1, p2
|
||||
fsubs ff30, p5, p2
|
||||
fdivs ff29, ff31, ff30
|
||||
fmuls ff28,ff29,ff29
|
||||
fadds ff25,ff29,ff29
|
||||
fsubs ff27,ff28,ff29
|
||||
fsubs ff30, p3, p6
|
||||
fmsubs ff26,ff25,ff27,ff28
|
||||
fmadds ff25,p4,ff27,p4
|
||||
fmadds ff26,ff26,ff30,p3
|
||||
fmadds ff25,p7,ff27,ff25
|
||||
fmsubs ff25,ff29,p4,ff25
|
||||
fnmsubs ff25,ff31,ff25,ff26
|
||||
|
||||
}
|
||||
#endif
|
||||
// clang-format on
|
||||
return ff25;
|
||||
}
|
||||
|
||||
namespace JMath {
|
||||
|
||||
inline f32 fastReciprocal(f32 value) {
|
||||
return JMAFastReciprocal(value);
|
||||
}
|
||||
|
||||
inline void gekko_ps_copy3(register void* dst, register const void* src) {
|
||||
register f32 src0;
|
||||
register f32 src1;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l src0, 0(src), 0, 0
|
||||
lfs src1, 8(src)
|
||||
psq_st src0, 0(dst), 0, 0
|
||||
stfs src1, 8(dst)
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void gekko_ps_copy6(register void* dst, register const void* src) {
|
||||
register f32 src0;
|
||||
register f32 src1;
|
||||
register f32 src2;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l src0, 0(src), 0, 0
|
||||
psq_l src1, 8(src), 0, 0
|
||||
psq_l src2, 16(src), 0, 0
|
||||
psq_st src0, 0(dst), 0, 0
|
||||
psq_st src1, 8(dst), 0, 0
|
||||
psq_st src2, 16(dst), 0, 0
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void gekko_ps_copy12(register void* dst, register const void* src) {
|
||||
register f32 src0;
|
||||
register f32 src1;
|
||||
register f32 src2;
|
||||
register f32 src3;
|
||||
register f32 src4;
|
||||
register f32 src5;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l src0, 0(src), 0, 0
|
||||
psq_l src1, 8(src), 0, 0
|
||||
psq_l src2, 16(src), 0, 0
|
||||
psq_l src3, 24(src), 0, 0
|
||||
psq_l src4, 32(src), 0, 0
|
||||
psq_l src5, 40(src), 0, 0
|
||||
psq_st src0, 0(dst), 0, 0
|
||||
psq_st src1, 8(dst), 0, 0
|
||||
psq_st src2, 16(dst), 0, 0
|
||||
psq_st src3, 24(dst), 0, 0
|
||||
psq_st src4, 32(dst), 0, 0
|
||||
psq_st src5, 40(dst), 0, 0
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void gekko_ps_copy16(register void* dst, register const void* src) {
|
||||
register f32 src0;
|
||||
register f32 src1;
|
||||
register f32 src2;
|
||||
register f32 src3;
|
||||
register f32 src4;
|
||||
register f32 src5;
|
||||
register f32 src6;
|
||||
register f32 src7;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l src0, 0(src), 0, 0
|
||||
psq_l src1, 8(src), 0, 0
|
||||
psq_l src2, 16(src), 0, 0
|
||||
psq_l src3, 24(src), 0, 0
|
||||
psq_l src4, 32(src), 0, 0
|
||||
psq_l src5, 40(src), 0, 0
|
||||
psq_l src6, 48(src), 0, 0
|
||||
psq_l src7, 56(src), 0, 0
|
||||
psq_st src0, 0(dst), 0, 0
|
||||
psq_st src1, 8(dst), 0, 0
|
||||
psq_st src2, 16(dst), 0, 0
|
||||
psq_st src3, 24(dst), 0, 0
|
||||
psq_st src4, 32(dst), 0, 0
|
||||
psq_st src5, 40(dst), 0, 0
|
||||
psq_st src6, 48(dst), 0, 0
|
||||
psq_st src7, 56(dst), 0, 0
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
}; // namespace JMath
|
||||
|
||||
namespace JMathInlineVEC {
|
||||
inline void C_VECAdd(register const Vec* a, register const Vec* b, register Vec* ab) {
|
||||
register f32 axy;
|
||||
register f32 bxy;
|
||||
register f32 az;
|
||||
register f32 sumz;
|
||||
register f32 bz;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l axy, 0(a), 0, 0
|
||||
psq_l bxy, 0(b), 0, 0
|
||||
ps_add bxy, axy, bxy
|
||||
psq_st bxy, 0(ab), 0, 0
|
||||
psq_l az, 8(a), 1, 0
|
||||
psq_l bz, 8(b), 1, 0
|
||||
ps_add sumz, az, bz
|
||||
psq_st sumz, 8(ab), 1, 0
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void C_VECSubtract(register const Vec* a, register const Vec* b, register Vec* ab) {
|
||||
register f32 axy;
|
||||
register f32 bxy;
|
||||
register f32 az;
|
||||
register f32 subz;
|
||||
register f32 bz;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l axy, 0(a), 0, 0
|
||||
psq_l bxy, 0(b), 0, 0
|
||||
ps_sub bxy, axy, bxy
|
||||
psq_st bxy, 0(ab), 0, 0
|
||||
psq_l az, 8(a), 1, 0
|
||||
psq_l bz, 8(b), 1, 0
|
||||
ps_sub subz, az, bz
|
||||
psq_st subz, 8(ab), 1, 0
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
inline f32 C_VECSquareMag(register const Vec* v) {
|
||||
register f32 x_y;
|
||||
register f32 z;
|
||||
register f32 res;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l x_y, 0(v), 0, 0
|
||||
ps_mul x_y, x_y, x_y
|
||||
lfs z, 8(v)
|
||||
ps_madd res, z, z, x_y
|
||||
ps_sum0 res, res, x_y, x_y
|
||||
}
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
inline f32 C_VECDotProduct(register const Vec *a, register const Vec *b) {
|
||||
register f32 res;
|
||||
register f32 thisyz;
|
||||
register f32 otheryz;
|
||||
register f32 otherxy;
|
||||
register f32 thisxy;
|
||||
#ifdef __MWERKS__
|
||||
asm {
|
||||
psq_l thisyz, 4(a), 0, 0
|
||||
psq_l otheryz, 4(b), 0, 0
|
||||
ps_mul thisyz, thisyz, otheryz
|
||||
psq_l thisxy, 0(a), 0, 0
|
||||
psq_l otherxy, 0(b), 0, 0
|
||||
ps_madd otheryz, thisxy, otherxy, thisyz
|
||||
ps_sum0 res, otheryz, thisyz, thisyz
|
||||
};
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
inline T JMAMax(T param_0, T param_1) {
|
||||
T ret;
|
||||
if (param_0 > param_1) {
|
||||
ret = param_0;
|
||||
} else {
|
||||
ret = param_1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* JMATH_H */
|
||||
@@ -0,0 +1,51 @@
|
||||
#ifndef RANDOM_H
|
||||
#define RANDOM_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
namespace JMath {
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jmath
|
||||
*
|
||||
*/
|
||||
struct TRandom_fast_ {
|
||||
u32 value;
|
||||
|
||||
TRandom_fast_(u32 value);
|
||||
u32 get(void) {
|
||||
value = (value * 0x19660d) + 0x3c6ef35f;
|
||||
return value;
|
||||
}
|
||||
|
||||
u32 get_bit32(void) { return this->get(); }
|
||||
|
||||
// due to the float constant, having this function inlined adds that float to data,
|
||||
// making it not match
|
||||
float get_ufloat_1(void) {
|
||||
// !@bug UB: in C++ it's not legal to read from an union member other
|
||||
// than the last one that was written to.
|
||||
union {
|
||||
f32 f;
|
||||
u32 s;
|
||||
} out;
|
||||
out.s = (this->get() >> 9) | 0x3f800000;
|
||||
return out.f - 1;
|
||||
}
|
||||
|
||||
void setSeed(u32 seed) { value = seed; }
|
||||
};
|
||||
|
||||
template <class RandomT>
|
||||
class TRandom_ : public RandomT {
|
||||
public:
|
||||
TRandom_(u32 value) : RandomT(value) {}
|
||||
|
||||
u8 get_uint8(u8 param_0) {
|
||||
return get_ufloat_1() * param_0;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace JMath
|
||||
|
||||
#endif /* RANDOM_H */
|
||||
@@ -0,0 +1,221 @@
|
||||
#ifndef JPABASESHAPE_H
|
||||
#define JPABASESHAPE_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/egg_types.h"
|
||||
#include "rvl/GX.h"
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
class JPABaseParticle;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPABaseShapeData {
|
||||
// Common header.
|
||||
/* 0x00 */ u8 mMagic[4];
|
||||
/* 0x04 */ u32 mSize;
|
||||
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ s16 mClrPrmAnmOffset;
|
||||
/* 0x0E */ s16 mClrEnvAnmOffset;
|
||||
/* 0x10 */ f32 mBaseSizeX;
|
||||
/* 0x14 */ f32 mBaseSizeY;
|
||||
/* 0x18 */ u16 mBlendModeCfg;
|
||||
/* 0x1A */ u8 mAlphaCompareCfg;
|
||||
/* 0x1B */ u8 mAlphaRef0;
|
||||
/* 0x1C */ u8 mAlphaRef1;
|
||||
/* 0x1D */ u8 mZModeCfg;
|
||||
/* 0x1E */ u8 mTexFlg;
|
||||
/* 0x1F */ u8 mTexAnmNum;
|
||||
/* 0x20 */ u8 mTexIdx;
|
||||
/* 0x21 */ u8 mClrFlg;
|
||||
/* 0x22 */ u8 mClrPrmKeyNum;
|
||||
/* 0x23 */ u8 mClrEnvKeyNum;
|
||||
/* 0x24 */ s16 mClrAnmFrmMax;
|
||||
/* 0x26 */ GXColor mClrPrm;
|
||||
/* 0x2A */ GXColor mClrEnv;
|
||||
/* 0x2E */ u8 mAnmRndm;
|
||||
/* 0x2F */ u8 mClrAnmRndmMask;
|
||||
/* 0x30 */ u8 mTexAnmRndmMask;
|
||||
};
|
||||
|
||||
struct JPABaseShapeAlphaArg {
|
||||
GXTevAlphaArg mArg[4];
|
||||
GXTevOp mOp;
|
||||
GXTevScale mScale;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPABaseShape {
|
||||
public:
|
||||
JPABaseShape(u8 const*, EGG::Heap*);
|
||||
void setGX(JPAEmitterWorkData*) const;
|
||||
|
||||
static GXBlendMode st_bm[4];
|
||||
static GXBlendFactor st_bf[10];
|
||||
static GXLogicOp st_lo[16];
|
||||
static GXCompare st_c[8];
|
||||
static GXAlphaOp st_ao[4];
|
||||
static GXTevColorArg st_ca[6][4];
|
||||
static JPABaseShapeAlphaArg st_aa[5];
|
||||
|
||||
GXBlendMode getBlendMode() const { return st_bm[mpData->mBlendModeCfg & 0x03]; }
|
||||
GXBlendFactor getBlendSrc() const { return st_bf[(mpData->mBlendModeCfg >> 2) & 0x0F]; }
|
||||
GXBlendFactor getBlendDst() const { return st_bf[(mpData->mBlendModeCfg >> 6) & 0x0F]; }
|
||||
GXLogicOp getLogicOp() const { return st_lo[(mpData->mBlendModeCfg >> 10) & 0x0F]; }
|
||||
GXBool getZCompLoc() const { return (GXBool)((mpData->mZModeCfg >> 5) & 0x01); }
|
||||
|
||||
GXBool getZEnable() const { return (GXBool)(mpData->mZModeCfg & 0x01); }
|
||||
GXCompare getZCmp() const { return st_c[(mpData->mZModeCfg >> 1) & 0x07]; }
|
||||
GXBool getZUpd() const { return (GXBool)((mpData->mZModeCfg >> 4) & 0x01); }
|
||||
|
||||
GXCompare getAlphaCmp0() const { return st_c[mpData->mAlphaCompareCfg & 0x07]; }
|
||||
u8 getAlphaRef0() const { return mpData->mAlphaRef0; }
|
||||
GXAlphaOp getAlphaOp() const { return st_ao[(mpData->mAlphaCompareCfg >> 3) & 0x03]; }
|
||||
GXCompare getAlphaCmp1() const { return st_c[(mpData->mAlphaCompareCfg >> 5) & 0x07]; }
|
||||
u8 getAlphaRef1() const { return mpData->mAlphaRef1; }
|
||||
|
||||
const GXTevColorArg* getTevColorArg() const { return st_ca[(mpData->mFlags >> 0x0F) & 0x07]; }
|
||||
const JPABaseShapeAlphaArg* getTevAlphaArg() const { return &st_aa[(mpData->mFlags >> 0x12) & 0x07]; }
|
||||
|
||||
u32 getType() const { return (mpData->mFlags >> 0) & 0x0F; }
|
||||
u32 getDirType() const { return (mpData->mFlags >> 4) & 0x07; }
|
||||
u32 getRotType() const { return (mpData->mFlags >> 7) & 0x07; }
|
||||
u32 getBasePlaneType() const { return (mpData->mFlags >> 10) & 0x01; }
|
||||
u32 getTilingS() const { return (mpData->mFlags >> 27) & 0x01; } // was 25
|
||||
u32 getTilingT() const { return (mpData->mFlags >> 28) & 0x01; } // was 26
|
||||
BOOL isGlblClrAnm() const { return mpData->mFlags & 0x00001000; }
|
||||
BOOL isGlblTexAnm() const { return mpData->mFlags & 0x00004000; }
|
||||
BOOL isPrjTex() const { return mpData->mFlags & 0x00400000; } // was 0x00100000
|
||||
bool isDrawFwdAhead() const { return !!(mpData->mFlags & 0x00800000); } // was 0x00200000
|
||||
bool isDrawPrntAhead() const { return !!(mpData->mFlags & 0x01000000); } // was 0x00400000
|
||||
BOOL isClipOn() const { return (mpData->mFlags & 0x02000000); } // was 0x00800000
|
||||
BOOL isTexCrdAnm() const { return mpData->mFlags & 0x04000000; } // was 0x01000000
|
||||
bool isNoDrawParent() const { return !!((mpData->mFlags >> 29) & 1); } // was 0x08000000
|
||||
bool isNoDrawChild() const { return !!((mpData->mFlags >> 30) & 1); } // was 0x10000000
|
||||
|
||||
BOOL isPrmAnm() const { return mpData->mClrFlg & 0x02; }
|
||||
BOOL isEnvAnm() const { return mpData->mClrFlg & 0x08; }
|
||||
u8 getClrAnmType() const { return (mpData->mClrFlg >> 4) & 0x07; }
|
||||
s16 getClrAnmMaxFrm() const { return mpData->mClrAnmFrmMax; }
|
||||
void getPrmClr(GXColor* dst) { *dst = mpData->mClrPrm; }
|
||||
void getPrmClr(s16 idx, GXColor* dst) { *dst = mpPrmClrAnmTbl[idx]; }
|
||||
void getEnvClr(GXColor* dst) { *dst = mpData->mClrEnv; }
|
||||
void getEnvClr(s16 idx, GXColor* dst) { *dst = mpEnvClrAnmTbl[idx]; }
|
||||
|
||||
BOOL isTexAnm() const { return mpData->mTexFlg & 0x01; }
|
||||
u8 getTexAnmType() const { return (mpData->mTexFlg >> 2) & 0x07; }
|
||||
u32 getTexIdx() const { return mpData->mTexIdx; }
|
||||
u8 getTexIdx(u8 idx) const { return mpTexIdxAnimTbl[idx]; }
|
||||
|
||||
f32 getBaseSizeX() const { return mpData->mBaseSizeX; }
|
||||
f32 getBaseSizeY() const { return mpData->mBaseSizeY; }
|
||||
u8 getClrLoopOfstMask() const { return mpData->mClrAnmRndmMask; }
|
||||
u32 getClrLoopOfst(u32 param_1) const { return getClrLoopOfstMask() & param_1; }
|
||||
u8 getTexLoopOfstMask() const { return mpData->mTexAnmRndmMask; }
|
||||
u32 getTexLoopOfst(u8 param_1) const { return getTexLoopOfstMask() & param_1; }
|
||||
u8 getLoopOfstValue() const { return mpData->mAnmRndm; }
|
||||
|
||||
f32 getIncTransX() const { return ((f32*)mpTexCrdMtxAnmTbl)[5]; }
|
||||
f32 getInitTransX() const { return ((f32*)mpTexCrdMtxAnmTbl)[0]; }
|
||||
f32 getIncTransY() const { return ((f32*)mpTexCrdMtxAnmTbl)[6]; }
|
||||
f32 getInitTransY() const { return ((f32*)mpTexCrdMtxAnmTbl)[1]; }
|
||||
f32 getIncScaleX() const { return ((f32*)mpTexCrdMtxAnmTbl)[7]; }
|
||||
f32 getInitScaleX() const { return ((f32*)mpTexCrdMtxAnmTbl)[2]; }
|
||||
f32 getIncScaleY() const { return ((f32*)mpTexCrdMtxAnmTbl)[8]; }
|
||||
f32 getInitScaleY() const { return ((f32*)mpTexCrdMtxAnmTbl)[3]; }
|
||||
f32 getIncRot() const { return ((f32*)mpTexCrdMtxAnmTbl)[9]; }
|
||||
f32 getInitRot() const { return ((f32*)mpTexCrdMtxAnmTbl)[4]; }
|
||||
u8 getTexAnmKeyNum() const { return mpData->mTexAnmNum; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ const JPABaseShapeData* mpData;
|
||||
/* 0x04 */ const void* mpTexCrdMtxAnmTbl;
|
||||
/* 0x08 */ const u8* mpTexIdxAnimTbl;
|
||||
/* 0x0C */ GXColor* mpPrmClrAnmTbl;
|
||||
/* 0x10 */ GXColor* mpEnvClrAnmTbl;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPAClrAnmKeyData {
|
||||
/* 0x0 */ s16 index;
|
||||
/* 0x2 */ GXColor color;
|
||||
};
|
||||
|
||||
void JPACalcTexIdxNormal(JPAEmitterWorkData*);
|
||||
void JPACalcTexIdxRepeat(JPAEmitterWorkData*);
|
||||
void JPACalcTexIdxReverse(JPAEmitterWorkData*);
|
||||
void JPACalcTexIdxMerge(JPAEmitterWorkData*);
|
||||
void JPACalcTexIdxRandom(JPAEmitterWorkData*);
|
||||
void JPACalcPrm(JPAEmitterWorkData*);
|
||||
void JPACalcEnv(JPAEmitterWorkData*);
|
||||
void JPACalcClrIdxNormal(JPAEmitterWorkData*);
|
||||
void JPACalcClrIdxRepeat(JPAEmitterWorkData*);
|
||||
void JPACalcClrIdxReverse(JPAEmitterWorkData*);
|
||||
void JPACalcClrIdxMerge(JPAEmitterWorkData*);
|
||||
void JPACalcClrIdxRandom(JPAEmitterWorkData*);
|
||||
|
||||
void JPACalcTexIdxNormal(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcTexIdxRepeat(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcTexIdxReverse(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcTexIdxMerge(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcTexIdxRandom(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcPrm(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcEnv(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcClrIdxNormal(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcClrIdxRepeat(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcClrIdxReverse(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcClrIdxMerge(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcClrIdxRandom(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcColorCopy(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
|
||||
// SS addition
|
||||
void fn_8031C2C0(JPAEmitterWorkData*);
|
||||
void JPADrawStripe(JPAEmitterWorkData*);
|
||||
void JPADrawStripeX(JPAEmitterWorkData*);
|
||||
void JPADrawEmitterCallBackB(JPAEmitterWorkData*);
|
||||
void JPALoadTex(JPAEmitterWorkData*);
|
||||
void JPALoadTexAnm(JPAEmitterWorkData*);
|
||||
void JPAGenTexCrdMtxIdt(JPAEmitterWorkData*);
|
||||
void JPAGenCalcTexCrdMtxAnm(JPAEmitterWorkData*);
|
||||
void JPAGenTexCrdMtxAnm(JPAEmitterWorkData*);
|
||||
void JPAGenTexCrdMtxPrj(JPAEmitterWorkData*);
|
||||
void JPALoadPosMtxCam(JPAEmitterWorkData*);
|
||||
void JPASetLineWidth(JPAEmitterWorkData*);
|
||||
void JPASetPointSize(JPAEmitterWorkData*);
|
||||
void JPARegistPrm(JPAEmitterWorkData*);
|
||||
void JPARegistEnv(JPAEmitterWorkData*);
|
||||
void JPARegistPrmEnv(JPAEmitterWorkData*);
|
||||
|
||||
void JPADrawPoint(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawLine(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawRotBillboard(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawBillboard(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawRotDirection(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawDirection(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawRotation(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawDBillboard(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawRotYBillboard(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawYBillboard(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPADrawParticleCallBack(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPALoadTexAnm(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPASetPointSize(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPASetLineWidth(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPALoadCalcTexCrdMtxAnm(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
// SS addition
|
||||
void fn_8031A8C0(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPARegistAlpha(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPARegistEnv(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPARegistAlphaEnv(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPARegistPrmAlpha(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPARegistPrmAlphaEnv(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
|
||||
#endif /* JPABASESHAPE_H */
|
||||
@@ -0,0 +1,91 @@
|
||||
#ifndef JPACHILDSHAPE_H
|
||||
#define JPACHILDSHAPE_H
|
||||
|
||||
#include "common.h"
|
||||
#include "rvl/GX.h"
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
class JPABaseParticle;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPAChildShapeData {
|
||||
// Common header.
|
||||
/* 0x00 */ u8 mMagic[4];
|
||||
/* 0x04 */ u32 mSize;
|
||||
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ f32 mPosRndm;
|
||||
/* 0x10 */ f32 mBaseVel;
|
||||
/* 0x14 */ f32 mBaseVelRndm;
|
||||
/* 0x18 */ f32 mVelInfRate;
|
||||
/* 0x1C */ f32 mGravity;
|
||||
/* 0x20 */ f32 mScaleX;
|
||||
/* 0x24 */ f32 mScaleY;
|
||||
/* 0x28 */ f32 mInheritScale;
|
||||
/* 0x2C */ f32 mInheritAlpha;
|
||||
/* 0x30 */ f32 mInheritRGB;
|
||||
/* 0x34 */ GXColor mPrmClr;
|
||||
/* 0x38 */ GXColor mEnvClr;
|
||||
/* 0x3C */ f32 mTiming;
|
||||
/* 0x40 */ s16 mLife;
|
||||
/* 0x42 */ s16 mRate;
|
||||
/* 0x44 */ u8 mStep;
|
||||
/* 0x45 */ u8 mTexIdx;
|
||||
/* 0x46 */ s16 mRotSpeed;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPAChildShape {
|
||||
public:
|
||||
JPAChildShape(u8 const*);
|
||||
|
||||
f32 getPosRndm() const { return mpData->mPosRndm; }
|
||||
f32 getBaseVel() const { return mpData->mBaseVel; }
|
||||
f32 getBaseVelRndm() const { return mpData->mBaseVelRndm; }
|
||||
f32 getVelInhRate() const { return mpData->mVelInfRate; }
|
||||
f32 getGravity() const { return mpData->mGravity; }
|
||||
f32 getScaleX() const { return mpData->mScaleX; }
|
||||
f32 getScaleY() const { return mpData->mScaleY; }
|
||||
f32 getScaleInhRate() const { return mpData->mInheritScale; }
|
||||
f32 getAlphaInhRate() const { return mpData->mInheritAlpha; }
|
||||
f32 getColorInhRate() const { return mpData->mInheritRGB; }
|
||||
void getPrmClr(GXColor* dst) const { *dst = mpData->mPrmClr; }
|
||||
u8 getPrmAlpha() const { return mpData->mPrmClr.a; }
|
||||
void getEnvClr(GXColor* dst) const { *dst = mpData->mEnvClr; }
|
||||
f32 getTiming() const { return mpData->mTiming; }
|
||||
s16 getLife() const { return mpData->mLife; }
|
||||
s16 getRate() const { return mpData->mRate; }
|
||||
u8 getStep() const { return mpData->mStep; }
|
||||
u8 getTexIdx() const { return mpData->mTexIdx; }
|
||||
s16 getRotInitSpeed() const { return mpData->mRotSpeed; }
|
||||
u32 getType() const { return mpData->mFlags & 0xF; }
|
||||
u32 getDirType() const { return (mpData->mFlags >> 4) & 7; }
|
||||
u32 getRotType() const { return (mpData->mFlags >> 7) & 7; }
|
||||
u32 getBasePlaneType() const { return (mpData->mFlags >> 10) & 1; }
|
||||
|
||||
BOOL isScaleInherited() const { return mpData->mFlags & 0x10000; }
|
||||
BOOL isAlphaInherited() const { return mpData->mFlags & 0x20000; }
|
||||
BOOL isColorInherited() const { return mpData->mFlags & 0x40000; }
|
||||
BOOL isClipOn() const { return mpData->mFlags & 0x100000; }
|
||||
BOOL isFieldAffected() const { return mpData->mFlags & 0x200000; }
|
||||
BOOL isScaleOutOn() const { return mpData->mFlags & 0x400000; }
|
||||
BOOL isAlphaOutOn() const { return mpData->mFlags & 0x800000; }
|
||||
BOOL isRotateOn() const { return mpData->mFlags & 0x1000000; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ const JPAChildShapeData* mpData;
|
||||
};
|
||||
|
||||
void fn_8031DBA0(JPAEmitterWorkData*);
|
||||
void JPARegistChildPrmEnv(JPAEmitterWorkData*);
|
||||
|
||||
void JPACalcChildAlphaOut(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcChildScaleOut(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
|
||||
#endif /* JPACHILDSHAPE_H */
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef JPADRAWINFO_H
|
||||
#define JPADRAWINFO_H
|
||||
|
||||
#include "common.h"
|
||||
#include "rvl/MTX.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPADrawInfo {
|
||||
public:
|
||||
JPADrawInfo(Mtx param_0, f32 fovY, f32 aspect) {
|
||||
MTXCopy(param_0, mCamMtx);
|
||||
C_MTXLightPerspective(mPrjMtx, fovY, aspect, 0.5f, -0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
JPADrawInfo(Mtx param_0, f32 top, f32 bottom, f32 left, f32 right) {
|
||||
MTXCopy(param_0, mCamMtx);
|
||||
C_MTXLightOrtho(mPrjMtx, top, bottom, left, right, 0.5f, 0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
Mtx mCamMtx;
|
||||
Mtx mPrjMtx;
|
||||
|
||||
void getCamMtx(Mtx dst) const { MTXCopy(mCamMtx, dst); }
|
||||
void getPrjMtx(Mtx dst) const { MTXCopy(mPrjMtx, dst); }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,111 @@
|
||||
#ifndef JPADYNAMICSBLOCK_H
|
||||
#define JPADYNAMICSBLOCK_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPADynamicsBlockData {
|
||||
// Common header.
|
||||
/* 0x00 */ u8 mMagic[4];
|
||||
/* 0x04 */ u32 mSize;
|
||||
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ u32 mResUserWork;
|
||||
/* 0x10 */ EGG::Vector3f mEmitterScl;
|
||||
/* 0x1C */ EGG::Vector3f mEmitterTrs;
|
||||
/* 0x28 */ EGG::Vector3f mEmitterDir;
|
||||
/* 0x34 */ f32 mInitialVelOmni;
|
||||
/* 0x38 */ f32 mInitialVelAxis;
|
||||
/* 0x3C */ f32 mInitialVelRndm;
|
||||
/* 0x40 */ f32 mInitialVelDir;
|
||||
/* 0x44 */ f32 mSpread;
|
||||
/* 0x48 */ f32 mInitialVelRatio;
|
||||
/* 0x4C */ f32 mRate;
|
||||
/* 0x50 */ f32 mRateRndm;
|
||||
/* 0x54 */ f32 mLifeTimeRndm;
|
||||
/* 0x58 */ f32 mVolumeSweep;
|
||||
/* 0x5C */ f32 mVolumeMinRad;
|
||||
/* 0x60 */ f32 mAirResist;
|
||||
/* 0x64 */ f32 mMoment;
|
||||
/* 0x68 */ JGeometry::TVec3<s16> mEmitterRot;
|
||||
/* 0x6E */ s16 mMaxFrame;
|
||||
/* 0x70 */ s16 mStartFrame;
|
||||
/* 0x72 */ s16 mLifeTime;
|
||||
/* 0x74 */ u16 mVolumeSize;
|
||||
/* 0x76 */ u16 mDivNumber;
|
||||
/* 0x78 */ u8 mRateStep;
|
||||
/* 0x7C */ u32 field_0x7c;
|
||||
};
|
||||
|
||||
typedef void (*JPADynamicsCalcVolumeFunc)(JPAEmitterWorkData*);
|
||||
|
||||
enum {
|
||||
JPADynFlag_FixedDensity = 0x01,
|
||||
JPADynFlag_FixedInterval = 0x02,
|
||||
JPADynFlag_InheritScale = 0x04,
|
||||
JPADynFlag_FollowEmtr = 0x08,
|
||||
JPADynFlag_FollowEmtrChld = 0x10,
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPADynamicsBlock {
|
||||
public:
|
||||
JPADynamicsBlock(u8 const*);
|
||||
void init();
|
||||
void create(JPAEmitterWorkData*);
|
||||
|
||||
void calc(JPAEmitterWorkData* work) { mpCalcVolumeFunc(work); }
|
||||
|
||||
s16 getStartFrame() const { return mpData->mStartFrame; }
|
||||
u32 getResUserWork() const { return mpData->mResUserWork; }
|
||||
u32 getFlag() const { return mpData->mFlags; }
|
||||
u32 getVolumeType() const { return (mpData->mFlags >> 8) & 0x07; }
|
||||
u16 getDivNumber() const { return mpData->mDivNumber; }
|
||||
f32 getRateRndm() const { return mpData->mRateRndm; }
|
||||
void getEmitterScl(EGG::Vector3f* vec) const {
|
||||
vec->set(mpData->mEmitterScl.x, mpData->mEmitterScl.y, mpData->mEmitterScl.z);
|
||||
}
|
||||
void getEmitterTrs(EGG::Vector3f* vec) const {
|
||||
vec->set(mpData->mEmitterTrs.x, mpData->mEmitterTrs.y, mpData->mEmitterTrs.z);
|
||||
}
|
||||
void getEmitterDir(EGG::Vector3f* vec) const {
|
||||
vec->set(mpData->mEmitterDir.x, mpData->mEmitterDir.y, mpData->mEmitterDir.z);
|
||||
}
|
||||
void getEmitterRot(JGeometry::TVec3<s16>* vec) const {
|
||||
vec->set(mpData->mEmitterRot.x, mpData->mEmitterRot.y, mpData->mEmitterRot.z);
|
||||
}
|
||||
s16 getMaxFrame() { return mpData->mMaxFrame; }
|
||||
s16 getLifetime() { return mpData->mLifeTime; }
|
||||
u16 getVolumeSize() { return mpData->mVolumeSize; }
|
||||
f32 getRate() { return mpData->mRate; }
|
||||
u8 getRateStep() { return mpData->mRateStep; }
|
||||
f32 getVolumeSweep() { return mpData->mVolumeSweep; }
|
||||
f32 getVolumeMinRad() { return mpData->mVolumeMinRad; }
|
||||
f32 getInitVelOmni() { return mpData->mInitialVelOmni; }
|
||||
f32 getInitVelAxis() { return mpData->mInitialVelAxis; }
|
||||
f32 getInitVelDir() { return mpData->mInitialVelDir; }
|
||||
f32 getInitVelDirSp() { return mpData->mSpread; }
|
||||
f32 getInitVelRndm() { return mpData->mInitialVelRndm; }
|
||||
f32 getInitVelRatio() const { return mpData->mInitialVelRatio; }
|
||||
f32 getAirRes() { return mpData->mAirResist; }
|
||||
f32 getLifetimeRndm() const { return mpData->mLifeTimeRndm; }
|
||||
f32 getMomentRndm() const { return mpData->mMoment; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ const JPADynamicsBlockData* mpData;
|
||||
/* 0x04 */ JPADynamicsCalcVolumeFunc mpCalcVolumeFunc;
|
||||
};
|
||||
|
||||
#endif /* JPADYNAMICSBLOCK_H */
|
||||
@@ -0,0 +1,273 @@
|
||||
#ifndef JPAEMITTER_H
|
||||
#define JPAEMITTER_H
|
||||
|
||||
#include "common.h"
|
||||
#include "rvl/GX.h"
|
||||
#include "JSystem/JParticle/JPAResource.h"
|
||||
#include "JSystem/JParticle/JPAList.h"
|
||||
#include "JSystem/JParticle/JPARandom.h"
|
||||
#include "JSystem/JParticle/JPAMath.h"
|
||||
#include "JSystem/JParticle/JPADynamicsBlock.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
|
||||
class JPAResourceManager;
|
||||
class JPABaseEmitter;
|
||||
class JPAEmitterManager;
|
||||
class JPAParticleCallBack;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPAEmitterWorkData {
|
||||
struct JPAVolumeCalcData {
|
||||
/* 0x00 */ EGG::Vector3f mVolumePos;
|
||||
/* 0x0C */ EGG::Vector3f mVelOmni;
|
||||
/* 0x18 */ EGG::Vector3f mVelAxis;
|
||||
};
|
||||
|
||||
JPAEmitterWorkData() : mRndm(0) {}
|
||||
|
||||
/* 0x00 */ JPABaseEmitter* mpEmtr;
|
||||
/* 0x04 */ JPAResource* mpRes;
|
||||
/* 0x08 */ JPAResourceManager* mpResMgr;
|
||||
/* 0x0C */ JPARandom mRndm;
|
||||
/* 0x10 */ JPAVolumeCalcData mVolumeCalcData;
|
||||
/* 0x34 */ f32 mVolumeSize;
|
||||
/* 0x38 */ f32 mVolumeMinRad;
|
||||
/* 0x3C */ f32 mVolumeSweep;
|
||||
/* 0x40 */ s32 mEmitCount;
|
||||
/* 0x44 */ s32 mVolumeEmitIdx;
|
||||
/* 0x48 */ Mtx mDirectionMtx;
|
||||
/* 0x78 */ Mtx mRotationMtx;
|
||||
/* 0xA8 */ Mtx mGlobalRot;
|
||||
/* 0xD8 */ Mtx mGlobalSR;
|
||||
/* 0x108 */ EGG::Vector3f mEmitterPos;
|
||||
/* 0x114 */ EGG::Vector3f mGlobalScl;
|
||||
/* 0x120 */ EGG::Vector3f mGlobalEmtrDir;
|
||||
/* 0x12C */ EGG::Vector3f mPublicScale;
|
||||
/* 0x138 */ EGG::Vector3f mGlobalPos;
|
||||
/* 0x144 */ JGeometry::TVec2<f32> mGlobalPtclScl;
|
||||
/* 0x14C */ JGeometry::TVec2<f32> mPivot;
|
||||
/* 0x154 */ Mtx mYBBCamMtx;
|
||||
/* 0x184 */ Mtx mPosCamMtx;
|
||||
/* 0x1B4 */ Mtx mPrjMtx;
|
||||
/* 0x1E4 */ JPAList<JPABaseParticle>* mpAlivePtcl;
|
||||
/* 0x1E8 */ JPANode<JPABaseParticle>* mpCurNode;
|
||||
/* 0x1EC */ s32 mVolumeAngleNum;
|
||||
/* 0x1F0 */ s32 mVolumeAngleMax;
|
||||
/* 0x1F4 */ s32 mVolumeX;
|
||||
/* 0x1F8 */ s32 mDivNumber;
|
||||
/* 0x1FC */ f32 mScaleAnm;
|
||||
/* 0x200 */ u32 mDirType;
|
||||
/* 0x204 */ u32 mRotType;
|
||||
/* 0x208 */ u32 mPlaneType;
|
||||
/* 0x20C */ u32 mDLType;
|
||||
/* 0x210 */ u32 mPrjType;
|
||||
/* 0x214 */ s16 mClrKeyFrame;
|
||||
/* 0x216 */ u8 mDrawCount;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPAEmitterCallBack {
|
||||
public:
|
||||
virtual ~JPAEmitterCallBack() = 0;
|
||||
virtual void execute(JPABaseEmitter*) {}
|
||||
virtual void executeAfter(JPABaseEmitter*) {}
|
||||
virtual void draw(JPABaseEmitter*) {}
|
||||
virtual void drawAfter(JPABaseEmitter*) {}
|
||||
|
||||
//~JPAEmitterCallBack();
|
||||
};
|
||||
|
||||
enum {
|
||||
JPAEmtrStts_StopEmit = 0x01,
|
||||
JPAEmtrStts_StopCalc = 0x02,
|
||||
JPAEmtrStts_StopDraw = 0x04,
|
||||
JPAEmtrStts_EnableDeleteEmitter = 0x08,
|
||||
JPAEmtrStts_FirstEmit = 0x10,
|
||||
JPAEmtrStts_RateStepEmit = 0x20,
|
||||
JPAEmtrStts_Immortal = 0x40,
|
||||
JPAEmtrStts_Delete = 0x100,
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPABaseEmitter {
|
||||
public:
|
||||
~JPABaseEmitter() {}
|
||||
JPABaseEmitter() : mLink(this), mRndm(0) {}
|
||||
void init(JPAEmitterManager*, JPAResource*);
|
||||
bool processTillStartFrame();
|
||||
bool processTermination();
|
||||
void calcEmitterGlobalPosition(EGG::Vector3f*) const;
|
||||
void deleteAllParticle();
|
||||
JPABaseParticle* createChild(JPABaseParticle*);
|
||||
JPABaseParticle* createParticle();
|
||||
u32 getCurrentCreateNumber() const;
|
||||
u8 getDrawCount() const;
|
||||
bool loadTexture(u8, GXTexMapID);
|
||||
|
||||
void initStatus(u32 status) { mStatus = status; }
|
||||
void setStatus(u32 status) { mStatus |= status; }
|
||||
void clearStatus(u32 status) { mStatus &= ~status; }
|
||||
u32 checkStatus(u32 status) const { return (mStatus & status); }
|
||||
bool checkFlag(u32 flag) const { return !!(mpRes->getDyn()->getFlag() & flag); }
|
||||
u8 getResourceManagerID() const { return mResMgrID; }
|
||||
u8 getGroupID() const { return mGroupID; }
|
||||
u8 getDrawTimes() const { return mDrawTimes; }
|
||||
void setRate(f32 rate) { mRate = rate; }
|
||||
void setDirectionalSpeed(f32 i_speed) { mDirSpeed = i_speed; }
|
||||
void setRandomDirectionSpeed(f32 i_speed) { mRndmDirSpeed = i_speed; }
|
||||
void setEmitterCallBackPtr(JPAEmitterCallBack* ptr) { mpEmtrCallBack = ptr; }
|
||||
void setGlobalRTMatrix(const Mtx m) { JPASetRMtxTVecfromMtx(m, mGlobalRot, &mGlobalTrs); }
|
||||
void setGlobalSRTMatrix(const Mtx m) {
|
||||
JPASetRMtxSTVecfromMtx(m, mGlobalRot, &mGlobalScl, &mGlobalTrs);
|
||||
|
||||
// set is actually used here in debug
|
||||
mGlobalPScl.x = mGlobalScl.x;
|
||||
mGlobalPScl.y = mGlobalScl.y;
|
||||
}
|
||||
void setGlobalTranslation(f32 x, f32 y, f32 z) { mGlobalTrs.set(x, y, z); }
|
||||
void setGlobalTranslation(const EGG::Vector3f& trs) { mGlobalTrs.set(trs); }
|
||||
void getLocalTranslation(EGG::Vector3f& vec) { vec.set(mLocalTrs); }
|
||||
void setGlobalRotation(const JGeometry::TVec3<s16>& rot) {
|
||||
JPAGetXYZRotateMtx(rot.x, rot.y, rot.z, mGlobalRot);
|
||||
}
|
||||
void getGlobalTranslation(EGG::Vector3f* out) const { out->set(mGlobalTrs); }
|
||||
void setGlobalDynamicsScale(const EGG::Vector3f& i_scale) { mGlobalScl.set(i_scale); }
|
||||
void setGlobalAlpha(u8 alpha) { mGlobalPrmClr.a = alpha; }
|
||||
u8 getGlobalAlpha() { return mGlobalPrmClr.a; }
|
||||
void getGlobalPrmColor(GXColor& color) { color = mGlobalPrmClr; }
|
||||
void setGlobalPrmColor(u8 r, u8 g, u8 b) { mGlobalPrmClr.r = r; mGlobalPrmClr.g = g; mGlobalPrmClr.b = b; }
|
||||
void setGlobalEnvColor(u8 r, u8 g, u8 b) { mGlobalEnvClr.r = r; mGlobalEnvClr.g = g; mGlobalEnvClr.b = b; }
|
||||
void setVolumeSize(u16 size) { mVolumeSize = size; }
|
||||
void setLifeTime(s16 lifetime) { mLifeTime = lifetime; }
|
||||
void setAwayFromCenterSpeed(f32 i_speed) { mAwayFromCenterSpeed = i_speed; }
|
||||
void setAwayFromAxisSpeed(f32 i_speed) { mAwayFromAxisSpeed = i_speed; }
|
||||
void setSpread(f32 i_spread) { mSpread = i_spread; }
|
||||
void setLocalTranslation(const EGG::Vector3f& i_trans) { mLocalTrs.set(i_trans); }
|
||||
void setLocalRotation(const JGeometry::TVec3<s16>& i_rot) { mLocalRot.set(i_rot.x * 0.005493248f, i_rot.y * 0.005493248f, i_rot.z * 0.005493248f); }
|
||||
void setRateStep(u8 i_step) { mRateStep = i_step; }
|
||||
|
||||
void setGlobalParticleHeightScale(f32 height) {
|
||||
mGlobalPScl.y = height;
|
||||
}
|
||||
void setGlobalParticleScale(const EGG::Vector3f& scale) {
|
||||
mGlobalPScl.set(scale.x, scale.y);
|
||||
}
|
||||
void setGlobalParticleScale(f32 scaleX, f32 scaleY) {
|
||||
mGlobalPScl.set(scaleX, scaleY);
|
||||
}
|
||||
void getGlobalParticleScale(EGG::Vector3f& scale) {
|
||||
scale.set(mGlobalPScl.x, mGlobalPScl.y, 1.0f);
|
||||
}
|
||||
void setGlobalScale(const EGG::Vector3f& scale) {
|
||||
mGlobalScl.set(scale);
|
||||
mGlobalPScl.set(scale.x ,scale.y);
|
||||
}
|
||||
void setGlobalSRTMatrix(const MtxP matrix) {
|
||||
JPASetRMtxSTVecfromMtx(matrix, mGlobalRot, &mGlobalScl, &mGlobalTrs);
|
||||
mGlobalPScl.set(mGlobalScl.x, mGlobalScl.y);
|
||||
}
|
||||
void setDirection(const EGG::Vector3f& direction) {
|
||||
mLocalDir.set(direction);
|
||||
}
|
||||
|
||||
void setLocalScale(const EGG::Vector3f& scale) {
|
||||
mLocalScl.set(scale);
|
||||
}
|
||||
|
||||
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 playCreateParticle() { clearStatus(JPAEmtrStts_StopEmit); }
|
||||
void becomeImmortalEmitter() { setStatus(JPAEmtrStts_Immortal); }
|
||||
void becomeContinuousParticle() { mMaxFrame = 0; }
|
||||
void becomeDeleteEmitter() { setStatus(JPAEmtrStts_Delete); }
|
||||
void becomeInvalidEmitter() {
|
||||
stopCreateParticle();
|
||||
mMaxFrame = 1;
|
||||
}
|
||||
|
||||
void quitImmortalEmitter() { clearStatus(JPAEmtrStts_Immortal); }
|
||||
void stopCalcEmitter() { setStatus(JPAEmtrStts_StopCalc); }
|
||||
void playCalcEmitter() { clearStatus(JPAEmtrStts_StopCalc); }
|
||||
void stopDrawParticle() { setStatus(JPAEmtrStts_StopDraw); }
|
||||
void playDrawParticle() { clearStatus(JPAEmtrStts_StopDraw); }
|
||||
|
||||
u32 getUserWork() { return mpUserWork; }
|
||||
void setUserWork(u32 userWork) { mpUserWork = userWork; }
|
||||
u32 getParticleNumber() {
|
||||
return mAlivePtclBase.getNum() + mAlivePtclChld.getNum();
|
||||
}
|
||||
bool isEnableDeleteEmitter() {
|
||||
return checkStatus(JPAEmtrStts_EnableDeleteEmitter) && getParticleNumber() == 0;
|
||||
}
|
||||
void setDrawTimes(u8 drawTimes) { mDrawTimes = drawTimes; }
|
||||
void setParticleCallBackPtr(JPAParticleCallBack* cb) { mpPtclCallBack = cb; }
|
||||
JPAParticleCallBack* getParticleCallBackPtr() { return mpPtclCallBack; }
|
||||
JPAEmitterCallBack* getEmitterCallBackPtr() const { return mpEmtrCallBack; }
|
||||
u32 getAge() const { return mTick; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ EGG::Vector3f mLocalScl;
|
||||
/* 0x0C */ EGG::Vector3f mLocalTrs;
|
||||
/* 0x18 */ EGG::Vector3f mLocalDir;
|
||||
/* 0x24 */ s32 mMaxFrame;
|
||||
/* 0x28 */ f32 mRate;
|
||||
/* 0x2C */ f32 mVolumeSweep;
|
||||
/* 0x30 */ f32 mVolumeMinRad;
|
||||
/* 0x34 */ f32 mAwayFromCenterSpeed;
|
||||
/* 0x38 */ f32 mAwayFromAxisSpeed;
|
||||
/* 0x3C */ f32 mDirSpeed;
|
||||
/* 0x40 */ f32 mSpread;
|
||||
/* 0x44 */ f32 mRndmDirSpeed;
|
||||
/* 0x48 */ f32 mAirResist;
|
||||
/* 0x4C */ JGeometry::TVec3<s16> mLocalRot;
|
||||
/* 0x52 */ s16 mLifeTime;
|
||||
/* 0x54 */ u16 mVolumeSize;
|
||||
/* 0x56 */ u8 mRateStep;
|
||||
/* 0x58 */ JSULink<JPABaseEmitter> mLink;
|
||||
/* 0x68 */ Mtx mGlobalRot;
|
||||
/* 0x98 */ EGG::Vector3f mGlobalScl;
|
||||
/* 0xA4 */ EGG::Vector3f mGlobalTrs;
|
||||
/* 0xB0 */ JGeometry::TVec2<f32> mGlobalPScl;
|
||||
/* 0xB8 */ GXColor mGlobalPrmClr;
|
||||
/* 0xBC */ GXColor mGlobalEnvClr;
|
||||
/* 0xC0 */ s32 mpUserWork;
|
||||
/* 0xC4 */ JPARandom mRndm;
|
||||
/* 0xC8 */ JPAList<JPABaseParticle> mAlivePtclBase;
|
||||
/* 0xD4 */ JPAList<JPABaseParticle> mAlivePtclChld;
|
||||
/* 0xE0 */ JPAList<JPABaseParticle>* mpPtclPool;
|
||||
/* 0xE4 */ JPAEmitterManager* mpEmtrMgr;
|
||||
/* 0xE8 */ JPAResource* mpRes;
|
||||
/* 0xEC */ JPAEmitterCallBack* mpEmtrCallBack;
|
||||
/* 0xF0 */ JPAParticleCallBack* mpPtclCallBack;
|
||||
/* 0xF4 */ u32 mStatus;
|
||||
/* 0xF8 */ f32 mEmitCount;
|
||||
/* 0xFC */ f32 mScaleOut;
|
||||
/* 0x100 */ u32 mTick;
|
||||
/* 0x104 */ s16 mWaitTime;
|
||||
/* 0x106 */ s16 mRateStepTimer;
|
||||
/* 0x108 */ GXColor mPrmClr;
|
||||
/* 0x10C */ GXColor mEnvClr;
|
||||
/* 0x110 */ u8 mDrawTimes;
|
||||
/* 0x111 */ u8 mTexAnmIdx;
|
||||
/* 0x112 */ u8 mGroupID;
|
||||
/* 0x113 */ u8 mResMgrID;
|
||||
};
|
||||
|
||||
enum {
|
||||
JPAPtclStts_Invisible = 0x08,
|
||||
};
|
||||
|
||||
#endif /* JPAEMITTER_H */
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef JPAEMITTERMANAGER_H
|
||||
#define JPAEMITTERMANAGER_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/egg_types.h"
|
||||
#include "JSystem/JParticle/JPAList.h"
|
||||
#include "JSystem/JParticle/JPADrawInfo.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
class JPAEmitterCallBack;
|
||||
class JPAParticleCallBack;
|
||||
class JPABaseEmitter;
|
||||
class JPAResourceManager;
|
||||
class JPABaseParticle;
|
||||
struct JPAEmitterWorkData;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPAEmitterManager {
|
||||
public:
|
||||
JPAEmitterManager(u32, u32, EGG::Heap*, u8, u8);
|
||||
JPABaseEmitter* createSimpleEmitterID(EGG::Vector3f const&, u16, u8, u8,
|
||||
JPAEmitterCallBack*, JPAParticleCallBack*);
|
||||
|
||||
~JPAEmitterManager() {}
|
||||
|
||||
void fn_80320E20(u8, f32, f32); // SS addition
|
||||
void calc(u8);
|
||||
void draw(JPADrawInfo const*, u8);
|
||||
void forceDeleteAllEmitter();
|
||||
void forceDeleteGroupEmitter(u8);
|
||||
void forceDeleteEmitter(JPABaseEmitter*);
|
||||
void entryResourceManager(JPAResourceManager*, u8);
|
||||
void clearResourceManager(u8);
|
||||
void calcYBBCam();
|
||||
JPAResourceManager* getResourceManager(u16 idx) { return pResMgrAry[idx]; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ JSUList<JPABaseEmitter>* pEmtrUseList;
|
||||
/* 0x04 */ JSUList<JPABaseEmitter> mFreeEmtrList;
|
||||
/* 0x10 */ JPAList<JPABaseParticle> mPtclPool;
|
||||
/* 0x1C */ JPAResourceManager** pResMgrAry;
|
||||
/* 0x20 */ JPAEmitterWorkData* pWd;
|
||||
/* 0x24 */ u32 emtrNum;
|
||||
/* 0x28 */ u32 ptclNum;
|
||||
/* 0x2C */ u8 gidMax;
|
||||
/* 0x2D */ u8 ridMax;
|
||||
};
|
||||
|
||||
#endif /* JPAEMITTERMANAGER_H */
|
||||
@@ -0,0 +1,70 @@
|
||||
#ifndef JPAEXTEXSHAPE_H
|
||||
#define JPAEXTEXSHAPE_H
|
||||
|
||||
#include "JSystem/JParticle/JPABaseShape.h"
|
||||
#include "common.h"
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPAExTexShapeData {
|
||||
// Common header.
|
||||
/* 0x00 */ u8 mMagic[4];
|
||||
/* 0x04 */ u32 mSize;
|
||||
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ f32 mIndTexMtx[2][3];
|
||||
/* 0x24 */ f32 field_0x24;
|
||||
/* 0x28 */ f32 field_0x28;
|
||||
/* 0x2C */ f32 field_0x2C;
|
||||
/* 0x30 */ f32 field_0x30;
|
||||
/* 0x34 */ f32 field_0x34;
|
||||
/* 0x38 */ f32 field_0x38;
|
||||
/* 0x3C */ f32 field_0x3C;
|
||||
/* 0x40 */ f32 field_0x40;
|
||||
/* 0x44 */ f32 field_0x44;
|
||||
/* 0x48 */ f32 field_0x48;
|
||||
/* 0x4C */ u8 field_0x4C;
|
||||
/* 0x4D */ s8 mExpScale;
|
||||
/* 0x4E */ s8 mIndTexIdx;
|
||||
/* 0x4F */ s8 mSecTexIdx;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPAExTexShape {
|
||||
public:
|
||||
JPAExTexShape(u8 const*);
|
||||
|
||||
const f32* getIndTexMtx() const { return &mpData->mIndTexMtx[0][0]; }
|
||||
u8 getfield_0x4C() const { return mpData->field_0x4C; }
|
||||
s8 getExpScale() const { return mpData->mExpScale; }
|
||||
u8 getIndTexIdx() const { return mpData->mIndTexIdx; }
|
||||
u8 getSecTexIdx() const { return mpData->mSecTexIdx; }
|
||||
bool isUseIndirect() const { return !!(mpData->mFlags & 0x01); }
|
||||
BOOL isUseSecTex() const { return (mpData->mFlags & 0x0100); }
|
||||
|
||||
f32 getField_0x24() const { return mpData->field_0x24; }
|
||||
f32 getField_0x28() const { return mpData->field_0x28; }
|
||||
f32 getField_0x2C() const { return mpData->field_0x2C; }
|
||||
f32 getField_0x30() const { return mpData->field_0x30; }
|
||||
f32 getField_0x34() const { return mpData->field_0x34; }
|
||||
f32 getField_0x38() const { return mpData->field_0x38; }
|
||||
f32 getField_0x3C() const { return mpData->field_0x3C; }
|
||||
f32 getField_0x40() const { return mpData->field_0x40; }
|
||||
f32 getField_0x44() const { return mpData->field_0x44; }
|
||||
f32 getField_0x48() const { return mpData->field_0x48; }
|
||||
|
||||
public:
|
||||
const JPAExTexShapeData* mpData;
|
||||
void fn_8031DE80(const JPABaseShape *bsp, f32) const;
|
||||
};
|
||||
|
||||
void JPALoadExTex(JPAEmitterWorkData*);
|
||||
|
||||
#endif /* JPAEXTEXSHAPE_H */
|
||||
@@ -0,0 +1,112 @@
|
||||
#ifndef JPAEXTRASHAPE_H
|
||||
#define JPAEXTRASHAPE_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
class JPABaseParticle;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPAExtraShapeData {
|
||||
// Common header.
|
||||
/* 0x00 */ u8 mMagic[4];
|
||||
/* 0x04 */ u32 mSize;
|
||||
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ f32 mScaleInTiming;
|
||||
/* 0x10 */ f32 mScaleOutTiming;
|
||||
/* 0x14 */ f32 mScaleInValueX;
|
||||
/* 0x18 */ f32 mScaleOutValueX;
|
||||
/* 0x1C */ f32 mScaleInValueY;
|
||||
/* 0x20 */ f32 mScaleOutValueY;
|
||||
/* 0x24 */ f32 mScaleOutRandom;
|
||||
/* 0x28 */ s16 mScaleAnmCycleX;
|
||||
/* 0x2A */ s16 mScaleAnmCycleY;
|
||||
/* 0x2C */ f32 mAlphaInTiming;
|
||||
/* 0x30 */ f32 mAlphaOutTiming;
|
||||
/* 0x34 */ f32 mAlphaInValue;
|
||||
/* 0x38 */ f32 mAlphaBaseValue;
|
||||
/* 0x3C */ f32 mAlphaOutValue;
|
||||
/* 0x40 */ f32 mAlphaWaveFrequency;
|
||||
/* 0x44 */ f32 mAlphaWaveRandom;
|
||||
/* 0x48 */ f32 mAlphaWaveAmplitude;
|
||||
/* 0x4C */ f32 mRotateAngle;
|
||||
/* 0x50 */ f32 mRotateAngleRandom;
|
||||
/* 0x54 */ f32 mRotateSpeed;
|
||||
/* 0x58 */ f32 mRotateSpeedRandom;
|
||||
/* 0x5C */ f32 mRotateDirection;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPAExtraShape {
|
||||
public:
|
||||
JPAExtraShape(u8 const*);
|
||||
void init();
|
||||
|
||||
f32 getScaleInTiming() const { return mpData->mScaleInTiming; }
|
||||
f32 getScaleOutTiming() const { return mpData->mScaleOutTiming; }
|
||||
f32 getScaleInValueX() const { return mpData->mScaleInValueX; }
|
||||
f32 getScaleInValueY() const { return mpData->mScaleInValueY; }
|
||||
f32 getScaleOutValueX() const { return mpData->mScaleOutValueX; }
|
||||
f32 getScaleOutValueY() const { return mpData->mScaleOutValueY; }
|
||||
f32 getScaleRndm() const { return mpData->mScaleOutRandom; }
|
||||
s16 getScaleAnmCycleX() const { return mpData->mScaleAnmCycleX; }
|
||||
s16 getScaleAnmCycleY() const { return mpData->mScaleAnmCycleY; }
|
||||
f32 getAlphaInTiming() const { return mpData->mAlphaInTiming; }
|
||||
f32 getAlphaOutTiming() const { return mpData->mAlphaOutTiming; }
|
||||
f32 getAlphaInValue() const { return mpData->mAlphaInValue; }
|
||||
f32 getAlphaOutValue() const { return mpData->mAlphaOutValue; }
|
||||
f32 getAlphaBaseValue() const { return mpData->mAlphaBaseValue; }
|
||||
f32 getAlphaFreq() const { return mpData->mAlphaWaveFrequency; }
|
||||
f32 getAlphaFreqRndm() const { return mpData->mAlphaWaveRandom; }
|
||||
f32 getAlphaAmp() const { return mpData->mAlphaWaveAmplitude; }
|
||||
f32 getRotateInitAngle() const { return mpData->mRotateAngle; }
|
||||
f32 getRotateRndmAngle() const { return mpData->mRotateAngleRandom; }
|
||||
f32 getRotateInitSpeed() const { return mpData->mRotateSpeed; }
|
||||
f32 getRotateRndmSpeed() const { return mpData->mRotateSpeedRandom; }
|
||||
f32 getRotateDirection() const { return mpData->mRotateDirection; }
|
||||
f32 getScaleIncRateX() const { return mScaleIncRateX; }
|
||||
f32 getScaleDecRateX() const { return mScaleDecRateX; }
|
||||
f32 getScaleIncRateY() const { return mScaleIncRateY; }
|
||||
f32 getScaleDecRateY() const { return mScaleDecRateY; }
|
||||
f32 getAlphaIncRate() const { return mAlphaIncRate; }
|
||||
f32 getAlphaDecRate() const { return mAlphaDecRate; }
|
||||
|
||||
BOOL isEnableScaleAnm() const { return mpData->mFlags & 1; }
|
||||
BOOL isScaleXYDiff() const { return mpData->mFlags & 2; }
|
||||
u32 getScaleAnmTypeX() const { return (mpData->mFlags >> 8) & 3; }
|
||||
u32 getScaleAnmTypeY() const { return (mpData->mFlags >> 10) & 3; }
|
||||
u32 getScaleCenterX() const { return (mpData->mFlags >> 12) & 3; }
|
||||
u32 getScaleCenterY() const { return (mpData->mFlags >> 14) & 3; }
|
||||
BOOL isEnableAlphaAnm() const { return mpData->mFlags & 0x10000; }
|
||||
BOOL isEnableAlphaFlick() const { return mpData->mFlags & 0x20000; }
|
||||
BOOL isEnableRotateAnm() const { return mpData->mFlags & 0x1000000; }
|
||||
|
||||
private:
|
||||
/* 0x00 */ const JPAExtraShapeData* mpData;
|
||||
/* 0x04 */ f32 mAlphaIncRate;
|
||||
/* 0x08 */ f32 mAlphaDecRate;
|
||||
/* 0x0C */ f32 mScaleIncRateX;
|
||||
/* 0x10 */ f32 mScaleIncRateY;
|
||||
/* 0x14 */ f32 mScaleDecRateX;
|
||||
/* 0x18 */ f32 mScaleDecRateY;
|
||||
};
|
||||
|
||||
void JPACalcAlphaFlickAnm(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcAlphaAnm(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcScaleX(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcScaleY(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcScaleCopy(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcScaleAnmNormal(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcScaleAnmRepeatX(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcScaleAnmReverseX(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcScaleAnmRepeatY(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPACalcScaleAnmReverseY(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
|
||||
#endif /* JPAEXTRASHAPE_H */
|
||||
@@ -0,0 +1,174 @@
|
||||
#ifndef JPAFIELDBLOCK_H
|
||||
#define JPAFIELDBLOCK_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/egg_types.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
class JPABaseParticle;
|
||||
class JPAFieldBlock;
|
||||
|
||||
class JPAFieldBase {
|
||||
public:
|
||||
void calcAffect(JPAFieldBlock*, JPABaseParticle*);
|
||||
f32 calcFadeAffect(JPAFieldBlock*, f32) const;
|
||||
|
||||
virtual ~JPAFieldBase() {}
|
||||
virtual void prepare(JPAEmitterWorkData*, JPAFieldBlock*) {}
|
||||
virtual void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*) = 0;
|
||||
|
||||
/* 0x04 */ EGG::Vector3f mAccel;
|
||||
};
|
||||
|
||||
class JPAFieldGravity : public JPAFieldBase {
|
||||
public:
|
||||
void prepare(JPAEmitterWorkData*, JPAFieldBlock*);
|
||||
void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
~JPAFieldGravity() {}
|
||||
};
|
||||
|
||||
class JPAFieldAir : public JPAFieldBase {
|
||||
public:
|
||||
void prepare(JPAEmitterWorkData*, JPAFieldBlock*);
|
||||
void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
~JPAFieldAir() {}
|
||||
};
|
||||
|
||||
class JPAFieldMagnet : public JPAFieldBase {
|
||||
public:
|
||||
void prepare(JPAEmitterWorkData*, JPAFieldBlock*);
|
||||
void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
~JPAFieldMagnet() {}
|
||||
|
||||
/* 0x10 */ EGG::Vector3f mDir;
|
||||
};
|
||||
|
||||
class JPAFieldNewton : public JPAFieldBase {
|
||||
public:
|
||||
void prepare(JPAEmitterWorkData*, JPAFieldBlock*);
|
||||
void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
~JPAFieldNewton() {}
|
||||
|
||||
/* 0x10 */ EGG::Vector3f mDir;
|
||||
/* 0x1C */ f32 mCutoff;
|
||||
};
|
||||
|
||||
class JPAFieldVortex : public JPAFieldBase {
|
||||
public:
|
||||
void prepare(JPAEmitterWorkData*, JPAFieldBlock*);
|
||||
void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
~JPAFieldVortex() {}
|
||||
|
||||
/* 0x10 */ EGG::Vector3f field_0x10;
|
||||
/* 0x1C */ f32 field_0x1c;
|
||||
/* 0x20 */ f32 field_0x20;
|
||||
};
|
||||
|
||||
class JPAFieldRandom : public JPAFieldBase {
|
||||
public:
|
||||
void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
~JPAFieldRandom() {}
|
||||
};
|
||||
|
||||
class JPAFieldDrag : public JPAFieldBase {
|
||||
public:
|
||||
void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
~JPAFieldDrag() {}
|
||||
};
|
||||
|
||||
class JPAFieldConvection : public JPAFieldBase {
|
||||
public:
|
||||
void prepare(JPAEmitterWorkData*, JPAFieldBlock*);
|
||||
void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
~JPAFieldConvection() {}
|
||||
|
||||
/* 0x10 */ EGG::Vector3f field_0x10;
|
||||
/* 0x1C */ EGG::Vector3f field_0x1c;
|
||||
/* 0x28 */ EGG::Vector3f field_0x28;
|
||||
};
|
||||
|
||||
class JPAFieldSpin : public JPAFieldBase {
|
||||
public:
|
||||
void prepare(JPAEmitterWorkData*, JPAFieldBlock*);
|
||||
void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
~JPAFieldSpin() {}
|
||||
|
||||
/* 0x10 */ EGG::Vector3f field_0x10;
|
||||
/* 0x1C */ EGG::Vector3f field_0x1c;
|
||||
/* 0x28 */ EGG::Vector3f field_0x28;
|
||||
};
|
||||
|
||||
// unknown name
|
||||
class JPAFieldBlockData {
|
||||
public:
|
||||
/* 0x00 */ u8 mMagic[4];
|
||||
/* 0x04 */ u32 mSize;
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ EGG::Vector3f mPos;
|
||||
/* 0x18 */ EGG::Vector3f mDir;
|
||||
/* 0x24 */ f32 mMag;
|
||||
/* 0x28 */ f32 mMagRndm;
|
||||
/* 0x2C */ f32 mVal1;
|
||||
/* 0x30 */ f32 mFadeInTime;
|
||||
/* 0x34 */ f32 mFadeOutTime;
|
||||
/* 0x38 */ f32 mEnTime;
|
||||
/* 0x3C */ f32 mDisTime;
|
||||
/* 0x40 */ u8 mCycle;
|
||||
};
|
||||
|
||||
class JPAFieldBlock {
|
||||
public:
|
||||
JPAFieldBlock(u8 const*, EGG::Heap*);
|
||||
void init(EGG::Heap*);
|
||||
|
||||
u32 getType() { return mpData->mFlags & 0xF; }
|
||||
u32 getAddType() { return (mpData->mFlags >> 8) & 3; }
|
||||
u32 getSttFlag() { return mpData->mFlags >> 16; }
|
||||
bool checkStatus(u16 flag) { return flag & getSttFlag(); }
|
||||
f32 getMagRndm() const { return mpData->mMagRndm; }
|
||||
f32 getVal1() const { return mpData->mVal1; }
|
||||
f32 getFadeInTime() { return mpData->mFadeInTime; }
|
||||
f32 getFadeOutTime() { return mpData->mFadeOutTime; }
|
||||
f32 getEnTime() { return mpData->mEnTime; }
|
||||
f32 getDisTime() { return mpData->mDisTime; }
|
||||
u8 getCycle() { return mpData->mCycle; }
|
||||
f32 getFadeInRate() { return mFadeInRate; }
|
||||
f32 getFadeOutRate() { return mFadeOutRate; }
|
||||
EGG::Vector3f& getPos() { return mPos; }
|
||||
EGG::Vector3f& getDir() { return mDir; }
|
||||
f32 getMag() const { return mMag; }
|
||||
void getPosOrig(EGG::Vector3f* pos) { pos->set(mpData->mPos); }
|
||||
void getDirOrig(EGG::Vector3f* dir) { dir->set(mpData->mDir); }
|
||||
f32 getMagOrig() { return mpData->mMag; }
|
||||
void initOpParam() {
|
||||
getPosOrig(&mPos);
|
||||
getDirOrig(&mDir);
|
||||
mMag = getMagOrig();
|
||||
}
|
||||
void prepare(JPAEmitterWorkData* work) { mpField->prepare(work, this); }
|
||||
void calc(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { mpField->calc(work, this, ptcl); }
|
||||
|
||||
private:
|
||||
/* 0x00 */ const JPAFieldBlockData* mpData;
|
||||
/* 0x04 */ JPAFieldBase* mpField;
|
||||
/* 0x08 */ f32 mFadeInRate;
|
||||
/* 0x0C */ f32 mFadeOutRate;
|
||||
/* 0x10 */ EGG::Vector3f mPos;
|
||||
/* 0x1C */ EGG::Vector3f mDir;
|
||||
/* 0x28 */ f32 mMag;
|
||||
|
||||
enum Type {
|
||||
/* 0x0 */ FIELD_GRAVITY,
|
||||
/* 0x1 */ FIELD_AIR,
|
||||
/* 0x2 */ FIELD_MAGNET,
|
||||
/* 0x3 */ FIELD_NEWTON,
|
||||
/* 0x4 */ FIELD_VORTEX,
|
||||
/* 0x5 */ FIELD_RANDOM,
|
||||
/* 0x6 */ FIELD_DRAG,
|
||||
/* 0x7 */ FIELD_CONVECTION,
|
||||
/* 0x8 */ FIELD_SPIN,
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* JPAFIELDBLOCK_H */
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef JPAKEYBLOCK_H
|
||||
#define JPAKEYBLOCK_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPAKeyBlock {
|
||||
JPAKeyBlock(u8 const*);
|
||||
f32 calc(f32);
|
||||
|
||||
u8 getID() { return mDataStart[8]; }
|
||||
|
||||
const u8* mDataStart;
|
||||
const f32* field_0x4;
|
||||
};
|
||||
|
||||
|
||||
#endif /* JPAKEYBLOCK_H */
|
||||
@@ -0,0 +1,131 @@
|
||||
#ifndef JPALIST_H
|
||||
#define JPALIST_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
template <class T>
|
||||
struct JPANode {
|
||||
JPANode() : mpPrev(NULL), mpNext(NULL) {
|
||||
}
|
||||
~JPANode() {}
|
||||
JPANode<T>* getPrev() { return mpPrev; }
|
||||
JPANode<T>* getNext() { return mpNext; }
|
||||
T* getObject() { return &mData; }
|
||||
|
||||
/* 0x00 */ JPANode<T>* mpPrev;
|
||||
/* 0x04 */ JPANode<T>* mpNext;
|
||||
/* 0x08 */ T mData;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
template <class T>
|
||||
struct JPAList {
|
||||
/* 0x00 */ JPANode<T>* mpFirst;
|
||||
/* 0x04 */ JPANode<T>* mpLast;
|
||||
/* 0x08 */ u32 mNum;
|
||||
|
||||
JPAList() : mpFirst(NULL), mpLast(NULL), mNum() {}
|
||||
~JPAList() {}
|
||||
|
||||
JPANode<T>* getEnd() { return NULL; }
|
||||
JPANode<T>* getFirst() const { return mpFirst; }
|
||||
JPANode<T>* getLast() const { return mpLast; }
|
||||
u32 getNum() const { return mNum; }
|
||||
|
||||
void push_front(JPANode<T>* node) {
|
||||
if (mpFirst != NULL) {
|
||||
node->mpPrev = NULL;
|
||||
node->mpNext = mpFirst;
|
||||
mpFirst->mpPrev = node;
|
||||
mpFirst = node;
|
||||
} else {
|
||||
mpLast = node;
|
||||
mpFirst = node;
|
||||
node->mpPrev = NULL;
|
||||
node->mpNext = NULL;
|
||||
}
|
||||
|
||||
mNum++;
|
||||
}
|
||||
|
||||
void push_back(JPANode<T>* node) {
|
||||
if (mpLast != NULL) {
|
||||
node->mpPrev = mpLast;
|
||||
node->mpNext = NULL;
|
||||
mpLast->mpNext = node;
|
||||
mpLast = node;
|
||||
} else {
|
||||
mpFirst = node;
|
||||
mpLast = node;
|
||||
node->mpNext = node->mpPrev = NULL;
|
||||
}
|
||||
|
||||
mNum++;
|
||||
}
|
||||
|
||||
JPANode<T>* pop_front() {
|
||||
JPANode<T>* ret = NULL;
|
||||
|
||||
if (mNum == 1) {
|
||||
ret = mpFirst;
|
||||
mpLast = NULL;
|
||||
mpFirst = NULL;
|
||||
mNum--;
|
||||
} else if (mNum) {
|
||||
ret = mpFirst;
|
||||
ret->mpNext->mpPrev = NULL;
|
||||
mpFirst = ret->mpNext;
|
||||
mNum--;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
JPANode<T>* pop_back() {
|
||||
JPANode<T>* ret = NULL;
|
||||
|
||||
if (mNum == 1) {
|
||||
ret = mpLast;
|
||||
mpLast = NULL;
|
||||
mpFirst = NULL;
|
||||
mNum--;
|
||||
} else if (mNum) {
|
||||
ret = mpLast;
|
||||
ret->mpPrev->mpNext = NULL;
|
||||
mpLast = ret->mpPrev;
|
||||
mNum--;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
JPANode<T>* erase(JPANode<T>* node) {
|
||||
if (node->mpNext != NULL && node->mpPrev != NULL) {
|
||||
node->mpPrev->mpNext = node->mpNext;
|
||||
node->mpNext->mpPrev = node->mpPrev;
|
||||
mNum--;
|
||||
} else if (node->mpNext != NULL) {
|
||||
node->mpNext->mpPrev = NULL;
|
||||
mpFirst = node->mpNext;
|
||||
mNum--;
|
||||
} else if (node->mpPrev != NULL) {
|
||||
node->mpPrev->mpNext = NULL;
|
||||
mpLast = node->mpPrev;
|
||||
mNum--;
|
||||
} else {
|
||||
mpLast = NULL;
|
||||
mpFirst = NULL;
|
||||
mNum--;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef JPAMATH_H
|
||||
#define JPAMATH_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
void JPAGetDirMtx(EGG::Vector3f const& param_0, f32 (*param_1)[4]);
|
||||
void JPAGetYZRotateMtx(s16 angleY, s16 angleZ, f32 (*param_2)[4]);
|
||||
void JPAGetXYZRotateMtx(s16 x, s16 y, s16 z, Mtx dst);
|
||||
void JPASetRMtxTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4], EGG::Vector3f *param_2);
|
||||
f32 JPACalcKeyAnmValue(f32 param_0, u16 param_1, f32 const* param_2);
|
||||
void JPASetRMtxSTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4],
|
||||
EGG::Vector3f* param_2, EGG::Vector3f* param_3);
|
||||
|
||||
#endif /* JPAMATH_H */
|
||||
@@ -0,0 +1,93 @@
|
||||
#ifndef JPAPARTICLE_H
|
||||
#define JPAPARTICLE_H
|
||||
|
||||
#include "common.h"
|
||||
#include "rvl/GX.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
class JPABaseEmitter;
|
||||
class JPABaseParticle;
|
||||
class JPAEmitterCallBack;
|
||||
class JPAEmitterManager;
|
||||
class JPAParticleCallBack;
|
||||
class JPAResourceManager;
|
||||
struct JPAEmitterWorkData;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPABaseParticle {
|
||||
public:
|
||||
~JPABaseParticle() {}
|
||||
void init_p(JPAEmitterWorkData*);
|
||||
void init_c(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
bool calc_p(JPAEmitterWorkData*);
|
||||
bool calc_c(JPAEmitterWorkData*);
|
||||
bool canCreateChild(JPAEmitterWorkData*);
|
||||
f32 getWidth(JPABaseEmitter const*) const;
|
||||
f32 getHeight(JPABaseEmitter const*) const;
|
||||
int getAge() { return mAge; }
|
||||
void setOffsetPosition(const EGG::Vector3f& pos) { mOffsetPosition.set(pos); }
|
||||
void setOffsetPosition(f32 x, f32 y, f32 z) { mOffsetPosition.set(x, y, z); }
|
||||
void getOffsetPosition(EGG::Vector3f& pos) { pos.set(mOffsetPosition); }
|
||||
s16 getRotateAngle() const { return mRotateAngle; }
|
||||
void getGlobalPosition(EGG::Vector3f& pos) const { pos.set(mPosition); }
|
||||
f32 getParticleScaleX() const { return mParticleScaleX; }
|
||||
f32 getParticleScaleY() const { return mParticleScaleY; }
|
||||
void setStatus(u32 flag) { mStatus |= flag; }
|
||||
u32 checkStatus(u32 flag) { return mStatus & flag; }
|
||||
void initStatus(u32 status) { mStatus = status; }
|
||||
void setInvisibleParticleFlag() { setStatus(8); }
|
||||
void setDeleteParticleFlag() { setStatus(2); }
|
||||
void getVelVec(EGG::Vector3f& vec) const { vec.set(mVelocity); }
|
||||
void getLocalPosition(EGG::Vector3f& vec) const { vec.set(mLocalPosition); }
|
||||
void getBaseAxis(EGG::Vector3f& vec) const { vec.set(mBaseAxis); }
|
||||
|
||||
public:
|
||||
/* 0x00 */ EGG::Vector3f mPosition;
|
||||
/* 0x0C */ EGG::Vector3f mLocalPosition;
|
||||
/* 0x18 */ EGG::Vector3f mOffsetPosition;
|
||||
/* 0x24 */ EGG::Vector3f mVelocity;
|
||||
/* 0x30 */ EGG::Vector3f mVelType1;
|
||||
/* 0x3C */ EGG::Vector3f mVelType0;
|
||||
/* 0x48 */ EGG::Vector3f mVelType2;
|
||||
/* 0x54 */ EGG::Vector3f mBaseAxis;
|
||||
/* 0x60 */ f32 mParticleScaleX;
|
||||
/* 0x64 */ f32 mParticleScaleY;
|
||||
/* 0x68 */ f32 mScaleOut;
|
||||
/* 0x6C */ f32 mAlphaWaveRandom;
|
||||
/* 0x70 */ f32 mMoment;
|
||||
/* 0x74 */ f32 mDrag;
|
||||
/* 0x78 */ u32 field_0x78;
|
||||
/* 0x7C */ u32 mStatus;
|
||||
/* 0x80 */ s16 mAge;
|
||||
/* 0x82 */ s16 mLifeTime;
|
||||
/* 0x84 */ f32 mTime;
|
||||
/* 0x88 */ u16 mRotateAngle;
|
||||
/* 0x8A */ s16 mRotateSpeed;
|
||||
/* 0x8C */ GXColor mPrmClr;
|
||||
/* 0x90 */ GXColor mEnvClr;
|
||||
/* 0x94 */ u8 mTexAnmIdx;
|
||||
/* 0x95 */ u8 mAnmRandom;
|
||||
/* 0x96 */ u8 mPrmColorAlphaAnm;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPAParticleCallBack {
|
||||
public:
|
||||
JPAParticleCallBack() {}
|
||||
virtual ~JPAParticleCallBack() = 0;
|
||||
virtual void execute(JPABaseEmitter*, JPABaseParticle*) {}
|
||||
virtual void draw(JPABaseEmitter*, JPABaseParticle*) {}
|
||||
};
|
||||
|
||||
// not sure where this belongs
|
||||
static inline u32 COLOR_MULTI(u32 a, u32 b) {
|
||||
return ((a * (b + 1)) * 0x10000) >> 24;
|
||||
}
|
||||
|
||||
#endif /* JPAPARTICLE_H */
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef JPARANDOM_H
|
||||
#define JPARANDOM_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPARandom {
|
||||
public:
|
||||
JPARandom() { mSeed = 0; }
|
||||
JPARandom(u32 seed) { mSeed = seed; }
|
||||
~JPARandom() {}
|
||||
void set_seed(u32 seed) { mSeed = seed; }
|
||||
|
||||
u32 get_rndm_u() { return mSeed = mSeed * 0x19660du + 0x3c6ef35fu; }
|
||||
|
||||
f32 get_rndm_f() {
|
||||
union {
|
||||
u32 u;
|
||||
f32 f;
|
||||
} a;
|
||||
a.u = ((get_rndm_u() >> 9) | 0x3f800000);
|
||||
return a.f - 1.0f;
|
||||
}
|
||||
|
||||
f32 get_rndm_zp() {
|
||||
f32 f = get_rndm_f();
|
||||
return (f + f) - 1.0f;
|
||||
}
|
||||
|
||||
f32 get_rndm_zh() {
|
||||
return get_rndm_f() - 0.5f;
|
||||
}
|
||||
|
||||
s16 get_rndm_ss() { return (s16)(get_rndm_u() >> 16); }
|
||||
|
||||
public:
|
||||
u32 mSeed;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
#ifndef JPARESOURCE_H
|
||||
#define JPARESOURCE_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/egg_types.h"
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
class JPABaseEmitter;
|
||||
class JPABaseParticle;
|
||||
|
||||
class JPABaseShape;
|
||||
class JPAExtraShape;
|
||||
class JPAChildShape;
|
||||
class JPAExTexShape;
|
||||
class JPADynamicsBlock;
|
||||
class JPAFieldBlock;
|
||||
class JPAKeyBlock;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPAResource {
|
||||
public:
|
||||
JPAResource();
|
||||
void init(EGG::Heap*);
|
||||
bool calc(JPAEmitterWorkData*, JPABaseEmitter*);
|
||||
void draw(JPAEmitterWorkData*, JPABaseEmitter*);
|
||||
void drawP(JPAEmitterWorkData*);
|
||||
void drawC(JPAEmitterWorkData*);
|
||||
void setPTev();
|
||||
void setCTev(JPAEmitterWorkData*);
|
||||
void calc_p(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void calc_c(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void calcField(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void calcKey(JPAEmitterWorkData*);
|
||||
void calcWorkData_c(JPAEmitterWorkData*);
|
||||
void calcWorkData_d(JPAEmitterWorkData*);
|
||||
|
||||
JPABaseShape* getBsp() const { return mpBaseShape; }
|
||||
JPAExtraShape* getEsp() const { return mpExtraShape; }
|
||||
JPAChildShape* getCsp() const { return mpChildShape; }
|
||||
JPAExTexShape* getEts() const { return mpExTexShape; }
|
||||
JPADynamicsBlock* getDyn() const { return mpDynamicsBlock; }
|
||||
|
||||
u32 getTexIdx(u32 idx) const { return mpTDB1[idx]; }
|
||||
u16 getUsrIdx() const { return mUsrIdx; }
|
||||
|
||||
public:
|
||||
typedef void (*EmitterFunc)(JPAEmitterWorkData*);
|
||||
typedef void (*ParticleFunc)(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
/* 0x00 */ EmitterFunc* mpCalcEmitterFuncList;
|
||||
/* 0x04 */ EmitterFunc* mpDrawEmitterFuncList;
|
||||
/* 0x08 */ EmitterFunc* mpDrawEmitterChildFuncList;
|
||||
/* 0x0C */ ParticleFunc* mpCalcParticleFuncList;
|
||||
/* 0x10 */ ParticleFunc* mpDrawParticleFuncList;
|
||||
/* 0x14 */ ParticleFunc* mpCalcParticleChildFuncList;
|
||||
/* 0x18 */ ParticleFunc* mpDrawParticleChildFuncList;
|
||||
|
||||
/* 0x1C */ JPABaseShape* mpBaseShape;
|
||||
/* 0x20 */ JPAExtraShape* mpExtraShape;
|
||||
/* 0x24 */ JPAChildShape* mpChildShape;
|
||||
/* 0x28 */ JPAExTexShape* mpExTexShape;
|
||||
/* 0x2C */ JPADynamicsBlock* mpDynamicsBlock;
|
||||
/* 0x30 */ JPAFieldBlock** mpFieldBlocks;
|
||||
/* 0x34 */ JPAKeyBlock** mpKeyBlocks;
|
||||
/* 0x38 */ u16 const* mpTDB1;
|
||||
/* 0x3C */ u16 mUsrIdx;
|
||||
/* 0x3E */ u8 mFieldBlockNum;
|
||||
/* 0x3F */ u8 mKeyBlockNum;
|
||||
/* 0x40 */ u8 mTDB1Num;
|
||||
/* 0x41 */ u8 mpCalcEmitterFuncListNum;
|
||||
/* 0x42 */ u8 mpDrawEmitterFuncListNum;
|
||||
/* 0x43 */ u8 mpDrawEmitterChildFuncListNum;
|
||||
/* 0x44 */ u8 mpCalcParticleFuncListNum;
|
||||
/* 0x45 */ u8 mpDrawParticleFuncListNum;
|
||||
/* 0x46 */ u8 mpCalcParticleChildFuncListNum;
|
||||
/* 0x47 */ u8 mpDrawParticleChildFuncListNum;
|
||||
};
|
||||
|
||||
#endif /* JPARESOURCE_H */
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef JPARESOURCELOADER_H
|
||||
#define JPARESOURCELOADER_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
class JPAResourceManager;
|
||||
|
||||
class JPAResourceLoader {
|
||||
public:
|
||||
JPAResourceLoader(u8 const*, JPAResourceManager*);
|
||||
void load_jpc(u8 const*, JPAResourceManager*);
|
||||
};
|
||||
|
||||
#endif /* JPARESOURCELOADER_H */
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef JPARESOURCEMANAGER_H
|
||||
#define JPARESOURCEMANAGER_H
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/egg_types.h"
|
||||
#include "rvl/GX.h"
|
||||
#include "JSystem/JParticle/JPATexture.h"
|
||||
|
||||
class JPAResource;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPAResourceManager {
|
||||
public:
|
||||
JPAResourceManager(void const*, EGG::Heap*);
|
||||
JPAResource* getResource(u16) const;
|
||||
bool checkUserIndexDuplication(u16) const;
|
||||
const EGG::ResTIMG* swapTexture(EGG::ResTIMG const*, char const*);
|
||||
void registRes(JPAResource*);
|
||||
void registTex(JPATexture*);
|
||||
u32 getResUserWork(u16) const;
|
||||
|
||||
void load(u16 idx, GXTexMapID texMapID) { mpTexArr[idx]->load(texMapID); }
|
||||
|
||||
public:
|
||||
/* 0x00 */ EGG::Heap* mpHeap;
|
||||
/* 0x04 */ JPAResource** mpResArr;
|
||||
/* 0x08 */ JPATexture** mpTexArr;
|
||||
/* 0x0C */ u16 mResMax;
|
||||
/* 0x0E */ u16 mResNum;
|
||||
/* 0x10 */ u16 mTexMax;
|
||||
/* 0x12 */ u16 mTexNum;
|
||||
};
|
||||
|
||||
#endif /* JPARESOURCEMANAGER_H */
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef JPATEXTURE_H
|
||||
#define JPATEXTURE_H
|
||||
|
||||
#include "common.h"
|
||||
#include "rvl/GX.h"
|
||||
#include "egg/gfx/eggTexture.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
struct JPATextureData {
|
||||
// Probably magic / size / flags up top here, but they're unused.
|
||||
/* 0x00 */ char field_0x00[0x0C];
|
||||
/* 0x0C */ char mName[0x14];
|
||||
/* 0x20 */ EGG::ResTIMG mResTIMG;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
*/
|
||||
class JPATexture {
|
||||
public:
|
||||
JPATexture(u8 const*);
|
||||
virtual ~JPATexture();
|
||||
|
||||
void load(GXTexMapID texMapID) { mTexture.load(texMapID); }
|
||||
|
||||
EGG::Texture* getJUTTexture() { return &mTexture; }
|
||||
const char* getName() const { return mpData->mName; }
|
||||
|
||||
public:
|
||||
EGG::Texture mTexture;
|
||||
const JPATextureData* mpData;
|
||||
};
|
||||
|
||||
#endif /* JPATEXTURE_H */
|
||||
@@ -0,0 +1,254 @@
|
||||
#ifndef JSULIST_H
|
||||
#define JSULIST_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
template <typename T>
|
||||
class JSUList;
|
||||
|
||||
//
|
||||
// Link
|
||||
//
|
||||
|
||||
class JSUPtrList;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
*
|
||||
*/
|
||||
class JSUPtrLink {
|
||||
public:
|
||||
JSUPtrLink(void* object);
|
||||
~JSUPtrLink();
|
||||
|
||||
void* getObjectPtr() const { return mObject; }
|
||||
|
||||
JSUPtrList* getList() const { return mList; }
|
||||
|
||||
JSUPtrLink* getNext() const { return mNext; }
|
||||
|
||||
JSUPtrLink* getPrev() const { return mPrev; }
|
||||
|
||||
public:
|
||||
void* mObject;
|
||||
JSUPtrList* mList;
|
||||
JSUPtrLink* mPrev;
|
||||
JSUPtrLink* mNext;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
*
|
||||
*/
|
||||
template <typename T>
|
||||
class JSULink : public JSUPtrLink {
|
||||
public:
|
||||
JSULink(T* object) : JSUPtrLink((void*)object) {}
|
||||
|
||||
T* getObject() const { return static_cast<T*>(mObject); }
|
||||
|
||||
JSUList<T>* getSupervisor() const { return static_cast<JSUList<T>*>(this->getList()); }
|
||||
|
||||
JSULink<T>* getNext() const { return static_cast<JSULink*>(mNext); }
|
||||
|
||||
JSULink<T>* getPrev() const { return static_cast<JSULink*>(mPrev); }
|
||||
};
|
||||
|
||||
//
|
||||
// List
|
||||
//
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
*
|
||||
*/
|
||||
class JSUPtrList {
|
||||
public:
|
||||
JSUPtrList() { this->initiate(); }
|
||||
JSUPtrList(bool init);
|
||||
~JSUPtrList();
|
||||
|
||||
void initiate();
|
||||
void setFirst(JSUPtrLink* first);
|
||||
bool append(JSUPtrLink* ptr);
|
||||
bool prepend(JSUPtrLink* ptr);
|
||||
bool insert(JSUPtrLink* before, JSUPtrLink* ptr);
|
||||
bool remove(JSUPtrLink* ptr);
|
||||
JSUPtrLink* getNthLink(u32 i) const;
|
||||
|
||||
JSUPtrLink* getFirstLink() const { return mHead; }
|
||||
|
||||
JSUPtrLink* getLastLink() const { return mTail; }
|
||||
|
||||
u32 getNumLinks() const { return mLength; }
|
||||
|
||||
private:
|
||||
JSUPtrLink* mHead;
|
||||
JSUPtrLink* mTail;
|
||||
u32 mLength;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
*
|
||||
*/
|
||||
template <typename T>
|
||||
class JSUList : public JSUPtrList {
|
||||
public:
|
||||
JSUList() : JSUPtrList() {}
|
||||
JSUList(bool init) : JSUPtrList(init) {}
|
||||
|
||||
~JSUList() {}
|
||||
|
||||
bool append(JSULink<T>* link) { return this->JSUPtrList::append((JSUPtrLink*)link); }
|
||||
|
||||
bool prepend(JSULink<T>* link) { return this->JSUPtrList::prepend((JSUPtrLink*)link); }
|
||||
|
||||
bool insert(JSULink<T>* before, JSULink<T>* link) {
|
||||
return this->JSUPtrList::insert((JSUPtrLink*)before, (JSUPtrLink*)link);
|
||||
}
|
||||
|
||||
bool remove(JSULink<T>* link) { return this->JSUPtrList::remove((JSUPtrLink*)link); }
|
||||
|
||||
JSULink<T>* getFirst() const { return (JSULink<T>*)getFirstLink(); }
|
||||
|
||||
JSULink<T>* getLast() const { return (JSULink<T>*)getLastLink(); }
|
||||
|
||||
JSULink<T>* getNth(int index) { return (JSULink<T>*)getNthLink(index); }
|
||||
|
||||
JSULink<T>* getEnd() const { return NULL; }
|
||||
|
||||
u32 getNumLinks() const { return this->JSUPtrList::getNumLinks(); }
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
*
|
||||
*/
|
||||
template <typename T>
|
||||
class JSUListIterator {
|
||||
public:
|
||||
JSUListIterator() : mLink(NULL) {}
|
||||
JSUListIterator(JSULink<T>* link) : mLink(link) {}
|
||||
JSUListIterator(JSUList<T>* list) : mLink(list->getFirst()) {}
|
||||
|
||||
JSUListIterator<T>& operator=(JSULink<T>* link) {
|
||||
this->mLink = link;
|
||||
return *this;
|
||||
}
|
||||
|
||||
T* getObject() { return this->mLink->getObject(); }
|
||||
|
||||
bool operator==(JSULink<T> const* other) const { return this->mLink == other; }
|
||||
bool operator!=(JSULink<T> const* other) const { return this->mLink != other; }
|
||||
bool operator==(JSUListIterator<T> const& other) const { return this->mLink == other.mLink; }
|
||||
bool operator!=(JSUListIterator<T> const& other) const { return this->mLink != other.mLink; }
|
||||
|
||||
JSUListIterator<T> operator++(int) {
|
||||
JSUListIterator<T> prev = *this;
|
||||
this->mLink = this->mLink->getNext();
|
||||
return prev;
|
||||
}
|
||||
|
||||
JSUListIterator<T>& operator++() {
|
||||
this->mLink = this->mLink->getNext();
|
||||
return *this;
|
||||
}
|
||||
|
||||
JSUListIterator<T> operator--(int) {
|
||||
JSUListIterator<T> prev = *this;
|
||||
this->mLink = this->mLink->getPrev();
|
||||
return prev;
|
||||
}
|
||||
|
||||
JSUListIterator<T>& operator--() {
|
||||
this->mLink = this->mLink->getPrev();
|
||||
return *this;
|
||||
}
|
||||
|
||||
T& operator*() { return *this->getObject(); }
|
||||
|
||||
T* operator->() const { return mLink->getObject(); }
|
||||
|
||||
// private:
|
||||
JSULink<T>* mLink;
|
||||
};
|
||||
|
||||
//
|
||||
// Tree
|
||||
//
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
*
|
||||
*/
|
||||
template <typename T>
|
||||
class JSUTree : public JSUList<T>, public JSULink<T> {
|
||||
public:
|
||||
JSUTree(T* owner) : JSUList<T>(), JSULink<T>(owner) {}
|
||||
~JSUTree() {}
|
||||
|
||||
bool appendChild(JSUTree<T>* child) { return this->append(child); }
|
||||
|
||||
bool removeChild(JSUTree<T>* child) { return this->remove(child); }
|
||||
|
||||
bool insertChild(JSUTree<T>* before, JSUTree<T>* child) { return this->insert(before, child); }
|
||||
|
||||
JSUTree<T>* getEndChild() const { return NULL; }
|
||||
|
||||
JSUTree<T>* getFirstChild() const { return (JSUTree<T>*)this->getFirst(); }
|
||||
|
||||
JSUTree<T>* getLastChild() const { return (JSUTree<T>*)this->getLast(); }
|
||||
|
||||
JSUTree<T>* getNextChild() const { return (JSUTree<T>*)this->getNext(); }
|
||||
|
||||
JSUTree<T>* getPrevChild() const { return (JSUTree<T>*)this->getPrev(); }
|
||||
|
||||
u32 getNumChildren() const { return this->getNumLinks(); }
|
||||
|
||||
T* getObject() const { return (T*)this->getObjectPtr(); }
|
||||
|
||||
JSUTree<T>* getParent() const { return (JSUTree<T>*)this->getList(); }
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
*
|
||||
*/
|
||||
template <typename T>
|
||||
class JSUTreeIterator {
|
||||
public:
|
||||
JSUTreeIterator() : mTree(NULL) {}
|
||||
JSUTreeIterator(JSUTree<T>* tree) : mTree(tree) {}
|
||||
|
||||
JSUTreeIterator<T>& operator=(JSUTree<T>* tree) {
|
||||
this->mTree = tree;
|
||||
return *this;
|
||||
}
|
||||
|
||||
T* getObject() { return this->mTree->getObject(); }
|
||||
|
||||
bool operator==(JSUTree<T>* other) { return this->mTree == other; }
|
||||
|
||||
bool operator!=(JSUTree<T>* other) { return this->mTree != other; }
|
||||
|
||||
JSUTreeIterator<T> operator++(int) {
|
||||
JSUTreeIterator<T> prev = *this;
|
||||
this->mTree = this->mTree->getNextChild();
|
||||
return prev;
|
||||
}
|
||||
|
||||
JSUTreeIterator<T>& operator++() {
|
||||
this->mTree = this->mTree->getNextChild();
|
||||
return *this;
|
||||
}
|
||||
|
||||
T* operator*() { return this->getObject(); }
|
||||
|
||||
T* operator->() { return this->getObject(); }
|
||||
|
||||
private:
|
||||
JSUTree<T>* mTree;
|
||||
};
|
||||
|
||||
#endif /* JSULIST_H */
|
||||
@@ -0,0 +1,45 @@
|
||||
#ifndef JSUPPORT_H
|
||||
#define JSUPPORT_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
*
|
||||
*/
|
||||
template <typename T>
|
||||
T* JSUConvertOffsetToPtr(const void* ptr, u32 offset) {
|
||||
if (offset == 0) {
|
||||
return NULL;
|
||||
} else {
|
||||
return (T*)((s32)ptr + (s32)offset);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
*
|
||||
*/
|
||||
template <typename T>
|
||||
T* JSUConvertOffsetToPtr(const void* ptr, const void* offset) {
|
||||
if (offset == NULL) {
|
||||
return NULL;
|
||||
} else {
|
||||
return (T*)((s32)ptr + (s32)offset);
|
||||
}
|
||||
}
|
||||
|
||||
inline u8 JSULoNibble(u8 param_0) { return param_0 & 0x0f; }
|
||||
inline u8 JSUHiNibble(u8 param_0) {return param_0 >> 4; }
|
||||
|
||||
inline u8 JSULoByte(u16 in) {
|
||||
return in & 0xff;
|
||||
}
|
||||
|
||||
inline u8 JSUHiByte(u16 in) {
|
||||
return in >> 8;
|
||||
}
|
||||
|
||||
inline u16 JSULoHalf(u32 param_0) {return param_0; }
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,64 @@
|
||||
#ifndef JUTASSERT_H
|
||||
#define JUTASSERT_H
|
||||
|
||||
#include "rvl/OS.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#define JUT_ASSERT(LINE, COND) \
|
||||
(COND) ? (void)0 : (JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND), OSPanic(__FILE__, LINE, "Halt"));
|
||||
|
||||
#define JUT_ASSERT_MSG(LINE, COND, MSG) \
|
||||
(COND) ? (void)0 : (JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, MSG), OSPanic(__FILE__, LINE, "Halt"));
|
||||
|
||||
#define JUT_ASSERT_MSG_F(LINE, COND, MSG, ...) \
|
||||
(COND) ? (void)0 : (JUTAssertion::showAssert_f(JUTAssertion::getSDevice(), __FILE__, LINE, MSG, __VA_ARGS__), OSPanic(__FILE__, LINE, "Halt"));
|
||||
|
||||
#define J3D_ASSERT(LINE, COND, MSG) JUT_ASSERT_MSG(LINE, (COND) != 0, MSG)
|
||||
|
||||
#define JUT_PANIC(LINE, TEXT) \
|
||||
JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, TEXT); \
|
||||
OSPanic(__FILE__, LINE, "Halt");
|
||||
|
||||
#define JUT_WARN_DEVICE(LINE, DEVICE, ...) \
|
||||
JUTAssertion::setWarningMessage_f(DEVICE, __FILE__, LINE, __VA_ARGS__); \
|
||||
|
||||
#define JUT_WARN(LINE, ...) \
|
||||
JUT_WARN_DEVICE(LINE, JUTAssertion::getSDevice(), __VA_ARGS__)
|
||||
|
||||
#define JUT_LOG(LINE, ...) \
|
||||
JUTAssertion::setLogMessage_f(JUTAssertion::getSDevice(), __FILE__, LINE, __VA_ARGS__)
|
||||
|
||||
#define JUT_CONFIRM(LINE, COND) \
|
||||
JUTAssertion::setConfirmMessage(JUTAssertion::getSDevice(), __FILE__, LINE, COND, #COND)
|
||||
|
||||
#else
|
||||
#define JUT_ASSERT(...) (void)0;
|
||||
#define JUT_ASSERT_MSG(...) (void)0;
|
||||
#define JUT_ASSERT_MSG_F(...) (void)0;
|
||||
#define J3D_ASSERT(...) (void)0;
|
||||
#define JUT_PANIC(...)
|
||||
#define JUT_WARN(...)
|
||||
#define JUT_WARN_DEVICE(...)
|
||||
#define JUT_LOG(...)
|
||||
#define JUT_CONFIRM(...)
|
||||
#endif
|
||||
|
||||
namespace JUTAssertion {
|
||||
void create();
|
||||
u32 flush_subroutine();
|
||||
void flushMessage();
|
||||
void flushMessage_dbPrint();
|
||||
void setVisible(bool);
|
||||
void setMessageCount(int);
|
||||
|
||||
u32 getSDevice();
|
||||
void showAssert(u32 device, const char * file, int line, const char * assertion);
|
||||
void showAssert_f(u32 device, const char* file, int line, const char* msg, ...);
|
||||
void setWarningMessage_f(u32 device, char * file, int line, const char * fmt, ...);
|
||||
void setLogMessage_f(u32 device, char* file, int line, const char* fmt, ...);
|
||||
void setConfirmMessage(u32 param_1, char* file, int line, bool param_4, const char* msg);
|
||||
};
|
||||
|
||||
extern bool sAssertVisible;
|
||||
|
||||
#endif /* JUTASSERT_H */
|
||||
@@ -47,6 +47,14 @@ public:
|
||||
setCaptureFlag(false);
|
||||
}
|
||||
|
||||
void store(const ResTIMG *p_timg) {
|
||||
mTexInfo = nullptr;
|
||||
mEmbPalette = nullptr;
|
||||
mFlags = 0;
|
||||
field_0x3c = nullptr;
|
||||
storeTIMG(p_timg, (u8)0);
|
||||
}
|
||||
|
||||
Texture(int, int, GXTexFmt, Heap *);
|
||||
~Texture();
|
||||
|
||||
|
||||
@@ -36,6 +36,15 @@ struct Vector3f : public nw4r::math::VEC3 {
|
||||
return *this;
|
||||
}
|
||||
|
||||
void mul(const Vector3f &v, const Vector3f &w) {
|
||||
set(v.x * w.x, v.y * w.y, v.z * w.z);
|
||||
}
|
||||
|
||||
Vector3f &operator*=(const Vector3f &v) {
|
||||
set(x * v.x, y * v.y, z * v.z);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3f operator-() const {
|
||||
f32 z = this->z;
|
||||
f32 y = this->y;
|
||||
@@ -43,7 +52,7 @@ struct Vector3f : public nw4r::math::VEC3 {
|
||||
return Vector3f(-x, -y, -z);
|
||||
}
|
||||
|
||||
Vector3f operator-(const Vector3f &v) {
|
||||
Vector3f operator-(const Vector3f &v) const {
|
||||
return Vector3f(x - v.x, y - v.y, z - v.z);
|
||||
}
|
||||
|
||||
@@ -109,6 +118,22 @@ struct Vector3f : public nw4r::math::VEC3 {
|
||||
z = fz;
|
||||
}
|
||||
|
||||
Vector3f negated() {
|
||||
return Vector3f(-x, -y, -z);
|
||||
}
|
||||
|
||||
void set(const EGG::Vector3f& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
}
|
||||
|
||||
bool isZero() const {
|
||||
return squaredLength() <= Math<f32>::epsilon();
|
||||
}
|
||||
|
||||
void setZero() { x = y = z = 0.0f; };
|
||||
|
||||
f32 normalise();
|
||||
|
||||
Vector3f normalize() {
|
||||
|
||||
@@ -135,7 +135,7 @@ struct TexCoordGen {
|
||||
// __ct__Q34nw4r3lyt11TexCoordGenFv
|
||||
TexCoordGen() {
|
||||
reserve = 0;
|
||||
Set(GX_TG_MTX2x4, GX_TG_TEX0, GX_TEXMTX_IDENT);
|
||||
Set(GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
}
|
||||
|
||||
// Set__Q34nw4r3lyt11TexCoordGenF13_GXTexGenType12_GXTexGenSrcUl
|
||||
|
||||
+21
-21
@@ -4,27 +4,27 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "rvl/GX/GXAttr.h"
|
||||
#include "rvl/GX/GXBump.h"
|
||||
#include "rvl/GX/GXDisplayList.h"
|
||||
#include "rvl/GX/GXDraw.h"
|
||||
#include "rvl/GX/GXFifo.h"
|
||||
#include "rvl/GX/GXFrameBuf.h"
|
||||
#include "rvl/GX/GXGeometry.h"
|
||||
#include "rvl/GX/GXHardware.h"
|
||||
#include "rvl/GX/GXHardwareBP.h"
|
||||
#include "rvl/GX/GXHardwareCP.h"
|
||||
#include "rvl/GX/GXHardwareXF.h"
|
||||
#include "rvl/GX/GXInit.h"
|
||||
#include "rvl/GX/GXInternal.h"
|
||||
#include "rvl/GX/GXLight.h"
|
||||
#include "rvl/GX/GXMisc.h"
|
||||
#include "rvl/GX/GXPixel.h"
|
||||
#include "rvl/GX/GXTev.h"
|
||||
#include "rvl/GX/GXTexture.h"
|
||||
#include "rvl/GX/GXTransform.h"
|
||||
#include "rvl/GX/GXTypes.h"
|
||||
#include "rvl/GX/GXVert.h"
|
||||
#include "rvl/GX/GXAttr.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXBump.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXDisplayList.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXDraw.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXFifo.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXFrameBuf.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXGeometry.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXHardware.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXHardwareBP.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXHardwareCP.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXHardwareXF.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXInit.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXInternal.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXLight.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXMisc.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXPixel.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXTev.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXTexture.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXTransform.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXTypes.h" // IWYU pragma: export
|
||||
#include "rvl/GX/GXVert.h" // IWYU pragma: export
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ void __GXSetVCD(void);
|
||||
void __GXCalculateVLim(void);
|
||||
void __GXSetVAT(void);
|
||||
|
||||
static void GXSetTexCoordGen(GXTexCoordID id, GXTexGenType type, GXTexGenSrc src, u32 texMtxIdx);
|
||||
void GXSetTexCoordGen(GXTexCoordID id, GXTexGenType type, GXTexGenSrc src, u32 texMtxIdx);
|
||||
// // TODO: What matrix index is this???
|
||||
// GXSetTexCoordGen2(id, type, src, texMtxIdx, FALSE, 125);
|
||||
// }
|
||||
|
||||
@@ -8,8 +8,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
void GXBegin(GXPrimitive prim, GXVtxFmt fmt, u16 verts);
|
||||
|
||||
static void GXEnd(void);
|
||||
|
||||
#define GXEnd()
|
||||
|
||||
void GXSetLineWidth(u8 width, u32 offset);
|
||||
void GXSetPointSize(u8 size, u32 offset);
|
||||
void GXEnableTexOffsets(GXTexCoordID coordId, GXBool lineOfs, GXBool pointOfs);
|
||||
|
||||
@@ -26,7 +26,7 @@ void GXLoadPosMtxIndx(u16 index, u32 id);
|
||||
void GXLoadNrmMtxImm(const Mtx mtx, u32 id);
|
||||
void GXLoadNrmMtxIndx3x3(u16 index, u32 id);
|
||||
void GXSetCurrentMtx(u32 id);
|
||||
void GXLoadTexMtxImm(const f32 mtx[][4], u32 id, GXMtxType type);
|
||||
void GXLoadTexMtxImm(const f32 mtx[][4], u32 id, GXTexMtxType type);
|
||||
void GXSetViewportJitter(f32 ox, f32 oy, f32 sx, f32 sy, f32 near, f32 far, u32 nextField);
|
||||
void GXSetViewport(f32 ox, f32 oy, f32 sx, f32 sy, f32 near, f32 far);
|
||||
void GXGetViewportv(f32 view[6]);
|
||||
|
||||
@@ -44,6 +44,12 @@ extern "C" {
|
||||
// Real name! (from patent)
|
||||
typedef unsigned char GXBool;
|
||||
|
||||
#define GX_FALSE ((GXBool)0)
|
||||
#define GX_TRUE ((GXBool)1)
|
||||
|
||||
#define GX_ENABLE ((GXBool)1)
|
||||
#define GX_DISABLE ((GXBool)0)
|
||||
|
||||
/**
|
||||
* Common structs
|
||||
*/
|
||||
@@ -549,6 +555,30 @@ typedef enum _GXTevOp {
|
||||
GX_TEV_COMP_A8_EQ = GX_TEV_COMP_RGB8_EQ
|
||||
} GXTevOp;
|
||||
|
||||
typedef enum _GXPTTexMtx {
|
||||
GX_PTTEXMTX0 = 64,
|
||||
GX_PTTEXMTX1 = 67,
|
||||
GX_PTTEXMTX2 = 70,
|
||||
GX_PTTEXMTX3 = 73,
|
||||
GX_PTTEXMTX4 = 76,
|
||||
GX_PTTEXMTX5 = 79,
|
||||
GX_PTTEXMTX6 = 82,
|
||||
GX_PTTEXMTX7 = 85,
|
||||
GX_PTTEXMTX8 = 88,
|
||||
GX_PTTEXMTX9 = 91,
|
||||
GX_PTTEXMTX10 = 94,
|
||||
GX_PTTEXMTX11 = 97,
|
||||
GX_PTTEXMTX12 = 100,
|
||||
GX_PTTEXMTX13 = 103,
|
||||
GX_PTTEXMTX14 = 106,
|
||||
GX_PTTEXMTX15 = 109,
|
||||
GX_PTTEXMTX16 = 112,
|
||||
GX_PTTEXMTX17 = 115,
|
||||
GX_PTTEXMTX18 = 118,
|
||||
GX_PTTEXMTX19 = 121,
|
||||
GX_PTIDENTITY = 125,
|
||||
} GXPTTexMtx;
|
||||
|
||||
typedef enum _GXTevRegID {
|
||||
GX_TEVPREV,
|
||||
GX_TEVREG0,
|
||||
@@ -684,6 +714,11 @@ typedef enum _GXTevMode {
|
||||
GX_BLEND
|
||||
} GXTevMode;
|
||||
|
||||
typedef enum _GXTexMtxType {
|
||||
GX_MTX3x4,
|
||||
GX_MTX2x4,
|
||||
} GXTexMtxType;
|
||||
|
||||
typedef enum _GXTexCoordID {
|
||||
GX_TEXCOORD0,
|
||||
GX_TEXCOORD1,
|
||||
@@ -806,7 +841,7 @@ typedef enum _GXTexMtx {
|
||||
GX_TEXMTX7 = 51,
|
||||
GX_TEXMTX8 = 54,
|
||||
GX_TEXMTX9 = 57,
|
||||
GX_TEXMTX_IDENT = 60,
|
||||
GX_IDENTITY = 60,
|
||||
|
||||
// 3x4 matrices (in dual-tex XF matrix memory)
|
||||
// Enum represents base row of matrix
|
||||
@@ -901,6 +936,23 @@ typedef enum _GXZTexOp {
|
||||
GX_MAX_ZTEXOP
|
||||
} GXZTexOp;
|
||||
|
||||
typedef enum _GXMiscToken {
|
||||
GX_MT_XF_FLUSH = 1,
|
||||
GX_MT_DL_SAVE_CONTEXT = 2,
|
||||
GX_MT_ABORT_WAIT_COPYOUT = 3,
|
||||
GX_MT_NULL = 0,
|
||||
} GXMiscToken;
|
||||
|
||||
typedef enum _GXTexOffset {
|
||||
GX_TO_ZERO,
|
||||
GX_TO_SIXTEENTH,
|
||||
GX_TO_EIGHTH,
|
||||
GX_TO_FOURTH,
|
||||
GX_TO_HALF,
|
||||
GX_TO_ONE,
|
||||
GX_MAX_TEXOFFSET,
|
||||
} GXTexOffset;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+3
-1
@@ -4,11 +4,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "rvl/MTX/mtx.h"
|
||||
// IWYU pragma: begin_exports
|
||||
#include "rvl/MTX/mtx.h"
|
||||
#include "rvl/MTX/mtx44.h"
|
||||
#include "rvl/MTX/mtxvec.h"
|
||||
#include "rvl/MTX/quat.h"
|
||||
#include "rvl/MTX/vec.h"
|
||||
// IWYU pragma: end_exports
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -8,6 +8,14 @@ extern "C" {
|
||||
typedef f32 Mtx[3][4];
|
||||
typedef f32 Mtx44[4][4];
|
||||
|
||||
// do these belong in the sdk?
|
||||
typedef f32 Mtx33[3][3];
|
||||
typedef f32 Mtx23[2][3];
|
||||
typedef f32 (*Mtx3P)[3];
|
||||
typedef f32 (*MtxP)[4];
|
||||
typedef const f32 (*CMtxP)[4];
|
||||
typedef f32 QuaternionP[4];
|
||||
|
||||
typedef struct Vec {
|
||||
f32 x, y, z;
|
||||
} Vec;
|
||||
@@ -16,6 +24,23 @@ typedef struct Quaternion {
|
||||
f32 x, y, z, w;
|
||||
} Quaternion;
|
||||
|
||||
#define MTXIdentity PSMTXIdentity
|
||||
#define MTXCopy PSMTXCopy
|
||||
#define MTXConcat PSMTXConcat
|
||||
#define MTXInverse PSMTXInverse
|
||||
#define MTXTranspose PSMTXTranspose
|
||||
#define MTXInverse PSMTXInverse
|
||||
#define MTXInvXpose PSMTXInvXpose
|
||||
#define MTXRotRad PSMTXRotRad
|
||||
#define MTXRotTrig PSMTXRotTrig
|
||||
#define MTXRotAxisRad PSMTXRotAxisRad
|
||||
#define MTXTrans PSMTXTrans
|
||||
#define MTXTransApply PSMTXTransApply
|
||||
#define MTXScale PSMTXScale
|
||||
#define MTXScaleApply PSMTXScaleApply
|
||||
#define MTXQuat PSMTXQuat
|
||||
#define MTXReflect PSMTXReflect
|
||||
|
||||
void PSMTXIdentity(Mtx);
|
||||
void PSMTXCopy(const Mtx, Mtx);
|
||||
void PSMTXConcat(const Mtx, const Mtx, Mtx);
|
||||
|
||||
@@ -7,8 +7,15 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void PSMTXMultVec(const Mtx, const Vec *, Vec *);
|
||||
void PSMTXMultVecSR(const Mtx, const Vec *, Vec *);
|
||||
#define MTXMultVec PSMTXMultVec
|
||||
#define MTXMultVecArray PSMTXMultVecArray
|
||||
#define MTXMultVecSR PSMTXMultVecSR
|
||||
#define MTXMultVecArraySR PSMTXMultVecArraySR
|
||||
|
||||
void PSMTXMultVec(const Mtx m, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVecArray(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
||||
void PSMTXMultVecSR(const Mtx m, const Vec* src, Vec* dst);
|
||||
void PSMTXMultVecArraySR(const Mtx m, const Vec* srcBase, Vec* dstBase, u32 count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -16,6 +16,17 @@ f32 PSVECDotProduct(const Vec *, const Vec *);
|
||||
void PSVECCrossProduct(const Vec *, const Vec *, Vec *);
|
||||
f32 PSVECSquareDistance(const Vec *, const Vec *);
|
||||
|
||||
#define VECAdd PSVECAdd
|
||||
#define VECSubtract PSVECSubtract
|
||||
#define VECScale PSVECScale
|
||||
#define VECNormalize PSVECNormalize
|
||||
#define VECSquareMag PSVECSquareMag
|
||||
#define VECMag PSVECMag
|
||||
#define VECDotProduct PSVECDotProduct
|
||||
#define VECCrossProduct PSVECCrossProduct
|
||||
#define VECSquareDistance PSVECSquareDistance
|
||||
#define VECDistance PSVECDistance
|
||||
|
||||
void C_VECHalfAngle(const Vec *, const Vec *, Vec *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAChildShape
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAChildShape.h"
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "rvl/GX.h"
|
||||
|
||||
// SS addition
|
||||
void fn_8031DBA0(JPAEmitterWorkData* work) {
|
||||
if (work->mpEmtr->mAlivePtclBase.getNum() == 0) {
|
||||
work->mpEmtr->deleteAllParticle();
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027AEBC-8027AFDC 2757FC 0120+00 0/0 1/1 0/0 .text JPARegistChildPrmEnv__FP18JPAEmitterWorkData
|
||||
*/
|
||||
void JPARegistChildPrmEnv(JPAEmitterWorkData* work) {
|
||||
JPAChildShape* csp = work->mpRes->getCsp();
|
||||
JPABaseEmitter* emtr = work->mpEmtr;
|
||||
GXColor prm, env;
|
||||
csp->getPrmClr(&prm);
|
||||
csp->getEnvClr(&env);
|
||||
prm.r = COLOR_MULTI(prm.r, emtr->mGlobalPrmClr.r);
|
||||
prm.g = COLOR_MULTI(prm.g, emtr->mGlobalPrmClr.g);
|
||||
prm.b = COLOR_MULTI(prm.b, emtr->mGlobalPrmClr.b);
|
||||
prm.a = COLOR_MULTI(prm.a, emtr->mGlobalPrmClr.a);
|
||||
env.r = COLOR_MULTI(env.r, emtr->mGlobalEnvClr.r);
|
||||
env.g = COLOR_MULTI(env.g, emtr->mGlobalEnvClr.g);
|
||||
env.b = COLOR_MULTI(env.b, emtr->mGlobalEnvClr.b);
|
||||
GXSetTevColor(GX_TEVREG0, prm);
|
||||
GXSetTevColor(GX_TEVREG1, env);
|
||||
}
|
||||
|
||||
/* 8027AFDC-8027B008 27591C 002C+00 0/0 1/1 0/0 .text
|
||||
* JPACalcChildAlphaOut__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcChildAlphaOut(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
f32 anm = (1.0f - ptcl->mTime) * 255.0f;
|
||||
OSf32tou8(&anm, &ptcl->mPrmColorAlphaAnm);
|
||||
}
|
||||
|
||||
/* 8027B008-8027B038 275948 0030+00 0/0 1/1 0/0 .text
|
||||
* JPACalcChildScaleOut__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcChildScaleOut(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
ptcl->mParticleScaleX = ptcl->mScaleOut * (1.0f - ptcl->mTime);
|
||||
ptcl->mParticleScaleY = ptcl->mAlphaWaveRandom * (1.0f - ptcl->mTime);
|
||||
}
|
||||
|
||||
/* 8027B038-8027B040 -00001 0008+00 0/0 0/0 0/0 .text __ct__13JPAChildShapeFPCUc */
|
||||
JPAChildShape::JPAChildShape(u8 const* pData) {
|
||||
mpData = (JPAChildShapeData*)pData;
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPADynamicsBlock
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPADynamicsBlock.h"
|
||||
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "nw4r/math/math_triangular.h"
|
||||
|
||||
/* 8027B144-8027B220 275A84 00DC+00 1/1 0/0 0/0 .text JPAVolumePoint__FP18JPAEmitterWorkData */
|
||||
void JPAVolumePoint(JPAEmitterWorkData* work) {
|
||||
work->mVolumeCalcData.mVolumePos.setZero();
|
||||
work->mVolumeCalcData.mVelOmni.set(work->mpEmtr->get_r_zh(), work->mpEmtr->get_r_zh(),
|
||||
work->mpEmtr->get_r_zh());
|
||||
work->mVolumeCalcData.mVelAxis.set(work->mVolumeCalcData.mVelOmni.x, 0.0f,
|
||||
work->mVolumeCalcData.mVelOmni.z);
|
||||
}
|
||||
|
||||
/* 8027B220-8027B33C 275B60 011C+00 1/1 0/0 0/0 .text JPAVolumeLine */
|
||||
void JPAVolumeLine(JPAEmitterWorkData* work) {
|
||||
if (work->mpEmtr->checkFlag(JPADynFlag_FixedInterval)) {
|
||||
work->mVolumeCalcData.mVolumePos.set(
|
||||
0.0f, 0.0f,
|
||||
work->mVolumeSize * ((work->mVolumeEmitIdx / (work->mEmitCount - 1.0f) - 0.5f)));
|
||||
work->mVolumeEmitIdx++;
|
||||
} else {
|
||||
work->mVolumeCalcData.mVolumePos.set(0.0f, 0.0f,
|
||||
work->mVolumeSize * work->mpEmtr->get_r_zh());
|
||||
}
|
||||
|
||||
work->mVolumeCalcData.mVelOmni.set(0.0f, 0.0f,
|
||||
work->mVolumeCalcData.mVolumePos.z * work->mGlobalScl.z);
|
||||
work->mVolumeCalcData.mVelAxis.set(0.0f, 0.0f, work->mVolumeCalcData.mVolumePos.z);
|
||||
}
|
||||
|
||||
/* 8027B33C-8027B4E8 275C7C 01AC+00 1/1 0/0 0/0 .text JPAVolumeCircle */
|
||||
// NONMATCHING regalloc. Could be issue with mul asm implementations
|
||||
void JPAVolumeCircle(JPAEmitterWorkData* work) {
|
||||
s16 theta;
|
||||
f32 distance;
|
||||
|
||||
if (work->mpEmtr->checkFlag(JPADynFlag_FixedInterval)) {
|
||||
theta = (s16)((work->mVolumeEmitIdx << 16) / work->mEmitCount);
|
||||
theta = theta * work->mVolumeSweep;
|
||||
work->mVolumeEmitIdx++;
|
||||
} else {
|
||||
theta = work->mVolumeSweep * work->mpEmtr->get_r_ss();
|
||||
}
|
||||
|
||||
distance = work->mpEmtr->get_r_f();
|
||||
if (work->mpEmtr->checkFlag(JPADynFlag_FixedDensity)) {
|
||||
distance = 1.0f - (distance * distance);
|
||||
}
|
||||
|
||||
distance = work->mVolumeSize * (work->mVolumeMinRad + distance * (1.0f - work->mVolumeMinRad));
|
||||
work->mVolumeCalcData.mVolumePos.set(distance * nw4r::math::SinIdx(theta), 0.0f,
|
||||
distance * nw4r::math::CosIdx(theta));
|
||||
work->mVolumeCalcData.mVelOmni = work->mVolumeCalcData.mVolumePos;
|
||||
work->mVolumeCalcData.mVelOmni *= work->mGlobalScl;
|
||||
work->mVolumeCalcData.mVelAxis.set(work->mVolumeCalcData.mVolumePos.x, 0.0f,
|
||||
work->mVolumeCalcData.mVolumePos.z);
|
||||
}
|
||||
|
||||
/* 8027B4E8-8027B5F0 275E28 0108+00 1/1 0/0 0/0 .text JPAVolumeCube */
|
||||
void JPAVolumeCube(JPAEmitterWorkData* work) {
|
||||
work->mVolumeCalcData.mVolumePos.set(work->mpEmtr->get_r_zh() * work->mVolumeSize,
|
||||
work->mpEmtr->get_r_zh() * work->mVolumeSize,
|
||||
work->mpEmtr->get_r_zh() * work->mVolumeSize);
|
||||
work->mVolumeCalcData.mVelOmni = work->mVolumeCalcData.mVolumePos;
|
||||
work->mVolumeCalcData.mVelOmni *= work->mGlobalScl;
|
||||
work->mVolumeCalcData.mVelAxis.set(work->mVolumeCalcData.mVolumePos.x, 0.0f, work->mVolumeCalcData.mVolumePos.z);
|
||||
}
|
||||
|
||||
/* 8027B5F0-8027B87C 275F30 028C+00 1/1 0/0 0/0 .text JPAVolumeSphere__FP18JPAEmitterWorkData */
|
||||
static void JPAVolumeSphere(JPAEmitterWorkData* work) {
|
||||
s16 phi, theta;
|
||||
if (work->mpEmtr->checkFlag(JPADynFlag_FixedInterval)) {
|
||||
phi = (u16)(work->mVolumeX * 0x8000 / (work->mDivNumber - 1) + 0x4000);
|
||||
f32 tmp = (u16)(work->mVolumeAngleNum * 0x10000 / (work->mVolumeAngleMax - 1));
|
||||
theta = tmp * work->mVolumeSweep + 0x8000;
|
||||
work->mVolumeAngleNum++;
|
||||
if (work->mVolumeAngleNum == work->mVolumeAngleMax) {
|
||||
work->mVolumeAngleNum = 0;
|
||||
work->mVolumeX++;
|
||||
if (work->mVolumeX * 2 < work->mDivNumber) {
|
||||
work->mVolumeAngleMax = work->mVolumeAngleMax != 1 ?
|
||||
work->mVolumeAngleMax + 4 : work->mVolumeAngleMax + 3;
|
||||
} else {
|
||||
work->mVolumeAngleMax = work->mVolumeAngleMax != 4 ? work->mVolumeAngleMax - 4 : 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
phi = work->mpEmtr->get_r_ss() >> 1;
|
||||
theta = work->mVolumeSweep * work->mpEmtr->get_r_ss();
|
||||
}
|
||||
|
||||
f32 rnd = work->mpEmtr->get_r_f();
|
||||
if (work->mpEmtr->checkFlag(JPADynFlag_FixedDensity)) {
|
||||
rnd = 1.0f - rnd * rnd * rnd;
|
||||
}
|
||||
f32 rad = work->mVolumeSize * (work->mVolumeMinRad + rnd * (1.0f - work->mVolumeMinRad));
|
||||
work->mVolumeCalcData.mVolumePos.set(rad * nw4r::math::CosIdx(phi) * nw4r::math::SinIdx(theta), -rad * nw4r::math::SinIdx(phi),
|
||||
rad * nw4r::math::CosIdx(phi) * nw4r::math::CosIdx(theta));
|
||||
work->mVolumeCalcData.mVelOmni.set(
|
||||
work->mVolumeCalcData.mVolumePos.x * work->mGlobalScl.x,
|
||||
work->mVolumeCalcData.mVolumePos.y * work->mGlobalScl.y, work->mVolumeCalcData.mVolumePos.z * work->mGlobalScl.z
|
||||
);
|
||||
work->mVolumeCalcData.mVelAxis.set(work->mVolumeCalcData.mVolumePos.x, 0.0f,
|
||||
work->mVolumeCalcData.mVolumePos.z);
|
||||
}
|
||||
|
||||
/* 8027B87C-8027B9F8 2761BC 017C+00 1/1 0/0 0/0 .text JPAVolumeCylinder__FP18JPAEmitterWorkData */
|
||||
static void JPAVolumeCylinder(JPAEmitterWorkData* work) {
|
||||
s16 theta = work->mVolumeSweep * work->mpEmtr->get_r_ss();
|
||||
f32 rnd = work->mpEmtr->get_r_f();
|
||||
if (work->mpEmtr->checkFlag(JPADynFlag_FixedDensity)) {
|
||||
rnd = 1.0f - rnd * rnd;
|
||||
}
|
||||
f32 rad = work->mVolumeSize * (work->mVolumeMinRad + rnd * (1.0f - work->mVolumeMinRad));
|
||||
work->mVolumeCalcData.mVolumePos.set(
|
||||
rad * nw4r::math::SinIdx(theta), work->mVolumeSize * work->mpEmtr->get_r_zp(), rad * nw4r::math::CosIdx(theta));
|
||||
work->mVolumeCalcData.mVelOmni.set(
|
||||
work->mVolumeCalcData.mVolumePos.x * work->mGlobalScl.x,
|
||||
work->mVolumeCalcData.mVolumePos.y * work->mGlobalScl.y, work->mVolumeCalcData.mVolumePos.z * work->mGlobalScl.z
|
||||
);
|
||||
work->mVolumeCalcData.mVelAxis.set(work->mVolumeCalcData.mVolumePos.x, 0.0f,
|
||||
work->mVolumeCalcData.mVolumePos.z);
|
||||
}
|
||||
|
||||
/* 8027B9F8-8027BB18 276338 0120+00 1/1 0/0 0/0 .text JPAVolumeTorus__FP18JPAEmitterWorkData */
|
||||
static void JPAVolumeTorus(JPAEmitterWorkData* work) {
|
||||
s16 theta = work->mVolumeSweep * work->mpEmtr->get_r_ss();
|
||||
s16 phi = work->mpEmtr->get_r_ss();
|
||||
f32 rad = work->mVolumeSize * work->mVolumeMinRad;
|
||||
work->mVolumeCalcData.mVelAxis.set(rad * nw4r::math::SinIdx(theta) * nw4r::math::CosIdx(phi), rad * nw4r::math::SinIdx(phi),
|
||||
rad * nw4r::math::CosIdx(theta) * nw4r::math::CosIdx(phi));
|
||||
work->mVolumeCalcData.mVolumePos.set(
|
||||
work->mVolumeCalcData.mVelAxis.x + work->mVolumeSize * nw4r::math::SinIdx(theta),
|
||||
work->mVolumeCalcData.mVelAxis.y,
|
||||
work->mVolumeCalcData.mVelAxis.z + work->mVolumeSize * nw4r::math::CosIdx(theta));
|
||||
work->mVolumeCalcData.mVelOmni.set(
|
||||
work->mVolumeCalcData.mVolumePos.x * work->mGlobalScl.x,
|
||||
work->mVolumeCalcData.mVolumePos.y * work->mGlobalScl.y, work->mVolumeCalcData.mVolumePos.z * work->mGlobalScl.z
|
||||
);
|
||||
}
|
||||
|
||||
/* 8027BB18-8027BB4C 276458 0034+00 0/0 1/1 0/0 .text __ct__16JPADynamicsBlockFPCUc */
|
||||
JPADynamicsBlock::JPADynamicsBlock(u8 const* data) {
|
||||
mpData = (const JPADynamicsBlockData*)data;
|
||||
init();
|
||||
}
|
||||
|
||||
enum {
|
||||
VOL_Cube = 0x00,
|
||||
VOL_Sphere = 0x01,
|
||||
VOL_Cylinder = 0x02,
|
||||
VOL_Torus = 0x03,
|
||||
VOL_Point = 0x04,
|
||||
VOL_Circle = 0x05,
|
||||
VOL_Line = 0x06,
|
||||
};
|
||||
|
||||
/* 8027BB4C-8027BBE8 27648C 009C+00 2/1 0/0 0/0 .text init__16JPADynamicsBlockFv */
|
||||
void JPADynamicsBlock::init() {
|
||||
switch (getVolumeType()) {
|
||||
case VOL_Cube:
|
||||
mpCalcVolumeFunc = &JPAVolumeCube;
|
||||
break;
|
||||
case VOL_Sphere:
|
||||
mpCalcVolumeFunc = &JPAVolumeSphere;
|
||||
break;
|
||||
case VOL_Cylinder:
|
||||
mpCalcVolumeFunc = &JPAVolumeCylinder;
|
||||
break;
|
||||
case VOL_Torus:
|
||||
mpCalcVolumeFunc = &JPAVolumeTorus;
|
||||
break;
|
||||
case VOL_Point:
|
||||
mpCalcVolumeFunc = &JPAVolumePoint;
|
||||
break;
|
||||
case VOL_Circle:
|
||||
mpCalcVolumeFunc = &JPAVolumeCircle;
|
||||
break;
|
||||
case VOL_Line:
|
||||
mpCalcVolumeFunc = &JPAVolumeLine;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027BBE8-8027BDEC 276528 0204+00 0/0 1/1 0/0 .text
|
||||
* create__16JPADynamicsBlockFP18JPAEmitterWorkData */
|
||||
void JPADynamicsBlock::create(JPAEmitterWorkData* work) {
|
||||
if (work->mpEmtr->checkStatus(JPAEmtrStts_RateStepEmit)) {
|
||||
s32 emitCount;
|
||||
s32 createCount;
|
||||
|
||||
// Probably an inlined function.
|
||||
if (work->mpEmtr->checkFlag(JPADynFlag_FixedInterval)) {
|
||||
s32 count;
|
||||
if (getVolumeType() == VOL_Sphere) {
|
||||
count = 4 * getDivNumber() * getDivNumber() + 2;
|
||||
} else {
|
||||
count = getDivNumber();
|
||||
}
|
||||
emitCount = count;
|
||||
|
||||
work->mVolumeEmitIdx = 0;
|
||||
} else {
|
||||
f32 newPtclCount =
|
||||
work->mpEmtr->mRate * (getRateRndm() * work->mpEmtr->get_r_zp() + 1.0f);
|
||||
f32 newEmitCount = work->mpEmtr->mEmitCount + newPtclCount;
|
||||
work->mpEmtr->mEmitCount = newEmitCount;
|
||||
emitCount = (s32)newEmitCount;
|
||||
work->mpEmtr->mEmitCount -= emitCount;
|
||||
|
||||
if (work->mpEmtr->checkStatus(JPAEmtrStts_FirstEmit) && 0.0f < newPtclCount &&
|
||||
newPtclCount < 1.0f)
|
||||
emitCount = 1;
|
||||
}
|
||||
|
||||
work->mEmitCount = emitCount;
|
||||
if (work->mpEmtr->checkStatus(JPAEmtrStts_StopEmit)) {
|
||||
emitCount = 0;
|
||||
}
|
||||
|
||||
// Probably an inlined function.
|
||||
createCount = emitCount;
|
||||
while (createCount > 0) {
|
||||
JPABaseParticle* ptcl = work->mpEmtr->createParticle();
|
||||
if (ptcl == NULL)
|
||||
break;
|
||||
createCount--;
|
||||
}
|
||||
}
|
||||
|
||||
if (++work->mpEmtr->mRateStepTimer >= (work->mpEmtr->mRateStep + 1)) {
|
||||
work->mpEmtr->mRateStepTimer -= (work->mpEmtr->mRateStep + 1);
|
||||
work->mpEmtr->setStatus(JPAEmtrStts_RateStepEmit);
|
||||
} else {
|
||||
work->mpEmtr->clearStatus(JPAEmtrStts_RateStepEmit);
|
||||
}
|
||||
|
||||
work->mpEmtr->clearStatus(JPAEmtrStts_FirstEmit);
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAEmitter
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "JSystem/JParticle/JPAEmitterManager.h"
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
#include "JSystem/JParticle/JPABaseShape.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
//
|
||||
// Types:
|
||||
//
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 8027E6A4-8027E6EC 278FE4 0048+00 0/0 14/14 16/16 .text __dt__18JPAEmitterCallBackFv */
|
||||
JPAEmitterCallBack::~JPAEmitterCallBack() {
|
||||
}
|
||||
|
||||
/* 8027E6EC-8027EA40 27902C 0354+00 0/0 1/1 0/0 .text
|
||||
* init__14JPABaseEmitterFP17JPAEmitterManagerP11JPAResource */
|
||||
void JPABaseEmitter::init(JPAEmitterManager* param_0, JPAResource* param_1) {
|
||||
mpEmtrMgr = param_0;
|
||||
mpRes = param_1;
|
||||
mpRes->getDyn()->getEmitterScl(&mLocalScl);
|
||||
mpRes->getDyn()->getEmitterTrs(&mLocalTrs);
|
||||
mpRes->getDyn()->getEmitterDir(&mLocalDir);
|
||||
mLocalDir.normalise();
|
||||
mpRes->getDyn()->getEmitterRot(&mLocalRot);
|
||||
mMaxFrame = mpRes->getDyn()->getMaxFrame();
|
||||
mLifeTime = mpRes->getDyn()->getLifetime();
|
||||
mVolumeSize = mpRes->getDyn()->getVolumeSize();
|
||||
mRate = mpRes->getDyn()->getRate();
|
||||
mRateStep = mpRes->getDyn()->getRateStep();
|
||||
mVolumeSweep = mpRes->getDyn()->getVolumeSweep();
|
||||
mVolumeMinRad = mpRes->getDyn()->getVolumeMinRad();
|
||||
mAwayFromCenterSpeed = mpRes->getDyn()->getInitVelOmni();
|
||||
mAwayFromAxisSpeed = mpRes->getDyn()->getInitVelAxis();
|
||||
mDirSpeed = mpRes->getDyn()->getInitVelDir();
|
||||
mSpread = mpRes->getDyn()->getInitVelDirSp();
|
||||
mRndmDirSpeed = mpRes->getDyn()->getInitVelRndm();
|
||||
mAirResist = mpRes->getDyn()->getAirRes();
|
||||
mRndm.set_seed(mpEmtrMgr->pWd->mRndm.get_rndm_u());
|
||||
MTXIdentity(mGlobalRot);
|
||||
mGlobalScl.set(1.0f, 1.0f, 1.0f);
|
||||
mGlobalTrs.setZero();
|
||||
mGlobalPScl.set(1.0f, 1.0f);
|
||||
mGlobalEnvClr.a = 0xff;
|
||||
mGlobalEnvClr.b = 0xff;
|
||||
mGlobalEnvClr.g = 0xff;
|
||||
mGlobalEnvClr.r = 0xff;
|
||||
mGlobalPrmClr.a = 0xff;
|
||||
mGlobalPrmClr.b = 0xff;
|
||||
mGlobalPrmClr.g = 0xff;
|
||||
mGlobalPrmClr.r = 0xff;
|
||||
param_1->getBsp()->getPrmClr(&mPrmClr);
|
||||
param_1->getBsp()->getEnvClr(&mEnvClr);
|
||||
mpUserWork = NULL;
|
||||
mScaleOut = 1.0f;
|
||||
mEmitCount = 0.0f;
|
||||
initStatus(0x30);
|
||||
mDrawTimes = 1;
|
||||
mTick = 0;
|
||||
mWaitTime = 0;
|
||||
mRateStepTimer = 0;
|
||||
mTexAnmIdx = 0;
|
||||
}
|
||||
|
||||
/* 8027EA40-8027EB60 279380 0120+00 0/0 3/3 0/0 .text createParticle__14JPABaseEmitterFv
|
||||
*/
|
||||
JPABaseParticle* JPABaseEmitter::createParticle() {
|
||||
if (mpPtclPool->getNum() != 0) {
|
||||
JPANode<JPABaseParticle>* node = mpPtclPool->pop_front();
|
||||
mAlivePtclBase.push_front(node);
|
||||
mpRes->getDyn()->calc(mpEmtrMgr->pWd);
|
||||
node->mData.init_p(mpEmtrMgr->pWd);
|
||||
return &node->mData;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 8027EB60-8027EC60 2794A0 0100+00 0/0 1/1 0/0 .text
|
||||
* createChild__14JPABaseEmitterFP15JPABaseParticle */
|
||||
JPABaseParticle* JPABaseEmitter::createChild(JPABaseParticle* parent) {
|
||||
if (mpPtclPool->getNum() != 0) {
|
||||
JPANode<JPABaseParticle>* node = mpPtclPool->pop_front();
|
||||
mAlivePtclChld.push_front(node);
|
||||
node->mData.init_c(mpEmtrMgr->pWd, parent);
|
||||
return &node->mData;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 8027EC60-8027EDD4 2795A0 0174+00 0/0 2/2 21/21 .text deleteAllParticle__14JPABaseEmitterFv */
|
||||
void JPABaseEmitter::deleteAllParticle() {
|
||||
while (mAlivePtclBase.getNum())
|
||||
mpPtclPool->push_front(mAlivePtclBase.pop_back());
|
||||
while (mAlivePtclChld.getNum())
|
||||
mpPtclPool->push_front(mAlivePtclChld.pop_back());
|
||||
}
|
||||
|
||||
/* 8027EDD4-8027EE14 279714 0040+00 0/0 1/1 0/0 .text processTillStartFrame__14JPABaseEmitterFv */
|
||||
bool JPABaseEmitter::processTillStartFrame() {
|
||||
JPADynamicsBlock* dyn = mpRes->getDyn();
|
||||
s16 startFrame = dyn->getStartFrame();
|
||||
|
||||
if (mWaitTime >= startFrame)
|
||||
return true;
|
||||
|
||||
if (!(mStatus & 2))
|
||||
mWaitTime++;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 8027EE14-8027EEB0 279754 009C+00 0/0 1/1 0/0 .text processTermination__14JPABaseEmitterFv */
|
||||
bool JPABaseEmitter::processTermination() {
|
||||
if (checkStatus(0x100)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mMaxFrame == 0) {
|
||||
return false;
|
||||
}
|
||||
if (mMaxFrame < 0) {
|
||||
setStatus(8);
|
||||
return getParticleNumber() == 0;
|
||||
}
|
||||
if (mTick >= mMaxFrame) {
|
||||
setStatus(8);
|
||||
if (checkStatus(0x40)) {
|
||||
return false;
|
||||
}
|
||||
return getParticleNumber() == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 8027EEB0-8027EF30 2797F0 0080+00 0/0 1/1 0/0 .text
|
||||
* calcEmitterGlobalPosition__14JPABaseEmitterCFPQ29JGeometry8TVec3<f> */
|
||||
void JPABaseEmitter::calcEmitterGlobalPosition(EGG::Vector3f* dst) const {
|
||||
Mtx mtx;
|
||||
MTXScale(mtx, mGlobalScl.x, mGlobalScl.y, mGlobalScl.z);
|
||||
MTXConcat(mGlobalRot, mtx, mtx);
|
||||
mtx[0][3] = mGlobalTrs.x;
|
||||
mtx[1][3] = mGlobalTrs.y;
|
||||
mtx[2][3] = mGlobalTrs.z;
|
||||
MTXMultVec(mtx, mLocalTrs, *dst);
|
||||
}
|
||||
|
||||
/* 8027EF30-8027EF40 279870 0010+00 0/0 1/1 0/0 .text getCurrentCreateNumber__14JPABaseEmitterCFv
|
||||
*/
|
||||
u32 JPABaseEmitter::getCurrentCreateNumber() const {
|
||||
return mpEmtrMgr->pWd->mEmitCount;
|
||||
}
|
||||
|
||||
/* 8027EF40-8027EF50 279880 0010+00 0/0 3/3 0/0 .text getDrawCount__14JPABaseEmitterCFv
|
||||
*/
|
||||
u8 JPABaseEmitter::getDrawCount() const {
|
||||
return mpEmtrMgr->pWd->mDrawCount;
|
||||
}
|
||||
|
||||
/* 8027EF50-8027EFA4 279890 0054+00 0/0 1/1 0/0 .text
|
||||
* loadTexture__14JPABaseEmitterFUc11_GXTexMapID */
|
||||
bool JPABaseEmitter::loadTexture(u8 idx, GXTexMapID texMapID) {
|
||||
mpEmtrMgr->pWd->mpResMgr->load(mpRes->getTexIdx(idx), texMapID);
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAEmitterManager
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAList.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "JSystem/JParticle/JPAEmitterManager.h"
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
#include "rvl/GX/GXTransform.h"
|
||||
#include "rvl/GX/GXTypes.h"
|
||||
#include "rvl/GX.h"
|
||||
|
||||
/* 8027DCA0-8027DEBC 2785E0 021C+00 0/0 1/1 0/0 .text __ct__17JPAEmitterManagerFUlUlP7EGG::HeapUcUc
|
||||
*/
|
||||
JPAEmitterManager::JPAEmitterManager(u32 i_ptclNum, u32 i_emtrNum, EGG::Heap* pHeap, u8 i_gidMax,
|
||||
u8 i_ridMax) {
|
||||
emtrNum = i_emtrNum;
|
||||
ptclNum = i_ptclNum;
|
||||
gidMax = i_gidMax;
|
||||
ridMax = i_ridMax;
|
||||
|
||||
JUT_ASSERT(40, emtrNum && ptclNum && gidMax && ridMax);
|
||||
|
||||
JPABaseEmitter* p_emtr_link = new (pHeap, 4) JPABaseEmitter[emtrNum];
|
||||
JUT_ASSERT(44, p_emtr_link);
|
||||
for (u32 i = 0; i < emtrNum; i++)
|
||||
mFreeEmtrList.prepend(&p_emtr_link[i].mLink);
|
||||
|
||||
JPANode<JPABaseParticle>* p_ptcl_node = new (pHeap, 4) JPANode<JPABaseParticle>[ptclNum];
|
||||
JUT_ASSERT(51, p_ptcl_node);
|
||||
for (u32 i = 0; i < ptclNum; i++)
|
||||
mPtclPool.push_back(&p_ptcl_node[i]);
|
||||
|
||||
pEmtrUseList = new (pHeap, 4) JSUList<JPABaseEmitter>[gidMax];
|
||||
JUT_ASSERT(58, pEmtrUseList);
|
||||
pResMgrAry = new (pHeap, 4) JPAResourceManager*[ridMax];
|
||||
JUT_ASSERT(62, pResMgrAry)
|
||||
for (int i = 0; i < ridMax; i++) {
|
||||
pResMgrAry[i] = NULL;
|
||||
}
|
||||
|
||||
pWd = new (pHeap, 4) JPAEmitterWorkData();
|
||||
JUT_ASSERT(67, pWd);
|
||||
}
|
||||
|
||||
/* 8027DEBC-8027DFA0 2787FC 00E4+00 0/0 3/3 0/0 .text
|
||||
* createSimpleEmitterID__17JPAEmitterManagerFRCQ29JGeometry8TVec3<f>UsUcUcP18JPAEmitterCallBackP19JPAParticleCallBack
|
||||
*/
|
||||
JPABaseEmitter* JPAEmitterManager::createSimpleEmitterID(EGG::Vector3f const& pos,
|
||||
u16 resID, u8 group_id, u8 res_mgr_id,
|
||||
JPAEmitterCallBack* emtrCB,
|
||||
JPAParticleCallBack* ptclCB) {
|
||||
JUT_ASSERT(88, group_id < gidMax);
|
||||
JUT_ASSERT(89, res_mgr_id < ridMax);
|
||||
JUT_ASSERT(90, pResMgrAry[res_mgr_id] != 0);
|
||||
JPAResource* pRes = pResMgrAry[res_mgr_id]->getResource(resID);
|
||||
|
||||
if (pRes == NULL) {
|
||||
JUT_WARN_DEVICE(94, 3, "JPA : User Index %d is NOT exist\n", resID);
|
||||
} else if (mFreeEmtrList.getNumLinks() == 0) {
|
||||
JUT_WARN_DEVICE(97, 3, "JPA : Can NOT create emitter more\n");
|
||||
} else {
|
||||
JSULink<JPABaseEmitter>* pLink = mFreeEmtrList.getFirst();
|
||||
mFreeEmtrList.remove(pLink);
|
||||
pEmtrUseList[group_id].append(pLink);
|
||||
JPABaseEmitter* emtr = pLink->getObject();
|
||||
emtr->init(this, pRes);
|
||||
emtr->mpPtclPool = &mPtclPool;
|
||||
emtr->mpEmtrCallBack = emtrCB;
|
||||
emtr->mpPtclCallBack = ptclCB;
|
||||
emtr->mGroupID = group_id;
|
||||
emtr->mResMgrID = res_mgr_id;
|
||||
emtr->mGlobalTrs.set(pos);
|
||||
return emtr;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// SS addition
|
||||
void JPAEmitterManager::fn_80320E20(u8 group_id, f32 of_x, f32 of_z) {
|
||||
JSULink<JPABaseEmitter> *pNext = NULL;
|
||||
for (JSULink<JPABaseEmitter> *pLink = pEmtrUseList[group_id].getFirst(); pLink != pEmtrUseList[group_id].getEnd();
|
||||
pLink = pNext) {
|
||||
pNext = pLink->getNext();
|
||||
JPABaseEmitter *pEmit = pLink->getObject();
|
||||
|
||||
EGG::Vector3f offset;
|
||||
JPANode<JPABaseParticle> *pNextBase = NULL;
|
||||
|
||||
for (JPANode<JPABaseParticle> *baseLink = pEmit->mAlivePtclBase.getFirst();
|
||||
baseLink != pEmit->mAlivePtclBase.getEnd(); baseLink = pNextBase) {
|
||||
pNextBase = baseLink->getNext();
|
||||
|
||||
JPABaseParticle *o = baseLink->getObject();
|
||||
o->getOffsetPosition(offset);
|
||||
offset.x += of_x;
|
||||
offset.z += of_z;
|
||||
o->setOffsetPosition(offset);
|
||||
}
|
||||
|
||||
for (JPANode<JPABaseParticle> *childLink = pEmit->mAlivePtclChld.getFirst();
|
||||
childLink != pEmit->mAlivePtclChld.getEnd(); childLink = pNextBase) {
|
||||
pNextBase = childLink->getNext();
|
||||
|
||||
JPABaseParticle *o = childLink->getObject();
|
||||
o->getOffsetPosition(offset);
|
||||
offset.x += of_x;
|
||||
offset.z += of_z;
|
||||
o->setOffsetPosition(offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027DFA0-8027E028 2788E0 0088+00 0/0 3/3 0/0 .text calc__17JPAEmitterManagerFUc */
|
||||
void JPAEmitterManager::calc(u8 group_id) {
|
||||
JUT_ASSERT(154, group_id < gidMax);
|
||||
JSULink<JPABaseEmitter>* pNext = NULL;
|
||||
for (JSULink<JPABaseEmitter>* pLink = pEmtrUseList[group_id].getFirst();
|
||||
pLink != pEmtrUseList[group_id].getEnd(); pLink = pNext) {
|
||||
pNext = pLink->getNext();
|
||||
|
||||
JPABaseEmitter* emtr = pLink->getObject();
|
||||
|
||||
if (emtr->mpRes->calc(pWd, emtr) && !emtr->checkStatus(0x200))
|
||||
forceDeleteEmitter(emtr);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027E028-8027E220 278968 01F8+00 0/0 1/1 0/0 .text draw__17JPAEmitterManagerFPC11JPADrawInfoUc
|
||||
*/
|
||||
void JPAEmitterManager::draw(JPADrawInfo const* drawInfo, u8 group_id) {
|
||||
JUT_ASSERT(192, group_id < gidMax);
|
||||
drawInfo->getCamMtx(pWd->mPosCamMtx);
|
||||
drawInfo->getPrjMtx(pWd->mPrjMtx);
|
||||
calcYBBCam();
|
||||
GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
|
||||
GXEnableTexOffsets(GX_TEXCOORD0, GX_TRUE, GX_TRUE);
|
||||
GXEnableTexOffsets(GX_TEXCOORD1, GX_TRUE, GX_TRUE);
|
||||
GXEnableTexOffsets(GX_TEXCOORD2, GX_TRUE, GX_TRUE);
|
||||
GXSetCullMode(GX_CULL_NONE);
|
||||
GXSetCoPlanar(GX_FALSE);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_INDEX8);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_INDEX8);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S8, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_S8, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
|
||||
GXSetCurrentMtx(GX_PNMTX0);
|
||||
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE,
|
||||
GX_AF_NONE);
|
||||
GXSetChanCtrl(GX_COLOR1A1, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE,
|
||||
GX_AF_NONE);
|
||||
GXSetNumChans(0);
|
||||
|
||||
for (JSULink<JPABaseEmitter>* pLink = pEmtrUseList[group_id].getFirst();
|
||||
pLink != pEmtrUseList[group_id].getEnd(); pLink = pLink->getNext()) {
|
||||
JPABaseEmitter* emtr = pLink->getObject();
|
||||
if (!emtr->checkStatus(0x04)) {
|
||||
pWd->mpResMgr = pResMgrAry[emtr->mResMgrID];
|
||||
emtr->mpRes->draw(pWd, emtr);
|
||||
}
|
||||
}
|
||||
|
||||
GXSetClipMode(GX_CLIP_ENABLE);
|
||||
}
|
||||
|
||||
/* 8027E220-8027E278 278B60 0058+00 0/0 1/1 0/0 .text forceDeleteAllEmitter__17JPAEmitterManagerFv
|
||||
*/
|
||||
void JPAEmitterManager::forceDeleteAllEmitter() {
|
||||
for (u8 i = 0; i < gidMax; i++)
|
||||
forceDeleteGroupEmitter(i);
|
||||
}
|
||||
|
||||
/* 8027E278-8027E2D8 278BB8 0060+00 1/1 0/0 0/0 .text
|
||||
* forceDeleteGroupEmitter__17JPAEmitterManagerFUc */
|
||||
void JPAEmitterManager::forceDeleteGroupEmitter(u8 group_id) {
|
||||
JUT_ASSERT(288, group_id < gidMax);
|
||||
while (pEmtrUseList[group_id].getNumLinks())
|
||||
forceDeleteEmitter(pEmtrUseList[group_id].getLast()->getObject());
|
||||
}
|
||||
|
||||
/* 8027E2D8-8027E344 278C18 006C+00 3/3 1/1 0/0 .text
|
||||
* forceDeleteEmitter__17JPAEmitterManagerFP14JPABaseEmitter */
|
||||
void JPAEmitterManager::forceDeleteEmitter(JPABaseEmitter* emtr) {
|
||||
emtr->deleteAllParticle();
|
||||
emtr->setStatus(0x300);
|
||||
pEmtrUseList[emtr->getGroupID()].remove(&emtr->mLink);
|
||||
mFreeEmtrList.prepend(&emtr->mLink);
|
||||
}
|
||||
|
||||
/* 8027E344-8027E354 278C84 0010+00 0/0 2/2 0/0 .text
|
||||
* entryResourceManager__17JPAEmitterManagerFP18JPAResourceManagerUc */
|
||||
void JPAEmitterManager::entryResourceManager(JPAResourceManager* resMgr, u8 resMgrID) {
|
||||
JUT_ASSERT_MSG_F(325, resMgrID < ridMax && (pResMgrAry[resMgrID]) == 0,
|
||||
"res_id %d res_id_max %d array[%d] = %x", resMgrID, ridMax, resMgrID,
|
||||
pResMgrAry[resMgrID]);
|
||||
pResMgrAry[resMgrID] = resMgr;
|
||||
}
|
||||
|
||||
/* 8027E354-8027E3F4 278C94 00A0+00 0/0 1/1 0/0 .text clearResourceManager__17JPAEmitterManagerFUc
|
||||
*/
|
||||
void JPAEmitterManager::clearResourceManager(u8 res_mgr_id) {
|
||||
JUT_ASSERT(339, res_mgr_id < ridMax);
|
||||
for (u8 i = 0; i < gidMax; i++) {
|
||||
JSULink<JPABaseEmitter>* pNext = NULL;
|
||||
for (JSULink<JPABaseEmitter>* pLink = pEmtrUseList[i].getFirst();
|
||||
pLink != pEmtrUseList[i].getEnd(); pLink = pNext) {
|
||||
pNext = pLink->getNext();
|
||||
|
||||
if (res_mgr_id == pLink->getObject()->getResourceManagerID())
|
||||
forceDeleteEmitter(pLink->getObject());
|
||||
}
|
||||
}
|
||||
|
||||
pResMgrAry[res_mgr_id] = NULL;
|
||||
}
|
||||
|
||||
/* 8027E3F4-8027E51C 278D34 0128+00 1/1 0/0 0/0 .text calcYBBCam__17JPAEmitterManagerFv
|
||||
*/
|
||||
void JPAEmitterManager::calcYBBCam() {
|
||||
EGG::Vector3f v(0.0f, pWd->mPosCamMtx[1][1], pWd->mPosCamMtx[2][1]);
|
||||
JUT_ASSERT(367, !v.isZero());
|
||||
v.normalise();
|
||||
pWd->mYBBCamMtx[0][0] = 1.0f;
|
||||
pWd->mYBBCamMtx[0][1] = 0.0f;
|
||||
pWd->mYBBCamMtx[0][2] = 0.0f;
|
||||
pWd->mYBBCamMtx[0][3] = pWd->mPosCamMtx[0][3];
|
||||
pWd->mYBBCamMtx[1][0] = 0.0f;
|
||||
pWd->mYBBCamMtx[1][1] = v.y;
|
||||
pWd->mYBBCamMtx[1][2] = -v.z;
|
||||
pWd->mYBBCamMtx[1][3] = pWd->mPosCamMtx[1][3];
|
||||
pWd->mYBBCamMtx[2][0] = 0.0f;
|
||||
pWd->mYBBCamMtx[2][1] = v.z;
|
||||
pWd->mYBBCamMtx[2][2] = v.y;
|
||||
pWd->mYBBCamMtx[2][3] = pWd->mPosCamMtx[2][3];
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAExTexShape
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAExTexShape.h"
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "nw4r/math/math_triangular.h"
|
||||
#include "rvl/MTX.h"
|
||||
#include "rvl/GX.h"
|
||||
|
||||
/* 8027B040-8027B13C 275980 00FC+00 0/0 1/1 0/0 .text JPALoadExTex__FP18JPAEmitterWorkData */
|
||||
void JPALoadExTex(JPAEmitterWorkData* work) {
|
||||
Mtx m;
|
||||
JPAExTexShape* ets = work->mpRes->getEts();
|
||||
|
||||
GXTexCoordID secTexCoordID = GX_TEXCOORD1;
|
||||
if (ets->isUseIndirect()) {
|
||||
MTXIdentity(m);
|
||||
GXLoadTexMtxImm(m, GX_TEXMTX2, GX_MTX2x4);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX0, GX_TEXMTX2, GX_FALSE,
|
||||
GX_PTIDENTITY);
|
||||
u8 texIdx = ets->getIndTexIdx();
|
||||
work->mpResMgr->load(work->mpRes->getTexIdx(texIdx), GX_TEXMAP2);
|
||||
secTexCoordID = GX_TEXCOORD2;
|
||||
}
|
||||
|
||||
if (ets->isUseSecTex()) {
|
||||
GXSetTexCoordGen2(secTexCoordID, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, GX_FALSE,
|
||||
GX_PTIDENTITY);
|
||||
u8 texIdx = ets->getSecTexIdx();
|
||||
work->mpResMgr->load(work->mpRes->getTexIdx(texIdx), GX_TEXMAP3);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027B13C-8027B144 -00001 0008+00 0/0 0/0 0/0 .text __ct__13JPAExTexShapeFPCUc */
|
||||
JPAExTexShape::JPAExTexShape(u8 const* data) {
|
||||
mpData = (const JPAExTexShapeData*)data;
|
||||
}
|
||||
|
||||
// Similar to JPAGenCalcTexCrdMtxAnm
|
||||
void JPAExTexShape::fn_8031DE80(const JPABaseShape *shp, f32 f) const {
|
||||
f32 tilingS = 0.5f * (1.0f + shp->getTilingS());
|
||||
f32 tilingT = 0.5f * (1.0f + shp->getTilingT());
|
||||
f32 _0x38_x_0x24 = f * getField_0x38() + getField_0x24();
|
||||
f32 _0x3C_x_0x28 = f * getField_0x3C() + getField_0x28();
|
||||
f32 _0x40_x_0x2C = f * getField_0x40() + getField_0x2C();
|
||||
f32 _0x44_x_0x30 = f * getField_0x44() + getField_0x30();
|
||||
|
||||
s16 v = f * getField_0x48() * 0x8000 + getField_0x34() * 0x8000;
|
||||
f32 sin = nw4r::math::SinIdx(v);
|
||||
f32 cos = nw4r::math::CosIdx(v);
|
||||
|
||||
Mtx texMtx;
|
||||
|
||||
texMtx[0][0] = _0x40_x_0x2C * cos;
|
||||
texMtx[0][1] = -_0x40_x_0x2C * sin;
|
||||
texMtx[0][2] = 0.0f;
|
||||
texMtx[0][3] = tilingS + (_0x40_x_0x2C * (sin * (tilingT + _0x3C_x_0x28) - cos * (tilingS + _0x38_x_0x24)));
|
||||
|
||||
texMtx[1][0] = _0x44_x_0x30 * sin;
|
||||
texMtx[1][1] = _0x44_x_0x30 * cos;
|
||||
texMtx[1][2] = 0.0f;
|
||||
texMtx[1][3] = tilingT + (-_0x44_x_0x30 * (sin * (tilingS + _0x38_x_0x24) + cos * (tilingT + _0x3C_x_0x28)));
|
||||
|
||||
texMtx[2][0] = 0.0f;
|
||||
texMtx[2][1] = 0.0f;
|
||||
texMtx[2][2] = 1.0f;
|
||||
texMtx[2][3] = 0.0f;
|
||||
GXLoadTexMtxImm(texMtx, 0x24, GX_MTX2x4);
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAExtraShape
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAExtraShape.h"
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "nw4r/math/math_triangular.h"
|
||||
|
||||
/* 8027A918-8027A990 275258 0078+00 0/0 1/1 0/0 .text
|
||||
* JPACalcScaleX__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcScaleX(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
if (work->mScaleAnm < esp->getScaleInTiming()) {
|
||||
ptcl->mParticleScaleX =
|
||||
ptcl->mScaleOut * (esp->getScaleIncRateX() * work->mScaleAnm + esp->getScaleInValueX());
|
||||
} else if (work->mScaleAnm > esp->getScaleOutTiming()) {
|
||||
ptcl->mParticleScaleX =
|
||||
ptcl->mScaleOut *
|
||||
(esp->getScaleDecRateX() * (work->mScaleAnm - esp->getScaleOutTiming()) + 1.0f);
|
||||
} else {
|
||||
ptcl->mParticleScaleX = ptcl->mScaleOut;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027A990-8027AA08 2752D0 0078+00 0/0 1/1 0/0 .text
|
||||
* JPACalcScaleY__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcScaleY(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
if (work->mScaleAnm < esp->getScaleInTiming()) {
|
||||
ptcl->mParticleScaleY =
|
||||
ptcl->mScaleOut * (esp->getScaleIncRateY() * work->mScaleAnm + esp->getScaleInValueY());
|
||||
} else if (work->mScaleAnm > esp->getScaleOutTiming()) {
|
||||
ptcl->mParticleScaleY =
|
||||
ptcl->mScaleOut *
|
||||
(esp->getScaleDecRateY() * (work->mScaleAnm - esp->getScaleOutTiming()) + 1.0f);
|
||||
} else {
|
||||
ptcl->mParticleScaleY = ptcl->mScaleOut;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027AA08-8027AA14 275348 000C+00 0/0 1/1 0/0 .text
|
||||
* JPACalcScaleCopy__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcScaleCopy(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
ptcl->mParticleScaleY = ptcl->mParticleScaleX;
|
||||
}
|
||||
|
||||
/* 8027AA14-8027AA20 275354 000C+00 0/0 1/1 0/0 .text
|
||||
* JPACalcScaleAnmNormal__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcScaleAnmNormal(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
work->mScaleAnm = ptcl->mTime;
|
||||
}
|
||||
|
||||
/* 8027AA20-8027AA84 275360 0064+00 0/0 1/1 0/0 .text
|
||||
* JPACalcScaleAnmRepeatX__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcScaleAnmRepeatX(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
work->mScaleAnm = (ptcl->mAge % esp->getScaleAnmCycleX()) / (f32)esp->getScaleAnmCycleX();
|
||||
}
|
||||
|
||||
/* 8027AA84-8027AAE8 2753C4 0064+00 0/0 1/1 0/0 .text
|
||||
* JPACalcScaleAnmRepeatY__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcScaleAnmRepeatY(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
work->mScaleAnm = (ptcl->mAge % esp->getScaleAnmCycleY()) / (f32)esp->getScaleAnmCycleY();
|
||||
}
|
||||
|
||||
/* 8027AAE8-8027AB7C 275428 0094+00 0/0 1/1 0/0 .text
|
||||
* JPACalcScaleAnmReverseX__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcScaleAnmReverseX(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
f32 cycle = ptcl->mAge / esp->getScaleAnmCycleX() & 1;
|
||||
f32 base = (ptcl->mAge % esp->getScaleAnmCycleX()) / (f32)esp->getScaleAnmCycleX();
|
||||
work->mScaleAnm = base + (cycle * (1.0f - base * 2.0f));
|
||||
}
|
||||
|
||||
/* 8027AB7C-8027AC10 2754BC 0094+00 0/0 1/1 0/0 .text
|
||||
* JPACalcScaleAnmReverseY__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcScaleAnmReverseY(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
f32 cycle = ptcl->mAge / esp->getScaleAnmCycleY() & 1;
|
||||
f32 base = (ptcl->mAge % esp->getScaleAnmCycleY()) / (f32)esp->getScaleAnmCycleY();
|
||||
work->mScaleAnm = base + (cycle * (1.0f - base * 2.0f));
|
||||
}
|
||||
|
||||
/* 8027AC10-8027AC98 275550 0088+00 0/0 1/1 0/0 .text
|
||||
* JPACalcAlphaAnm__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcAlphaAnm(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
0.0f; // float order
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
f32 alpha;
|
||||
if (ptcl->mTime < esp->getAlphaInTiming()) {
|
||||
alpha = 255.0f * (esp->getAlphaInValue() + esp->getAlphaIncRate() * ptcl->mTime);
|
||||
} else if (ptcl->mTime > esp->getAlphaOutTiming()) {
|
||||
alpha = 255.0f * ((ptcl->mTime - esp->getAlphaOutTiming()) * esp->getAlphaDecRate() +
|
||||
esp->getAlphaBaseValue());
|
||||
} else {
|
||||
alpha = 255.0f * esp->getAlphaBaseValue();
|
||||
}
|
||||
OSf32tou8(&alpha, &ptcl->mPrmColorAlphaAnm);
|
||||
}
|
||||
|
||||
/* 8027AC98-8027AD88 2755D8 00F0+00 0/0 1/1 0/0 .text
|
||||
* JPACalcAlphaFlickAnm__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPACalcAlphaFlickAnm(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
f32 alpha;
|
||||
if (ptcl->mTime < esp->getAlphaInTiming()) {
|
||||
alpha = (esp->getAlphaInValue() + esp->getAlphaIncRate() * ptcl->mTime);
|
||||
} else if (ptcl->mTime > esp->getAlphaOutTiming()) {
|
||||
alpha = ((ptcl->mTime - esp->getAlphaOutTiming()) * esp->getAlphaDecRate() +
|
||||
esp->getAlphaBaseValue());
|
||||
} else {
|
||||
alpha = esp->getAlphaBaseValue();
|
||||
}
|
||||
s32 theta = ptcl->mAlphaWaveRandom * ptcl->mAge * 16384.0f * (1.0f - esp->getAlphaFreq());
|
||||
f32 wave = nw4r::math::SinIdx(theta);
|
||||
alpha *= (1.0f + esp->getAlphaAmp() * (wave - 1.0f) * 0.5f) * 255.0f;
|
||||
OSf32tou8(&alpha, &ptcl->mPrmColorAlphaAnm);
|
||||
}
|
||||
|
||||
/* 8027AD88-8027ADBC 2756C8 0034+00 0/0 1/1 0/0 .text __ct__13JPAExtraShapeFPCUc */
|
||||
JPAExtraShape::JPAExtraShape(u8 const* data) {
|
||||
mpData = (const JPAExtraShapeData*)data;
|
||||
init();
|
||||
}
|
||||
|
||||
/* 8027ADBC-8027AEBC 2756FC 0100+00 1/1 0/0 0/0 .text init__13JPAExtraShapeFv */
|
||||
void JPAExtraShape::init() {
|
||||
mAlphaIncRate = (getAlphaInTiming() != 0.0f) ?
|
||||
(getAlphaBaseValue() - getAlphaInValue()) / getAlphaInTiming() :
|
||||
1.0f;
|
||||
mAlphaDecRate = (getAlphaOutTiming() != 1.0f) ?
|
||||
(getAlphaOutValue() - getAlphaBaseValue()) / (1.0f - getAlphaOutTiming()) :
|
||||
1.0f;
|
||||
|
||||
if (getScaleInTiming() != 0.0f) {
|
||||
mScaleIncRateX = (1.0f - getScaleInValueX()) / getScaleInTiming();
|
||||
mScaleIncRateY = (1.0f - getScaleInValueY()) / getScaleInTiming();
|
||||
} else {
|
||||
mScaleIncRateX = mScaleIncRateY = 1.0f;
|
||||
}
|
||||
|
||||
if (getScaleOutTiming() != 1.0f) {
|
||||
mScaleDecRateX = (getScaleOutValueX() - 1.0f) / (1.0f - getScaleOutTiming());
|
||||
mScaleDecRateY = (getScaleOutValueY() - 1.0f) / (1.0f - getScaleOutTiming());
|
||||
} else {
|
||||
mScaleDecRateX = mScaleDecRateY = 1.0f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAFieldBlock
|
||||
//
|
||||
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "JSystem/JParticle/JPAFieldBlock.h"
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
/* 8027BDEC-8027BF18 27672C 012C+00 8/8 0/0 0/0 .text
|
||||
* calcAffect__12JPAFieldBaseFP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldBase::calcAffect(JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
EGG::Vector3f vec = mAccel;
|
||||
if (!ptcl->checkStatus(4) && block->checkStatus(0x78)) {
|
||||
vec *= calcFadeAffect(block, ptcl->mTime);
|
||||
}
|
||||
|
||||
switch (block->getAddType()) {
|
||||
case 0:
|
||||
ptcl->mVelType0 += vec;
|
||||
break;
|
||||
case 1:
|
||||
ptcl->mVelType1 += vec;
|
||||
break;
|
||||
case 2:
|
||||
ptcl->mVelType2 += vec;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027BF18-8027BFB4 276858 009C+00 2/2 0/0 0/0 .text
|
||||
* calcFadeAffect__12JPAFieldBaseCFP13JPAFieldBlockf */
|
||||
f32 JPAFieldBase::calcFadeAffect(JPAFieldBlock* block, f32 time) const {
|
||||
f32 fade = 1.0f;
|
||||
if ((block->checkStatus(8) && time < block->getEnTime())
|
||||
|| (block->checkStatus(0x10) && time >= block->getDisTime()))
|
||||
{
|
||||
fade = 0.0f;
|
||||
} else if (block->checkStatus(0x40) && time >= block->getFadeOutTime()) {
|
||||
fade = (block->getDisTime() - time) * block->getFadeOutRate();
|
||||
} else if (block->checkStatus(0x20) && time < block->getFadeInTime()) {
|
||||
fade = (time - block->getEnTime()) * block->getFadeInRate();
|
||||
}
|
||||
return fade;
|
||||
}
|
||||
|
||||
/* 8027BFB4-8027C054 2768F4 00A0+00 1/0 0/0 0/0 .text
|
||||
* prepare__15JPAFieldGravityFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldGravity::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
if (block->checkStatus(2)) {
|
||||
mAccel = block->getMag() * block->getDir();
|
||||
} else {
|
||||
MTXMultVecSR(work->mRotationMtx, block->getDir(), mAccel);
|
||||
mAccel *= block->getMag();
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027C054-8027C07C 276994 0028+00 1/0 0/0 0/0 .text
|
||||
* calc__15JPAFieldGravityFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldGravity::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
|
||||
/* 8027C07C-8027C1B8 2769BC 013C+00 1/0 0/0 0/0 .text
|
||||
* prepare__11JPAFieldAirFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldAir::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
EGG::Vector3f vec = block->getDir();
|
||||
vec.normalise();
|
||||
if (block->checkStatus(2)) {
|
||||
mAccel = block->getMag() * vec;
|
||||
} else {
|
||||
MTXMultVecSR(work->mRotationMtx, vec, mAccel);
|
||||
mAccel *= block->getMag();
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027C1B8-8027C24C 276AF8 0094+00 1/0 0/0 0/0 .text
|
||||
* calc__11JPAFieldAirFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldAir::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
calcAffect(block, ptcl);
|
||||
if (block->checkStatus(4)) {
|
||||
f32 len = ptcl->mVelType1.length();
|
||||
if (len > block->getMagRndm()) {
|
||||
ptcl->mVelType1 *= block->getMagRndm() / len;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027C24C-8027C29C 276B8C 0050+00 1/0 0/0 0/0 .text
|
||||
* prepare__14JPAFieldMagnetFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldMagnet::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
mDir = block->getPos() - work->mEmitterPos;
|
||||
MTXMultVecSR(work->mRotationMtx, mDir, mDir);
|
||||
}
|
||||
|
||||
/* 8027C29C-8027C36C 276BDC 00D0+00 1/0 0/0 0/0 .text
|
||||
* calc__14JPAFieldMagnetFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldMagnet::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
mAccel = mDir - ptcl->mLocalPosition;
|
||||
mAccel.setLength(block->getMag());
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
|
||||
/* 8027C36C-8027C3E0 276CAC 0074+00 1/0 0/0 0/0 .text
|
||||
* prepare__14JPAFieldNewtonFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldNewton::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
mDir = block->getPos() - work->mEmitterPos;
|
||||
MTXMultVecSR(work->mRotationMtx, mDir, mDir);
|
||||
mCutoff = block->getVal1() * block->getVal1();
|
||||
}
|
||||
|
||||
/* 8027C3E0-8027C56C 276D20 018C+00 1/0 0/0 0/0 .text
|
||||
* calc__14JPAFieldNewtonFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldNewton::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
mAccel = mDir - ptcl->mLocalPosition;
|
||||
f32 len_sq = mAccel.squaredLength();
|
||||
if (len_sq > mCutoff) {
|
||||
mAccel.setLength(mCutoff * (block->getMag() * 10.0f) / len_sq);
|
||||
} else {
|
||||
mAccel.setLength(block->getMag() * 10.0f);
|
||||
}
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
|
||||
/* 8027C56C-8027C674 276EAC 0108+00 1/0 0/0 0/0 .text
|
||||
* prepare__14JPAFieldVortexFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldVortex::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
PSMTXMultVecSR(work->mGlobalRot, block->getDir(), field_0x10);
|
||||
field_0x10.normalise();
|
||||
field_0x1c = block->getPos().z * block->getPos().z;
|
||||
field_0x20 = 1.0f / field_0x1c;
|
||||
}
|
||||
|
||||
/* 8027C674-8027C814 276FB4 01A0+00 1/0 0/0 0/0 .text
|
||||
* calc__14JPAFieldVortexFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldVortex::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
EGG::Vector3f vec;
|
||||
vec = field_0x10.dot(ptcl->mLocalPosition) * field_0x10;
|
||||
vec = ptcl->mLocalPosition - vec;
|
||||
f32 mag = vec.squaredLength();
|
||||
if (mag > field_0x1c) {
|
||||
mag = block->getMagRndm();
|
||||
} else {
|
||||
mag *= field_0x20;
|
||||
mag = (1.0f - mag) * block->getMag() + mag * block->getMagRndm();
|
||||
}
|
||||
vec.normalise();
|
||||
mAccel = vec.cross(field_0x10);
|
||||
mAccel *= mag;
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
|
||||
/* 8027C814-8027CA94 277154 0280+00 1/0 0/0 0/0 .text
|
||||
* prepare__18JPAFieldConvectionFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldConvection::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
EGG::Vector3f vec1, vec2;
|
||||
vec2 = block->getPos().cross(block->getDir());
|
||||
vec1 = block->getDir().cross(vec2);
|
||||
MTXMultVecSR(work->mGlobalRot, vec1, field_0x10);
|
||||
MTXMultVecSR(work->mGlobalRot, block->getDir(), field_0x1c);
|
||||
MTXMultVecSR(work->mGlobalRot, vec2, field_0x28);
|
||||
field_0x10.normalise();
|
||||
field_0x1c.normalise();
|
||||
field_0x28.normalise();
|
||||
}
|
||||
|
||||
/* 8027CA94-8027CCCC 2773D4 0238+00 1/0 0/0 0/0 .text
|
||||
* calc__18JPAFieldConvectionFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldConvection::calc(JPAEmitterWorkData* work, JPAFieldBlock* block,
|
||||
JPABaseParticle* ptcl) {
|
||||
EGG::Vector3f vec1, vec2, vec3;
|
||||
vec1 = field_0x10.dot(ptcl->mLocalPosition) * field_0x10;
|
||||
vec3 = field_0x28.dot(ptcl->mLocalPosition) * field_0x28;
|
||||
vec1 += vec3;
|
||||
vec1.setLength(vec1, block->getVal1());
|
||||
vec2 = ptcl->mLocalPosition - vec1;
|
||||
vec3 = field_0x1c.cross(vec1);
|
||||
mAccel = vec3.cross(vec2);
|
||||
mAccel.setLength(block->getMag());
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
|
||||
/* 8027CCCC-8027CDE4 27760C 0118+00 1/0 0/0 0/0 .text
|
||||
* calc__14JPAFieldRandomFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldRandom::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
if (ptcl->mAge == 0 || (block->getCycle() != 0 && ptcl->mAge % block->getCycle() == 0)) {
|
||||
JPABaseEmitter* emtr = work->mpEmtr;
|
||||
mAccel.set(emtr->get_r_zh(), emtr->get_r_zh(), emtr->get_r_zh());
|
||||
mAccel *= block->getMag();
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027CDE4-8027CE64 277724 0080+00 1/0 0/0 0/0 .text
|
||||
* calc__12JPAFieldDragFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldDrag::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
if (!ptcl->checkStatus(4)) {
|
||||
f32 fade = calcFadeAffect(block, ptcl->mTime);
|
||||
ptcl->mDrag *= 1.0f - fade * (1.0f - block->getMag());
|
||||
} else {
|
||||
ptcl->mDrag *= block->getMag();
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027CE64-8027CFA8 2777A4 0144+00 1/0 0/0 0/0 .text
|
||||
* prepare__12JPAFieldSpinFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldSpin::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
EGG::Vector3f axis;
|
||||
MTXMultVecSR(work->mGlobalRot, block->getDir(), axis);
|
||||
axis.normalise();
|
||||
Mtx mtx;
|
||||
MTXRotAxisRad(mtx, axis, block->getMag());
|
||||
field_0x10.set(mtx[0][0], mtx[1][0], mtx[2][0]);
|
||||
field_0x1c.set(mtx[0][1], mtx[1][1], mtx[2][1]);
|
||||
field_0x28.set(mtx[0][2], mtx[1][2], mtx[2][2]);
|
||||
}
|
||||
|
||||
/* 8027CFA8-8027D088 2778E8 00E0+00 1/0 0/0 0/0 .text
|
||||
* calc__12JPAFieldSpinFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldSpin::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
Mtx mtx;
|
||||
mtx[0][0] = field_0x10.x;
|
||||
mtx[1][0] = field_0x10.y;
|
||||
mtx[2][0] = field_0x10.z;
|
||||
mtx[0][1] = field_0x1c.x;
|
||||
mtx[1][1] = field_0x1c.y;
|
||||
mtx[2][1] = field_0x1c.z;
|
||||
mtx[0][2] = field_0x28.x;
|
||||
mtx[1][2] = field_0x28.y;
|
||||
mtx[2][2] = field_0x28.z;
|
||||
mtx[0][3] = mtx[1][3] = mtx[2][3] = 0.0f;
|
||||
Vec vec;
|
||||
MTXMultVecSR(mtx, ptcl->mLocalPosition, &vec);
|
||||
mAccel.set(vec.x - ptcl->mLocalPosition.x, vec.y - ptcl->mLocalPosition.y,
|
||||
vec.z - ptcl->mLocalPosition.z);
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
|
||||
/* 8027D088-8027D0C0 2779C8 0038+00 0/0 1/1 0/0 .text __ct__13JPAFieldBlockFPCUcP7JKRHeap
|
||||
*/
|
||||
JPAFieldBlock::JPAFieldBlock(u8 const* data, EGG::Heap* heap)
|
||||
: mpData((const JPAFieldBlockData*)data) {
|
||||
init(heap);
|
||||
}
|
||||
|
||||
/* 8027D0C0-8027D3AC 277A00 02EC+00 2/1 0/0 0/0 .text init__13JPAFieldBlockFP7JKRHeap */
|
||||
void JPAFieldBlock::init(EGG::Heap* heap) {
|
||||
mFadeInRate = getFadeInTime() - getEnTime();
|
||||
if (mFadeInRate == 0.0f) {
|
||||
mFadeInRate = 1.0f;
|
||||
} else {
|
||||
mFadeInRate = 1.0f / mFadeInRate;
|
||||
}
|
||||
|
||||
mFadeOutRate = getDisTime() - getFadeOutTime();
|
||||
if (mFadeOutRate == 0.0f) {
|
||||
mFadeOutRate = 1.0f;
|
||||
} else {
|
||||
mFadeOutRate = 1.0f / mFadeOutRate;
|
||||
}
|
||||
|
||||
getPosOrig(&mPos);
|
||||
getDirOrig(&mDir);
|
||||
mMag = getMagOrig();
|
||||
|
||||
switch (getType()) {
|
||||
case FIELD_GRAVITY:
|
||||
mpField = new (heap, 4) JPAFieldGravity();
|
||||
break;
|
||||
case FIELD_AIR:
|
||||
mpField = new (heap, 4) JPAFieldAir();
|
||||
break;
|
||||
case FIELD_MAGNET:
|
||||
mpField = new (heap, 4) JPAFieldMagnet();
|
||||
break;
|
||||
case FIELD_NEWTON:
|
||||
mpField = new (heap, 4) JPAFieldNewton();
|
||||
break;
|
||||
case FIELD_VORTEX:
|
||||
mpField = new (heap, 4) JPAFieldVortex();
|
||||
break;
|
||||
case FIELD_RANDOM:
|
||||
mpField = new (heap, 4) JPAFieldRandom();
|
||||
break;
|
||||
case FIELD_DRAG:
|
||||
mpField = new (heap, 4) JPAFieldDrag();
|
||||
break;
|
||||
case FIELD_CONVECTION:
|
||||
mpField = new (heap, 4) JPAFieldConvection();
|
||||
break;
|
||||
case FIELD_SPIN:
|
||||
mpField = new (heap, 4) JPAFieldSpin();
|
||||
break;
|
||||
default:
|
||||
mpField = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAKeyBlock
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAKeyBlock.h"
|
||||
#include "JSystem/JParticle/JPAMath.h"
|
||||
|
||||
/* 8027D730-8027D740 278070 0010+00 0/0 1/1 0/0 .text __ct__11JPAKeyBlockFPCUc */
|
||||
JPAKeyBlock::JPAKeyBlock(const u8* data)
|
||||
: mDataStart(data)
|
||||
, field_0x4(reinterpret_cast<const float*>(&data[0xC]))
|
||||
{
|
||||
}
|
||||
|
||||
/* 8027D740-8027D7D4 278080 0094+00 0/0 1/1 0/0 .text calc__11JPAKeyBlockFf */
|
||||
f32 JPAKeyBlock::calc(float p1) {
|
||||
if (mDataStart[0xB] != '\0') {
|
||||
int v1 = (int)field_0x4[(mDataStart[9] - 1) * 4] + 1;
|
||||
// p1 -= (v1 * ((int)p1 / v1));
|
||||
int v2 = ((int)p1 / v1);
|
||||
p1 = p1 - (v2 * v1);
|
||||
}
|
||||
return JPACalcKeyAnmValue(p1, mDataStart[9], field_0x4);
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAMath
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAMath.h"
|
||||
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "egg/math/eggMath.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
#include "nw4r/math/math_triangular.h"
|
||||
|
||||
/* 80280588-802806C0 27AEC8 0138+00 0/0 1/1 0/0 .text JPAGetDirMtx__FRCQ29JGeometry8TVec3<f>PA4_f
|
||||
*/
|
||||
void JPAGetDirMtx(EGG::Vector3f const& param_0, f32 (*param_1)[4]) {
|
||||
1.0f; // probably some dummy function
|
||||
|
||||
EGG::Vector3f local_78(param_0.y, -param_0.x, 0.0f);
|
||||
f32 len = local_78.length();
|
||||
|
||||
if (len <= EGG::Math<f32>::epsilon()) {
|
||||
local_78.setZero();
|
||||
} else {
|
||||
local_78 *= (1.0f / len);
|
||||
}
|
||||
f32 xsquared = local_78.x * local_78.x;
|
||||
f32 ysquared = local_78.y * local_78.y;
|
||||
f32 xlen = local_78.x * len;
|
||||
f32 ylen = local_78.y * len;
|
||||
f32 fVar5 = (1.0f - param_0.z) * (local_78.x * local_78.y);
|
||||
param_1[0][0] = xsquared + param_0.z * (1.0f - xsquared);
|
||||
param_1[0][1] = fVar5;
|
||||
param_1[0][2] = -ylen;
|
||||
param_1[0][3] = 0.0f;
|
||||
param_1[1][0] = fVar5;
|
||||
param_1[1][1] = ysquared + param_0.z * (1.0f - ysquared);
|
||||
param_1[1][2] = xlen;
|
||||
param_1[1][3] = 0.0f;
|
||||
param_1[2][0] = ylen;
|
||||
param_1[2][1] = -xlen;
|
||||
param_1[2][2] = param_0.z;
|
||||
param_1[2][3] = 0.0f;
|
||||
}
|
||||
|
||||
/* 802806C0-80280734 27B000 0074+00 0/0 1/1 0/0 .text JPAGetYZRotateMtx__FssPA4_f */
|
||||
void JPAGetYZRotateMtx(s16 angleY, s16 angleZ, f32 (*param_2)[4]) {
|
||||
f32 cosy = nw4r::math::CosIdx(angleY);
|
||||
f32 cosz = nw4r::math::CosIdx(angleZ);
|
||||
f32 siny = nw4r::math::SinIdx(angleY);
|
||||
f32 sinz = nw4r::math::SinIdx(angleZ);
|
||||
param_2[0][0] = (cosy * cosz);
|
||||
param_2[0][1] = -sinz;
|
||||
param_2[0][2] = (siny * cosz);
|
||||
param_2[1][0] = (cosy * sinz);
|
||||
param_2[1][1] = cosz;
|
||||
param_2[1][2] = (siny * sinz);
|
||||
param_2[2][0] = -siny;
|
||||
param_2[2][2] = cosy;
|
||||
param_2[2][3] = 0.0f;
|
||||
param_2[2][1] = 0.0f;
|
||||
param_2[1][3] = 0.0f;
|
||||
param_2[0][3] = 0.0f;
|
||||
}
|
||||
|
||||
/* 80280734-802807E0 27B074 00AC+00 0/0 6/6 11/11 .text JPAGetXYZRotateMtx__FsssPA4_f */
|
||||
void JPAGetXYZRotateMtx(s16 x, s16 y, s16 z, Mtx mtx) {
|
||||
f32 cosx = nw4r::math::CosIdx(x);
|
||||
f32 cosy = nw4r::math::CosIdx(y);
|
||||
f32 cosz = nw4r::math::CosIdx(z);
|
||||
f32 sinx = nw4r::math::SinIdx(x);
|
||||
f32 siny = nw4r::math::SinIdx(y);
|
||||
f32 sinz = nw4r::math::SinIdx(z);
|
||||
mtx[0][0] = cosy * cosz;
|
||||
mtx[1][0] = cosy * sinz;
|
||||
mtx[2][0] = -siny;
|
||||
mtx[2][1] = sinx * cosy;
|
||||
mtx[2][2] = cosx * cosy;
|
||||
f32 sinxsinz;
|
||||
f32 cosxcosz;
|
||||
f32 cosxsinz;
|
||||
f32 sinxcosz;
|
||||
cosxsinz = cosx * sinz;
|
||||
sinxcosz = sinx * cosz;
|
||||
mtx[0][1] = sinxcosz * siny - cosxsinz;
|
||||
mtx[1][2] = cosxsinz * siny - sinxcosz;
|
||||
sinxsinz = sinx * sinz;
|
||||
cosxcosz = cosx * cosz;
|
||||
mtx[0][2] = sinxsinz + cosxcosz * siny;
|
||||
mtx[1][1] = cosxcosz + sinxsinz * siny;
|
||||
mtx[2][3] = 0.0f;
|
||||
mtx[1][3] = 0.0f;
|
||||
mtx[0][3] = 0.0f;
|
||||
}
|
||||
|
||||
/* 802807E0-80280808 27B120 0028+00 0/0 11/11 71/71 .text
|
||||
* JPASetRMtxTVecfromMtx__FPA4_CfPA4_fPQ29JGeometry8TVec3<f> */
|
||||
void JPASetRMtxTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4], EGG::Vector3f *param_2) {
|
||||
EGG::Vector3f dummy;
|
||||
JPASetRMtxSTVecfromMtx(param_0, param_1, &dummy, param_2);
|
||||
}
|
||||
|
||||
/* 80280808-80280984 27B148 017C+00 1/1 1/1 53/53 .text
|
||||
* JPASetRMtxSTVecfromMtx__FPA4_CfPA4_fPQ29JGeometry8TVec3<f>PQ29JGeometry8TVec3<f> */
|
||||
void JPASetRMtxSTVecfromMtx(
|
||||
f32 const (*param_0)[4], f32 (*param_1)[4], EGG::Vector3f *param_2, EGG::Vector3f *param_3
|
||||
) {
|
||||
EGG::Vector3f aTStack_54;
|
||||
aTStack_54.set(param_0[0][0], param_0[1][0], param_0[2][0]);
|
||||
param_2->x = aTStack_54.length();
|
||||
aTStack_54.set(param_0[0][1], param_0[1][1], param_0[2][1]);
|
||||
param_2->y = aTStack_54.length();
|
||||
aTStack_54.set(param_0[0][2], param_0[1][2], param_0[2][2]);
|
||||
param_2->z = aTStack_54.length();
|
||||
MTXIdentity(param_1);
|
||||
if (param_2->x != 0.0f) {
|
||||
f32 fVar5 = 1.0f / param_2->x;
|
||||
param_1[0][0] = param_0[0][0] * fVar5;
|
||||
param_1[1][0] = param_0[1][0] * fVar5;
|
||||
param_1[2][0] = param_0[2][0] * fVar5;
|
||||
}
|
||||
if (param_2->y != 0.0f) {
|
||||
f32 fVar5 = 1.0f / param_2->y;
|
||||
param_1[0][1] = param_0[0][1] * fVar5;
|
||||
param_1[1][1] = param_0[1][1] * fVar5;
|
||||
param_1[2][1] = param_0[2][1] * fVar5;
|
||||
}
|
||||
if (param_2->z != 0.0f) {
|
||||
f32 fVar5 = 1.0f / param_2->z;
|
||||
param_1[0][2] = param_0[0][2] * fVar5;
|
||||
param_1[1][2] = param_0[1][2] * fVar5;
|
||||
param_1[2][2] = param_0[2][2] * fVar5;
|
||||
}
|
||||
param_3->set(param_0[0][3], param_0[1][3], param_0[2][3]);
|
||||
}
|
||||
|
||||
/* 80280984-80280A48 27B2C4 00C4+00 0/0 2/1 0/0 .text JPACalcKeyAnmValue__FfUsPCf */
|
||||
f32 JPACalcKeyAnmValue(f32 param_0, u16 param_1, f32 const* param_2) {
|
||||
if (param_0 < param_2[0]) {
|
||||
return param_2[1];
|
||||
}
|
||||
int ind = param_1 - 1;
|
||||
if (param_2[ind * 4] <= param_0) {
|
||||
return (¶m_2[ind * 4])[1];
|
||||
}
|
||||
int x = param_1;
|
||||
while (x > 1) {
|
||||
u32 uVar3 = x / 2;
|
||||
if (param_0 >= param_2[uVar3 * 4]) {
|
||||
param_2 += uVar3 * 4;
|
||||
x -= uVar3;
|
||||
} else {
|
||||
x = uVar3;
|
||||
}
|
||||
}
|
||||
return JMAHermiteInterpolation(param_0, param_2[0], param_2[1],
|
||||
param_2[3], param_2[4],
|
||||
param_2[5], param_2[6]);
|
||||
}
|
||||
@@ -0,0 +1,333 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAParticle
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPABaseShape.h"
|
||||
#include "JSystem/JParticle/JPAChildShape.h"
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "JSystem/JParticle/JPAEmitterManager.h"
|
||||
#include "JSystem/JParticle/JPAExtraShape.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
/* 8027EFA4-8027EFEC 2798E4 0048+00 0/0 11/11 1/1 .text __dt__19JPAParticleCallBackFv */
|
||||
JPAParticleCallBack::~JPAParticleCallBack() {
|
||||
/* empty function */
|
||||
}
|
||||
|
||||
/* 8027EFEC-8027F8C8 27992C 08DC+00 0/0 1/1 0/0 .text
|
||||
* init_p__15JPABaseParticleFP18JPAEmitterWorkData */
|
||||
void JPABaseParticle::init_p(JPAEmitterWorkData* work) {
|
||||
JPABaseEmitter* emtr = work->mpEmtr;
|
||||
JPAExtraShape* esp = work->mpRes->getEsp();
|
||||
JPABaseShape* bsp = work->mpRes->getBsp();
|
||||
JPADynamicsBlock* dyn = work->mpRes->getDyn();
|
||||
|
||||
mAge = -1;
|
||||
mLifeTime = (1.0f - dyn->getLifetimeRndm() * emtr->get_r_f()) * emtr->mLifeTime;
|
||||
mTime = 0.0f;
|
||||
|
||||
initStatus(0);
|
||||
MTXMultVecSR(work->mGlobalSR, work->mVolumeCalcData.mVolumePos, mLocalPosition);
|
||||
if (emtr->checkFlag(8)) {
|
||||
setStatus(0x20);
|
||||
}
|
||||
|
||||
mOffsetPosition.set(work->mGlobalPos);
|
||||
mPosition.set(mOffsetPosition.x + mLocalPosition.x * work->mPublicScale.x,
|
||||
mOffsetPosition.y + mLocalPosition.y * work->mPublicScale.y,
|
||||
mOffsetPosition.z + mLocalPosition.z * work->mPublicScale.z);
|
||||
|
||||
EGG::Vector3f velOmni;
|
||||
if (emtr->mAwayFromCenterSpeed) {
|
||||
velOmni.setLength(work->mVolumeCalcData.mVelOmni, emtr->mAwayFromCenterSpeed);
|
||||
} else {
|
||||
velOmni.setZero();
|
||||
}
|
||||
|
||||
EGG::Vector3f velAxis;
|
||||
if (emtr->mAwayFromAxisSpeed) {
|
||||
velAxis.setLength(work->mVolumeCalcData.mVelAxis, emtr->mAwayFromAxisSpeed);
|
||||
} else {
|
||||
velAxis.setZero();
|
||||
}
|
||||
|
||||
EGG::Vector3f velDir;
|
||||
if (emtr->mDirSpeed) {
|
||||
Mtx mtx;
|
||||
JPAGetYZRotateMtx(emtr->get_r_zp() * 0x8000 * emtr->mSpread, emtr->get_r_ss(), mtx);
|
||||
MTXConcat(work->mDirectionMtx, mtx, mtx);
|
||||
velDir.set(emtr->mDirSpeed * mtx[0][2],
|
||||
emtr->mDirSpeed * mtx[1][2],
|
||||
emtr->mDirSpeed * mtx[2][2]);
|
||||
} else {
|
||||
velDir.setZero();
|
||||
}
|
||||
|
||||
EGG::Vector3f velRndm;
|
||||
if (emtr->mRndmDirSpeed) {
|
||||
velRndm.set(emtr->mRndmDirSpeed * emtr->get_r_zh(),
|
||||
emtr->mRndmDirSpeed * emtr->get_r_zh(),
|
||||
emtr->mRndmDirSpeed * emtr->get_r_zh());
|
||||
} else {
|
||||
velRndm.setZero();
|
||||
}
|
||||
|
||||
f32 ratio = emtr->get_r_zp() * dyn->getInitVelRatio() + 1.0f;
|
||||
mVelType1.set(ratio * (velOmni.x + velAxis.x + velDir.x + velRndm.x),
|
||||
ratio * (velOmni.y + velAxis.y + velDir.y + velRndm.y),
|
||||
ratio * (velOmni.z + velAxis.z + velDir.z + velRndm.z));
|
||||
|
||||
if (emtr->checkFlag(4)) {
|
||||
mVelType1 *= emtr->mLocalScl;
|
||||
}
|
||||
MTXMultVecSR(work->mGlobalRot, mVelType1, mVelType1);
|
||||
|
||||
mVelType0.setZero();
|
||||
|
||||
mMoment = 1.0f - dyn->getMomentRndm() * emtr->get_r_f();
|
||||
mDrag = 1.0f;
|
||||
field_0x78 = 0;
|
||||
|
||||
mBaseAxis.set(work->mGlobalRot[0][1], work->mGlobalRot[1][1], work->mGlobalRot[2][1]);
|
||||
|
||||
mPrmClr = emtr->mPrmClr;
|
||||
mEnvClr = emtr->mEnvClr;
|
||||
|
||||
mAnmRandom = emtr->get_r_f() * bsp->getLoopOfstValue();
|
||||
|
||||
if (esp != NULL && esp->isEnableScaleAnm()) {
|
||||
mParticleScaleX = mParticleScaleY = mScaleOut = emtr->mScaleOut * (emtr->get_r_zp() * esp->getScaleRndm() + 1.0f);
|
||||
} else {
|
||||
mParticleScaleX = mParticleScaleY = mScaleOut = emtr->mScaleOut;
|
||||
}
|
||||
|
||||
mPrmColorAlphaAnm = 0xff;
|
||||
|
||||
if (esp != NULL && esp->isEnableAlphaFlick()) {
|
||||
mAlphaWaveRandom = emtr->get_r_zp() * esp->getAlphaFreqRndm() + 1.0f;
|
||||
} else {
|
||||
mAlphaWaveRandom = 1.0f;
|
||||
}
|
||||
|
||||
if (esp != NULL) {
|
||||
if (esp->isEnableRotateAnm()) {
|
||||
mRotateAngle = esp->getRotateInitAngle() + esp->getRotateRndmAngle() * emtr->get_r_zh();
|
||||
mRotateSpeed = esp->getRotateInitSpeed() *
|
||||
(esp->getRotateRndmSpeed() * emtr->get_r_zp() + 1.0f);
|
||||
mRotateSpeed = emtr->get_r_zp() < esp->getRotateDirection() ?
|
||||
mRotateSpeed : (s16)-mRotateSpeed;
|
||||
} else {
|
||||
mRotateAngle = 0;
|
||||
mRotateSpeed = 0;
|
||||
}
|
||||
} else {
|
||||
mRotateAngle = 0;
|
||||
mRotateSpeed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027F8C8-8027FFD0 27A208 0708+00 0/0 1/1 0/0 .text
|
||||
* init_c__15JPABaseParticleFP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPABaseParticle::init_c(JPAEmitterWorkData* work, JPABaseParticle* parent) {
|
||||
JPABaseEmitter* emtr = work->mpEmtr;
|
||||
JPAChildShape* csp = work->mpRes->getCsp();
|
||||
|
||||
mAge = -1;
|
||||
mLifeTime = csp->getLife();
|
||||
mTime = 0.0f;
|
||||
initStatus(4);
|
||||
mLocalPosition.set(parent->mLocalPosition);
|
||||
|
||||
f32 pos_rndm = csp->getPosRndm();
|
||||
if (pos_rndm != 0.0f) {
|
||||
EGG::Vector3f rnd(emtr->get_r_zh(), emtr->get_r_zh(), emtr->get_r_zh());
|
||||
rnd.setLength(pos_rndm * emtr->get_r_f());
|
||||
mLocalPosition += rnd;
|
||||
}
|
||||
|
||||
if (emtr->checkFlag(0x10)) {
|
||||
setStatus(0x20);
|
||||
}
|
||||
|
||||
mOffsetPosition.set(parent->mOffsetPosition);
|
||||
|
||||
f32 base_speed = csp->getBaseVel() * (csp->getBaseVelRndm() * emtr->get_r_zp() + 1.0f);
|
||||
EGG::Vector3f base_vel(emtr->get_r_zp(), emtr->get_r_zp(), emtr->get_r_zp());
|
||||
base_vel.setLength(base_speed);
|
||||
EGG::Vector3f v = parent->mVelType1 * csp->getVelInhRate();
|
||||
mVelType1 = v + base_vel;
|
||||
mVelType0 = parent->mVelType2 * csp->getVelInhRate();
|
||||
|
||||
mMoment = parent->mMoment;
|
||||
if (csp->isFieldAffected()) {
|
||||
mDrag = parent->mDrag;
|
||||
} else {
|
||||
setStatus(0x40);
|
||||
mDrag = 1.0f;
|
||||
}
|
||||
field_0x78 = parent->field_0x78;
|
||||
|
||||
mVelType2.set(mVelType0);
|
||||
f32 ratio = mMoment * mDrag;
|
||||
mVelocity.set(ratio * (mVelType1.x + mVelType2.x),
|
||||
ratio * (mVelType1.y + mVelType2.y),
|
||||
ratio * (mVelType1.z + mVelType2.z));
|
||||
|
||||
mBaseAxis.set(parent->mBaseAxis);
|
||||
|
||||
if (csp->isScaleInherited()) {
|
||||
mParticleScaleX = mScaleOut = parent->mParticleScaleX * csp->getScaleInhRate();
|
||||
mParticleScaleY = mAlphaWaveRandom = parent->mParticleScaleY * csp->getScaleInhRate();
|
||||
} else {
|
||||
mParticleScaleX = mScaleOut = mParticleScaleY = mAlphaWaveRandom = 1.0f;
|
||||
}
|
||||
|
||||
if (csp->isColorInherited()) {
|
||||
mPrmClr.r = parent->mPrmClr.r * csp->getColorInhRate();
|
||||
mPrmClr.g = parent->mPrmClr.g * csp->getColorInhRate();
|
||||
mPrmClr.b = parent->mPrmClr.b * csp->getColorInhRate();
|
||||
mEnvClr.r = parent->mEnvClr.r * csp->getColorInhRate();
|
||||
mEnvClr.g = parent->mEnvClr.g * csp->getColorInhRate();
|
||||
mEnvClr.b = parent->mEnvClr.b * csp->getColorInhRate();
|
||||
} else {
|
||||
csp->getPrmClr(&mPrmClr);
|
||||
csp->getEnvClr(&mEnvClr);
|
||||
}
|
||||
|
||||
mPrmColorAlphaAnm = 0xff;
|
||||
if (csp->isAlphaInherited()) {
|
||||
mPrmClr.a = COLOR_MULTI(parent->mPrmClr.a, parent->mPrmColorAlphaAnm)
|
||||
* csp->getAlphaInhRate();
|
||||
} else {
|
||||
mPrmClr.a = csp->getPrmAlpha();
|
||||
}
|
||||
|
||||
mRotateAngle = parent->mRotateAngle;
|
||||
if (csp->isRotateOn()) {
|
||||
mRotateSpeed = csp->getRotInitSpeed();
|
||||
} else {
|
||||
mRotateSpeed = 0;
|
||||
}
|
||||
|
||||
mTexAnmIdx = 0;
|
||||
}
|
||||
|
||||
/* 8027FFD0-80280260 27A910 0290+00 0/0 1/1 0/0 .text
|
||||
* calc_p__15JPABaseParticleFP18JPAEmitterWorkData */
|
||||
bool JPABaseParticle::calc_p(JPAEmitterWorkData* work) {
|
||||
if (++mAge >= mLifeTime) {
|
||||
return true;
|
||||
}
|
||||
mTime = (f32)mAge / (f32)mLifeTime;
|
||||
|
||||
if (checkStatus(0x20)) {
|
||||
mOffsetPosition.set(work->mGlobalPos);
|
||||
}
|
||||
|
||||
mVelType2.setZero();
|
||||
if (!checkStatus(0x40)) {
|
||||
work->mpRes->calcField(work, this);
|
||||
}
|
||||
mVelType2 += mVelType0;
|
||||
mVelType1 *= work->mpEmtr->mAirResist;
|
||||
f32 ratio = mMoment * mDrag;
|
||||
mVelocity.set(ratio * (mVelType1.x + mVelType2.x),
|
||||
ratio * (mVelType1.y + mVelType2.y),
|
||||
ratio * (mVelType1.z + mVelType2.z));
|
||||
|
||||
if (work->mpEmtr->mpPtclCallBack != NULL) {
|
||||
work->mpEmtr->mpPtclCallBack->execute(work->mpEmtr, this);
|
||||
}
|
||||
|
||||
if (checkStatus(2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
work->mpRes->calc_p(work, this);
|
||||
mRotateAngle += mRotateSpeed;
|
||||
|
||||
if (work->mpRes->getCsp() != NULL && canCreateChild(work)) {
|
||||
for (int i = work->mpRes->getCsp()->getRate(); i > 0; i--) {
|
||||
work->mpEmtr->createChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
mLocalPosition += mVelocity;
|
||||
mPosition.set(mOffsetPosition.x + mLocalPosition.x * work->mPublicScale.x,
|
||||
mOffsetPosition.y + mLocalPosition.y * work->mPublicScale.y,
|
||||
mOffsetPosition.z + mLocalPosition.z * work->mPublicScale.z);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 80280260-802804C8 27ABA0 0268+00 0/0 1/1 0/0 .text
|
||||
* calc_c__15JPABaseParticleFP18JPAEmitterWorkData */
|
||||
bool JPABaseParticle::calc_c(JPAEmitterWorkData* work) {
|
||||
if (++mAge >= mLifeTime) {
|
||||
return true;
|
||||
}
|
||||
mTime = (f32)mAge / (f32)mLifeTime;
|
||||
|
||||
if (mAge != 0) {
|
||||
if (checkStatus(0x20)) {
|
||||
mOffsetPosition.set(work->mGlobalPos);
|
||||
}
|
||||
|
||||
mVelType1.y -= work->mpRes->getCsp()->getGravity();
|
||||
mVelType2.setZero();
|
||||
if (!checkStatus(0x40)) {
|
||||
work->mpRes->calcField(work, this);
|
||||
}
|
||||
mVelType2 += mVelType0;
|
||||
mVelType1 *= work->mpEmtr->mAirResist;
|
||||
f32 ratio = mMoment * mDrag;
|
||||
mVelocity.set(ratio * (mVelType1.x + mVelType2.x),
|
||||
ratio * (mVelType1.y + mVelType2.y),
|
||||
ratio * (mVelType1.z + mVelType2.z));
|
||||
}
|
||||
|
||||
if (work->mpEmtr->mpPtclCallBack != NULL) {
|
||||
work->mpEmtr->mpPtclCallBack->execute(work->mpEmtr, this);
|
||||
}
|
||||
|
||||
if (checkStatus(2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
work->mpRes->calc_c(work, this);
|
||||
mRotateAngle += mRotateSpeed;
|
||||
mLocalPosition += mVelocity;
|
||||
mPosition.set(mOffsetPosition.x + mLocalPosition.x * work->mPublicScale.x,
|
||||
mOffsetPosition.y + mLocalPosition.y * work->mPublicScale.y,
|
||||
mOffsetPosition.z + mLocalPosition.z * work->mPublicScale.z);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 802804C8-80280548 27AE08 0080+00 1/1 0/0 0/0 .text
|
||||
* canCreateChild__15JPABaseParticleFP18JPAEmitterWorkData */
|
||||
bool JPABaseParticle::canCreateChild(JPAEmitterWorkData* work) {
|
||||
JPAChildShape* csp = work->mpRes->getCsp();
|
||||
bool ret = false;
|
||||
int time = mAge - (int)((mLifeTime - 1) * csp->getTiming());
|
||||
if (time >= 0 && time % (csp->getStep() + 1) == 0) {
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 80280548-80280568 27AE88 0020+00 0/0 3/3 0/0 .text
|
||||
* getWidth__15JPABaseParticleCFPC14JPABaseEmitter */
|
||||
f32 JPABaseParticle::getWidth(JPABaseEmitter const* emtr) const {
|
||||
f32 scale = 2.0f * mParticleScaleX;
|
||||
return scale * emtr->mpEmtrMgr->pWd->mGlobalPtclScl.x;
|
||||
}
|
||||
|
||||
/* 80280568-80280588 27AEA8 0020+00 0/0 3/3 0/0 .text
|
||||
* getHeight__15JPABaseParticleCFPC14JPABaseEmitter */
|
||||
f32 JPABaseParticle::getHeight(JPABaseEmitter const* emtr) const {
|
||||
f32 scale = 2.0f * mParticleScaleY;
|
||||
return scale * emtr->mpEmtrMgr->pWd->mGlobalPtclScl.y;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAResourceLoader
|
||||
//
|
||||
|
||||
#include "egg/core/eggHeap.h"
|
||||
#include "JSystem/JParticle/JPAResourceLoader.h"
|
||||
#include "JSystem/JParticle/JPABaseShape.h"
|
||||
#include "JSystem/JParticle/JPAChildShape.h"
|
||||
#include "JSystem/JParticle/JPADynamicsBlock.h"
|
||||
#include "JSystem/JParticle/JPAExTexShape.h"
|
||||
#include "JSystem/JParticle/JPAExtraShape.h"
|
||||
#include "JSystem/JParticle/JPAFieldBlock.h"
|
||||
#include "JSystem/JParticle/JPAKeyBlock.h"
|
||||
#include "JSystem/JParticle/JPAResource.h"
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
|
||||
/* 8027D8A0-8027D8E0 2781E0 0040+00 0/0 1/1 0/0 .text
|
||||
* __ct__17JPAResourceLoaderFPCUcP18JPAResourceManager */
|
||||
JPAResourceLoader::JPAResourceLoader(u8 const* data, JPAResourceManager* mgr) {
|
||||
if (*(u32*)(data + 4) == '2-11') {
|
||||
load_jpc(data, mgr);
|
||||
}
|
||||
}
|
||||
|
||||
struct JPAResourceHeader {
|
||||
/* 0x0 */ u16 mUsrIdx;
|
||||
/* 0x2 */ u16 mBlockNum;
|
||||
/* 0x4 */ u8 mFieldBlockNum;
|
||||
/* 0x5 */ u8 mKeyBlockNum;
|
||||
/* 0x6 */ u8 mTDB1Num;
|
||||
};
|
||||
|
||||
/* 8027D8E0-8027DCA0 278220 03C0+00 1/1 0/0 0/0 .text
|
||||
* load_jpc__17JPAResourceLoaderFPCUcP18JPAResourceManager */
|
||||
void JPAResourceLoader::load_jpc(u8 const* data, JPAResourceManager* mgr) {
|
||||
EGG::Heap* heap = mgr->mpHeap;
|
||||
mgr->mResMax = *(u16*)(data + 8);
|
||||
mgr->mTexMax = *(u16*)(data + 0xA);
|
||||
mgr->mpResArr = new (heap, 4) JPAResource*[mgr->mResMax];
|
||||
mgr->mpTexArr = new (heap, 4) JPATexture*[mgr->mTexMax];
|
||||
|
||||
u32 offset = 0x10;
|
||||
for (int i = 0; i < *(u16*)(data + 8); i++) {
|
||||
JPAResourceHeader* header = (JPAResourceHeader*)(data + offset);
|
||||
JPAResource* res = new (heap, 4) JPAResource();
|
||||
res->mFieldBlockNum = header->mFieldBlockNum;
|
||||
res->mpFieldBlocks = res->mFieldBlockNum != 0 ?
|
||||
new (heap, 4) JPAFieldBlock*[res->mFieldBlockNum] : NULL;
|
||||
res->mKeyBlockNum = header->mKeyBlockNum;
|
||||
res->mpKeyBlocks = res->mKeyBlockNum != 0 ?
|
||||
new (heap, 4) JPAKeyBlock*[res->mKeyBlockNum] : NULL;
|
||||
res->mTDB1Num = header->mTDB1Num;
|
||||
res->mpTDB1 = NULL;
|
||||
res->mUsrIdx = header->mUsrIdx;
|
||||
|
||||
offset += 8;
|
||||
u32 field_idx = 0;
|
||||
u32 key_idx = 0;
|
||||
|
||||
for (int j = 0; j < header->mBlockNum; j++) {
|
||||
u32 magic = *(u32*)(data + offset);
|
||||
u32 size = *(u32*)(data + offset + 4);
|
||||
switch (magic) {
|
||||
case 'FLD1':
|
||||
res->mpFieldBlocks[field_idx] = new (heap, 4) JPAFieldBlock(data + offset, heap);
|
||||
field_idx++;
|
||||
break;
|
||||
case 'KFA1':
|
||||
res->mpKeyBlocks[key_idx] = new (heap, 4) JPAKeyBlock(data + offset);
|
||||
key_idx++;
|
||||
break;
|
||||
case 'BEM1':
|
||||
res->mpDynamicsBlock = new (heap, 4) JPADynamicsBlock(data + offset);
|
||||
break;
|
||||
case 'BSP1':
|
||||
res->mpBaseShape = new (heap, 4) JPABaseShape(data + offset, heap);
|
||||
break;
|
||||
case 'ESP1':
|
||||
res->mpExtraShape = new (heap, 4) JPAExtraShape(data + offset);
|
||||
break;
|
||||
case 'SSP1':
|
||||
res->mpChildShape = new (heap, 4) JPAChildShape(data + offset);
|
||||
break;
|
||||
case 'ETX1':
|
||||
res->mpExTexShape = new (heap, 4) JPAExTexShape(data + offset);
|
||||
break;
|
||||
case 'TDB1':
|
||||
res->mpTDB1 = (const u16*)(data + offset + 8);
|
||||
break;
|
||||
}
|
||||
offset += size;
|
||||
}
|
||||
|
||||
res->init(heap);
|
||||
mgr->registRes(res);
|
||||
}
|
||||
|
||||
offset = *(u32*)(data + 0xC);
|
||||
for (int i = 0; i < *(u16*)(data + 0xA); i++) {
|
||||
u32 size = *(u32*)(data + offset + 4);
|
||||
JPATexture* tex = new (heap, 4) JPATexture(data + offset);
|
||||
mgr->registTex(tex);
|
||||
offset += size;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPAResourceManager
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
#include "JSystem/JParticle/JPADynamicsBlock.h"
|
||||
#include "JSystem/JParticle/JPAResource.h"
|
||||
#include "string.h"
|
||||
|
||||
struct JPAResourceLoader {
|
||||
/* 8027D8A0 */ JPAResourceLoader(u8 const*, JPAResourceManager*);
|
||||
};
|
||||
|
||||
/* 80273E10-80273E68 26E750 0058+00 0/0 2/2 0/0 .text __ct__18JPAResourceManagerFPCvP7JKRHeap */
|
||||
JPAResourceManager::JPAResourceManager(void const* pData, EGG::Heap* pHeap) {
|
||||
mpResArr = NULL;
|
||||
mpTexArr = NULL;
|
||||
mResMax = 0;
|
||||
mResNum = 0;
|
||||
mTexMax = 0;
|
||||
mTexNum = 0;
|
||||
mpHeap = pHeap;
|
||||
JPAResourceLoader loader((u8 const*)pData, this);
|
||||
}
|
||||
|
||||
/* 80273E68-80273EA8 26E7A8 0040+00 1/1 1/1 0/0 .text getResource__18JPAResourceManagerCFUs */
|
||||
JPAResource* JPAResourceManager::getResource(u16 usrIdx) const {
|
||||
for (u16 i = 0; i < mResNum; i++)
|
||||
if (mpResArr[i]->getUsrIdx() == usrIdx)
|
||||
return mpResArr[i];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 80273EA8-80273EEC 26E7E8 0044+00 0/0 2/2 0/0 .text
|
||||
* checkUserIndexDuplication__18JPAResourceManagerCFUs */
|
||||
bool JPAResourceManager::checkUserIndexDuplication(u16 usrIdx) const {
|
||||
for (s32 i = 0; i < mResNum; i++)
|
||||
if (mpResArr[i]->getUsrIdx() == usrIdx)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 80273EEC-80273F8C 26E82C 00A0+00 0/0 2/2 0/0 .text
|
||||
* swapTexture__18JPAResourceManagerFPC7ResTIMGPCc */
|
||||
const EGG::ResTIMG* JPAResourceManager::swapTexture(EGG::ResTIMG const* img, char const* swapName) {
|
||||
const EGG::ResTIMG* ret = NULL;
|
||||
|
||||
for (s32 i = 0; i < mTexNum; i++) {
|
||||
if (strcmp(swapName, mpTexArr[i]->getName()) == 0) {
|
||||
EGG::Texture* tex = mpTexArr[i]->getJUTTexture();
|
||||
ret = tex->getTexInfo();
|
||||
tex->storeTIMG(img, (u8)0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 80273F8C-80273FAC 26E8CC 0020+00 0/0 1/1 0/0 .text
|
||||
* registRes__18JPAResourceManagerFP11JPAResource */
|
||||
void JPAResourceManager::registRes(JPAResource* res) {
|
||||
mpResArr[mResNum] = res;
|
||||
mResNum++;
|
||||
}
|
||||
|
||||
/* 80273FAC-80273FCC 26E8EC 0020+00 0/0 1/1 0/0 .text
|
||||
* registTex__18JPAResourceManagerFP10JPATexture */
|
||||
void JPAResourceManager::registTex(JPATexture* tex) {
|
||||
mpTexArr[mTexNum] = tex;
|
||||
mTexNum++;
|
||||
}
|
||||
|
||||
/* 80273FCC-80274010 26E90C 0044+00 0/0 6/6 0/0 .text getResUserWork__18JPAResourceManagerCFUs */
|
||||
u32 JPAResourceManager::getResUserWork(u16 usrIdx) const {
|
||||
u32 ret = 0;
|
||||
|
||||
JPAResource* res = getResource(usrIdx);
|
||||
if (res != NULL)
|
||||
ret = res->getDyn()->getResUserWork();
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JPATexture
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPATexture.h"
|
||||
|
||||
/* 8027D7D4-8027D83C 278114 0068+00 0/0 1/1 0/0 .text __ct__10JPATextureFPCUc */
|
||||
JPATexture::JPATexture(u8 const* pData) {
|
||||
mpData = (const JPATextureData*)pData;
|
||||
mTexture.store(&mpData->mResTIMG);
|
||||
}
|
||||
|
||||
/* 8027D83C-8027D8A0 27817C 0064+00 1/0 0/0 0/0 .text __dt__10JPATextureFv */
|
||||
JPATexture::~JPATexture() {}
|
||||
@@ -0,0 +1,162 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JSUList
|
||||
//
|
||||
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
|
||||
JSUPtrLink::JSUPtrLink(void* object) {
|
||||
mList = NULL;
|
||||
mObject = object;
|
||||
mPrev = NULL;
|
||||
mNext = NULL;
|
||||
}
|
||||
|
||||
JSUPtrLink::~JSUPtrLink() {
|
||||
if (mList != NULL) {
|
||||
mList->remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
JSUPtrList::JSUPtrList(bool init) {
|
||||
if (init) {
|
||||
initiate();
|
||||
}
|
||||
}
|
||||
|
||||
JSUPtrList::~JSUPtrList() {
|
||||
JSUPtrLink* node = mHead;
|
||||
s32 removed = 0;
|
||||
while (mLength > removed) {
|
||||
node->mList = NULL;
|
||||
node = node->getNext();
|
||||
removed += 1;
|
||||
}
|
||||
}
|
||||
|
||||
void JSUPtrList::initiate() {
|
||||
mHead = NULL;
|
||||
mTail = NULL;
|
||||
mLength = 0;
|
||||
}
|
||||
|
||||
void JSUPtrList::setFirst(JSUPtrLink* first) {
|
||||
first->mList = this;
|
||||
first->mPrev = NULL;
|
||||
first->mNext = NULL;
|
||||
mTail = first;
|
||||
mHead = first;
|
||||
mLength = 1;
|
||||
}
|
||||
|
||||
bool JSUPtrList::append(JSUPtrLink* ptr) {
|
||||
JSUPtrList* list = ptr->mList;
|
||||
bool result = (NULL == list);
|
||||
if (!result) {
|
||||
result = list->remove(ptr);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
if (mLength == 0) {
|
||||
setFirst(ptr);
|
||||
} else {
|
||||
ptr->mList = this;
|
||||
ptr->mPrev = mTail;
|
||||
ptr->mNext = NULL;
|
||||
mTail->mNext = ptr;
|
||||
mTail = ptr;
|
||||
mLength++;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool JSUPtrList::prepend(JSUPtrLink* ptr) {
|
||||
JSUPtrList* list = ptr->mList;
|
||||
bool result = (NULL == list);
|
||||
if (!result) {
|
||||
result = list->remove(ptr);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
if (mLength == 0) {
|
||||
setFirst(ptr);
|
||||
} else {
|
||||
ptr->mList = this;
|
||||
ptr->mPrev = NULL;
|
||||
ptr->mNext = mHead;
|
||||
mHead->mPrev = ptr;
|
||||
mHead = ptr;
|
||||
mLength++;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool JSUPtrList::insert(JSUPtrLink* before, JSUPtrLink* ptr) {
|
||||
if (before == mHead) {
|
||||
return prepend(ptr);
|
||||
} else if (before == NULL) {
|
||||
return append(ptr);
|
||||
}
|
||||
|
||||
if (before->mList != this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = (NULL == ptr->mList);
|
||||
if (!result) {
|
||||
result = ptr->mList->remove(ptr);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
JSUPtrLink* prev = before->mPrev;
|
||||
ptr->mList = this;
|
||||
ptr->mPrev = prev;
|
||||
ptr->mNext = before;
|
||||
prev->mNext = ptr;
|
||||
before->mPrev = ptr;
|
||||
mLength++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool JSUPtrList::remove(JSUPtrLink* ptr) {
|
||||
bool is_parent = (ptr->mList == this);
|
||||
if (is_parent) {
|
||||
if (mLength == 1) {
|
||||
mHead = NULL;
|
||||
mTail = NULL;
|
||||
} else if (ptr == mHead) {
|
||||
ptr->mNext->mPrev = NULL;
|
||||
mHead = ptr->mNext;
|
||||
} else if (ptr == mTail) {
|
||||
ptr->mPrev->mNext = NULL;
|
||||
mTail = ptr->mPrev;
|
||||
} else {
|
||||
ptr->mPrev->mNext = ptr->mNext;
|
||||
ptr->mNext->mPrev = ptr->mPrev;
|
||||
}
|
||||
|
||||
ptr->mList = NULL;
|
||||
mLength--;
|
||||
}
|
||||
|
||||
return is_parent;
|
||||
}
|
||||
|
||||
JSUPtrLink* JSUPtrList::getNthLink(u32 index) const {
|
||||
if (index >= mLength) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JSUPtrLink* node = mHead;
|
||||
for (u32 i = 0; i < index; i++) {
|
||||
node = node->getNext();
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -334,7 +334,7 @@ void LightTexture::fn_804AC0E0(int i, const GXColor &color, bool b) {
|
||||
mtx._13 = sDrawHeight - (h + sTexHeight);
|
||||
|
||||
GXLoadPosMtxImm(mtx, 0);
|
||||
GXLoadTexMtxImm(sIdentityMtx, 0x1E, GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(sIdentityMtx, 0x1E, GX_MTX2x4);
|
||||
|
||||
GXColor c;
|
||||
if ((field_0x36 & 1) != 0) {
|
||||
@@ -474,7 +474,7 @@ void LightTexture::draw(int i) {
|
||||
mtx._13 = sDrawHeight - (h + sTexHeight);
|
||||
|
||||
GXLoadPosMtxImm(mtx, 0);
|
||||
GXLoadTexMtxImm(sIdentityMtx, 0x1E, GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(sIdentityMtx, 0x1E, GX_MTX2x4);
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
|
||||
GXPosition1x8(0);
|
||||
@@ -520,7 +520,7 @@ void LightTexture::debugDraw(int i) {
|
||||
mtx._13 = sDrawHeight - (u2 + sTexHeight);
|
||||
|
||||
GXLoadPosMtxImm(mtx, 0);
|
||||
GXLoadTexMtxImm(sIdentityMtx, 0x1E, GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(sIdentityMtx, 0x1E, GX_MTX2x4);
|
||||
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ void PostEffectBlur::drawInternal(u8 kernelIdx, u8 p2, f32 f1, f32 f2) {
|
||||
// clang-format on
|
||||
);
|
||||
PSMTXConcat(m, mtx, m);
|
||||
GXLoadTexMtxImm(m, texMtxId, GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(m, texMtxId, GX_MTX2x4);
|
||||
unk_00_scale++;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void PostEffectBlurGather::setMaterialInternal() {
|
||||
} else {
|
||||
loadTextureInternal();
|
||||
}
|
||||
GXLoadTexMtxImm(mtx, texMtxIdx, GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(mtx, texMtxIdx, GX_MTX2x4);
|
||||
}
|
||||
|
||||
f32 v = field_0x30 * 255.0f;
|
||||
|
||||
@@ -19,8 +19,8 @@ void PostEffectMask::setMaterialInternal() {
|
||||
setMatColorChannel();
|
||||
GXSetNumTexGens(2);
|
||||
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_TEXMTX_IDENT, false, GX_DUALMTX_IDENT);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX0, GX_TEXMTX_IDENT, false, GX_DUALMTX_IDENT);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, false, GX_DUALMTX_IDENT);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, false, GX_DUALMTX_IDENT);
|
||||
setMatInd();
|
||||
GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
|
||||
@@ -118,10 +118,10 @@ void PostEffectMaskDOF::setMaterialInternal() {
|
||||
setMatColorChannel();
|
||||
GXSetNumTexGens(2);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_TEXMTX0, false, GX_DUALMTX_IDENT);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX1, GX_TEXMTX_IDENT, false, GX_DUALMTX_IDENT);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX1, GX_IDENTITY, false, GX_DUALMTX_IDENT);
|
||||
nw4r::math::MTX34 baseTexMtx;
|
||||
getBaseTexMtx(&baseTexMtx);
|
||||
GXLoadTexMtxImm(baseTexMtx, GX_TEXMTX0, GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(baseTexMtx, GX_TEXMTX0, GX_MTX2x4);
|
||||
GXSetNumIndStages(1);
|
||||
GXSetIndTexOrder(GX_INDTEXSTAGE0, GX_TEXCOORD0, mTex1.mTexMapID);
|
||||
GXSetIndTexCoordScale(GX_INDTEXSTAGE0, GX_ITS_1, GX_ITS_1);
|
||||
|
||||
@@ -20,7 +20,7 @@ void PostEffectSimple::setMaterialInternal() {
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 0x1e, 0, 0x7d);
|
||||
nw4r::math::MTX34 mtx;
|
||||
getBaseTexMtx(&mtx);
|
||||
GXLoadTexMtxImm(mtx, 0x1e, GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(mtx, 0x1e, GX_MTX2x4);
|
||||
setMatInd();
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
|
||||
@@ -94,7 +94,7 @@ void PostEffectUnk2::draw(f32 width, f32 height) {
|
||||
|
||||
mtx[1][3] = 0.f;
|
||||
mtx[0][3] = 0.f;
|
||||
GXLoadTexMtxImm(mtx, GXUtility::getTexMtxID(j), GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(mtx, GXUtility::getTexMtxID(j), GX_MTX2x4);
|
||||
}
|
||||
if (i == 1 && field_0x2C <= 1) {
|
||||
GXSetBlendMode(GX_BM_LOGIC, GX_BL_ZERO, GX_BL_ZERO, GX_LO_OR);
|
||||
|
||||
@@ -172,7 +172,7 @@ void StateGX::resetTexGen() {
|
||||
GXSetNumTexGens(1);
|
||||
|
||||
for (u32 i = 0; i < 10; i++) {
|
||||
GXLoadTexMtxImm(identity, i * 3 + 0x1E, GX_MTX_3x4);
|
||||
GXLoadTexMtxImm(identity, i * 3 + 0x1E, GX_MTX3x4);
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < GX_MAX_TEXCOORD; i++) {
|
||||
|
||||
@@ -109,7 +109,7 @@ void blineMat_c::setupGX(bool bTransparent) {
|
||||
GXSetNumTevStages(1);
|
||||
}
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_TEXMTX_IDENT, 0, GX_DUALMTX_IDENT);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, 0, GX_DUALMTX_IDENT);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
|
||||
@@ -271,7 +271,7 @@ static void drawSub2(void *data, u8 i) {
|
||||
GXSetTexCoordGen2((GXTexCoordID)id, GX_TG_MTX2x4, GX_TG_TEX0, idx, FALSE, GX_DUALMTX_IDENT);
|
||||
sTexMtx[0][3] = 0.01f * nw4r::math::CosIdx(ang);
|
||||
sTexMtx[1][3] = 0.01f * nw4r::math::SinIdx(ang);
|
||||
GXLoadTexMtxImm(sTexMtx, idx, GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(sTexMtx, idx, GX_MTX2x4);
|
||||
}
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, GX_CC_A0, GX_CC_ZERO);
|
||||
@@ -596,7 +596,7 @@ void mShadowChild_c::draw() {
|
||||
Mtx mtx;
|
||||
C_MTXLightOrtho(mtx, field_0x13C, -field_0x13C, -field_0x13C, field_0x13C, 0.5f, -0.5f, 0.5f, 0.5f);
|
||||
PSMTXConcat(mtx, mFrustum.mView.m, mtx);
|
||||
GXLoadTexMtxImm(mtx, GX_TEXMTX0, GX_MTX_3x4);
|
||||
GXLoadTexMtxImm(mtx, GX_TEXMTX0, GX_MTX3x4);
|
||||
mShadow_c::GetInstance()->draw(mFrustum.mView, field_0x154);
|
||||
GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ public:
|
||||
idArray[i] = GX_PNMTX0;
|
||||
allIdent = false;
|
||||
} else {
|
||||
idArray[i] = GX_TEXMTX_IDENT;
|
||||
idArray[i] = GX_IDENTITY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1653,11 +1653,11 @@ void LoadResTexSrt(const ResTexSrt srt) {
|
||||
sPostTexMtx.SetIdentity(i);
|
||||
math::MTX34Identity(&identMtx);
|
||||
|
||||
GXLoadTexMtxImm(identMtx, i * 3 + GX_DUALMTX0, GX_MTX_3x4);
|
||||
GXLoadTexMtxImm(identMtx, i * 3 + GX_DUALMTX0, GX_MTX3x4);
|
||||
}
|
||||
} else {
|
||||
sPostTexMtx.ResetIdentity(i);
|
||||
GXLoadTexMtxImm(mtx, i * 3 + GX_DUALMTX0, GX_MTX_3x4);
|
||||
GXLoadTexMtxImm(mtx, i * 3 + GX_DUALMTX0, GX_MTX3x4);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -158,12 +158,12 @@ void GDSetIndTexMtx(u32 id, const math::MTX34 &rMtx) {
|
||||
}
|
||||
|
||||
void GDResetCurrentMtx() {
|
||||
u32 regA = GX_PNMTX0 << GX_CP_MATRIXINDEXA_POSNRM_SHIFT | GX_TEXMTX_IDENT << GX_CP_MATRIXINDEXA_TEX0_SHIFT |
|
||||
GX_TEXMTX_IDENT << GX_CP_MATRIXINDEXA_TEX1_SHIFT | GX_TEXMTX_IDENT << GX_CP_MATRIXINDEXA_TEX2_SHIFT |
|
||||
GX_TEXMTX_IDENT << GX_CP_MATRIXINDEXA_TEX3_SHIFT;
|
||||
u32 regA = GX_PNMTX0 << GX_CP_MATRIXINDEXA_POSNRM_SHIFT | GX_IDENTITY << GX_CP_MATRIXINDEXA_TEX0_SHIFT |
|
||||
GX_IDENTITY << GX_CP_MATRIXINDEXA_TEX1_SHIFT | GX_IDENTITY << GX_CP_MATRIXINDEXA_TEX2_SHIFT |
|
||||
GX_IDENTITY << GX_CP_MATRIXINDEXA_TEX3_SHIFT;
|
||||
|
||||
u32 regB = GX_TEXMTX_IDENT << GX_CP_MATRIXINDEXB_TEX4_SHIFT | GX_TEXMTX_IDENT << GX_CP_MATRIXINDEXB_TEX5_SHIFT |
|
||||
GX_TEXMTX_IDENT << GX_CP_MATRIXINDEXB_TEX6_SHIFT | GX_TEXMTX_IDENT << GX_CP_MATRIXINDEXB_TEX7_SHIFT;
|
||||
u32 regB = GX_IDENTITY << GX_CP_MATRIXINDEXB_TEX4_SHIFT | GX_IDENTITY << GX_CP_MATRIXINDEXB_TEX5_SHIFT |
|
||||
GX_IDENTITY << GX_CP_MATRIXINDEXB_TEX6_SHIFT | GX_IDENTITY << GX_CP_MATRIXINDEXB_TEX7_SHIFT;
|
||||
|
||||
LoadCPCmd(GX_CP_REG_MATRIXINDEXA, regA);
|
||||
LoadCPCmd(GX_CP_REG_MATRIXINDEXB, regB);
|
||||
@@ -204,7 +204,7 @@ void GDLoadTexMtxImm3x3(const math::MTX33 &rMtx, u32 id) {
|
||||
mtx._22 = pMtx->_22;
|
||||
mtx._23 = 0.0f;
|
||||
|
||||
GXLoadTexMtxImm(mtx, id, GX_MTX_3x4);
|
||||
GXLoadTexMtxImm(mtx, id, GX_MTX3x4);
|
||||
}
|
||||
|
||||
} // namespace fifo
|
||||
|
||||
@@ -681,7 +681,7 @@ bool Material::SetupGX(bool bModVtxCol, u8 alpha) {
|
||||
if (bUseTexMtx[i]) {
|
||||
math::MTX34 texMtx;
|
||||
CalcTextureMtx(&texMtx, texSRTs[i]);
|
||||
GXLoadTexMtxImm(texMtx, GetTexMtx(i), GX_MTX_2x4);
|
||||
GXLoadTexMtxImm(texMtx, GetTexMtx(i), GX_MTX2x4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ static void SetupGXCommon() {
|
||||
GXSetChanCtrl(GX_COLOR0A0, FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);
|
||||
GXSetChanCtrl(GX_COLOR1A1, FALSE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE);
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_TEXMTX_IDENT, FALSE, GX_DUALMTX_IDENT);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, FALSE, GX_DUALMTX_IDENT);
|
||||
GXSetNumIndStages(0);
|
||||
GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user