mirror of https://github.com/zeldaret/tp.git
66 lines
2.0 KiB
C++
66 lines
2.0 KiB
C++
//
|
|
// Generated By: dol2asm
|
|
// Translation Unit: JPAChildShape
|
|
//
|
|
|
|
#include "JSystem/JParticle/JPAChildShape.h"
|
|
#include "JSystem/JParticle/JPAParticle.h"
|
|
#include "dol2asm.h"
|
|
#include "dolphin/os/OS.h"
|
|
#include "dolphin/types.h"
|
|
|
|
//
|
|
// Types:
|
|
//
|
|
|
|
//
|
|
// Forward References:
|
|
//
|
|
|
|
//
|
|
// Declarations:
|
|
//
|
|
|
|
static inline u32 COLOR_MULTI(u32 a, u32 b) {
|
|
return ((a * (b + 1)) * 0x10000) >> 24;
|
|
}
|
|
|
|
/* 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) {
|
|
// literal
|
|
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;
|
|
}
|