mirror of
https://github.com/zeldaret/ss
synced 2026-06-21 00:11:13 -04:00
Get the thing building again after Eggification
This commit is contained in:
@@ -1762,6 +1762,7 @@ JSystem/JParticle/JPAResource.cpp:
|
||||
|
||||
JSystem/JParticle/JPABaseShape.cpp:
|
||||
.text start:0x803198A0 end:0x8031D53C align:16
|
||||
.sdata2 start:0x8057CE50 end:0x8057CE88
|
||||
|
||||
JSystem/JParticle/JPAExtraShape.cpp:
|
||||
.text start:0x8031D540 end:0x8031DB98 align:16
|
||||
@@ -1777,6 +1778,8 @@ JSystem/JParticle/JPADynamicsBlock.cpp:
|
||||
|
||||
JSystem/JParticle/JPAFieldBlock.cpp:
|
||||
.text start:0x8031F020 end:0x80320410 align:16
|
||||
.data start:0x80547180 end:0x80547268
|
||||
.sdata2 start:0x8057CF00 end:0x8057CF10
|
||||
|
||||
JSystem/JParticle/JPAKeyBlock.cpp:
|
||||
.text start:0x80320410 end:0x803204B4 align:16
|
||||
@@ -1792,12 +1795,15 @@ JSystem/JParticle/JPAEmitterManager.cpp:
|
||||
|
||||
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
|
||||
|
||||
@@ -18583,13 +18583,13 @@ __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__25JSULink<14JPABaseEmitter>Fv = .text:0x80320B90; // type:function size:0x58
|
||||
__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
|
||||
fn_80320CE0 = .text:0x80320CE0; // type:function size:0x10
|
||||
fn_80320CF0 = .text:0x80320CF0; // type:function size:0x40
|
||||
createSimpleEmitterID__17JPAEmitterManagerFRCQ29JGeometry8TVec3<f>UsUcUcP18JPAEmitterCallBackP19JPAParticleCallBack = .text:0x80320D30; // type:function size:0xE4
|
||||
__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 = .text:0x80320E20; // type:function size:0xB8
|
||||
calc__17JPAEmitterManagerFUc = .text:0x80320EE0; // type:function size:0x88
|
||||
draw__17JPAEmitterManagerFPC11JPADrawInfoUc = .text:0x80320F70; // type:function size:0x204
|
||||
@@ -18606,7 +18606,7 @@ createChild__14JPABaseEmitterFP15JPABaseParticle = .text:0x80321850; // type:fun
|
||||
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__14JPABaseEmitterCFPQ29JGeometry8TVec3<f> = .text:0x80321B90; // type:function size:0x80
|
||||
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
|
||||
@@ -18615,10 +18615,10 @@ init_c__15JPABaseParticleFP18JPAEmitterWorkDataP15JPABaseParticle = .text:0x8032
|
||||
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__FRCQ29JGeometry8TVec3<f>PA4_f = .text:0x80323050; // type:function size:0x13C
|
||||
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_fPQ29JGeometry8TVec3<f>PQ29JGeometry8TVec3<f> = .text:0x80323480; // type:function size:0x1BC
|
||||
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
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#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>
|
||||
|
||||
@@ -41,6 +41,12 @@ struct JPABaseShapeData {
|
||||
/* 0x30 */ u8 mTexAnmRndmMask;
|
||||
};
|
||||
|
||||
struct JPABaseShapeAlphaArg {
|
||||
GXTevAlphaArg mArg[4];
|
||||
GXTevOp mOp;
|
||||
GXTevScale mScale;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
@@ -56,7 +62,7 @@ public:
|
||||
static GXCompare st_c[8];
|
||||
static GXAlphaOp st_ao[4];
|
||||
static GXTevColorArg st_ca[6][4];
|
||||
static GXTevAlphaArg st_aa[2][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]; }
|
||||
@@ -75,14 +81,14 @@ public:
|
||||
u8 getAlphaRef1() const { return mpData->mAlphaRef1; }
|
||||
|
||||
const GXTevColorArg* getTevColorArg() const { return st_ca[(mpData->mFlags >> 0x0F) & 0x07]; }
|
||||
const GXTevAlphaArg* getTevAlphaArg() const { return st_aa[(mpData->mFlags >> 0x12) & 0x01]; }
|
||||
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 >> 25) & 0x01; }
|
||||
u32 getTilingT() const { return (mpData->mFlags >> 26) & 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 & 0x00100000; }
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
@@ -19,9 +20,9 @@ struct JPADynamicsBlockData {
|
||||
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ u32 mResUserWork;
|
||||
/* 0x10 */ JGeometry::TVec3<f32> mEmitterScl;
|
||||
/* 0x1C */ JGeometry::TVec3<f32> mEmitterTrs;
|
||||
/* 0x28 */ JGeometry::TVec3<f32> mEmitterDir;
|
||||
/* 0x10 */ EGG::Vector3f mEmitterScl;
|
||||
/* 0x1C */ EGG::Vector3f mEmitterTrs;
|
||||
/* 0x28 */ EGG::Vector3f mEmitterDir;
|
||||
/* 0x34 */ f32 mInitialVelOmni;
|
||||
/* 0x38 */ f32 mInitialVelAxis;
|
||||
/* 0x3C */ f32 mInitialVelRndm;
|
||||
@@ -73,13 +74,13 @@ public:
|
||||
u32 getVolumeType() const { return (mpData->mFlags >> 8) & 0x07; }
|
||||
u16 getDivNumber() const { return mpData->mDivNumber; }
|
||||
f32 getRateRndm() const { return mpData->mRateRndm; }
|
||||
void getEmitterScl(JGeometry::TVec3<f32>* vec) const {
|
||||
void getEmitterScl(EGG::Vector3f* vec) const {
|
||||
vec->set(mpData->mEmitterScl.x, mpData->mEmitterScl.y, mpData->mEmitterScl.z);
|
||||
}
|
||||
void getEmitterTrs(JGeometry::TVec3<f32>* vec) const {
|
||||
void getEmitterTrs(EGG::Vector3f* vec) const {
|
||||
vec->set(mpData->mEmitterTrs.x, mpData->mEmitterTrs.y, mpData->mEmitterTrs.z);
|
||||
}
|
||||
void getEmitterDir(JGeometry::TVec3<f32>* vec) const {
|
||||
void getEmitterDir(EGG::Vector3f* vec) const {
|
||||
vec->set(mpData->mEmitterDir.x, mpData->mEmitterDir.y, mpData->mEmitterDir.z);
|
||||
}
|
||||
void getEmitterRot(JGeometry::TVec3<s16>* vec) const {
|
||||
|
||||
@@ -21,9 +21,9 @@ class JPAParticleCallBack;
|
||||
*/
|
||||
struct JPAEmitterWorkData {
|
||||
struct JPAVolumeCalcData {
|
||||
/* 0x00 */ JGeometry::TVec3<f32> mVolumePos;
|
||||
/* 0x0C */ JGeometry::TVec3<f32> mVelOmni;
|
||||
/* 0x18 */ JGeometry::TVec3<f32> mVelAxis;
|
||||
/* 0x00 */ EGG::Vector3f mVolumePos;
|
||||
/* 0x0C */ EGG::Vector3f mVelOmni;
|
||||
/* 0x18 */ EGG::Vector3f mVelAxis;
|
||||
};
|
||||
|
||||
JPAEmitterWorkData() : mRndm(0) {}
|
||||
@@ -42,11 +42,11 @@ struct JPAEmitterWorkData {
|
||||
/* 0x78 */ Mtx mRotationMtx;
|
||||
/* 0xA8 */ Mtx mGlobalRot;
|
||||
/* 0xD8 */ Mtx mGlobalSR;
|
||||
/* 0x108 */ JGeometry::TVec3<f32> mEmitterPos;
|
||||
/* 0x114 */ JGeometry::TVec3<f32> mGlobalScl;
|
||||
/* 0x120 */ JGeometry::TVec3<f32> mGlobalEmtrDir;
|
||||
/* 0x12C */ JGeometry::TVec3<f32> mPublicScale;
|
||||
/* 0x138 */ JGeometry::TVec3<f32> mGlobalPos;
|
||||
/* 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;
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
/* 8027E6EC */ void init(JPAEmitterManager*, JPAResource*);
|
||||
/* 8027EDD4 */ bool processTillStartFrame();
|
||||
/* 8027EE14 */ bool processTermination();
|
||||
/* 8027EEB0 */ void calcEmitterGlobalPosition(JGeometry::TVec3<f32>*) const;
|
||||
/* 8027EEB0 */ void calcEmitterGlobalPosition(EGG::Vector3f*) const;
|
||||
/* 8027EC60 */ void deleteAllParticle();
|
||||
/* 8027EB60 */ JPABaseParticle* createChild(JPABaseParticle*);
|
||||
/* 8027EA40 */ JPABaseParticle* createParticle();
|
||||
@@ -134,13 +134,13 @@ public:
|
||||
mGlobalPScl.y = mGlobalScl.y;
|
||||
}
|
||||
void setGlobalTranslation(f32 x, f32 y, f32 z) { mGlobalTrs.set(x, y, z); }
|
||||
void setGlobalTranslation(const JGeometry::TVec3<f32>& trs) { mGlobalTrs.set(trs); }
|
||||
void getLocalTranslation(JGeometry::TVec3<f32>& vec) { vec.set(mLocalTrs); }
|
||||
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(JGeometry::TVec3<f32>* out) const { out->set(mGlobalTrs); }
|
||||
void setGlobalDynamicsScale(const JGeometry::TVec3<f32>& i_scale) { mGlobalScl.set(i_scale); }
|
||||
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; }
|
||||
@@ -151,23 +151,23 @@ public:
|
||||
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 JGeometry::TVec3<f32>& i_trans) { mLocalTrs.set(i_trans); }
|
||||
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 JGeometry::TVec3<f32>& scale) {
|
||||
void setGlobalParticleScale(const EGG::Vector3f& scale) {
|
||||
mGlobalPScl.set(scale.x, scale.y);
|
||||
}
|
||||
void setGlobalParticleScale(f32 scaleX, f32 scaleY) {
|
||||
mGlobalPScl.set(scaleX, scaleY);
|
||||
}
|
||||
void getGlobalParticleScale(JGeometry::TVec3<f32>& scale) {
|
||||
void getGlobalParticleScale(EGG::Vector3f& scale) {
|
||||
scale.set(mGlobalPScl.x, mGlobalPScl.y, 1.0f);
|
||||
}
|
||||
void setGlobalScale(const JGeometry::TVec3<f32>& scale) {
|
||||
void setGlobalScale(const EGG::Vector3f& scale) {
|
||||
mGlobalScl.set(scale);
|
||||
mGlobalPScl.set(scale.x ,scale.y);
|
||||
}
|
||||
@@ -175,11 +175,11 @@ public:
|
||||
JPASetRMtxSTVecfromMtx(matrix, mGlobalRot, &mGlobalScl, &mGlobalTrs);
|
||||
mGlobalPScl.set(mGlobalScl.x, mGlobalScl.y);
|
||||
}
|
||||
void setDirection(const JGeometry::TVec3<f32>& direction) {
|
||||
void setDirection(const EGG::Vector3f& direction) {
|
||||
mLocalDir.set(direction);
|
||||
}
|
||||
|
||||
void setLocalScale(const JGeometry::TVec3<f32>& scale) {
|
||||
void setLocalScale(const EGG::Vector3f& scale) {
|
||||
mLocalScl.set(scale);
|
||||
}
|
||||
|
||||
@@ -219,9 +219,9 @@ public:
|
||||
u32 getAge() const { return mTick; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ JGeometry::TVec3<f32> mLocalScl;
|
||||
/* 0x0C */ JGeometry::TVec3<f32> mLocalTrs;
|
||||
/* 0x18 */ JGeometry::TVec3<f32> mLocalDir;
|
||||
/* 0x00 */ EGG::Vector3f mLocalScl;
|
||||
/* 0x0C */ EGG::Vector3f mLocalTrs;
|
||||
/* 0x18 */ EGG::Vector3f mLocalDir;
|
||||
/* 0x24 */ s32 mMaxFrame;
|
||||
/* 0x28 */ f32 mRate;
|
||||
/* 0x2C */ f32 mVolumeSweep;
|
||||
@@ -238,8 +238,8 @@ public:
|
||||
/* 0x56 */ u8 mRateStep;
|
||||
/* 0x58 */ JSULink<JPABaseEmitter> mLink;
|
||||
/* 0x68 */ Mtx mGlobalRot;
|
||||
/* 0x98 */ JGeometry::TVec3<f32> mGlobalScl;
|
||||
/* 0xA4 */ JGeometry::TVec3<f32> mGlobalTrs;
|
||||
/* 0x98 */ EGG::Vector3f mGlobalScl;
|
||||
/* 0xA4 */ EGG::Vector3f mGlobalTrs;
|
||||
/* 0xB0 */ JGeometry::TVec2<f32> mGlobalPScl;
|
||||
/* 0xB8 */ GXColor mGlobalPrmClr;
|
||||
/* 0xBC */ GXColor mGlobalEnvClr;
|
||||
|
||||
@@ -22,7 +22,7 @@ struct JPAEmitterWorkData;
|
||||
class JPAEmitterManager {
|
||||
public:
|
||||
/* 8027DCA0 */ JPAEmitterManager(u32, u32, EGG::Heap*, u8, u8);
|
||||
/* 8027DEBC */ JPABaseEmitter* createSimpleEmitterID(JGeometry::TVec3<f32> const&, u16, u8, u8,
|
||||
/* 8027DEBC */ JPABaseEmitter* createSimpleEmitterID(EGG::Vector3f const&, u16, u8, u8,
|
||||
JPAEmitterCallBack*, JPAParticleCallBack*);
|
||||
/* 8027DFA0 */ void calc(u8);
|
||||
/* 8027E028 */ void draw(JPADrawInfo const*, u8);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/egg_types.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
class JPABaseParticle;
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
/* 80276A8C */ virtual void prepare(JPAEmitterWorkData*, JPAFieldBlock*) {}
|
||||
virtual void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*) = 0;
|
||||
|
||||
/* 0x04 */ JGeometry::TVec3<f32> mAccel;
|
||||
/* 0x04 */ EGG::Vector3f mAccel;
|
||||
};
|
||||
|
||||
class JPAFieldVortex : public JPAFieldBase {
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
/* 8027C674 */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D564 */ ~JPAFieldVortex() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> field_0x10;
|
||||
/* 0x10 */ EGG::Vector3f field_0x10;
|
||||
/* 0x1C */ f32 field_0x1c;
|
||||
/* 0x20 */ f32 field_0x20;
|
||||
};
|
||||
@@ -38,9 +38,9 @@ public:
|
||||
/* 8027CFA8 */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D3F4 */ ~JPAFieldSpin() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> field_0x10;
|
||||
/* 0x1C */ JGeometry::TVec3<f32> field_0x1c;
|
||||
/* 0x28 */ JGeometry::TVec3<f32> field_0x28;
|
||||
/* 0x10 */ EGG::Vector3f field_0x10;
|
||||
/* 0x1C */ EGG::Vector3f field_0x1c;
|
||||
/* 0x28 */ EGG::Vector3f field_0x28;
|
||||
};
|
||||
|
||||
class JPAFieldRandom : public JPAFieldBase {
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
/* 8027C3E0 */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D5C0 */ ~JPAFieldNewton() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> mDir;
|
||||
/* 0x10 */ EGG::Vector3f mDir;
|
||||
/* 0x1C */ f32 mCutoff;
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
/* 8027C29C */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D61C */ ~JPAFieldMagnet() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> mDir;
|
||||
/* 0x10 */ EGG::Vector3f mDir;
|
||||
};
|
||||
|
||||
class JPAFieldGravity : public JPAFieldBase {
|
||||
@@ -87,9 +87,9 @@ public:
|
||||
/* 8027CA94 */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D508 */ ~JPAFieldConvection() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> field_0x10;
|
||||
/* 0x1C */ JGeometry::TVec3<f32> field_0x1c;
|
||||
/* 0x28 */ JGeometry::TVec3<f32> field_0x28;
|
||||
/* 0x10 */ EGG::Vector3f field_0x10;
|
||||
/* 0x1C */ EGG::Vector3f field_0x1c;
|
||||
/* 0x28 */ EGG::Vector3f field_0x28;
|
||||
};
|
||||
|
||||
class JPAFieldAir : public JPAFieldBase {
|
||||
@@ -105,8 +105,8 @@ public:
|
||||
/* 0x00 */ u8 mMagic[4];
|
||||
/* 0x04 */ u32 mSize;
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ JGeometry::TVec3<f32> mPos;
|
||||
/* 0x18 */ JGeometry::TVec3<f32> mDir;
|
||||
/* 0x0C */ EGG::Vector3f mPos;
|
||||
/* 0x18 */ EGG::Vector3f mDir;
|
||||
/* 0x24 */ f32 mMag;
|
||||
/* 0x28 */ f32 mMagRndm;
|
||||
/* 0x2C */ f32 mVal1;
|
||||
@@ -135,11 +135,11 @@ public:
|
||||
u8 getCycle() { return mpData->mCycle; }
|
||||
f32 getFadeInRate() { return mFadeInRate; }
|
||||
f32 getFadeOutRate() { return mFadeOutRate; }
|
||||
JGeometry::TVec3<f32>& getPos() { return mPos; }
|
||||
JGeometry::TVec3<f32>& getDir() { return mDir; }
|
||||
EGG::Vector3f& getPos() { return mPos; }
|
||||
EGG::Vector3f& getDir() { return mDir; }
|
||||
f32 getMag() const { return mMag; }
|
||||
void getPosOrig(JGeometry::TVec3<f32>* pos) { pos->set(mpData->mPos); }
|
||||
void getDirOrig(JGeometry::TVec3<f32>* dir) { dir->set(mpData->mDir); }
|
||||
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);
|
||||
@@ -154,8 +154,8 @@ private:
|
||||
/* 0x04 */ JPAFieldBase* mpField;
|
||||
/* 0x08 */ f32 mFadeInRate;
|
||||
/* 0x0C */ f32 mFadeOutRate;
|
||||
/* 0x10 */ JGeometry::TVec3<f32> mPos;
|
||||
/* 0x1C */ JGeometry::TVec3<f32> mDir;
|
||||
/* 0x10 */ EGG::Vector3f mPos;
|
||||
/* 0x1C */ EGG::Vector3f mDir;
|
||||
/* 0x28 */ f32 mMag;
|
||||
|
||||
enum Type {
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
#define JPAMATH_H
|
||||
|
||||
#include "common.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
void JPAGetDirMtx(JGeometry::TVec3<f32> const& param_0, f32 (*param_1)[4]);
|
||||
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],
|
||||
JGeometry::TVec3<f32>* param_2);
|
||||
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],
|
||||
JGeometry::TVec3<f32>* param_2, JGeometry::TVec3<f32>* param_3);
|
||||
EGG::Vector3f* param_2, EGG::Vector3f* param_3);
|
||||
|
||||
#endif /* JPAMATH_H */
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "rvl/GX.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
class JPABaseEmitter;
|
||||
class JPABaseParticle;
|
||||
@@ -28,11 +28,11 @@ public:
|
||||
/* 80280548 */ f32 getWidth(JPABaseEmitter const*) const;
|
||||
/* 80280568 */ f32 getHeight(JPABaseEmitter const*) const;
|
||||
int getAge() { return mAge; }
|
||||
void setOffsetPosition(const JGeometry::TVec3<f32>& pos) { mOffsetPosition.set(pos); }
|
||||
void setOffsetPosition(const EGG::Vector3f& pos) { mOffsetPosition.set(pos); }
|
||||
void setOffsetPosition(f32 x, f32 y, f32 z) { mOffsetPosition.set(x, y, z); }
|
||||
void getOffsetPosition(JGeometry::TVec3<f32>& pos) { pos.set(mOffsetPosition); }
|
||||
void getOffsetPosition(EGG::Vector3f& pos) { pos.set(mOffsetPosition); }
|
||||
u16 getRotateAngle() const { return mRotateAngle; }
|
||||
void getGlobalPosition(JGeometry::TVec3<f32>& pos) const { pos.set(mPosition); }
|
||||
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; }
|
||||
@@ -40,19 +40,19 @@ public:
|
||||
void initStatus(u32 status) { mStatus = status; }
|
||||
void setInvisibleParticleFlag() { setStatus(8); }
|
||||
void setDeleteParticleFlag() { setStatus(2); }
|
||||
void getVelVec(JGeometry::TVec3<f32>& vec) const { vec.set(mVelocity); }
|
||||
void getLocalPosition(JGeometry::TVec3<f32>& vec) const { vec.set(mLocalPosition); }
|
||||
void getBaseAxis(JGeometry::TVec3<f32>& vec) const { vec.set(mBaseAxis); }
|
||||
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 */ JGeometry::TVec3<f32> mPosition;
|
||||
/* 0x0C */ JGeometry::TVec3<f32> mLocalPosition;
|
||||
/* 0x18 */ JGeometry::TVec3<f32> mOffsetPosition;
|
||||
/* 0x24 */ JGeometry::TVec3<f32> mVelocity;
|
||||
/* 0x30 */ JGeometry::TVec3<f32> mVelType1;
|
||||
/* 0x3C */ JGeometry::TVec3<f32> mVelType0;
|
||||
/* 0x48 */ JGeometry::TVec3<f32> mVelType2;
|
||||
/* 0x54 */ JGeometry::TVec3<f32> mBaseAxis;
|
||||
/* 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;
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
#ifndef TPOSITION3_H
|
||||
#define TPOSITION3_H
|
||||
|
||||
#include "dolphin/mtx.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
namespace JGeometry {
|
||||
|
||||
template <typename T>
|
||||
struct SMatrix34C {
|
||||
T data[3][4];
|
||||
};
|
||||
|
||||
template <>
|
||||
struct SMatrix34C<f32> {
|
||||
f32 data[3][4];
|
||||
|
||||
void identity() { MTXIdentity(data); }
|
||||
|
||||
typedef f32 ArrType[4];
|
||||
void set(const ArrType* src) {
|
||||
JMath::gekko_ps_copy12(data, src);
|
||||
}
|
||||
|
||||
operator ArrType*() { return data; }
|
||||
operator const ArrType*() const { return data; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct SMatrix33C {
|
||||
T data[3][3];
|
||||
|
||||
inline T& ref(int i, int j) {
|
||||
return data[i][j];
|
||||
}
|
||||
|
||||
inline T at(int i, int j) const {
|
||||
return data[i][j];
|
||||
}
|
||||
|
||||
inline void set(T param_1, T param_2, T param_3, T param_4, T param_5,
|
||||
T param_6, T param_7, T param_8, T param_9) {
|
||||
ref(0,0) = param_1;
|
||||
ref(0,1) = param_2;
|
||||
ref(0,2) = param_3;
|
||||
ref(1,0) = param_4;
|
||||
ref(1,1) = param_5;
|
||||
ref(1,2) = param_6;
|
||||
ref(2,0) = param_7;
|
||||
ref(2,1) = param_8;
|
||||
ref(2,2) = param_9;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TMatrix34 : public T {};
|
||||
|
||||
template <typename T>
|
||||
struct TRotation3 : public T {};
|
||||
|
||||
template<typename T>
|
||||
struct TRotation3<SMatrix33C<T> > : public SMatrix33C<T> {
|
||||
inline void getEulerXYZ(TVec3<T>* param_1) const {
|
||||
if (at(2, 0) - TUtil<T>::one() >= -TUtil<T>::epsilon()) {
|
||||
param_1->set(TUtil<T>::atan2(-at(0, 1), at(1, 1)), -TUtil<T>::halfPI(), 0.0);
|
||||
} else {
|
||||
if (at(2, 0) + TUtil<T>::one() <= TUtil<T>::epsilon()) {
|
||||
param_1->set(TUtil<T>::atan2(at(0, 1), at(1, 1)), TUtil<T>::halfPI(), 0.0);
|
||||
} else {
|
||||
param_1->x = TUtil<T>::atan2(at(2, 1), at(2, 2));
|
||||
param_1->z = TUtil<T>::atan2(at(1, 0), at(0, 0));
|
||||
param_1->y = TUtil<T>::asin(-at(2, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TPosition3 : public T {};
|
||||
|
||||
typedef TPosition3<TRotation3<TMatrix34<SMatrix34C<f32> > > > TPosition3f32;
|
||||
|
||||
} // namespace JGeometry
|
||||
|
||||
#endif
|
||||
@@ -36,6 +36,11 @@ struct Vector3f : public nw4r::math::VEC3 {
|
||||
return *this;
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -109,6 +114,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() {
|
||||
|
||||
+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
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
#include "JSystem/JMath/JMATrigonometric.h"
|
||||
#include "nw4r/math/math_triangular.h"
|
||||
#include "rvl/MTX.h"
|
||||
#include "rvl/GX.h"
|
||||
|
||||
@@ -302,8 +302,8 @@ void JPAGenCalcTexCrdMtxAnm(JPAEmitterWorkData* work) {
|
||||
f32 dVar13 = (dVar16 * shape->getIncScaleX()) + shape->getInitScaleX();
|
||||
f32 dVar12 = (dVar16 * shape->getIncScaleY()) + shape->getInitScaleY();
|
||||
s32 local_c0 = (dVar16 * shape->getIncRot()) + shape->getInitRot();
|
||||
f32 dVar8 = JMASSin(local_c0);
|
||||
f32 dVar9 = JMASCos(local_c0);
|
||||
f32 dVar8 = nw4r::math::SinIdx(local_c0);
|
||||
f32 dVar9 = nw4r::math::CosIdx(local_c0);
|
||||
Mtx local_108;
|
||||
local_108[0][0] = dVar13 * dVar9;
|
||||
local_108[0][1] = -dVar13 * dVar8;
|
||||
@@ -335,8 +335,8 @@ void JPALoadCalcTexCrdMtxAnm(JPAEmitterWorkData* work, JPABaseParticle* param_1)
|
||||
f32 dVar13 = (dVar16 * shape->getIncScaleX()) + shape->getInitScaleX();
|
||||
f32 dVar12 = (dVar16 * shape->getIncScaleY()) + shape->getInitScaleY();
|
||||
s32 local_c0 = (dVar16 * shape->getIncRot()) + shape->getInitRot();
|
||||
f32 dVar8 = JMASSin(local_c0);
|
||||
f32 dVar9 = JMASCos(local_c0);
|
||||
f32 dVar8 = nw4r::math::SinIdx(local_c0);
|
||||
f32 dVar9 = nw4r::math::CosIdx(local_c0);
|
||||
Mtx local_108;
|
||||
local_108[0][0] = dVar13 * dVar9;
|
||||
local_108[0][1] = -dVar13 * dVar8;
|
||||
@@ -485,8 +485,8 @@ static void loadPrjAnm(JPAEmitterWorkData const* work, const Mtx srt) {
|
||||
f32 dVar13 = (dVar16 * shape->getIncScaleX()) + shape->getInitScaleX();
|
||||
f32 dVar12 = (dVar16 * shape->getIncScaleY()) + shape->getInitScaleY();
|
||||
s32 local_c0 = (dVar16 * shape->getIncRot()) + shape->getInitRot();
|
||||
f32 dVar8 = JMASSin(local_c0);
|
||||
f32 dVar9 = JMASCos(local_c0);
|
||||
f32 dVar8 = nw4r::math::SinIdx(local_c0);
|
||||
f32 dVar9 = nw4r::math::CosIdx(local_c0);
|
||||
Mtx local_108;
|
||||
local_108[0][0] = dVar13 * dVar9;
|
||||
local_108[0][1] = -dVar13 * dVar8;
|
||||
@@ -532,7 +532,7 @@ static projectionFunc p_prj[3] = {
|
||||
* JPADrawBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPADrawBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_48;
|
||||
EGG::Vector3f local_48;
|
||||
MTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
Mtx local_38;
|
||||
local_38[0][0] = work->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
@@ -557,10 +557,10 @@ void JPADrawBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
* JPADrawRotBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPADrawRotBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_48;
|
||||
EGG::Vector3f local_48;
|
||||
MTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
f32 sinRot = JMASSin(param_1->mRotateAngle);
|
||||
f32 cosRot = JMASCos(param_1->mRotateAngle);
|
||||
f32 sinRot = nw4r::math::SinIdx(param_1->mRotateAngle);
|
||||
f32 cosRot = nw4r::math::CosIdx(param_1->mRotateAngle);
|
||||
f32 particleX = work->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
f32 particleY = work->mGlobalPtclScl.y * param_1->mParticleScaleY;
|
||||
|
||||
@@ -587,11 +587,12 @@ void JPADrawRotBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
* JPADrawYBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPADrawYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_48;
|
||||
EGG::Vector3f local_48;
|
||||
MTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
Mtx local_38;
|
||||
f32 particleX = work->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
f32 particleY = work->mGlobalPtclScl.y * param_1->mParticleScaleY;
|
||||
local_38[0][0] = work->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
local_38[0][0] = particleX;
|
||||
local_38[0][3] = local_48.x;
|
||||
local_38[1][1] = work->mYBBCamMtx[1][1] * particleY;
|
||||
local_38[1][2] = work->mYBBCamMtx[1][2];
|
||||
@@ -613,10 +614,10 @@ void JPADrawYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
* JPADrawRotYBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPADrawRotYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_48;
|
||||
EGG::Vector3f local_48;
|
||||
MTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
f32 sinRot = JMASSin(param_1->mRotateAngle);
|
||||
f32 cosRot = JMASCos(param_1->mRotateAngle);
|
||||
f32 sinRot = nw4r::math::SinIdx((s16)param_1->mRotateAngle);
|
||||
f32 cosRot = nw4r::math::CosIdx((s16)param_1->mRotateAngle);
|
||||
Mtx local_38;
|
||||
f32 particleX = work->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
f32 particleY = work->mGlobalPtclScl.y * param_1->mParticleScaleY;
|
||||
@@ -645,37 +646,37 @@ void JPADrawRotYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
/* 802782B4-802782D0 272BF4 001C+00 1/0 0/0 0/0 .text
|
||||
* dirTypeVel__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ29JGeometry8TVec3<f> */
|
||||
void dirTypeVel(JPAEmitterWorkData const* work, JPABaseParticle const* param_1,
|
||||
JGeometry::TVec3<f32>* param_2) {
|
||||
EGG::Vector3f* param_2) {
|
||||
param_1->getVelVec(*param_2);
|
||||
}
|
||||
|
||||
/* 802782D0-802782EC 272C10 001C+00 1/0 0/0 0/0 .text
|
||||
* dirTypePos__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ29JGeometry8TVec3<f> */
|
||||
void dirTypePos(JPAEmitterWorkData const* work, JPABaseParticle const* param_1,
|
||||
JGeometry::TVec3<f32>* param_2) {
|
||||
EGG::Vector3f* param_2) {
|
||||
param_1->getLocalPosition(*param_2);
|
||||
}
|
||||
|
||||
/* 802782EC-80278320 272C2C 0034+00 1/0 0/0 0/0 .text
|
||||
* dirTypePosInv__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ29JGeometry8TVec3<f> */
|
||||
void dirTypePosInv(JPAEmitterWorkData const* work, JPABaseParticle const* param_1,
|
||||
JGeometry::TVec3<f32>* param_2) {
|
||||
EGG::Vector3f* param_2) {
|
||||
param_1->getLocalPosition(*param_2);
|
||||
param_2->negate();
|
||||
*param_2 = param_2->negated();
|
||||
}
|
||||
|
||||
/* 80278320-8027833C 272C60 001C+00 1/0 0/0 0/0 .text
|
||||
* dirTypeEmtrDir__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ29JGeometry8TVec3<f> */
|
||||
void dirTypeEmtrDir(JPAEmitterWorkData const* work, JPABaseParticle const* param_1,
|
||||
JGeometry::TVec3<f32>* param_2) {
|
||||
EGG::Vector3f* param_2) {
|
||||
param_2->set(work->mGlobalEmtrDir);
|
||||
}
|
||||
|
||||
/* 8027833C-802783D4 272C7C 0098+00 1/0 0/0 0/0 .text
|
||||
* dirTypePrevPtcl__FPC18JPAEmitterWorkDataPC15JPABaseParticlePQ29JGeometry8TVec3<f> */
|
||||
void dirTypePrevPtcl(JPAEmitterWorkData const* work, JPABaseParticle const* param_1,
|
||||
JGeometry::TVec3<f32>* param_2) {
|
||||
JGeometry::TVec3<f32> aTStack_24;
|
||||
EGG::Vector3f* param_2) {
|
||||
EGG::Vector3f aTStack_24;
|
||||
param_1->getGlobalPosition(aTStack_24);
|
||||
JPANode<JPABaseParticle>* end = work->mpAlivePtcl->getEnd();
|
||||
JPANode<JPABaseParticle>* prev = work->mpCurNode->getPrev();
|
||||
@@ -686,7 +687,7 @@ void dirTypePrevPtcl(JPAEmitterWorkData const* work, JPABaseParticle const* para
|
||||
} else {
|
||||
work->mpEmtr->calcEmitterGlobalPosition(param_2);
|
||||
}
|
||||
param_2->sub(aTStack_24);
|
||||
*param_2 -= aTStack_24;
|
||||
}
|
||||
|
||||
/* 802783D4-80278414 272D14 0040+00 1/0 0/0 0/0 .text rotTypeY__FffRA3_A4_f */
|
||||
@@ -739,23 +740,26 @@ static void rotTypeZ(f32 param_0, f32 param_1, Mtx& param_2) {
|
||||
|
||||
/* 80278494-802784F0 272DD4 005C+00 1/0 0/0 0/0 .text rotTypeXYZ__FffRA3_A4_f */
|
||||
static void rotTypeXYZ(f32 param_0, f32 param_1, Mtx& param_2) {
|
||||
f32 f3 = 0.33333298563957214f * (1.0f - param_1);
|
||||
f32 f3;
|
||||
f32 fVar1;
|
||||
f32 f4;
|
||||
f32 fVar2;
|
||||
|
||||
f3 = 0.33333298563957214f * (1.0f - param_1);
|
||||
f4 = f3 + 0.5773500204086304f * param_0;
|
||||
fVar1 = f3 - 0.5773500204086304f * param_0;
|
||||
f3 += param_1;
|
||||
param_2[0][0] = f3;
|
||||
fVar2 = f3 + param_1;
|
||||
param_2[0][0] = fVar2;
|
||||
param_2[0][1] = fVar1;
|
||||
param_2[0][2] = f4;
|
||||
param_2[0][3] = 0.0f;
|
||||
param_2[1][0] = f4;
|
||||
param_2[1][1] = f3;
|
||||
param_2[1][1] = fVar2;
|
||||
param_2[1][2] = fVar1;
|
||||
param_2[1][3] = 0.0f;
|
||||
param_2[2][0] = fVar1;
|
||||
param_2[2][1] = f4;
|
||||
param_2[2][2] = f3;
|
||||
param_2[2][2] = fVar2;
|
||||
param_2[2][3] = 0.0f;
|
||||
}
|
||||
|
||||
@@ -794,7 +798,7 @@ static void basePlaneTypeX(MtxP param_0, f32 param_1, f32 param_2) {
|
||||
|
||||
/* 803C432C-803C4340 -00001 0014+00 2/5 0/0 0/0 .data p_direction */
|
||||
typedef void (*dirTypeFunc)(JPAEmitterWorkData const*, JPABaseParticle const*,
|
||||
JGeometry::TVec3<f32>*);
|
||||
EGG::Vector3f*);
|
||||
static dirTypeFunc p_direction[5] = {
|
||||
dirTypeVel, dirTypePos, dirTypePosInv,
|
||||
dirTypeEmtrDir, dirTypePrevPtcl,
|
||||
@@ -830,15 +834,15 @@ static u8* p_dl[2] = {
|
||||
* JPADrawDirection__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPADrawDirection(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_6c;
|
||||
JGeometry::TVec3<f32> local_78;
|
||||
EGG::Vector3f local_6c;
|
||||
EGG::Vector3f local_78;
|
||||
p_direction[param_0->mDirType](param_0, param_1, &local_6c);
|
||||
if (!local_6c.isZero()) {
|
||||
local_6c.normalize();
|
||||
local_78.cross(param_1->mBaseAxis, local_6c);
|
||||
local_78 = param_1->mBaseAxis.cross(local_6c);
|
||||
if (!local_78.isZero()) {
|
||||
local_78.normalize();
|
||||
param_1->mBaseAxis.cross(local_6c, local_78);
|
||||
param_1->mBaseAxis = local_6c.cross(local_78);
|
||||
param_1->mBaseAxis.normalize();
|
||||
Mtx local_60;
|
||||
f32 fVar1 = param_0->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
@@ -869,17 +873,17 @@ void JPADrawDirection(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
* JPADrawRotDirection__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPADrawRotDirection(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
f32 sinRot = JMASSin(param_1->mRotateAngle);
|
||||
f32 cosRot = JMASCos(param_1->mRotateAngle);
|
||||
JGeometry::TVec3<f32> local_6c;
|
||||
JGeometry::TVec3<f32> local_78;
|
||||
f32 sinRot = nw4r::math::SinIdx(param_1->mRotateAngle);
|
||||
f32 cosRot = nw4r::math::CosIdx(param_1->mRotateAngle);
|
||||
EGG::Vector3f local_6c;
|
||||
EGG::Vector3f local_78;
|
||||
p_direction[param_0->mDirType](param_0, param_1, &local_6c);
|
||||
if (!local_6c.isZero()) {
|
||||
local_6c.normalize();
|
||||
local_78.cross(param_1->mBaseAxis, local_6c);
|
||||
local_78 = param_1->mBaseAxis.cross(local_6c);
|
||||
if (!local_78.isZero()) {
|
||||
local_78.normalize();
|
||||
param_1->mBaseAxis.cross(local_6c, local_78);
|
||||
param_1->mBaseAxis = local_6c.cross(local_78);
|
||||
param_1->mBaseAxis.normalize();
|
||||
f32 particleX = param_0->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
f32 particleY = param_0->mGlobalPtclScl.y * param_1->mParticleScaleY;
|
||||
@@ -913,16 +917,16 @@ void JPADrawRotDirection(JPAEmitterWorkData* param_0, JPABaseParticle* param_1)
|
||||
* JPADrawDBillboard__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPADrawDBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_70;
|
||||
EGG::Vector3f local_70;
|
||||
p_direction[param_0->mDirType](param_0, param_1, &local_70);
|
||||
JGeometry::TVec3<f32> aTStack_7c;
|
||||
EGG::Vector3f aTStack_7c;
|
||||
aTStack_7c.set(param_0->mPosCamMtx[2][0], param_0->mPosCamMtx[2][1],
|
||||
param_0->mPosCamMtx[2][2]);
|
||||
local_70.cross(local_70, aTStack_7c);
|
||||
local_70 = local_70.cross(aTStack_7c);
|
||||
if (!local_70.isZero()) {
|
||||
local_70.normalize();
|
||||
MTXMultVecSR(param_0->mPosCamMtx, local_70, local_70);
|
||||
JGeometry::TVec3<f32> local_88;
|
||||
EGG::Vector3f local_88;
|
||||
MTXMultVec(param_0->mPosCamMtx, param_1->mPosition, local_88);
|
||||
f32 particleX = param_0->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
f32 particleY = param_0->mGlobalPtclScl.y * param_1->mParticleScaleY;
|
||||
@@ -950,8 +954,8 @@ void JPADrawDBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
* JPADrawRotation__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPADrawRotation(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
f32 sinRot = JMASSin(param_1->mRotateAngle);
|
||||
f32 cosRot = JMASCos(param_1->mRotateAngle);
|
||||
f32 sinRot = nw4r::math::SinIdx(param_1->mRotateAngle);
|
||||
f32 cosRot = nw4r::math::CosIdx(param_1->mRotateAngle);
|
||||
f32 particleX = param_0->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
f32 particleY = param_0->mGlobalPtclScl.y * param_1->mParticleScaleY;
|
||||
Mtx auStack_88;
|
||||
@@ -987,13 +991,12 @@ void JPADrawPoint(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
|
||||
* JPADrawLine__FP18JPAEmitterWorkDataP15JPABaseParticle */
|
||||
void JPADrawLine(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_1c;
|
||||
JGeometry::setTVec3f(¶m_1->mPosition.x, &local_1c.x);
|
||||
JGeometry::TVec3<f32> local_28;
|
||||
EGG::Vector3f local_1c = param_1->mPosition;
|
||||
EGG::Vector3f local_28;
|
||||
param_1->getVelVec(local_28);
|
||||
if (!local_28.isZero()) {
|
||||
local_28.setLength(param_0->mGlobalPtclScl.y * (25.0f * param_1->mParticleScaleY));
|
||||
local_28.sub(local_1c, local_28);
|
||||
local_28 = local_1c - local_28;
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||
GXBegin(GX_LINES, GX_VTXFMT1, 2);
|
||||
@@ -1035,10 +1038,10 @@ void JPADrawStripe(JPAEmitterWorkData* param_0) {
|
||||
Mtx local_c8;
|
||||
f32 dVar11;
|
||||
f32 dVar12;
|
||||
JGeometry::TVec3<f32> local_ec;
|
||||
JGeometry::TVec3<f32> local_e0[2];
|
||||
JGeometry::TVec3<f32> local_f8;
|
||||
JGeometry::TVec3<f32> local_104;
|
||||
EGG::Vector3f local_ec;
|
||||
EGG::Vector3f local_e0[2];
|
||||
EGG::Vector3f local_f8;
|
||||
EGG::Vector3f local_104;
|
||||
getNodeFunc node_func;
|
||||
JPANode<JPABaseParticle>* startNode;
|
||||
if (shape->isDrawFwdAhead()) {
|
||||
@@ -1061,8 +1064,8 @@ void JPADrawStripe(JPAEmitterWorkData* param_0) {
|
||||
param_0->mpCurNode = node;
|
||||
JPABaseParticle* particle = node->getObject();
|
||||
local_ec.set(particle->mPosition);
|
||||
dVar11 = JMASSin(particle->mRotateAngle);
|
||||
dVar12 = JMASCos(particle->mRotateAngle);
|
||||
dVar11 = nw4r::math::SinIdx(particle->mRotateAngle);
|
||||
dVar12 = nw4r::math::CosIdx(particle->mRotateAngle);
|
||||
local_e0[0].set(-particle->mParticleScaleX * dVar14, 0.0f, 0.0f);
|
||||
local_e0[0].set(local_e0[0].x * dVar12, 0.0f, local_e0[0].x * dVar11);
|
||||
local_e0[1].set(particle->mParticleScaleX * dVar13, 0.0f, 0.0f);
|
||||
@@ -1073,13 +1076,13 @@ void JPADrawStripe(JPAEmitterWorkData* param_0) {
|
||||
} else {
|
||||
local_f8.normalize();
|
||||
}
|
||||
local_104.cross(particle->mBaseAxis, local_f8);
|
||||
local_104 = particle->mBaseAxis.cross(local_f8);
|
||||
if (local_104.isZero()) {
|
||||
local_104.set(1.0f, 0.0f, 0.0f);
|
||||
} else {
|
||||
local_104.normalize();
|
||||
}
|
||||
particle->mBaseAxis.cross(local_f8, local_104);
|
||||
particle->mBaseAxis = local_f8.cross( local_104);
|
||||
particle->mBaseAxis.normalize();
|
||||
|
||||
local_c8[0][0] = local_104.x;
|
||||
@@ -1125,10 +1128,10 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) {
|
||||
Mtx local_90;
|
||||
f32 dVar11;
|
||||
f32 dVar12;
|
||||
JGeometry::TVec3<f32> local_b4;
|
||||
JGeometry::TVec3<f32> local_a8[2];
|
||||
JGeometry::TVec3<f32> local_c0;
|
||||
JGeometry::TVec3<f32> local_cc;
|
||||
EGG::Vector3f local_b4;
|
||||
EGG::Vector3f local_a8[2];
|
||||
EGG::Vector3f local_c0;
|
||||
EGG::Vector3f local_cc;
|
||||
JPANode<JPABaseParticle>* startNode;
|
||||
getNodeFunc node_func;
|
||||
if (shape->isDrawFwdAhead()) {
|
||||
@@ -1151,8 +1154,8 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) {
|
||||
param_0->mpCurNode = node;
|
||||
JPABaseParticle* particle = node->getObject();
|
||||
local_b4.set(particle->mPosition);
|
||||
dVar11 = JMASSin(particle->mRotateAngle);
|
||||
dVar12 = JMASCos(particle->mRotateAngle);
|
||||
dVar11 = nw4r::math::SinIdx(particle->mRotateAngle);
|
||||
dVar12 = nw4r::math::CosIdx(particle->mRotateAngle);
|
||||
local_a8[0].set(-particle->mParticleScaleX * local_154, 0.0f, 0.0f);
|
||||
local_a8[0].set(local_a8[0].x * dVar12, 0.0f, local_a8[0].x * dVar11);
|
||||
local_a8[1].set(particle->mParticleScaleX * local_158, 0.0f, 0.0f);
|
||||
@@ -1163,13 +1166,13 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) {
|
||||
} else {
|
||||
local_c0.normalize();
|
||||
}
|
||||
local_cc.cross(particle->mBaseAxis, local_c0);
|
||||
local_cc = particle->mBaseAxis.cross(local_c0);
|
||||
if (local_cc.isZero()) {
|
||||
local_cc.set(1.0f, 0.0f, 0.0f);
|
||||
} else {
|
||||
local_cc.normalize();
|
||||
}
|
||||
particle->mBaseAxis.cross(local_c0, local_cc);
|
||||
particle->mBaseAxis = local_c0.cross( local_cc);
|
||||
particle->mBaseAxis.normalize();
|
||||
|
||||
local_90[0][0] = local_cc.x;
|
||||
@@ -1201,8 +1204,8 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) {
|
||||
param_0->mpCurNode = node;
|
||||
JPABaseParticle* particle = node->getObject();
|
||||
local_b4.set(particle->mPosition);
|
||||
dVar11 = JMASCos(particle->mRotateAngle);
|
||||
dVar12 = -JMASSin(particle->mRotateAngle);
|
||||
dVar11 = nw4r::math::CosIdx(particle->mRotateAngle);
|
||||
dVar12 = -nw4r::math::SinIdx(particle->mRotateAngle);
|
||||
local_a8[0].set(-particle->mParticleScaleY * local_15c, 0.0f, 0.0f);
|
||||
local_a8[0].set(local_a8[0].x * dVar12, 0.0f, local_a8[0].x * dVar11);
|
||||
local_a8[1].set(particle->mParticleScaleY * local_160, 0.0f, 0.0f);
|
||||
@@ -1213,13 +1216,13 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) {
|
||||
} else {
|
||||
local_c0.normalize();
|
||||
}
|
||||
local_cc.cross(particle->mBaseAxis, local_c0);
|
||||
local_cc = particle->mBaseAxis.cross(local_c0);
|
||||
if (local_cc.isZero()) {
|
||||
local_cc.set(1.0f, 0.0f, 0.0f);
|
||||
} else {
|
||||
local_cc.normalize();
|
||||
}
|
||||
particle->mBaseAxis.cross(local_c0, local_cc);
|
||||
particle->mBaseAxis = local_c0.cross( local_cc);
|
||||
particle->mBaseAxis.normalize();
|
||||
|
||||
local_90[0][0] = local_cc.x;
|
||||
@@ -1418,18 +1421,46 @@ GXTevColorArg JPABaseShape::st_ca[6][4] = {
|
||||
};
|
||||
|
||||
/* 803C4464-803C4488 021584 0020+04 0/1 0/0 0/0 .data st_aa__12JPABaseShape */
|
||||
GXTevAlphaArg JPABaseShape::st_aa[2][4] = {
|
||||
JPABaseShapeAlphaArg JPABaseShape::st_aa[5] = {
|
||||
{
|
||||
GX_CA_ZERO,
|
||||
GX_CA_TEXA,
|
||||
GX_CA_A0,
|
||||
GX_CA_ZERO,
|
||||
GX_TEV_ADD,
|
||||
GX_CS_SCALE_1,
|
||||
},
|
||||
{
|
||||
GX_CA_ZERO,
|
||||
GX_CA_ZERO,
|
||||
GX_CA_ZERO,
|
||||
GX_CA_A0,
|
||||
GX_TEV_ADD,
|
||||
GX_CS_SCALE_1,
|
||||
},
|
||||
{
|
||||
GX_CA_A0,
|
||||
GX_CA_ZERO,
|
||||
GX_CA_ZERO,
|
||||
GX_CA_A0,
|
||||
GX_TEV_SUB,
|
||||
GX_CS_SCALE_1,
|
||||
},
|
||||
{
|
||||
GX_CA_A0,
|
||||
GX_CA_ZERO,
|
||||
GX_CA_ZERO,
|
||||
GX_CA_A0,
|
||||
GX_TEV_SUB,
|
||||
GX_CS_SCALE_2,
|
||||
},
|
||||
{
|
||||
GX_CA_ZERO,
|
||||
GX_CA_TEXA,
|
||||
GX_CA_A0,
|
||||
GX_CA_ZERO,
|
||||
GX_TEV_ADD,
|
||||
GX_CS_SCALE_2,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1437,12 +1468,13 @@ GXTevAlphaArg JPABaseShape::st_aa[2][4] = {
|
||||
*/
|
||||
void JPABaseShape::setGX(JPAEmitterWorkData* work) const {
|
||||
const GXTevColorArg* colorArg = getTevColorArg();
|
||||
const GXTevAlphaArg* alphaArg = getTevAlphaArg();
|
||||
const JPABaseShapeAlphaArg* alphaArg = getTevAlphaArg();
|
||||
GXSetBlendMode(getBlendMode(), getBlendSrc(), getBlendDst(), getLogicOp());
|
||||
GXSetZMode(getZEnable(), getZCmp(), getZUpd());
|
||||
GXSetAlphaCompare(getAlphaCmp0(), getAlphaRef0(), getAlphaOp(), getAlphaCmp1(), getAlphaRef1());
|
||||
GXSetTevColorIn(GX_TEVSTAGE0, colorArg[0], colorArg[1], colorArg[2], colorArg[3]);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, alphaArg[0], alphaArg[1], alphaArg[2], alphaArg[3]);
|
||||
GXSetTevAlphaIn(GX_TEVSTAGE0, alphaArg->mArg[0], alphaArg->mArg[1], alphaArg->mArg[2], alphaArg->mArg[3]);
|
||||
GXSetTevAlphaOp(GX_TEVSTAGE0, alphaArg->mOp, GX_TB_ZERO, alphaArg->mScale, true, GX_TEVPREV);
|
||||
GXSetTevDirect(GX_TEVSTAGE0);
|
||||
GXSetTevDirect(GX_TEVSTAGE1);
|
||||
GXSetZCompLoc(getZCompLoc());
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
/* 8027B144-8027B220 275A84 00DC+00 1/1 0/0 0/0 .text JPAVolumePoint__FP18JPAEmitterWorkData */
|
||||
void JPAVolumePoint(JPAEmitterWorkData* work) {
|
||||
work->mVolumeCalcData.mVolumePos.zero();
|
||||
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,
|
||||
@@ -55,7 +55,7 @@ void JPAVolumeCircle(JPAEmitterWorkData* work) {
|
||||
distance = work->mVolumeSize * (work->mVolumeMinRad + distance * (1.0f - work->mVolumeMinRad));
|
||||
work->mVolumeCalcData.mVolumePos.set(distance * JMASSin(theta), 0.0f,
|
||||
distance * JMASCos(theta));
|
||||
work->mVolumeCalcData.mVelOmni.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
// work->mVolumeCalcData.mVelOmni.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
work->mVolumeCalcData.mVelAxis.set(work->mVolumeCalcData.mVolumePos.x, 0.0f,
|
||||
work->mVolumeCalcData.mVolumePos.z);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ 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.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
// work->mVolumeCalcData.mVelOmni.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
work->mVolumeCalcData.mVelAxis.set(work->mVolumeCalcData.mVolumePos.x, 0.0f, work->mVolumeCalcData.mVolumePos.z);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ static void JPAVolumeSphere(JPAEmitterWorkData* work) {
|
||||
f32 rad = work->mVolumeSize * (work->mVolumeMinRad + rnd * (1.0f - work->mVolumeMinRad));
|
||||
work->mVolumeCalcData.mVolumePos.set(rad * JMASCos(phi) * JMASSin(theta), -rad * JMASSin(phi),
|
||||
rad * JMASCos(phi) * JMASCos(theta));
|
||||
work->mVolumeCalcData.mVelOmni.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
// work->mVolumeCalcData.mVelOmni.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
work->mVolumeCalcData.mVelAxis.set(work->mVolumeCalcData.mVolumePos.x, 0.0f,
|
||||
work->mVolumeCalcData.mVolumePos.z);
|
||||
}
|
||||
@@ -114,7 +114,7 @@ static void JPAVolumeCylinder(JPAEmitterWorkData* work) {
|
||||
f32 rad = work->mVolumeSize * (work->mVolumeMinRad + rnd * (1.0f - work->mVolumeMinRad));
|
||||
work->mVolumeCalcData.mVolumePos.set(
|
||||
rad * JMASSin(theta), work->mVolumeSize * work->mpEmtr->get_r_zp(), rad * JMASCos(theta));
|
||||
work->mVolumeCalcData.mVelOmni.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
// work->mVolumeCalcData.mVelOmni.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
work->mVolumeCalcData.mVelAxis.set(work->mVolumeCalcData.mVolumePos.x, 0.0f,
|
||||
work->mVolumeCalcData.mVolumePos.z);
|
||||
}
|
||||
@@ -130,7 +130,7 @@ static void JPAVolumeTorus(JPAEmitterWorkData* work) {
|
||||
work->mVolumeCalcData.mVelAxis.x + work->mVolumeSize * JMASSin(theta),
|
||||
work->mVolumeCalcData.mVelAxis.y,
|
||||
work->mVolumeCalcData.mVelAxis.z + work->mVolumeSize * JMASCos(theta));
|
||||
work->mVolumeCalcData.mVelOmni.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
// work->mVolumeCalcData.mVelOmni.mul(work->mVolumeCalcData.mVolumePos, work->mGlobalScl);
|
||||
}
|
||||
|
||||
/* 8027BB18-8027BB4C 276458 0034+00 0/0 1/1 0/0 .text __ct__16JPADynamicsBlockFPCUc */
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
#include "JSystem/JParticle/JPABaseShape.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
//
|
||||
// Types:
|
||||
@@ -37,7 +38,7 @@ void JPABaseEmitter::init(JPAEmitterManager* param_0, JPAResource* param_1) {
|
||||
mpRes->getDyn()->getEmitterScl(&mLocalScl);
|
||||
mpRes->getDyn()->getEmitterTrs(&mLocalTrs);
|
||||
mpRes->getDyn()->getEmitterDir(&mLocalDir);
|
||||
mLocalDir.normalize();
|
||||
mLocalDir.normalise();
|
||||
mpRes->getDyn()->getEmitterRot(&mLocalRot);
|
||||
mMaxFrame = mpRes->getDyn()->getMaxFrame();
|
||||
mLifeTime = mpRes->getDyn()->getLifetime();
|
||||
@@ -55,7 +56,7 @@ void JPABaseEmitter::init(JPAEmitterManager* param_0, JPAResource* param_1) {
|
||||
mRndm.set_seed(mpEmtrMgr->pWd->mRndm.get_rndm_u());
|
||||
MTXIdentity(mGlobalRot);
|
||||
mGlobalScl.set(1.0f, 1.0f, 1.0f);
|
||||
mGlobalTrs.zero();
|
||||
mGlobalTrs.setZero();
|
||||
mGlobalPScl.set(1.0f, 1.0f);
|
||||
mGlobalEnvClr.a = 0xff;
|
||||
mGlobalEnvClr.b = 0xff;
|
||||
@@ -143,7 +144,7 @@ bool JPABaseEmitter::processTermination() {
|
||||
if (mTick >= mMaxFrame) {
|
||||
setStatus(8);
|
||||
if (checkStatus(0x40)) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
return getParticleNumber() == 0;
|
||||
}
|
||||
@@ -152,7 +153,7 @@ bool JPABaseEmitter::processTermination() {
|
||||
|
||||
/* 8027EEB0-8027EF30 2797F0 0080+00 0/0 1/1 0/0 .text
|
||||
* calcEmitterGlobalPosition__14JPABaseEmitterCFPQ29JGeometry8TVec3<f> */
|
||||
void JPABaseEmitter::calcEmitterGlobalPosition(JGeometry::TVec3<f32>* dst) const {
|
||||
void JPABaseEmitter::calcEmitterGlobalPosition(EGG::Vector3f* dst) const {
|
||||
Mtx mtx;
|
||||
MTXScale(mtx, mGlobalScl.x, mGlobalScl.y, mGlobalScl.z);
|
||||
MTXConcat(mGlobalRot, mtx, mtx);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
#include "rvl/GX.h"
|
||||
|
||||
/* 8027DCA0-8027DEBC 2785E0 021C+00 0/0 1/1 0/0 .text __ct__17JPAEmitterManagerFUlUlP7EGG::HeapUcUc
|
||||
@@ -47,7 +48,7 @@ JPAEmitterManager::JPAEmitterManager(u32 i_ptclNum, u32 i_emtrNum, EGG::Heap* pH
|
||||
/* 8027DEBC-8027DFA0 2787FC 00E4+00 0/0 3/3 0/0 .text
|
||||
* createSimpleEmitterID__17JPAEmitterManagerFRCQ29JGeometry8TVec3<f>UsUcUcP18JPAEmitterCallBackP19JPAParticleCallBack
|
||||
*/
|
||||
JPABaseEmitter* JPAEmitterManager::createSimpleEmitterID(JGeometry::TVec3<f32> const& pos,
|
||||
JPABaseEmitter* JPAEmitterManager::createSimpleEmitterID(EGG::Vector3f const& pos,
|
||||
u16 resID, u8 group_id, u8 res_mgr_id,
|
||||
JPAEmitterCallBack* emtrCB,
|
||||
JPAParticleCallBack* ptclCB) {
|
||||
@@ -185,9 +186,9 @@ void JPAEmitterManager::clearResourceManager(u8 res_mgr_id) {
|
||||
/* 8027E3F4-8027E51C 278D34 0128+00 1/1 0/0 0/0 .text calcYBBCam__17JPAEmitterManagerFv
|
||||
*/
|
||||
void JPAEmitterManager::calcYBBCam() {
|
||||
JGeometry::TVec3<float> v(0.0f, pWd->mPosCamMtx[1][1], pWd->mPosCamMtx[2][1]);
|
||||
EGG::Vector3f v(0.0f, pWd->mPosCamMtx[1][1], pWd->mPosCamMtx[2][1]);
|
||||
JUT_ASSERT(367, !v.isZero());
|
||||
v.normalize();
|
||||
v.normalise();
|
||||
pWd->mYBBCamMtx[0][0] = 1.0f;
|
||||
pWd->mYBBCamMtx[0][1] = 0.0f;
|
||||
pWd->mYBBCamMtx[0][2] = 0.0f;
|
||||
|
||||
@@ -7,24 +7,25 @@
|
||||
#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) {
|
||||
JGeometry::TVec3<f32> vec = mAccel;
|
||||
EGG::Vector3f vec = mAccel;
|
||||
if (!ptcl->checkStatus(4) && block->checkStatus(0x78)) {
|
||||
vec.scale(calcFadeAffect(block, ptcl->mTime));
|
||||
vec *= calcFadeAffect(block, ptcl->mTime);
|
||||
}
|
||||
|
||||
switch (block->getAddType()) {
|
||||
case 0:
|
||||
ptcl->mVelType0.add(vec);
|
||||
ptcl->mVelType0 += vec;
|
||||
break;
|
||||
case 1:
|
||||
ptcl->mVelType1.add(vec);
|
||||
ptcl->mVelType1 += vec;
|
||||
break;
|
||||
case 2:
|
||||
ptcl->mVelType2.add(vec);
|
||||
ptcl->mVelType2 += vec;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -49,10 +50,10 @@ f32 JPAFieldBase::calcFadeAffect(JPAFieldBlock* block, f32 time) const {
|
||||
* prepare__15JPAFieldGravityFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldGravity::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
if (block->checkStatus(2)) {
|
||||
mAccel.scale(block->getMag(), block->getDir());
|
||||
mAccel = block->getMag() * block->getDir();
|
||||
} else {
|
||||
MTXMultVecSR(work->mRotationMtx, &block->getDir(), &mAccel);
|
||||
mAccel.scale(block->getMag());
|
||||
MTXMultVecSR(work->mRotationMtx, block->getDir(), mAccel);
|
||||
mAccel *= block->getMag();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,13 +66,13 @@ void JPAFieldGravity::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABa
|
||||
/* 8027C07C-8027C1B8 2769BC 013C+00 1/0 0/0 0/0 .text
|
||||
* prepare__11JPAFieldAirFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldAir::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
JGeometry::TVec3<f32> vec;
|
||||
vec.normalize(block->getDir());
|
||||
EGG::Vector3f vec = block->getDir();
|
||||
vec.normalise();
|
||||
if (block->checkStatus(2)) {
|
||||
mAccel.scale(block->getMag(), vec);
|
||||
mAccel = block->getMag() * vec;
|
||||
} else {
|
||||
MTXMultVecSR(work->mRotationMtx, vec, mAccel);
|
||||
mAccel.scale(block->getMag());
|
||||
mAccel *= block->getMag();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +83,7 @@ void JPAFieldAir::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABasePa
|
||||
if (block->checkStatus(4)) {
|
||||
f32 len = ptcl->mVelType1.length();
|
||||
if (len > block->getMagRndm()) {
|
||||
ptcl->mVelType1.scale(block->getMagRndm() / len);
|
||||
ptcl->mVelType1 *= block->getMagRndm() / len;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,14 +91,14 @@ void JPAFieldAir::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABasePa
|
||||
/* 8027C24C-8027C29C 276B8C 0050+00 1/0 0/0 0/0 .text
|
||||
* prepare__14JPAFieldMagnetFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldMagnet::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
mDir.sub(block->getPos(), work->mEmitterPos);
|
||||
MTXMultVecSR(work->mRotationMtx, &mDir, &mDir);
|
||||
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.sub(mDir, ptcl->mLocalPosition);
|
||||
mAccel = mDir - ptcl->mLocalPosition;
|
||||
mAccel.setLength(block->getMag());
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
@@ -105,16 +106,16 @@ void JPAFieldMagnet::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABas
|
||||
/* 8027C36C-8027C3E0 276CAC 0074+00 1/0 0/0 0/0 .text
|
||||
* prepare__14JPAFieldNewtonFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldNewton::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
mDir.sub(block->getPos(), work->mEmitterPos);
|
||||
MTXMultVecSR(work->mRotationMtx, &mDir, &mDir);
|
||||
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.sub(mDir, ptcl->mLocalPosition);
|
||||
f32 len_sq = mAccel.squared();
|
||||
mAccel = mDir - ptcl->mLocalPosition;
|
||||
f32 len_sq = mAccel.squaredLength();
|
||||
if (len_sq > mCutoff) {
|
||||
mAccel.setLength(mCutoff * (block->getMag() * 10.0f) / len_sq);
|
||||
} else {
|
||||
@@ -126,8 +127,8 @@ void JPAFieldNewton::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABas
|
||||
/* 8027C56C-8027C674 276EAC 0108+00 1/0 0/0 0/0 .text
|
||||
* prepare__14JPAFieldVortexFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldVortex::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
MTXMultVecSR(work->mGlobalRot, &block->getDir(), &field_0x10);
|
||||
field_0x10.normalize();
|
||||
PSMTXMultVecSR(work->mGlobalRot, block->getDir(), field_0x10);
|
||||
field_0x10.normalise();
|
||||
field_0x1c = block->getPos().z * block->getPos().z;
|
||||
field_0x20 = 1.0f / field_0x1c;
|
||||
}
|
||||
@@ -135,48 +136,47 @@ void JPAFieldVortex::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
/* 8027C674-8027C814 276FB4 01A0+00 1/0 0/0 0/0 .text
|
||||
* calc__14JPAFieldVortexFP18JPAEmitterWorkDataP13JPAFieldBlockP15JPABaseParticle */
|
||||
void JPAFieldVortex::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseParticle* ptcl) {
|
||||
JGeometry::TVec3<f32> vec;
|
||||
vec.scale(field_0x10.dot(ptcl->mLocalPosition), field_0x10);
|
||||
vec.sub(ptcl->mLocalPosition, vec);
|
||||
f32 mag = vec.squared();
|
||||
EGG::Vector3f vec;
|
||||
vec = ptcl->mLocalPosition - field_0x10.dot(ptcl->mLocalPosition) * field_0x10;
|
||||
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.normalize();
|
||||
mAccel.cross(vec, field_0x10);
|
||||
mAccel.scale(mag);
|
||||
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) {
|
||||
JGeometry::TVec3<f32> vec1, vec2;
|
||||
vec2.cross(block->getPos(), block->getDir());
|
||||
vec1.cross(block->getDir(), vec2);
|
||||
MTXMultVecSR(work->mGlobalRot, &vec1, &field_0x10);
|
||||
MTXMultVecSR(work->mGlobalRot, &block->getDir(), field_0x1c);
|
||||
MTXMultVecSR(work->mGlobalRot, &vec2, &field_0x28);
|
||||
field_0x10.normalize();
|
||||
field_0x1c.normalize();
|
||||
field_0x28.normalize();
|
||||
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) {
|
||||
JGeometry::TVec3<f32> vec1, vec2, vec3;
|
||||
vec1.scale(field_0x10.dot(ptcl->mLocalPosition), field_0x10);
|
||||
vec3.scale(field_0x28.dot(ptcl->mLocalPosition), field_0x28);
|
||||
vec1.add(vec3);
|
||||
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.sub(ptcl->mLocalPosition, vec1);
|
||||
vec3.cross(field_0x1c, vec1);
|
||||
mAccel.cross(vec3, vec2);
|
||||
vec2 = ptcl->mLocalPosition - vec1;
|
||||
vec3 = field_0x1c.cross(vec1);
|
||||
mAccel = vec3.cross(vec2);
|
||||
mAccel.setLength(block->getMag());
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
@@ -187,7 +187,7 @@ void JPAFieldRandom::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABas
|
||||
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.scale(block->getMag());
|
||||
mAccel *= block->getMag();
|
||||
calcAffect(block, ptcl);
|
||||
}
|
||||
}
|
||||
@@ -206,11 +206,11 @@ void JPAFieldDrag::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseP
|
||||
/* 8027CE64-8027CFA8 2777A4 0144+00 1/0 0/0 0/0 .text
|
||||
* prepare__12JPAFieldSpinFP18JPAEmitterWorkDataP13JPAFieldBlock */
|
||||
void JPAFieldSpin::prepare(JPAEmitterWorkData* work, JPAFieldBlock* block) {
|
||||
JGeometry::TVec3<f32> axis;
|
||||
MTXMultVecSR(work->mGlobalRot, &block->getDir(), &axis);
|
||||
axis.normalize();
|
||||
EGG::Vector3f axis;
|
||||
MTXMultVecSR(work->mGlobalRot, block->getDir(), axis);
|
||||
axis.normalise();
|
||||
Mtx mtx;
|
||||
MTXRotAxisRad(mtx, &axis, block->getMag());
|
||||
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]);
|
||||
@@ -231,7 +231,7 @@ void JPAFieldSpin::calc(JPAEmitterWorkData* work, JPAFieldBlock* block, JPABaseP
|
||||
mtx[2][2] = field_0x28.z;
|
||||
mtx[0][3] = mtx[1][3] = mtx[2][3] = 0.0f;
|
||||
Vec vec;
|
||||
MTXMultVecSR(mtx, &ptcl->mLocalPosition, &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);
|
||||
@@ -266,31 +266,31 @@ void JPAFieldBlock::init(EGG::Heap* heap) {
|
||||
|
||||
switch (getType()) {
|
||||
case FIELD_GRAVITY:
|
||||
mpField = new (heap, 0) JPAFieldGravity();
|
||||
mpField = new (heap, 4) JPAFieldGravity();
|
||||
break;
|
||||
case FIELD_AIR:
|
||||
mpField = new (heap, 0) JPAFieldAir();
|
||||
mpField = new (heap, 4) JPAFieldAir();
|
||||
break;
|
||||
case FIELD_MAGNET:
|
||||
mpField = new (heap, 0) JPAFieldMagnet();
|
||||
mpField = new (heap, 4) JPAFieldMagnet();
|
||||
break;
|
||||
case FIELD_NEWTON:
|
||||
mpField = new (heap, 0) JPAFieldNewton();
|
||||
mpField = new (heap, 4) JPAFieldNewton();
|
||||
break;
|
||||
case FIELD_VORTEX:
|
||||
mpField = new (heap, 0) JPAFieldVortex();
|
||||
mpField = new (heap, 4) JPAFieldVortex();
|
||||
break;
|
||||
case FIELD_RANDOM:
|
||||
mpField = new (heap, 0) JPAFieldRandom();
|
||||
mpField = new (heap, 4) JPAFieldRandom();
|
||||
break;
|
||||
case FIELD_DRAG:
|
||||
mpField = new (heap, 0) JPAFieldDrag();
|
||||
mpField = new (heap, 4) JPAFieldDrag();
|
||||
break;
|
||||
case FIELD_CONVECTION:
|
||||
mpField = new (heap, 0) JPAFieldConvection();
|
||||
mpField = new (heap, 4) JPAFieldConvection();
|
||||
break;
|
||||
case FIELD_SPIN:
|
||||
mpField = new (heap, 0) JPAFieldSpin();
|
||||
mpField = new (heap, 4) JPAFieldSpin();
|
||||
break;
|
||||
default:
|
||||
mpField = NULL;
|
||||
|
||||
@@ -4,24 +4,24 @@
|
||||
//
|
||||
|
||||
#include "JSystem/JParticle/JPAMath.h"
|
||||
#include "JSystem/JMath/JMATrigonometric.h"
|
||||
|
||||
/* ############################################################################################## */
|
||||
// Probably some local function needed to change float literal order
|
||||
static f32 floatDummyFunc() {
|
||||
return 1.0f;
|
||||
}
|
||||
#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(JGeometry::TVec3<f32> const& param_0, f32 (*param_1)[4]) {
|
||||
JGeometry::TVec3<float> local_78(param_0.y, -param_0.x, 0.0f);
|
||||
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 <= JGeometry::TUtil<f32>::epsilon()) {
|
||||
local_78.zero();
|
||||
if (len <= EGG::Math<f32>::epsilon()) {
|
||||
local_78.setZero();
|
||||
} else {
|
||||
local_78.scale(1.0f / len);
|
||||
local_78 *= (1.0f / len);
|
||||
}
|
||||
f32 xsquared = local_78.x * local_78.x;
|
||||
f32 ysquared = local_78.y * local_78.y;
|
||||
@@ -44,10 +44,10 @@ void JPAGetDirMtx(JGeometry::TVec3<f32> const& param_0, f32 (*param_1)[4]) {
|
||||
|
||||
/* 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 = JMASCos(angleY);
|
||||
f32 cosz = JMASCos(angleZ);
|
||||
f32 siny = JMASSin(angleY);
|
||||
f32 sinz = JMASSin(angleZ);
|
||||
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);
|
||||
@@ -64,23 +64,27 @@ void JPAGetYZRotateMtx(s16 angleY, s16 angleZ, f32 (*param_2)[4]) {
|
||||
|
||||
/* 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 = JMASCos(x);
|
||||
f32 cosy = JMASCos(y);
|
||||
f32 cosz = JMASCos(z);
|
||||
f32 sinx = JMASSin(x);
|
||||
f32 siny = JMASSin(y);
|
||||
f32 sinz = JMASSin(z);
|
||||
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 cosxsinz = cosx * sinz;
|
||||
f32 sinxcosz = sinx * cosz;
|
||||
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;
|
||||
f32 sinxsinz = sinx * sinz;
|
||||
f32 cosxcosz = cosx * cosz;
|
||||
sinxsinz = sinx * sinz;
|
||||
cosxcosz = cosx * cosz;
|
||||
mtx[0][2] = sinxsinz + cosxcosz * siny;
|
||||
mtx[1][1] = cosxcosz + sinxsinz * siny;
|
||||
mtx[2][3] = 0.0f;
|
||||
@@ -90,17 +94,17 @@ void JPAGetXYZRotateMtx(s16 x, s16 y, s16 z, Mtx mtx) {
|
||||
|
||||
/* 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],
|
||||
JGeometry::TVec3<f32>* param_2) {
|
||||
JGeometry::TVec3<f32> dummy;
|
||||
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],
|
||||
JGeometry::TVec3<f32>* param_2, JGeometry::TVec3<f32>* param_3) {
|
||||
JGeometry::TVec3<float> aTStack_54;
|
||||
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]);
|
||||
@@ -136,7 +140,7 @@ f32 JPACalcKeyAnmValue(f32 param_0, u16 param_1, f32 const* param_2) {
|
||||
}
|
||||
int ind = param_1 - 1;
|
||||
if (param_2[ind * 4] <= param_0) {
|
||||
return param_2[ind * 4 + 1];
|
||||
return (¶m_2[ind * 4])[1];
|
||||
}
|
||||
int x = param_1;
|
||||
while (x > 1) {
|
||||
|
||||
@@ -28,7 +28,7 @@ void JPABaseParticle::init_p(JPAEmitterWorkData* work) {
|
||||
mTime = 0.0f;
|
||||
|
||||
initStatus(0);
|
||||
MTXMultVecSR(work->mGlobalSR, &work->mVolumeCalcData.mVolumePos, &mLocalPosition);
|
||||
MTXMultVecSR(work->mGlobalSR, work->mVolumeCalcData.mVolumePos, mLocalPosition);
|
||||
if (emtr->checkFlag(8)) {
|
||||
setStatus(0x20);
|
||||
}
|
||||
@@ -38,21 +38,21 @@ void JPABaseParticle::init_p(JPAEmitterWorkData* work) {
|
||||
mOffsetPosition.y + mLocalPosition.y * work->mPublicScale.y,
|
||||
mOffsetPosition.z + mLocalPosition.z * work->mPublicScale.z);
|
||||
|
||||
JGeometry::TVec3<f32> velOmni;
|
||||
EGG::Vector3f velOmni;
|
||||
if (emtr->mAwayFromCenterSpeed) {
|
||||
velOmni.setLength(work->mVolumeCalcData.mVelOmni, emtr->mAwayFromCenterSpeed);
|
||||
} else {
|
||||
velOmni.zero();
|
||||
velOmni.setZero();
|
||||
}
|
||||
|
||||
JGeometry::TVec3<f32> velAxis;
|
||||
EGG::Vector3f velAxis;
|
||||
if (emtr->mAwayFromAxisSpeed) {
|
||||
velAxis.setLength(work->mVolumeCalcData.mVelAxis, emtr->mAwayFromAxisSpeed);
|
||||
} else {
|
||||
velAxis.zero();
|
||||
velAxis.setZero();
|
||||
}
|
||||
|
||||
JGeometry::TVec3<f32> velDir;
|
||||
EGG::Vector3f velDir;
|
||||
if (emtr->mDirSpeed) {
|
||||
Mtx mtx;
|
||||
JPAGetYZRotateMtx(emtr->get_r_zp() * 0x8000 * emtr->mSpread, emtr->get_r_ss(), mtx);
|
||||
@@ -61,16 +61,16 @@ void JPABaseParticle::init_p(JPAEmitterWorkData* work) {
|
||||
emtr->mDirSpeed * mtx[1][2],
|
||||
emtr->mDirSpeed * mtx[2][2]);
|
||||
} else {
|
||||
velDir.zero();
|
||||
velDir.setZero();
|
||||
}
|
||||
|
||||
JGeometry::TVec3<f32> velRndm;
|
||||
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.zero();
|
||||
velRndm.setZero();
|
||||
}
|
||||
|
||||
f32 ratio = emtr->get_r_zp() * dyn->getInitVelRatio() + 1.0f;
|
||||
@@ -79,11 +79,11 @@ void JPABaseParticle::init_p(JPAEmitterWorkData* work) {
|
||||
ratio * (velOmni.z + velAxis.z + velDir.z + velRndm.z));
|
||||
|
||||
if (emtr->checkFlag(4)) {
|
||||
mVelType1.mul(emtr->mLocalScl);
|
||||
mVelType1 *= emtr->mLocalScl;
|
||||
}
|
||||
MTXMultVecSR(work->mGlobalRot, &mVelType1, &mVelType1);
|
||||
MTXMultVecSR(work->mGlobalRot, mVelType1, mVelType1);
|
||||
|
||||
mVelType0.zero();
|
||||
mVelType0.setZero();
|
||||
|
||||
mMoment = 1.0f - dyn->getMomentRndm() * emtr->get_r_f();
|
||||
mDrag = 1.0f;
|
||||
@@ -141,9 +141,9 @@ void JPABaseParticle::init_c(JPAEmitterWorkData* work, JPABaseParticle* parent)
|
||||
|
||||
f32 pos_rndm = csp->getPosRndm();
|
||||
if (pos_rndm != 0.0f) {
|
||||
JGeometry::TVec3<f32> rnd(emtr->get_r_zh(), emtr->get_r_zh(), emtr->get_r_zh());
|
||||
EGG::Vector3f rnd(emtr->get_r_zh(), emtr->get_r_zh(), emtr->get_r_zh());
|
||||
rnd.setLength(pos_rndm * emtr->get_r_f());
|
||||
mLocalPosition.add(rnd);
|
||||
mLocalPosition += rnd;
|
||||
}
|
||||
|
||||
if (emtr->checkFlag(0x10)) {
|
||||
@@ -153,10 +153,10 @@ void JPABaseParticle::init_c(JPAEmitterWorkData* work, JPABaseParticle* parent)
|
||||
mOffsetPosition.set(parent->mOffsetPosition);
|
||||
|
||||
f32 base_speed = csp->getBaseVel() * (csp->getBaseVelRndm() * emtr->get_r_zp() + 1.0f);
|
||||
JGeometry::TVec3<f32> base_vel(emtr->get_r_zp(), emtr->get_r_zp(), emtr->get_r_zp());
|
||||
EGG::Vector3f base_vel(emtr->get_r_zp(), emtr->get_r_zp(), emtr->get_r_zp());
|
||||
base_vel.setLength(base_speed);
|
||||
mVelType1.scaleAdd(csp->getVelInhRate(), parent->mVelType1, base_vel);
|
||||
mVelType0.scale(csp->getVelInhRate(), parent->mVelType2);
|
||||
mVelType1 = csp->getVelInhRate() * parent->mVelType1 + base_vel;
|
||||
mVelType0 = csp->getVelInhRate() * parent->mVelType2;
|
||||
|
||||
mMoment = parent->mMoment;
|
||||
if (csp->isFieldAffected()) {
|
||||
@@ -224,12 +224,12 @@ bool JPABaseParticle::calc_p(JPAEmitterWorkData* work) {
|
||||
mOffsetPosition.set(work->mGlobalPos);
|
||||
}
|
||||
|
||||
mVelType2.zero();
|
||||
mVelType2.setZero();
|
||||
if (!checkStatus(0x40)) {
|
||||
work->mpRes->calcField(work, this);
|
||||
}
|
||||
mVelType2.add(mVelType0);
|
||||
mVelType1.scale(work->mpEmtr->mAirResist);
|
||||
mVelType2 += mVelType0;
|
||||
mVelType1 *= work->mpEmtr->mAirResist;
|
||||
f32 ratio = mMoment * mDrag;
|
||||
mVelocity.set(ratio * (mVelType1.x + mVelType2.x),
|
||||
ratio * (mVelType1.y + mVelType2.y),
|
||||
@@ -252,7 +252,7 @@ bool JPABaseParticle::calc_p(JPAEmitterWorkData* work) {
|
||||
}
|
||||
}
|
||||
|
||||
mLocalPosition.add(mVelocity);
|
||||
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);
|
||||
@@ -274,12 +274,12 @@ bool JPABaseParticle::calc_c(JPAEmitterWorkData* work) {
|
||||
}
|
||||
|
||||
mVelType1.y -= work->mpRes->getCsp()->getGravity();
|
||||
mVelType2.zero();
|
||||
mVelType2.setZero();
|
||||
if (!checkStatus(0x40)) {
|
||||
work->mpRes->calcField(work, this);
|
||||
}
|
||||
mVelType2.add(mVelType0);
|
||||
mVelType1.scale(work->mpEmtr->mAirResist);
|
||||
mVelType2 += mVelType0;
|
||||
mVelType1 *= work->mpEmtr->mAirResist;
|
||||
f32 ratio = mMoment * mDrag;
|
||||
mVelocity.set(ratio * (mVelType1.x + mVelType2.x),
|
||||
ratio * (mVelType1.y + mVelType2.y),
|
||||
@@ -296,7 +296,7 @@ bool JPABaseParticle::calc_c(JPAEmitterWorkData* work) {
|
||||
|
||||
work->mpRes->calc_c(work, this);
|
||||
mRotateAngle += mRotateSpeed;
|
||||
mLocalPosition.add(mVelocity);
|
||||
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);
|
||||
|
||||
@@ -1101,10 +1101,10 @@ void JPAResource::calcWorkData_c(JPAEmitterWorkData* work) {
|
||||
MTXConcat(work->mRotationMtx, local_rot_mtx, work->mGlobalRot);
|
||||
MTXConcat(work->mGlobalRot, local_scl_mtx, work->mGlobalSR);
|
||||
work->mEmitterPos.set(work->mpEmtr->mLocalTrs);
|
||||
work->mGlobalScl.mul(work->mpEmtr->mGlobalScl, work->mpEmtr->mLocalScl);
|
||||
work->mGlobalScl *= work->mpEmtr->mLocalScl;
|
||||
JPAGetDirMtx(work->mpEmtr->mLocalDir, work->mDirectionMtx);
|
||||
work->mPublicScale.set(work->mpEmtr->mGlobalScl);
|
||||
MTXMultVec(global_mtx, &work->mpEmtr->mLocalTrs, &work->mGlobalPos);
|
||||
MTXMultVec(global_mtx, work->mpEmtr->mLocalTrs, work->mGlobalPos);
|
||||
}
|
||||
|
||||
/* 80276A0C-80276A8C 27134C 0080+00 1/1 0/0 0/0 .text
|
||||
@@ -1114,7 +1114,7 @@ void JPAResource::calcWorkData_d(JPAEmitterWorkData* work) {
|
||||
JPAGetXYZRotateMtx(work->mpEmtr->mLocalRot.x * 0xB6, work->mpEmtr->mLocalRot.y * 0xB6,
|
||||
work->mpEmtr->mLocalRot.z * 0xB6, mtx);
|
||||
MTXConcat(work->mpEmtr->mGlobalRot, mtx, work->mGlobalRot);
|
||||
MTXMultVecSR(work->mGlobalRot, &work->mpEmtr->mLocalDir, &work->mGlobalEmtrDir);
|
||||
MTXMultVecSR(work->mGlobalRot, work->mpEmtr->mLocalDir, work->mGlobalEmtrDir);
|
||||
}
|
||||
|
||||
#pragma push
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/* 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-10') {
|
||||
if (*(u32*)(data + 4) == '2-11') {
|
||||
load_jpc(data, mgr);
|
||||
}
|
||||
}
|
||||
@@ -37,19 +37,19 @@ 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, 0) JPAResource*[mgr->mResMax];
|
||||
mgr->mpTexArr = new (heap, 0) JPATexture*[mgr->mTexMax];
|
||||
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, 0) JPAResource();
|
||||
JPAResource* res = new (heap, 4) JPAResource();
|
||||
res->mFieldBlockNum = header->mFieldBlockNum;
|
||||
res->mpFieldBlocks = res->mFieldBlockNum != 0 ?
|
||||
new (heap, 0) JPAFieldBlock*[res->mFieldBlockNum] : NULL;
|
||||
new (heap, 4) JPAFieldBlock*[res->mFieldBlockNum] : NULL;
|
||||
res->mKeyBlockNum = header->mKeyBlockNum;
|
||||
res->mpKeyBlocks = res->mKeyBlockNum != 0 ?
|
||||
new (heap, 0) JPAKeyBlock*[res->mKeyBlockNum] : NULL;
|
||||
new (heap, 4) JPAKeyBlock*[res->mKeyBlockNum] : NULL;
|
||||
res->mTDB1Num = header->mTDB1Num;
|
||||
res->mpTDB1 = NULL;
|
||||
res->mUsrIdx = header->mUsrIdx;
|
||||
@@ -63,27 +63,27 @@ void JPAResourceLoader::load_jpc(u8 const* data, JPAResourceManager* mgr) {
|
||||
u32 size = *(u32*)(data + offset + 4);
|
||||
switch (magic) {
|
||||
case 'FLD1':
|
||||
res->mpFieldBlocks[field_idx] = new (heap, 0) JPAFieldBlock(data + offset, heap);
|
||||
res->mpFieldBlocks[field_idx] = new (heap, 4) JPAFieldBlock(data + offset, heap);
|
||||
field_idx++;
|
||||
break;
|
||||
case 'KFA1':
|
||||
res->mpKeyBlocks[key_idx] = new (heap, 0) JPAKeyBlock(data + offset);
|
||||
res->mpKeyBlocks[key_idx] = new (heap, 4) JPAKeyBlock(data + offset);
|
||||
key_idx++;
|
||||
break;
|
||||
case 'BEM1':
|
||||
res->mpDynamicsBlock = new (heap, 0) JPADynamicsBlock(data + offset);
|
||||
res->mpDynamicsBlock = new (heap, 4) JPADynamicsBlock(data + offset);
|
||||
break;
|
||||
case 'BSP1':
|
||||
res->mpBaseShape = new (heap, 0) JPABaseShape(data + offset, heap);
|
||||
res->mpBaseShape = new (heap, 4) JPABaseShape(data + offset, heap);
|
||||
break;
|
||||
case 'ESP1':
|
||||
res->mpExtraShape = new (heap, 0) JPAExtraShape(data + offset);
|
||||
res->mpExtraShape = new (heap, 4) JPAExtraShape(data + offset);
|
||||
break;
|
||||
case 'SSP1':
|
||||
res->mpChildShape = new (heap, 0) JPAChildShape(data + offset);
|
||||
res->mpChildShape = new (heap, 4) JPAChildShape(data + offset);
|
||||
break;
|
||||
case 'ETX1':
|
||||
res->mpExTexShape = new (heap, 0) JPAExTexShape(data + offset);
|
||||
res->mpExTexShape = new (heap, 4) JPAExTexShape(data + offset);
|
||||
break;
|
||||
case 'TDB1':
|
||||
res->mpTDB1 = (const u16*)(data + offset + 8);
|
||||
@@ -99,7 +99,7 @@ void JPAResourceLoader::load_jpc(u8 const* data, JPAResourceManager* mgr) {
|
||||
offset = *(u32*)(data + 0xC);
|
||||
for (int i = 0; i < *(u16*)(data + 0xA); i++) {
|
||||
u32 size = *(u32*)(data + offset + 4);
|
||||
JPATexture* tex = new (heap, 0) JPATexture(data + offset);
|
||||
JPATexture* tex = new (heap, 4) JPATexture(data + offset);
|
||||
mgr->registTex(tex);
|
||||
offset += size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user