mirror of
https://github.com/pret/pokeplatinum.git
synced 2024-11-23 05:49:44 +00:00
SPLManager update function
This commit is contained in:
parent
effeafc69c
commit
0ea26be145
@ -6,24 +6,24 @@
|
||||
|
||||
static inline void SPL_UnkInline1 (SPLEmitter * param0, const VecFx32 * param1)
|
||||
{
|
||||
param0->unk_98.x = param1->x + param0->p_res->header->unk_04.x;
|
||||
param0->unk_98.y = param1->y + param0->p_res->header->unk_04.y;
|
||||
param0->unk_98.z = param1->z + param0->p_res->header->unk_04.z;
|
||||
param0->unk_98.x = param1->x + param0->resource->header->unk_04.x;
|
||||
param0->unk_98.y = param1->y + param0->resource->header->unk_04.y;
|
||||
param0->unk_98.z = param1->z + param0->resource->header->unk_04.z;
|
||||
}
|
||||
|
||||
static inline void SPL_UnkInline2 (SPLEmitter * param0, fx32 param1)
|
||||
{
|
||||
param0->unk_98.x = param1 + param0->p_res->header->unk_04.x;
|
||||
param0->unk_98.x = param1 + param0->resource->header->unk_04.x;
|
||||
}
|
||||
|
||||
static inline void SPL_UnkInline3 (SPLEmitter * param0, fx32 param1)
|
||||
{
|
||||
param0->unk_98.y = param1 + param0->p_res->header->unk_04.y;
|
||||
param0->unk_98.y = param1 + param0->resource->header->unk_04.y;
|
||||
}
|
||||
|
||||
static inline void SPL_UnkInline4 (SPLEmitter * param0, fx32 param1)
|
||||
{
|
||||
param0->unk_98.z = param1 + param0->p_res->header->unk_04.z;
|
||||
param0->unk_98.z = param1 + param0->resource->header->unk_04.z;
|
||||
}
|
||||
|
||||
static inline void SPL_UnkInline5 (SPLEmitter * param0, const VecFx16 * param1)
|
||||
|
@ -15,7 +15,7 @@ typedef struct UnkSPLStruct7 {
|
||||
{
|
||||
u32 terminate:1;
|
||||
u32 stop_generate:1;
|
||||
u32 stop_calc:1;
|
||||
u32 paused:1;
|
||||
u32 stop_draw:1;
|
||||
u32 started: 1 ;
|
||||
u32 reserved0:27;
|
||||
@ -26,14 +26,14 @@ typedef struct UnkSPLStruct7 {
|
||||
typedef struct SPLEmitter {
|
||||
struct SPLEmitter * unk_00;
|
||||
struct SPLEmitter * unk_04;
|
||||
SPLParticleList unk_08;
|
||||
SPLParticleList unk_4C;
|
||||
SPLResource * p_res;
|
||||
UnkSPLStruct7 unk_94;
|
||||
SPLParticleList particles;
|
||||
SPLParticleList childParticles;
|
||||
SPLResource *resource;
|
||||
UnkSPLStruct7 state;
|
||||
VecFx32 unk_98;
|
||||
VecFx32 unk_A4;
|
||||
VecFx32 unk_B0;
|
||||
u16 unk_BC;
|
||||
u16 age;
|
||||
fx16 unk_BE;
|
||||
VecFx16 unk_C0;
|
||||
u16 unk_C6;
|
||||
@ -53,9 +53,9 @@ typedef struct SPLEmitter {
|
||||
struct {
|
||||
u32 unk_00_0 : 8;
|
||||
u32 unk_01_0 : 8;
|
||||
u32 unk_02_0 : 3;
|
||||
u32 updateCycle : 3; // 0 = every frame, 1 = cycle A, 2 = cycle B, cycles A and B alternate
|
||||
u32 unk_02_3 : 13;
|
||||
} unk_F0;
|
||||
} misc;
|
||||
VecFx16 unk_F4;
|
||||
VecFx16 unk_FA;
|
||||
void (* unk_100)(struct SPLEmitter *, unsigned int);
|
||||
|
@ -38,7 +38,7 @@ typedef struct SPLManager {
|
||||
SPLEmitter * unk_00;
|
||||
const MtxFx43 * unk_04;
|
||||
} unk_40;
|
||||
u16 unk_48;
|
||||
u16 currentCycle;
|
||||
u16 unk_4A;
|
||||
} SPLManager; // size=0x4c
|
||||
|
||||
@ -55,7 +55,7 @@ SPLEmitter * SPL_0209C4D8(SPLManager * param0, int param1, EmitterCallback cb);
|
||||
SPLEmitter *SPL_CreateWithInitializeEx(SPLManager *mgr, int resNo, VecFx32 *pos, void *pvoid, EmitterCallbackEx cb);
|
||||
void SPL_0209C5E0(SPLManager * param0, const MtxFx43 * param1);
|
||||
SPLEmitter * SPL_0209C56C(SPLManager * param0, int param1, const VecFx32 * param2);
|
||||
void SPL_0209C6A8(SPLManager * param0);
|
||||
void SPLManager_Update(SPLManager * param0);
|
||||
BOOL SPLManager_UploadPalettes(SPLManager * param0);
|
||||
BOOL SPLManager_UploadTextures(SPLManager * param0);
|
||||
BOOL SPLManager_UploadPalettesEx(SPLManager * param0, u32 (* param1)(u32, BOOL));
|
||||
|
@ -30,7 +30,8 @@ typedef union {
|
||||
u32 hasTexAnim : 1;
|
||||
u32 unk_05_4 : 1;
|
||||
u32 unk_05_5 : 1;
|
||||
u32 unk_05_6 : 1;
|
||||
// If set, the emitter will terminate when it reaches the end of its life and all of its particles have died
|
||||
u32 selfTerminate : 1;
|
||||
u32 unk_05_7 : 1;
|
||||
u32 hasChildResource : 1;
|
||||
u32 unk_06_1 : 2;
|
||||
@ -96,13 +97,13 @@ typedef struct UnkSPLStruct9_t {
|
||||
fx32 unk_28;
|
||||
fx32 unk_2C;
|
||||
fx16 unk_30;
|
||||
u16 unk_32;
|
||||
u16 startDelay; // Delay, in frames, before the emitter starts emitting particles
|
||||
s16 unk_34;
|
||||
s16 unk_36;
|
||||
u16 unk_38;
|
||||
u16 reserved_3A;
|
||||
u16 unk_3C;
|
||||
u16 unk_40;
|
||||
u16 emitterLifeTime;
|
||||
u16 particleLifeTime;
|
||||
struct {
|
||||
u32 unk_00_0 : 8;
|
||||
u32 unk_01_0 : 8;
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <nnsys/gfd/VramManager/gfd_TexVramMan_Types.h>
|
||||
#include <nitro/fx/fx.h>
|
||||
|
||||
#include "spl_emitter.h"
|
||||
#include "spl_list.h"
|
||||
#include "spl_manager.h"
|
||||
#include "spl_behavior.h"
|
||||
@ -9,7 +10,11 @@
|
||||
#include "spl_particle.h"
|
||||
|
||||
#define DECODE_WH(X) ((u16)(1 << ((X) + 3)))
|
||||
|
||||
#define EMITTER_SHOULD_TERMINATE(emtr, header) \
|
||||
((\
|
||||
(header->flags.selfTerminate && header->emitterLifeTime != 0 && emtr->state.started && emtr->age > header->emitterLifeTime) \
|
||||
|| emtr->state.terminate \
|
||||
) && emtr->particles.count == 0 && emtr->childParticles.count == 0)
|
||||
|
||||
static u32 SPLUtil_AllocTextureVRAM(u32 size, BOOL is4x4);
|
||||
static u32 SPLUtil_AllocPaletteVRAM(u32 size, BOOL is4Pltt);
|
||||
@ -53,7 +58,7 @@ SPLManager *SPLManager_New(SPLAllocFunc alloc, u16 maxEmitters, u16 maxParticles
|
||||
mgr->inactiveParticles.first = NULL;
|
||||
|
||||
mgr->unk_3C = 0;
|
||||
mgr->unk_48 = 0;
|
||||
mgr->currentCycle = 0;
|
||||
|
||||
SPLEmitter *emtr = alloc(maxEmitters * sizeof(SPLEmitter));
|
||||
MI_CpuFill8(emtr, 0, maxEmitters * sizeof(SPLEmitter));
|
||||
@ -265,66 +270,63 @@ BOOL SPLManager_UploadPalettes(SPLManager *mgr)
|
||||
return SPLManager_UploadPalettesEx(mgr, SPLUtil_AllocPaletteVRAM);
|
||||
}
|
||||
|
||||
void SPL_0209C6A8(SPLManager *mgr)
|
||||
void SPLManager_Update(SPLManager *mgr)
|
||||
{
|
||||
// Required to match
|
||||
SPLEmitter *emtr;
|
||||
SPLEmitter *next;
|
||||
|
||||
emtr = mgr->activeEmitters.first;
|
||||
while (emtr != NULL) {
|
||||
SPLResourceHeader *base = emtr->p_res->header;
|
||||
SPLResourceHeader *header = emtr->resource->header;
|
||||
next = emtr->unk_00;
|
||||
|
||||
if (!emtr->unk_94.started && emtr->unk_BC >= base->unk_32) {
|
||||
emtr->unk_94.started = TRUE;
|
||||
emtr->unk_BC = 0;
|
||||
if (!emtr->state.started && emtr->age >= header->startDelay) {
|
||||
emtr->state.started = TRUE;
|
||||
emtr->age = 0;
|
||||
}
|
||||
|
||||
if (!emtr->unk_94.stop_calc) {
|
||||
if (emtr->unk_F0.unk_02_0 == 0 || mgr->unk_48 == emtr->unk_F0.unk_02_0 - 1) {
|
||||
if (!emtr->state.paused) {
|
||||
if (emtr->misc.updateCycle == 0 || mgr->currentCycle == emtr->misc.updateCycle - 1) {
|
||||
sub_0209D150(mgr, emtr);
|
||||
}
|
||||
}
|
||||
|
||||
if (((base->flags.unk_05_6 && base->unk_3C != 0 && emtr->unk_94.started && emtr->unk_BC > base->unk_3C)
|
||||
|| emtr->unk_94.terminate)
|
||||
&& emtr->unk_08.count == 0 && emtr->unk_4C.count == 0) {
|
||||
SPLEmitter *e0 = (SPLEmitter *)SPLList_Erase((SPLList *)&mgr->activeEmitters, (SPLNode *)emtr);
|
||||
SPLList_PushFront((SPLList *)&mgr->inactiveEmitters, (SPLNode *)e0);
|
||||
if (EMITTER_SHOULD_TERMINATE(emtr, header)) {
|
||||
SPLEmitter *terminatedEmitter = SPLEmitterList_Erase(&mgr->activeEmitters, emtr);
|
||||
SPLEmitterList_PushFront(&mgr->inactiveEmitters, terminatedEmitter);
|
||||
}
|
||||
|
||||
emtr = next;
|
||||
}
|
||||
|
||||
mgr->unk_48 += 1;
|
||||
if (mgr->unk_48 > 1) {
|
||||
mgr->unk_48 = 0;
|
||||
mgr->currentCycle += 1;
|
||||
if (mgr->currentCycle > 1) {
|
||||
mgr->currentCycle = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void SPL_0209C5E0(SPLManager *mgr, const MtxFx43 *cmr)
|
||||
{
|
||||
SPLEmitter *emtr;
|
||||
|
||||
G3X_AlphaBlend(TRUE);
|
||||
|
||||
mgr->unk_40.unk_04 = cmr;
|
||||
if (mgr->polygonID.drawOrder == SPL_DRAW_ORDER_REVERSE) {
|
||||
emtr = mgr->activeEmitters.first;
|
||||
SPLEmitter *emtr = mgr->activeEmitters.first;
|
||||
|
||||
while (emtr != NULL) {
|
||||
mgr->unk_40.unk_00 = emtr;
|
||||
if (!emtr->unk_94.stop_draw) {
|
||||
if (!emtr->state.stop_draw) {
|
||||
sub_0209CF00(mgr);
|
||||
}
|
||||
emtr = emtr->unk_00;
|
||||
}
|
||||
} else {
|
||||
emtr = mgr->activeEmitters.last;
|
||||
SPLEmitter *emtr = mgr->activeEmitters.last;
|
||||
|
||||
while (emtr != NULL) {
|
||||
mgr->unk_40.unk_00 = emtr;
|
||||
if (!emtr->unk_94.stop_draw) {
|
||||
if (!emtr->state.stop_draw) {
|
||||
sub_0209CF00(mgr);
|
||||
}
|
||||
emtr = emtr->unk_04;
|
||||
@ -340,7 +342,7 @@ SPLEmitter *SPL_0209C56C(SPLManager *mgr, int resno, const VecFx32 *pos)
|
||||
emtr = (SPLEmitter *)SPLList_PopFront((SPLList *)&mgr->inactiveEmitters);
|
||||
sub_0209D998(emtr, mgr->resources + resno, pos);
|
||||
SPLList_PushFront((SPLList *)&mgr->activeEmitters, (SPLNode *)emtr);
|
||||
if (emtr->p_res->header->flags.unk_05_6) {
|
||||
if (emtr->resource->header->flags.selfTerminate) {
|
||||
emtr = NULL;
|
||||
}
|
||||
}
|
||||
@ -361,7 +363,7 @@ SPLEmitter *SPL_0209C4D8(SPLManager *mgr, int resno, EmitterCallback fpcb)
|
||||
fpcb(emtr);
|
||||
}
|
||||
SPLList_PushFront((SPLList *)&mgr->activeEmitters, (SPLNode *)emtr);
|
||||
if (emtr->p_res->header->flags.unk_05_6) {
|
||||
if (emtr->resource->header->flags.selfTerminate) {
|
||||
emtr = NULL;
|
||||
}
|
||||
}
|
||||
@ -382,7 +384,7 @@ SPLEmitter *SPL_CreateWithInitializeEx(SPLManager *mgr, int resNo, VecFx32 *pos,
|
||||
}
|
||||
|
||||
SPLList_PushFront((SPLList *)&mgr->activeEmitters, (SPLNode *)emtr);
|
||||
if (emtr->p_res->header->flags.unk_05_6) {
|
||||
if (emtr->resource->header->flags.selfTerminate) {
|
||||
emtr = NULL;
|
||||
}
|
||||
}
|
||||
@ -392,18 +394,18 @@ SPLEmitter *SPL_CreateWithInitializeEx(SPLManager *mgr, int resNo, VecFx32 *pos,
|
||||
|
||||
void SPL_0209C444(SPLManager *p0, SPLEmitter *p1)
|
||||
{
|
||||
SPLEmitter *v0 = (SPLEmitter *)SPLList_PopFront((SPLList *)&p1->unk_08);
|
||||
SPLEmitter *v0 = (SPLEmitter *)SPLList_PopFront((SPLList *)&p1->particles);
|
||||
if (v0 != NULL) {
|
||||
do {
|
||||
SPLList_PushFront((SPLList *)&p0->inactiveParticles, (SPLNode *)v0);
|
||||
v0 = (SPLEmitter *)SPLList_PopFront((SPLList *)&p1->unk_08);
|
||||
v0 = (SPLEmitter *)SPLList_PopFront((SPLList *)&p1->particles);
|
||||
} while (v0 != NULL);
|
||||
}
|
||||
v0 = (SPLEmitter *)SPLList_PopFront((SPLList *)&p1->unk_4C);
|
||||
v0 = (SPLEmitter *)SPLList_PopFront((SPLList *)&p1->childParticles);
|
||||
if (v0 != NULL) {
|
||||
do {
|
||||
SPLList_PushFront((SPLList *)&p0->inactiveParticles, (SPLNode *)v0);
|
||||
v0 = (SPLEmitter *)SPLList_PopFront((SPLList *)&p1->unk_4C);
|
||||
v0 = (SPLEmitter *)SPLList_PopFront((SPLList *)&p1->childParticles);
|
||||
} while (v0 != NULL);
|
||||
}
|
||||
SPLList_Erase((SPLList *)&p0->activeEmitters, (SPLNode *)p1);
|
||||
@ -429,8 +431,8 @@ void SPL_Emit(SPLManager *mgr, SPLEmitter *emtr)
|
||||
|
||||
void SPL_EmitAt(SPLManager *mgr, SPLEmitter *emtr, VecFx32 *pos)
|
||||
{
|
||||
emtr->unk_98.x = pos->x + emtr->p_res->header->unk_04.x;
|
||||
emtr->unk_98.y = pos->y + emtr->p_res->header->unk_04.y;
|
||||
emtr->unk_98.z = pos->z + emtr->p_res->header->unk_04.z;
|
||||
emtr->unk_98.x = pos->x + emtr->resource->header->unk_04.x;
|
||||
emtr->unk_98.y = pos->y + emtr->resource->header->unk_04.y;
|
||||
emtr->unk_98.z = pos->z + emtr->resource->header->unk_04.z;
|
||||
spl_generate(emtr, (SPLList *)&mgr->inactiveParticles);
|
||||
}
|
||||
|
@ -59,64 +59,64 @@ static void sub_0209DC64(SPLTexture *tex)
|
||||
|
||||
void sub_0209D998(SPLEmitter *emtr, SPLResource *res, const VecFx32 *pos)
|
||||
{
|
||||
emtr->p_res = res;
|
||||
emtr->unk_94.all = 0;
|
||||
emtr->resource = res;
|
||||
emtr->state.all = 0;
|
||||
|
||||
emtr->unk_98.x = pos->x + emtr->p_res->header->unk_04.x;
|
||||
emtr->unk_98.y = pos->y + emtr->p_res->header->unk_04.y;
|
||||
emtr->unk_98.z = pos->z + emtr->p_res->header->unk_04.z;
|
||||
emtr->unk_98.x = pos->x + emtr->resource->header->unk_04.x;
|
||||
emtr->unk_98.y = pos->y + emtr->resource->header->unk_04.y;
|
||||
emtr->unk_98.z = pos->z + emtr->resource->header->unk_04.z;
|
||||
|
||||
emtr->unk_B0.x = 0;
|
||||
emtr->unk_B0.y = 0;
|
||||
emtr->unk_B0.z = 0;
|
||||
emtr->unk_A4.x = emtr->unk_A4.y = emtr->unk_A4.z = 0;
|
||||
|
||||
emtr->unk_BC = 0;
|
||||
emtr->age = 0;
|
||||
emtr->unk_BE = 0;
|
||||
|
||||
emtr->unk_C0 = emtr->p_res->header->unk_1C;
|
||||
emtr->unk_C6 = emtr->p_res->header->unk_38;
|
||||
emtr->unk_C8 = emtr->p_res->header->unk_10;
|
||||
emtr->unk_CC = emtr->p_res->header->unk_14;
|
||||
emtr->unk_D0 = emtr->p_res->header->unk_18;
|
||||
emtr->unk_D4 = emtr->p_res->header->unk_24;
|
||||
emtr->unk_D8 = emtr->p_res->header->unk_28;
|
||||
emtr->unk_DC = emtr->p_res->header->unk_2C;
|
||||
emtr->unk_E0 = emtr->p_res->header->unk_40;
|
||||
emtr->unk_C0 = emtr->resource->header->unk_1C;
|
||||
emtr->unk_C6 = emtr->resource->header->unk_38;
|
||||
emtr->unk_C8 = emtr->resource->header->unk_10;
|
||||
emtr->unk_CC = emtr->resource->header->unk_14;
|
||||
emtr->unk_D0 = emtr->resource->header->unk_18;
|
||||
emtr->unk_D4 = emtr->resource->header->unk_24;
|
||||
emtr->unk_D8 = emtr->resource->header->unk_28;
|
||||
emtr->unk_DC = emtr->resource->header->unk_2C;
|
||||
emtr->unk_E0 = emtr->resource->header->particleLifeTime;
|
||||
|
||||
emtr->unk_E2 = GX_RGB(31, 31, 31);
|
||||
emtr->unk_F0.unk_00_0 = emtr->p_res->header->unk_48.unk_00_0;
|
||||
emtr->unk_F0.unk_01_0 = emtr->p_res->header->unk_48.unk_01_0;
|
||||
emtr->unk_F0.unk_02_0 = 0;
|
||||
emtr->unk_F0.unk_02_3 = 0;
|
||||
emtr->misc.unk_00_0 = emtr->resource->header->unk_48.unk_00_0;
|
||||
emtr->misc.unk_01_0 = emtr->resource->header->unk_48.unk_01_0;
|
||||
emtr->misc.updateCycle = 0;
|
||||
emtr->misc.unk_02_3 = 0;
|
||||
emtr->collisionPlaneHeight = FX32_MIN;
|
||||
emtr->unk_E8 = FX32_ONE << emtr->p_res->header->unk_48.unk_07_0;
|
||||
emtr->unk_EA = FX32_ONE << emtr->p_res->header->unk_48.unk_07_2;
|
||||
emtr->unk_E8 = FX32_ONE << emtr->resource->header->unk_48.unk_07_0;
|
||||
emtr->unk_EA = FX32_ONE << emtr->resource->header->unk_48.unk_07_2;
|
||||
|
||||
if (emtr->p_res->header->unk_48.unk_08_0) {
|
||||
if (emtr->resource->header->unk_48.unk_08_0) {
|
||||
emtr->unk_E8 *= -1;
|
||||
}
|
||||
|
||||
if (emtr->p_res->header->unk_48.unk_08_1) {
|
||||
if (emtr->resource->header->unk_48.unk_08_1) {
|
||||
emtr->unk_EA *= -1;
|
||||
}
|
||||
|
||||
if (emtr->p_res->header->flags.hasChildResource) {
|
||||
emtr->unk_EC = FX32_ONE << emtr->p_res->childResource->unk_0C.unk_04_0;
|
||||
emtr->unk_EE = FX32_ONE << emtr->p_res->childResource->unk_0C.unk_04_2;
|
||||
if (emtr->resource->header->flags.hasChildResource) {
|
||||
emtr->unk_EC = FX32_ONE << emtr->resource->childResource->unk_0C.unk_04_0;
|
||||
emtr->unk_EE = FX32_ONE << emtr->resource->childResource->unk_0C.unk_04_2;
|
||||
|
||||
if (emtr->p_res->childResource->unk_0C.unk_04_4) {
|
||||
if (emtr->resource->childResource->unk_0C.unk_04_4) {
|
||||
emtr->unk_EC *= -1;
|
||||
}
|
||||
|
||||
if (emtr->p_res->childResource->unk_0C.unk_04_5) {
|
||||
if (emtr->resource->childResource->unk_0C.unk_04_5) {
|
||||
emtr->unk_EE *= -1;
|
||||
}
|
||||
}
|
||||
|
||||
emtr->unk_00 = emtr->unk_04 = NULL;
|
||||
emtr->unk_08.first = emtr->unk_4C.first = NULL;
|
||||
emtr->unk_08.count = emtr->unk_4C.count = 0;
|
||||
emtr->particles.first = emtr->childParticles.first = NULL;
|
||||
emtr->particles.count = emtr->childParticles.count = 0;
|
||||
emtr->unk_100 = NULL;
|
||||
emtr->unk_104 = NULL;
|
||||
emtr->unk_108.unk_108_val1 = 0;
|
||||
@ -138,7 +138,7 @@ void sub_0209D150(SPLManager *mgr, SPLEmitter *emtr)
|
||||
VecFx32 vec;
|
||||
int idx;
|
||||
|
||||
res = emtr->p_res;
|
||||
res = emtr->resource;
|
||||
child = res->childResource;
|
||||
fieldIndex = 0;
|
||||
resBase = res->header;
|
||||
@ -150,9 +150,9 @@ void sub_0209D150(SPLManager *mgr, SPLEmitter *emtr)
|
||||
emtr->unk_100(emtr, FALSE);
|
||||
}
|
||||
|
||||
if (resBase->unk_3C == 0 || emtr->unk_BC < resBase->unk_3C) {
|
||||
if (emtr->unk_BC % emtr->unk_F0.unk_00_0 == 0) {
|
||||
if (!emtr->unk_94.terminate && !emtr->unk_94.stop_generate && emtr->unk_94.started) {
|
||||
if (resBase->emitterLifeTime == 0 || emtr->age < resBase->emitterLifeTime) {
|
||||
if (emtr->age % emtr->misc.unk_00_0 == 0) {
|
||||
if (!emtr->state.terminate && !emtr->state.stop_generate && emtr->state.started) {
|
||||
sub_020A08DC(emtr, (SPLList *)(&mgr->inactiveParticles));
|
||||
}
|
||||
}
|
||||
@ -178,7 +178,7 @@ void sub_0209D150(SPLManager *mgr, SPLEmitter *emtr)
|
||||
fieldFuncs[fieldIndex++].loop = res->texAnim->unk_08.unk_02_1;
|
||||
}
|
||||
|
||||
for (ptcl = emtr->unk_08.first; ptcl != NULL; ptcl = next) {
|
||||
for (ptcl = emtr->particles.first; ptcl != NULL; ptcl = next) {
|
||||
next = ptcl->next;
|
||||
lifeRates[0] = ptcl->unk_2A * ptcl->age >> 8;
|
||||
lifeRates[1] = ptcl->unk_2C.unk_01 + (ptcl->unk_28 * ptcl->age >> 8);
|
||||
@ -223,7 +223,7 @@ void sub_0209D150(SPLManager *mgr, SPLEmitter *emtr)
|
||||
}
|
||||
}
|
||||
|
||||
if (emtr->p_res->header->flags.unk_07_6) {
|
||||
if (emtr->resource->header->flags.unk_07_6) {
|
||||
ptcl->unk_2E.unk_01_2 = mgr->polygonID.fix;
|
||||
} else {
|
||||
ptcl->unk_2E.unk_01_2 = mgr->polygonID.current;
|
||||
@ -237,7 +237,7 @@ void sub_0209D150(SPLManager *mgr, SPLEmitter *emtr)
|
||||
ptcl->age += 1;
|
||||
|
||||
if (ptcl->age > ptcl->lifeTime) {
|
||||
SPLNode *node = SPLList_Erase((SPLList *)(&emtr->unk_08), (SPLNode *)ptcl);
|
||||
SPLNode *node = SPLList_Erase((SPLList *)(&emtr->particles), (SPLNode *)ptcl);
|
||||
SPLList_PushFront((SPLList *)&mgr->inactiveParticles, node);
|
||||
}
|
||||
}
|
||||
@ -258,7 +258,7 @@ void sub_0209D150(SPLManager *mgr, SPLEmitter *emtr)
|
||||
fldNum = 0;
|
||||
}
|
||||
|
||||
for (ptcl = emtr->unk_4C.first; ptcl != NULL; ptcl = next) {
|
||||
for (ptcl = emtr->childParticles.first; ptcl != NULL; ptcl = next) {
|
||||
next = ptcl->next;
|
||||
lifeRates[0] = (ptcl->age << 8) / ptcl->lifeTime;
|
||||
for (i = 0; i < fieldIndex; i++) {
|
||||
@ -290,7 +290,7 @@ void sub_0209D150(SPLManager *mgr, SPLEmitter *emtr)
|
||||
ptcl->position.y += ptcl->velocity.y + emtr->unk_A4.y;
|
||||
ptcl->position.z += ptcl->velocity.z + emtr->unk_A4.z;
|
||||
|
||||
if (emtr->p_res->header->flags.unk_07_7) {
|
||||
if (emtr->resource->header->flags.unk_07_7) {
|
||||
ptcl->unk_2E.unk_01_2 = mgr->polygonID.fix;
|
||||
} else {
|
||||
ptcl->unk_2E.unk_01_2 = mgr->polygonID.current;
|
||||
@ -304,12 +304,12 @@ void sub_0209D150(SPLManager *mgr, SPLEmitter *emtr)
|
||||
ptcl->age += 1;
|
||||
|
||||
if (ptcl->age > ptcl->lifeTime) {
|
||||
SPLList_PushFront((SPLList *)&mgr->inactiveParticles, SPLList_Erase((SPLList *)(&emtr->unk_4C), (SPLNode *)ptcl));
|
||||
SPLList_PushFront((SPLList *)&mgr->inactiveParticles, SPLList_Erase((SPLList *)(&emtr->childParticles), (SPLNode *)ptcl));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emtr->unk_BC += 1;
|
||||
emtr->age += 1;
|
||||
|
||||
if (emtr->unk_100) {
|
||||
emtr->unk_100(emtr, TRUE);
|
||||
@ -325,7 +325,7 @@ static void sub_0209D064(SPLManager *mgr)
|
||||
SetTexFunc setTexFunc;
|
||||
|
||||
emtr = mgr->unk_40.unk_00;
|
||||
resBase = emtr->p_res->header;
|
||||
resBase = emtr->resource->header;
|
||||
drawFunc = NULL;
|
||||
|
||||
sub_0209DC68(mgr->textures + resBase->unk_48.unk_03_0);
|
||||
@ -349,7 +349,7 @@ static void sub_0209D064(SPLManager *mgr)
|
||||
}
|
||||
|
||||
setTexFunc = resBase->flags.hasTexAnim ? sub_0209DC68 : sub_0209DC64;
|
||||
ptcl = emtr->unk_08.first;
|
||||
ptcl = emtr->particles.first;
|
||||
|
||||
while (ptcl != NULL) {
|
||||
setTexFunc(mgr->textures + ptcl->unk_2C.unk_00);
|
||||
@ -367,7 +367,7 @@ static void sub_0209CF7C(SPLManager *mgr)
|
||||
|
||||
emtr = mgr->unk_40.unk_00;
|
||||
drawFunc = NULL;
|
||||
res = emtr->p_res;
|
||||
res = emtr->resource;
|
||||
|
||||
if (!res->header->flags.hasChildResource) {
|
||||
return;
|
||||
@ -393,7 +393,7 @@ static void sub_0209CF7C(SPLManager *mgr)
|
||||
break;
|
||||
}
|
||||
|
||||
ptcl = emtr->unk_4C.first;
|
||||
ptcl = emtr->childParticles.first;
|
||||
while (ptcl != NULL) {
|
||||
drawFunc(mgr, ptcl);
|
||||
ptcl = ptcl->next;
|
||||
@ -404,7 +404,7 @@ void sub_0209CF00(SPLManager *mgr)
|
||||
{
|
||||
SPLResourceHeader *resBase;
|
||||
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
if (resBase->flags.unk_06_5) {
|
||||
sub_0209CF7C(mgr);
|
||||
|
||||
@ -429,7 +429,7 @@ void SPL_Util_SetCylinderEmiterDirection(SPLEmitter *emtr, VecFx32 *p1, VecFx32
|
||||
{
|
||||
VecFx32 vex;
|
||||
|
||||
if (emtr->p_res->header->flags.unk_04_0 == 6 || emtr->p_res->header->flags.unk_04_0 == 7) {
|
||||
if (emtr->resource->header->flags.unk_04_0 == 6 || emtr->resource->header->flags.unk_04_0 == 7) {
|
||||
emtr->unk_98.x = (p2->x + p1->x) / 2;
|
||||
emtr->unk_98.y = (p2->y + p1->y) / 2;
|
||||
emtr->unk_98.z = (p2->z + p1->z) / 2;
|
||||
|
@ -129,10 +129,10 @@ void sub_0209FF0C(SPLManager *mgr, SPLParticle *ptcl)
|
||||
u8 scaleAnimDirect;
|
||||
|
||||
SPLEmitter *emtr = mgr->unk_40.unk_00;
|
||||
SPLResourceHeader *resBase = emtr->p_res->header;
|
||||
SPLResourceHeader *resBase = emtr->resource->header;
|
||||
|
||||
cmr = mgr->unk_40.unk_04;
|
||||
aspect = mgr->unk_40.unk_00->p_res->header->unk_30;
|
||||
aspect = mgr->unk_40.unk_00->resource->header->unk_30;
|
||||
animScale = ptcl->unk_34;
|
||||
|
||||
ptclCol = ptcl->unk_36;
|
||||
@ -168,7 +168,7 @@ void sub_0209FF0C(SPLManager *mgr, SPLParticle *ptcl)
|
||||
sclY = FX_MUL(sclY, animScale);
|
||||
}
|
||||
|
||||
if (!mgr->unk_40.unk_00->p_res->header->flags.unk_06_7) {
|
||||
if (!mgr->unk_40.unk_00->resource->header->flags.unk_06_7) {
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z;
|
||||
@ -192,9 +192,9 @@ void sub_0209FF0C(SPLManager *mgr, SPLParticle *ptcl)
|
||||
G3_Identity();
|
||||
G3_MultMtx43(&load);
|
||||
} else {
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->p_res->header->unk_04.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->p_res->header->unk_04.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->p_res->header->unk_04.z;
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->resource->header->unk_04.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->resource->header->unk_04.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->resource->header->unk_04.z;
|
||||
MTX_MultVec43(&trs, cmr, &trs);
|
||||
|
||||
sin = FX_SinIdx(ptcl->unk_20);
|
||||
@ -214,7 +214,7 @@ void sub_0209FF0C(SPLManager *mgr, SPLParticle *ptcl)
|
||||
|
||||
G3_Identity();
|
||||
|
||||
SPLResourceHeader *resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
SPLResourceHeader *resBase = mgr->unk_40.unk_00->resource->header;
|
||||
G3_Translate(resBase->unk_04.x, resBase->unk_04.y, resBase->unk_04.z);
|
||||
G3_MultMtx43(&load);
|
||||
}
|
||||
@ -225,7 +225,7 @@ void sub_0209FF0C(SPLManager *mgr, SPLParticle *ptcl)
|
||||
GX_RGB_B_(ptclCol) * GX_RGB_B_(emtrCol) >> 25));
|
||||
|
||||
emtr = mgr->unk_40.unk_00;
|
||||
sub_020A0500(emtr->unk_E8, emtr->unk_EA, emtr->p_res->header->unk_54, emtr->p_res->header->unk_56);
|
||||
sub_020A0500(emtr->unk_E8, emtr->unk_EA, emtr->resource->header->unk_54, emtr->resource->header->unk_56);
|
||||
}
|
||||
|
||||
void sub_0209FAB8(SPLManager *mgr, SPLParticle *ptcl)
|
||||
@ -238,7 +238,7 @@ void sub_0209FAB8(SPLManager *mgr, SPLParticle *ptcl)
|
||||
fx32 sin;
|
||||
|
||||
cmr = mgr->unk_40.unk_04;
|
||||
aspect = mgr->unk_40.unk_00->p_res->header->unk_30;
|
||||
aspect = mgr->unk_40.unk_00->resource->header->unk_30;
|
||||
|
||||
fx32 alpha = (fx32)(ptcl->unk_2E.unk_00_0 * (ptcl->unk_2E.unk_00_5 + 1)) >> 5;
|
||||
|
||||
@ -259,7 +259,7 @@ void sub_0209FAB8(SPLManager *mgr, SPLParticle *ptcl)
|
||||
sclY = ptcl->unk_30;
|
||||
sclX = FX_MUL(sclY, aspect);
|
||||
|
||||
switch (mgr->unk_40.unk_00->p_res->header->unk_48.unk_07_4) {
|
||||
switch (mgr->unk_40.unk_00->resource->header->unk_48.unk_07_4) {
|
||||
case 0:
|
||||
sclX = FX_MUL(sclX, ptcl->unk_34);
|
||||
sclY = FX_MUL(sclY, ptcl->unk_34);
|
||||
@ -274,7 +274,7 @@ void sub_0209FAB8(SPLManager *mgr, SPLParticle *ptcl)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!mgr->unk_40.unk_00->p_res->header->flags.unk_06_7) {
|
||||
if (!mgr->unk_40.unk_00->resource->header->flags.unk_06_7) {
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z;
|
||||
@ -298,9 +298,9 @@ void sub_0209FAB8(SPLManager *mgr, SPLParticle *ptcl)
|
||||
G3_Identity();
|
||||
G3_MultMtx43(&load);
|
||||
} else {
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->p_res->header->unk_04.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->p_res->header->unk_04.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->p_res->header->unk_04.z;
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->resource->header->unk_04.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->resource->header->unk_04.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->resource->header->unk_04.z;
|
||||
MTX_MultVec43(&trs, cmr, &trs);
|
||||
|
||||
sin = FX_SinIdx(ptcl->unk_20);
|
||||
@ -320,7 +320,7 @@ void sub_0209FAB8(SPLManager *mgr, SPLParticle *ptcl)
|
||||
|
||||
G3_Identity();
|
||||
|
||||
SPLResourceHeader *resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
SPLResourceHeader *resBase = mgr->unk_40.unk_00->resource->header;
|
||||
G3_Translate(resBase->unk_04.x, resBase->unk_04.y, resBase->unk_04.z);
|
||||
G3_MultMtx43(&load);
|
||||
}
|
||||
@ -349,7 +349,7 @@ void sub_0209F3D0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
MtxFx43 load;
|
||||
|
||||
cmr = mgr->unk_40.unk_04;
|
||||
aspect = mgr->unk_40.unk_00->p_res->header->unk_30;
|
||||
aspect = mgr->unk_40.unk_00->resource->header->unk_30;
|
||||
|
||||
fx32 alpha = (fx32)(ptcl->unk_2E.unk_00_0 * (ptcl->unk_2E.unk_00_5 + 1)) >> 5;
|
||||
|
||||
@ -370,7 +370,7 @@ void sub_0209F3D0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
sclY = ptcl->unk_30;
|
||||
sclX = FX_MUL(sclY, aspect);
|
||||
|
||||
switch (mgr->unk_40.unk_00->p_res->header->unk_48.unk_07_4) {
|
||||
switch (mgr->unk_40.unk_00->resource->header->unk_48.unk_07_4) {
|
||||
case 0:
|
||||
sclX = FX_MUL(sclX, ptcl->unk_34);
|
||||
sclY = FX_MUL(sclY, ptcl->unk_34);
|
||||
@ -385,7 +385,7 @@ void sub_0209F3D0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!mgr->unk_40.unk_00->p_res->header->flags.unk_06_7) {
|
||||
if (!mgr->unk_40.unk_00->resource->header->flags.unk_06_7) {
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z;
|
||||
@ -414,7 +414,7 @@ void sub_0209F3D0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
dot = -dot;
|
||||
}
|
||||
|
||||
dot = FX_MUL(sclY, FX_MUL(FX32_ONE - dot, (fx32)mgr->unk_40.unk_00->p_res->header->unk_48.unk_05_0) + FX32_ONE);
|
||||
dot = FX_MUL(sclY, FX_MUL(FX32_ONE - dot, (fx32)mgr->unk_40.unk_00->resource->header->unk_48.unk_05_0) + FX32_ONE);
|
||||
load.m[0][0] = FX_MUL(dir.x, sclX);
|
||||
load.m[1][0] = FX_MUL(-dir.y, dot);
|
||||
load.m[3][0] = trs.x;
|
||||
@ -431,9 +431,9 @@ void sub_0209F3D0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
G3_Identity();
|
||||
G3_MultMtx43(&load);
|
||||
} else {
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->p_res->header->unk_04.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->p_res->header->unk_04.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->p_res->header->unk_04.z;
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->resource->header->unk_04.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->resource->header->unk_04.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->resource->header->unk_04.z;
|
||||
|
||||
dir = ptcl->velocity;
|
||||
|
||||
@ -459,7 +459,7 @@ void sub_0209F3D0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
dot = -dot;
|
||||
}
|
||||
|
||||
dot = FX_MUL(sclY, FX_MUL(FX32_ONE - dot, (fx32)mgr->unk_40.unk_00->p_res->header->unk_48.unk_05_0) + FX32_ONE);
|
||||
dot = FX_MUL(sclY, FX_MUL(FX32_ONE - dot, (fx32)mgr->unk_40.unk_00->resource->header->unk_48.unk_05_0) + FX32_ONE);
|
||||
load.m[0][0] = FX_MUL(dir.x, sclX);
|
||||
load.m[1][0] = FX_MUL(-dir.y, dot);
|
||||
load.m[2][0] = 0;
|
||||
@ -475,7 +475,7 @@ void sub_0209F3D0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
|
||||
G3_Identity();
|
||||
|
||||
SPLResourceHeader *resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
SPLResourceHeader *resBase = mgr->unk_40.unk_00->resource->header;
|
||||
G3_Translate(resBase->unk_04.x, resBase->unk_04.y, resBase->unk_04.z);
|
||||
G3_MultMtx43(&load);
|
||||
}
|
||||
@ -488,7 +488,7 @@ void sub_0209F3D0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
GX_RGB_B_(colA) * GX_RGB_B_(colB) >> 25));
|
||||
|
||||
SPLEmitter *emtr = mgr->unk_40.unk_00;
|
||||
sub_020A0500(emtr->unk_E8, emtr->unk_EA, emtr->p_res->header->unk_54, emtr->p_res->header->unk_56);
|
||||
sub_020A0500(emtr->unk_E8, emtr->unk_EA, emtr->resource->header->unk_54, emtr->resource->header->unk_56);
|
||||
}
|
||||
|
||||
void sub_0209ECF0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
@ -504,7 +504,7 @@ void sub_0209ECF0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
MtxFx43 load;
|
||||
|
||||
cmr = mgr->unk_40.unk_04;
|
||||
aspect = mgr->unk_40.unk_00->p_res->header->unk_30;
|
||||
aspect = mgr->unk_40.unk_00->resource->header->unk_30;
|
||||
|
||||
fx32 alpha = (fx32)(ptcl->unk_2E.unk_00_0 * (ptcl->unk_2E.unk_00_5 + 1)) >> 5;
|
||||
|
||||
@ -525,7 +525,7 @@ void sub_0209ECF0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
sclY = ptcl->unk_30;
|
||||
sclX = FX_MUL(sclY, aspect);
|
||||
|
||||
switch (mgr->unk_40.unk_00->p_res->header->unk_48.unk_07_4) {
|
||||
switch (mgr->unk_40.unk_00->resource->header->unk_48.unk_07_4) {
|
||||
case 0:
|
||||
sclX = FX_MUL(sclX, ptcl->unk_34);
|
||||
sclY = FX_MUL(sclY, ptcl->unk_34);
|
||||
@ -540,7 +540,7 @@ void sub_0209ECF0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!mgr->unk_40.unk_00->p_res->header->flags.unk_06_7) {
|
||||
if (!mgr->unk_40.unk_00->resource->header->flags.unk_06_7) {
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z;
|
||||
@ -569,7 +569,7 @@ void sub_0209ECF0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
dot = -dot;
|
||||
}
|
||||
|
||||
dot = FX_MUL(sclY, FX_MUL(FX32_ONE - dot, (fx32)mgr->unk_40.unk_00->p_res->header->unk_48.unk_05_0) + FX32_ONE);
|
||||
dot = FX_MUL(sclY, FX_MUL(FX32_ONE - dot, (fx32)mgr->unk_40.unk_00->resource->header->unk_48.unk_05_0) + FX32_ONE);
|
||||
load.m[0][0] = FX_MUL(dir.x, sclX);
|
||||
load.m[1][0] = FX_MUL(-dir.y, dot);
|
||||
load.m[3][0] = trs.x;
|
||||
@ -586,9 +586,9 @@ void sub_0209ECF0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
G3_Identity();
|
||||
G3_MultMtx43(&load);
|
||||
} else {
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->p_res->header->unk_04.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->p_res->header->unk_04.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->p_res->header->unk_04.z;
|
||||
trs.x = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->resource->header->unk_04.x;
|
||||
trs.y = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->resource->header->unk_04.y;
|
||||
trs.z = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->resource->header->unk_04.z;
|
||||
|
||||
dir = ptcl->velocity;
|
||||
|
||||
@ -614,7 +614,7 @@ void sub_0209ECF0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
dot = -dot;
|
||||
}
|
||||
|
||||
dot = FX_MUL(sclY, FX_MUL(FX32_ONE - dot, (fx32)mgr->unk_40.unk_00->p_res->header->unk_48.unk_05_0) + FX32_ONE);
|
||||
dot = FX_MUL(sclY, FX_MUL(FX32_ONE - dot, (fx32)mgr->unk_40.unk_00->resource->header->unk_48.unk_05_0) + FX32_ONE);
|
||||
load.m[0][0] = FX_MUL(dir.x, sclX);
|
||||
load.m[1][0] = FX_MUL(-dir.y, dot);
|
||||
load.m[2][0] = 0;
|
||||
@ -630,7 +630,7 @@ void sub_0209ECF0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
|
||||
G3_Identity();
|
||||
|
||||
SPLResourceHeader *resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
SPLResourceHeader *resBase = mgr->unk_40.unk_00->resource->header;
|
||||
G3_Translate(resBase->unk_04.x, resBase->unk_04.y, resBase->unk_04.z);
|
||||
G3_MultMtx43(&load);
|
||||
}
|
||||
@ -672,10 +672,10 @@ void sub_0209E9A0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
return;
|
||||
}
|
||||
|
||||
Unk_02100DA8[mgr->unk_40.unk_00->p_res->header->flags.unk_06_1](FX_SinIdx(ptcl->unk_20), FX_CosIdx(ptcl->unk_20), &rotMtx);
|
||||
Unk_02100DA8[mgr->unk_40.unk_00->resource->header->flags.unk_06_1](FX_SinIdx(ptcl->unk_20), FX_CosIdx(ptcl->unk_20), &rotMtx);
|
||||
|
||||
sclY = ptcl->unk_30;
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
sclX = FX_MUL(sclY, resBase->unk_30);
|
||||
|
||||
switch (resBase->unk_48.unk_07_4) {
|
||||
@ -697,20 +697,20 @@ void sub_0209E9A0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
MTX_Concat43(&sclMtx, &rotMtx, &load);
|
||||
|
||||
// resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
if (!mgr->unk_40.unk_00->p_res->header->flags.unk_06_7) {
|
||||
if (!mgr->unk_40.unk_00->resource->header->flags.unk_06_7) {
|
||||
load.m[3][0] = ptcl->position.x + ptcl->emitterPos.x;
|
||||
load.m[3][1] = ptcl->position.y + ptcl->emitterPos.y;
|
||||
load.m[3][2] = ptcl->position.z + ptcl->emitterPos.z;
|
||||
G3_LoadMtx43(mgr->unk_40.unk_04);
|
||||
G3_MultMtx43(&load);
|
||||
} else {
|
||||
load.m[3][0] = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->p_res->header->unk_04.x;
|
||||
load.m[3][1] = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->p_res->header->unk_04.y;
|
||||
load.m[3][2] = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->p_res->header->unk_04.z;
|
||||
load.m[3][0] = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->resource->header->unk_04.x;
|
||||
load.m[3][1] = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->resource->header->unk_04.y;
|
||||
load.m[3][2] = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->resource->header->unk_04.z;
|
||||
|
||||
G3_Identity();
|
||||
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
G3_Translate(resBase->unk_04.x, resBase->unk_04.y, resBase->unk_04.z);
|
||||
|
||||
G3_MultMtx43(mgr->unk_40.unk_04);
|
||||
@ -725,7 +725,7 @@ void sub_0209E9A0(SPLManager *mgr, SPLParticle *ptcl)
|
||||
GX_RGB_B_(colA) * GX_RGB_B_(colB) >> 25));
|
||||
|
||||
SPLEmitter *emtr = mgr->unk_40.unk_00;
|
||||
resBase = emtr->p_res->header;
|
||||
resBase = emtr->resource->header;
|
||||
Unk_02100DA0[resBase->flags.unk_06_3](emtr->unk_E8, emtr->unk_EA, resBase->unk_54, resBase->unk_56);
|
||||
}
|
||||
|
||||
@ -755,10 +755,10 @@ void sub_0209E650(SPLManager *mgr, SPLParticle *ptcl)
|
||||
return;
|
||||
}
|
||||
|
||||
Unk_02100DA8[mgr->unk_40.unk_00->p_res->childResource->unk_00.unk_03_1](FX_SinIdx(ptcl->unk_20), FX_CosIdx(ptcl->unk_20), &rotMtx);
|
||||
Unk_02100DA8[mgr->unk_40.unk_00->resource->childResource->unk_00.unk_03_1](FX_SinIdx(ptcl->unk_20), FX_CosIdx(ptcl->unk_20), &rotMtx);
|
||||
|
||||
sclY = ptcl->unk_30;
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
sclX = FX_MUL(sclY, resBase->unk_30);
|
||||
|
||||
switch (resBase->unk_48.unk_07_4) {
|
||||
@ -779,20 +779,20 @@ void sub_0209E650(SPLManager *mgr, SPLParticle *ptcl)
|
||||
MTX_Scale43(&sclMtx, sclX, sclY, sclY);
|
||||
MTX_Concat43(&rotMtx, &sclMtx, &load);
|
||||
|
||||
if (!mgr->unk_40.unk_00->p_res->header->flags.unk_06_7) {
|
||||
if (!mgr->unk_40.unk_00->resource->header->flags.unk_06_7) {
|
||||
load.m[3][0] = ptcl->position.x + ptcl->emitterPos.x;
|
||||
load.m[3][1] = ptcl->position.y + ptcl->emitterPos.y;
|
||||
load.m[3][2] = ptcl->position.z + ptcl->emitterPos.z;
|
||||
G3_LoadMtx43(mgr->unk_40.unk_04);
|
||||
G3_MultMtx43(&load);
|
||||
} else {
|
||||
load.m[3][0] = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->p_res->header->unk_04.x;
|
||||
load.m[3][1] = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->p_res->header->unk_04.y;
|
||||
load.m[3][2] = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->p_res->header->unk_04.z;
|
||||
load.m[3][0] = ptcl->position.x + ptcl->emitterPos.x - mgr->unk_40.unk_00->resource->header->unk_04.x;
|
||||
load.m[3][1] = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->resource->header->unk_04.y;
|
||||
load.m[3][2] = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->resource->header->unk_04.z;
|
||||
|
||||
G3_Identity();
|
||||
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
G3_Translate(resBase->unk_04.x, resBase->unk_04.y, resBase->unk_04.z);
|
||||
G3_MultMtx43(mgr->unk_40.unk_04);
|
||||
G3_MultMtx43(&load);
|
||||
@ -806,7 +806,7 @@ void sub_0209E650(SPLManager *mgr, SPLParticle *ptcl)
|
||||
GX_RGB_B_(colA) * GX_RGB_B_(colB) >> 25));
|
||||
|
||||
SPLEmitter *emtr = mgr->unk_40.unk_00;
|
||||
Unk_02100DA0[emtr->p_res->childResource->unk_00.unk_03_3](emtr->unk_EC, emtr->unk_EE, 0, 0);
|
||||
Unk_02100DA0[emtr->resource->childResource->unk_00.unk_03_3](emtr->unk_EC, emtr->unk_EE, 0, 0);
|
||||
}
|
||||
|
||||
void sub_0209E1D4(SPLManager *mgr, SPLParticle *ptcl)
|
||||
@ -837,11 +837,11 @@ void sub_0209E1D4(SPLManager *mgr, SPLParticle *ptcl)
|
||||
return;
|
||||
}
|
||||
|
||||
Unk_02100DA8[mgr->unk_40.unk_00->p_res->header->flags.unk_06_1](FX_SinIdx(ptcl->unk_20), FX_CosIdx(ptcl->unk_20), &rotMat);
|
||||
Unk_02100DA8[mgr->unk_40.unk_00->resource->header->flags.unk_06_1](FX_SinIdx(ptcl->unk_20), FX_CosIdx(ptcl->unk_20), &rotMat);
|
||||
|
||||
MTX_Identity43(&mat);
|
||||
|
||||
if (!mgr->unk_40.unk_00->p_res->header->unk_48.unk_07_7) {
|
||||
if (!mgr->unk_40.unk_00->resource->header->unk_48.unk_07_7) {
|
||||
VEC_Normalize(&ptcl->velocity, &vec1);
|
||||
} else {
|
||||
VEC_Normalize(&ptcl->position, &vec1);
|
||||
@ -875,7 +875,7 @@ void sub_0209E1D4(SPLManager *mgr, SPLParticle *ptcl)
|
||||
mat.m[2][2] = vec3.z;
|
||||
MTX_Concat43(&rotMat, &mat, &rotMat);
|
||||
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
scaleY = ptcl->unk_30;
|
||||
scaleX = FX_MUL(scaleY, resBase->unk_30);
|
||||
|
||||
@ -897,7 +897,7 @@ void sub_0209E1D4(SPLManager *mgr, SPLParticle *ptcl)
|
||||
MTX_Scale43(&sclMat, scaleX, scaleY, scaleY);
|
||||
MTX_Concat43(&sclMat, &rotMat, &transform);
|
||||
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
if (!resBase->flags.unk_06_7) {
|
||||
transform.m[3][0] = ptcl->position.x + ptcl->emitterPos.x;
|
||||
transform.m[3][1] = ptcl->position.y + ptcl->emitterPos.y;
|
||||
@ -906,12 +906,12 @@ void sub_0209E1D4(SPLManager *mgr, SPLParticle *ptcl)
|
||||
G3_MultMtx43(&transform);
|
||||
} else {
|
||||
transform.m[3][0] = ptcl->position.x + ptcl->emitterPos.x - resBase->unk_04.x;
|
||||
transform.m[3][1] = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->p_res->header->unk_04.y;
|
||||
transform.m[3][2] = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->p_res->header->unk_04.z;
|
||||
transform.m[3][1] = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->resource->header->unk_04.y;
|
||||
transform.m[3][2] = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->resource->header->unk_04.z;
|
||||
|
||||
G3_Identity();
|
||||
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
G3_Translate(resBase->unk_04.x, resBase->unk_04.y, resBase->unk_04.z);
|
||||
G3_MultMtx43(mgr->unk_40.unk_04);
|
||||
G3_MultMtx43(&transform);
|
||||
@ -925,7 +925,7 @@ void sub_0209E1D4(SPLManager *mgr, SPLParticle *ptcl)
|
||||
GX_RGB_B_(colA) * GX_RGB_B_(colB) >> 25));
|
||||
|
||||
emtr = mgr->unk_40.unk_00;
|
||||
resBase = emtr->p_res->header;
|
||||
resBase = emtr->resource->header;
|
||||
Unk_02100DA0[resBase->flags.unk_06_3](emtr->unk_E8, emtr->unk_EA, resBase->unk_54, resBase->unk_56);
|
||||
}
|
||||
|
||||
@ -955,11 +955,11 @@ void sub_0209DD54(SPLManager *mgr, SPLParticle *ptcl)
|
||||
return;
|
||||
}
|
||||
|
||||
Unk_02100DA8[mgr->unk_40.unk_00->p_res->childResource->unk_00.unk_03_1](FX_SinIdx(ptcl->unk_20), FX_CosIdx(ptcl->unk_20), &rotMtx);
|
||||
Unk_02100DA8[mgr->unk_40.unk_00->resource->childResource->unk_00.unk_03_1](FX_SinIdx(ptcl->unk_20), FX_CosIdx(ptcl->unk_20), &rotMtx);
|
||||
|
||||
MTX_Identity43(&mat);
|
||||
|
||||
if (!mgr->unk_40.unk_00->p_res->childResource->unk_0C.unk_04_6) {
|
||||
if (!mgr->unk_40.unk_00->resource->childResource->unk_0C.unk_04_6) {
|
||||
VEC_Normalize(&ptcl->velocity, &vec1);
|
||||
} else {
|
||||
VEC_Normalize(&ptcl->position, &vec1);
|
||||
@ -993,7 +993,7 @@ void sub_0209DD54(SPLManager *mgr, SPLParticle *ptcl)
|
||||
mat.m[2][2] = vec3.z;
|
||||
MTX_Concat43(&rotMtx, &mat, &rotMtx);
|
||||
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
scaleY = ptcl->unk_30;
|
||||
scaleX = FX_MUL(scaleY, resBase->unk_30);
|
||||
|
||||
@ -1015,7 +1015,7 @@ void sub_0209DD54(SPLManager *mgr, SPLParticle *ptcl)
|
||||
MTX_Scale43(&sclMat, scaleX, scaleY, scaleY);
|
||||
MTX_Concat43(&rotMtx, &sclMat, &transform);
|
||||
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
if (!resBase->flags.unk_06_7) {
|
||||
transform.m[3][0] = ptcl->position.x + ptcl->emitterPos.x;
|
||||
transform.m[3][1] = ptcl->position.y + ptcl->emitterPos.y;
|
||||
@ -1024,12 +1024,12 @@ void sub_0209DD54(SPLManager *mgr, SPLParticle *ptcl)
|
||||
G3_MultMtx43(&transform);
|
||||
} else {
|
||||
transform.m[3][0] = ptcl->position.x + ptcl->emitterPos.x - resBase->unk_04.x;
|
||||
transform.m[3][1] = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->p_res->header->unk_04.y;
|
||||
transform.m[3][2] = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->p_res->header->unk_04.z;
|
||||
transform.m[3][1] = ptcl->position.y + ptcl->emitterPos.y - mgr->unk_40.unk_00->resource->header->unk_04.y;
|
||||
transform.m[3][2] = ptcl->position.z + ptcl->emitterPos.z - mgr->unk_40.unk_00->resource->header->unk_04.z;
|
||||
|
||||
G3_Identity();
|
||||
|
||||
resBase = mgr->unk_40.unk_00->p_res->header;
|
||||
resBase = mgr->unk_40.unk_00->resource->header;
|
||||
G3_Translate(resBase->unk_04.x, resBase->unk_04.y, resBase->unk_04.z);
|
||||
G3_MultMtx43(mgr->unk_40.unk_04);
|
||||
G3_MultMtx43(&transform);
|
||||
@ -1043,5 +1043,5 @@ void sub_0209DD54(SPLManager *mgr, SPLParticle *ptcl)
|
||||
GX_RGB_B_(colA) * GX_RGB_B_(colB) >> 25));
|
||||
|
||||
SPLEmitter *emtr = mgr->unk_40.unk_00;
|
||||
Unk_02100DA0[emtr->p_res->childResource->unk_00.unk_03_3](emtr->unk_EC, emtr->unk_EE, 0, 0);
|
||||
Unk_02100DA0[emtr->resource->childResource->unk_00.unk_03_3](emtr->unk_EC, emtr->unk_EE, 0, 0);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ static void sub_020A1768(SPLEmitter *emtr)
|
||||
|
||||
vec = Unk_02100DB0;
|
||||
|
||||
switch (emtr->p_res->header->flags.unk_04_6) {
|
||||
switch (emtr->resource->header->flags.unk_04_6) {
|
||||
case 2:
|
||||
axis.x = FX32_ONE;
|
||||
axis.y = 0;
|
||||
@ -82,7 +82,7 @@ void sub_020A08DC(SPLEmitter *emtr, SPLList *list)
|
||||
fx32 magPos;
|
||||
fx32 magAxis;
|
||||
|
||||
res = emtr->p_res;
|
||||
res = emtr->resource;
|
||||
resBase = res->header;
|
||||
|
||||
int temp = emtr->unk_C8 + FX32_CAST(emtr->unk_BE);
|
||||
@ -104,7 +104,7 @@ void sub_020A08DC(SPLEmitter *emtr, SPLList *list)
|
||||
return;
|
||||
}
|
||||
|
||||
SPLList_PushFront((SPLList *)&emtr->unk_08, (SPLNode *)ptcl);
|
||||
SPLList_PushFront((SPLList *)&emtr->particles, (SPLNode *)ptcl);
|
||||
|
||||
switch (resBase->flags.unk_04_0) {
|
||||
case 0:
|
||||
@ -248,7 +248,7 @@ void sub_020A08DC(SPLEmitter *emtr, SPLList *list)
|
||||
ptcl->unk_36 = resBase->unk_22;
|
||||
}
|
||||
|
||||
ptcl->unk_2E.unk_00_0 = emtr->unk_F0.unk_01_0;
|
||||
ptcl->unk_2E.unk_00_0 = emtr->misc.unk_01_0;
|
||||
ptcl->unk_2E.unk_00_5 = 31;
|
||||
|
||||
if (resBase->flags.unk_05_5) {
|
||||
@ -293,7 +293,7 @@ void sub_020A05BC(SPLParticle *ptcl, SPLEmitter *emtr, SPLList *list)
|
||||
fx32 velBase, velRand;
|
||||
u32 rng;
|
||||
int i;
|
||||
SPLChildResource *chldRes = emtr->p_res->childResource;
|
||||
SPLChildResource *chldRes = emtr->resource->childResource;
|
||||
fx32 vel = FX_MUL((fx32)(chldRes->unk_08.unk_00_0 << FX32_SHIFT), FX32_CONST(1 / 256.0f));
|
||||
|
||||
for (i = 0; i < chldRes->unk_0C.unk_00_0; i++) {
|
||||
@ -301,7 +301,7 @@ void sub_020A05BC(SPLParticle *ptcl, SPLEmitter *emtr, SPLList *list)
|
||||
if (chld == NULL) {
|
||||
return;
|
||||
}
|
||||
SPLList_PushFront((SPLList *)&emtr->unk_4C, (SPLNode *)chld);
|
||||
SPLList_PushFront((SPLList *)&emtr->childParticles, (SPLNode *)chld);
|
||||
|
||||
chld->position = ptcl->position;
|
||||
|
||||
|
@ -2870,7 +2870,7 @@ static BOOL ov12_02229A50(SPLEmitter *param0)
|
||||
int v2;
|
||||
int v3;
|
||||
|
||||
v1 = param0->unk_08.first;
|
||||
v1 = param0->particles.first;
|
||||
|
||||
while (v1 != NULL) {
|
||||
v2 = v1->age;
|
||||
|
@ -522,7 +522,7 @@ void sub_02014638(UnkStruct_02014014 *param0)
|
||||
|
||||
void sub_02014674(UnkStruct_02014014 *param0)
|
||||
{
|
||||
SPL_0209C6A8(param0->unk_00);
|
||||
SPLManager_Update(param0->unk_00);
|
||||
}
|
||||
|
||||
int sub_02014680(void)
|
||||
@ -651,7 +651,7 @@ void sub_02014798(SPLEmitter *param0, VecFx16 *param1)
|
||||
|
||||
void sub_020147B0(SPLEmitter *param0, fx32 param1)
|
||||
{
|
||||
param0->p_res->header->unk_10 = param1;
|
||||
param0->resource->header->unk_10 = param1;
|
||||
}
|
||||
|
||||
enum {
|
||||
@ -669,14 +669,14 @@ static const void *sub_020147B8(SPLEmitter *param0, int param1)
|
||||
int v1;
|
||||
SPLBehavior *v2;
|
||||
|
||||
v1 = param0->p_res->behaviorCount;
|
||||
v1 = param0->resource->behaviorCount;
|
||||
|
||||
if (v1 == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (v0 = 0; v0 < v1; v0++) {
|
||||
v2 = ¶m0->p_res->behaviors[v0];
|
||||
v2 = ¶m0->resource->behaviors[v0];
|
||||
|
||||
if (v2 == NULL) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user