mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-14 03:44:34 +00:00
ovl_Eff_Dust OK (#655)
* void func_8099D8D0(void *arg0, s32 arg1) Signed-off-by: angie <angheloalf95@gmail.com> * void func_8099D8D8(void *arg0, s32 arg1) Signed-off-by: angie <angheloalf95@gmail.com> * void EffDust_Destroy(Actor *thisx, GlobalContext *globalCtx) Signed-off-by: angie <angheloalf95@gmail.com> * Fix some pointers in the struct Signed-off-by: angie <angheloalf95@gmail.com> * Fix functions declarations Signed-off-by: angie <angheloalf95@gmail.com> * void EffDust_Init(Actor *thisx, GlobalContext *globalCtx) Signed-off-by: angie <angheloalf95@gmail.com> * EffDust_Update, EffDust_Draw, renaming and cleanup Signed-off-by: angie <angheloalf95@gmail.com> * void func_8099D8E0(EffDust *this) Signed-off-by: angie <angheloalf95@gmail.com> * void func_8099DB28(EffDust *this, GlobalContext *globalCtx) Signed-off-by: angie <angheloalf95@gmail.com> * void EffDust_UpdateFunc_8099DD74(EffDust *this, GlobalContext *globalCtx) Signed-off-by: angie <angheloalf95@gmail.com> * Members renaming Signed-off-by: Anghelo <angheloalf95@gmail.com> * NON_MATCHING void func_8099E4F4(EffDust *this, GlobalContext *globalCtx) Signed-off-by: Anghelo <angheloalf95@gmail.com> * void func_8099DFC0(EffDust *this, GlobalContext *globalCtx) Signed-off-by: Anghelo <angheloalf95@gmail.com> * NON_MATCHING void func_8099E784(EffDust *this, GlobalContext *globalCtx) Signed-off-by: angie <angheloalf95@gmail.com> * NON_MATCHING func_8099E784 - score 100 Signed-off-by: Anghelo <angheloalf95@gmail.com> * func_8099E784 still not matching Signed-off-by: Anghelo <angheloalf95@gmail.com> * almost there (func_8099E784) Signed-off-by: Anghelo <angheloalf95@gmail.com> * func_8099E784 matching. needs cleanup Signed-off-by: Anghelo <angheloalf95@gmail.com> * void func_8099E784(EffDust *this, GlobalContext *globalCtx) Signed-off-by: Anghelo <angheloalf95@gmail.com> * Rename most members of the struct Signed-off-by: Anghelo <angheloalf95@gmail.com> * void func_8099E4F4(EffDust *this, GlobalContext *globalCtx) matching Signed-off-by: Anghelo <angheloalf95@gmail.com> * Rename a few variables and functions Signed-off-by: Anghelo <angheloalf95@gmail.com> * Add an enum for the possibles values for actor.param Signed-off-by: angie <angheloalf95@gmail.com> * format files Signed-off-by: angie <angheloalf95@gmail.com> * fix merge problems Signed-off-by: angie <angheloalf95@gmail.com> * delete reloc Signed-off-by: angie <angheloalf95@gmail.com> * remove defined symbols from undefined_syms Signed-off-by: angie <angheloalf95@gmail.com> * a bunch of functions Signed-off-by: angie <angheloalf95@gmail.com> * another bunch of functions Signed-off-by: angie <angheloalf95@gmail.com> * add dummies to func_8097911C to match it Signed-off-by: angie <angheloalf95@gmail.com> * fix some functions declarations Signed-off-by: angie <angheloalf95@gmail.com> * Add functions of the array used by the update function Signed-off-by: angie <angheloalf95@gmail.com> * add functions used by draw Signed-off-by: angie <angheloalf95@gmail.com> * draw and update functions Signed-off-by: angie <angheloalf95@gmail.com> * DemoGj_Init Signed-off-by: angie <angheloalf95@gmail.com> * fix some functions declarations Signed-off-by: Anghelo <angheloalf95@gmail.com> * 9 small functions Signed-off-by: Anghelo <angheloalf95@gmail.com> * Some unmatched functions and 12 small matched functions Signed-off-by: Anghelo <angheloalf95@gmail.com> * another 7 small functions Signed-off-by: Anghelo <angheloalf95@gmail.com> * add data Signed-off-by: Anghelo <angheloalf95@gmail.com> * small types fixes Signed-off-by: Anghelo <angheloalf95@gmail.com> * six more functions Signed-off-by: angie <angheloalf95@gmail.com> * func_80978C20 Signed-off-by: angie <angheloalf95@gmail.com> * func_8097BA48 Signed-off-by: Anghelo <angheloalf95@gmail.com> * five repeated functions Signed-off-by: Anghelo <angheloalf95@gmail.com> * Array of cylinders and two other functions Signed-off-by: Anghelo <angheloalf95@gmail.com> * seven equals and problematic functions Signed-off-by: Anghelo <angheloalf95@gmail.com> * func_80978F60 and func_80979860 Signed-off-by: angie <angheloalf95@gmail.com> * func_8097923C doesn't want to match :c Signed-off-by: Anghelo <angheloalf95@gmail.com> * three not matching functions Signed-off-by: Anghelo <angheloalf95@gmail.com> * func_80978AFC Signed-off-by: Anghelo <angheloalf95@gmail.com> * three more Signed-off-by: Anghelo <angheloalf95@gmail.com> * DemoGj_FindGanon Signed-off-by: angie <angheloalf95@gmail.com> * func_809797E4 Signed-off-by: angie <angheloalf95@gmail.com> * func_80978B90 Signed-off-by: angie <angheloalf95@gmail.com> * last non matching function Signed-off-by: angie <angheloalf95@gmail.com> * erase reloc Signed-off-by: angie <angheloalf95@gmail.com> * a bit of renaming Signed-off-by: angie <angheloalf95@gmail.com> * another chunk of renaming Signed-off-by: angie <angheloalf95@gmail.com> * fix reg macros and a few comments Signed-off-by: Anghelo <angheloalf95@gmail.com> * vt, arrayfuncs renaming and another bit of renaming Signed-off-by: Anghelo <angheloalf95@gmail.com> * More renaming Signed-off-by: Anghelo <angheloalf95@gmail.com> * i'm hating this actor Signed-off-by: angie <angheloalf95@gmail.com> * format Signed-off-by: angie <angheloalf95@gmail.com> * Changes asked by @shawlucas Signed-off-by: Anghelo <angheloalf95@gmail.com> * changes asked by @louist103 Signed-off-by: angie <angheloalf95@gmail.com> * Revert "Merge branch 'ovl_Demo_Gj' of github.com:AngheloAlf/oot into ovl_Eff_Dust" This reverts commit12e0e5d2a6
, reversing changes made tob251f1d234
. * fix merge problems Signed-off-by: Anghelo <angheloalf95@gmail.com> * Rename the param's enum and move it to header Signed-off-by: angie <angheloalf95@gmail.com> * add file description Signed-off-by: angie <angheloalf95@gmail.com> * Some changes requested by @Roman971 Signed-off-by: angie <angheloalf95@gmail.com> * more changes Signed-off-by: angie <angheloalf95@gmail.com> * Change the particles amount from hex to decimal Signed-off-by: angie <angheloalf95@gmail.com> * `format.sh` should also format headers :s Signed-off-by: angie <angheloalf95@gmail.com>
This commit is contained in:
parent
fb1909bb92
commit
6d01247f34
18 changed files with 364 additions and 1425 deletions
|
@ -1,3 +1,9 @@
|
|||
/**
|
||||
* File z_eff_dust.c
|
||||
* Overlay: ovl_Eff_Dust
|
||||
* Description: Dust effects
|
||||
*/
|
||||
|
||||
#include "z_eff_dust.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
|
@ -10,7 +16,14 @@ void EffDust_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void EffDust_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EffDust_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
/*
|
||||
void EffDust_InitPosAndDistance(EffDust* this);
|
||||
|
||||
void EffDust_UpdateFunc_8099DB28(EffDust* this, GlobalContext* globalCtx);
|
||||
void EffDust_UpdateFunc_8099DD74(EffDust* this, GlobalContext* globalCtx);
|
||||
void EffDust_UpdateFunc_8099DFC0(EffDust* this, GlobalContext* globalCtx);
|
||||
void EffDust_DrawFunc_8099E4F4(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
const ActorInit Eff_Dust_InitVars = {
|
||||
ACTOR_EFF_DUST,
|
||||
ACTORCAT_NPC,
|
||||
|
@ -22,28 +35,342 @@ const ActorInit Eff_Dust_InitVars = {
|
|||
(ActorFunc)EffDust_Update,
|
||||
(ActorFunc)EffDust_Draw,
|
||||
};
|
||||
*/
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/func_8099D8D0.s")
|
||||
static Gfx D_8099EB60[] = {
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/func_8099D8D8.s")
|
||||
void EffDust_SetupAction(EffDust* this, EffDustActionFunc actionFunc) {
|
||||
this->actionFunc = actionFunc;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/func_8099D8E0.s")
|
||||
void EffDust_SetupDraw(EffDust* this, EffDustDrawFunc drawFunc) {
|
||||
this->drawFunc = drawFunc;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/EffDust_Init.s")
|
||||
void EffDust_InitPosAndDistance(EffDust* this) {
|
||||
s32 i;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/EffDust_Destroy.s")
|
||||
for (i = 0; i < 64; i++) {
|
||||
this->initialPositions[i].z = 0.0f;
|
||||
this->initialPositions[i].y = 0.0f;
|
||||
this->initialPositions[i].x = 0.0f;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/func_8099DB28.s")
|
||||
this->distanceTraveled[i] = 1.0f;
|
||||
}
|
||||
this->index = 0;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/func_8099DD74.s")
|
||||
void EffDust_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EffDust* this = THIS;
|
||||
EffDustType dustEffect = this->actor.params;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/func_8099DFC0.s")
|
||||
EffDust_InitPosAndDistance(this);
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/EffDust_Update.s")
|
||||
switch (dustEffect) {
|
||||
case EFF_DUST_TYPE_0:
|
||||
EffDust_SetupAction(this, EffDust_UpdateFunc_8099DB28);
|
||||
EffDust_SetupDraw(this, EffDust_DrawFunc_8099E4F4);
|
||||
this->dy = 0.8f;
|
||||
this->dz = 0.8f;
|
||||
this->dx = 1.0f;
|
||||
this->scalingFactor = 0.1f;
|
||||
break;
|
||||
case EFF_DUST_TYPE_1:
|
||||
EffDust_SetupAction(this, EffDust_UpdateFunc_8099DD74);
|
||||
EffDust_SetupDraw(this, EffDust_DrawFunc_8099E4F4);
|
||||
this->dx = 0.8f;
|
||||
this->dz = 0.8f;
|
||||
this->dy = 1.0f;
|
||||
this->scalingFactor = 0.5f;
|
||||
break;
|
||||
case EFF_DUST_TYPE_2:
|
||||
EffDust_SetupAction(this, EffDust_UpdateFunc_8099DFC0);
|
||||
EffDust_SetupDraw(this, EffDust_DrawFunc_8099E784);
|
||||
this->dx = 0.5f;
|
||||
this->scalingFactor = 15.0f;
|
||||
break;
|
||||
case EFF_DUST_TYPE_3:
|
||||
EffDust_SetupAction(this, EffDust_UpdateFunc_8099DFC0);
|
||||
EffDust_SetupDraw(this, EffDust_DrawFunc_8099E784);
|
||||
this->dx = 0.5f;
|
||||
this->scalingFactor = 10.0f;
|
||||
break;
|
||||
case EFF_DUST_TYPE_4:
|
||||
EffDust_SetupAction(this, EffDust_UpdateFunc_8099DFC0);
|
||||
EffDust_SetupDraw(this, EffDust_DrawFunc_8099E784);
|
||||
this->actor.room = -1;
|
||||
this->dx = 0.5f;
|
||||
this->scalingFactor = 20.0f;
|
||||
break;
|
||||
default:
|
||||
SystemArena_FreeDebug(this, "../z_eff_dust.c", 202);
|
||||
break;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/func_8099E4F4.s")
|
||||
this->life = 10;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/func_8099E784.s")
|
||||
void EffDust_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Eff_Dust/EffDust_Draw.s")
|
||||
void EffDust_UpdateFunc_8099DB28(EffDust* this, GlobalContext* globalCtx) {
|
||||
s16 theta;
|
||||
s16 fi;
|
||||
f32* distanceTraveled = this->distanceTraveled;
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
if ((*distanceTraveled) < 1.0f) {
|
||||
*distanceTraveled += 0.05f;
|
||||
}
|
||||
distanceTraveled++;
|
||||
}
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
i = this->index & 0x3F;
|
||||
if (this->distanceTraveled[i] >= 1.0f) {
|
||||
// Spherical coordinate system.
|
||||
fi = Rand_CenteredFloat(8192.0f);
|
||||
theta = Rand_CenteredFloat(4096.0f);
|
||||
this->initialPositions[i].x = -800.0f * Math_CosS(fi) * Math_CosS(theta);
|
||||
this->initialPositions[i].y = -800.0f * Math_SinS(theta);
|
||||
this->initialPositions[i].z = -800.0f * Math_SinS(fi) * Math_CosS(theta);
|
||||
this->distanceTraveled[i] = 0.0f;
|
||||
this->index += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EffDust_UpdateFunc_8099DD74(EffDust* this, GlobalContext* globalCtx) {
|
||||
s16 theta;
|
||||
s16 fi;
|
||||
f32* distanceTraveled = this->distanceTraveled;
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
if ((*distanceTraveled) < 1.0f) {
|
||||
*distanceTraveled += 0.03f;
|
||||
}
|
||||
distanceTraveled++;
|
||||
}
|
||||
|
||||
for (j = 0; j < 2; j++) {
|
||||
i = this->index & 0x3F;
|
||||
if (this->distanceTraveled[i] >= 1.0f) {
|
||||
// Spherical coordinate system.
|
||||
fi = Rand_CenteredFloat(65536.0f);
|
||||
theta = Rand_ZeroFloat(8192.0f);
|
||||
this->initialPositions[i].x = 400.0f * Math_CosS(fi) * Math_CosS(theta);
|
||||
this->initialPositions[i].y = 400.0f * Math_SinS(theta);
|
||||
this->initialPositions[i].z = 400.0f * Math_SinS(fi) * Math_CosS(theta);
|
||||
this->distanceTraveled[i] = 0.0f;
|
||||
this->index += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EffDust_UpdateFunc_8099DFC0(EffDust* this, GlobalContext* globalCtx) {
|
||||
s16 theta;
|
||||
Player* player = PLAYER;
|
||||
Actor* parent = this->actor.parent;
|
||||
f32* distanceTraveled = this->distanceTraveled;
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & 0x1000)) {
|
||||
if (this->life != 0) {
|
||||
this->life -= 1;
|
||||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
if ((*distanceTraveled) < 1.0f) {
|
||||
*distanceTraveled += 0.2f;
|
||||
}
|
||||
distanceTraveled++;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
if ((*distanceTraveled) < 1.0f) {
|
||||
*distanceTraveled += 0.1f;
|
||||
}
|
||||
distanceTraveled++;
|
||||
}
|
||||
|
||||
this->actor.world.pos = parent->world.pos;
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
i = this->index & 0x3F;
|
||||
if (this->distanceTraveled[i] >= 1.0f) {
|
||||
|
||||
theta = Rand_CenteredFloat(65536.0f);
|
||||
switch (this->actor.params) {
|
||||
case EFF_DUST_TYPE_2:
|
||||
this->initialPositions[i].x = (Rand_ZeroOne() * 4500.0f) + 700.0f;
|
||||
if (this->initialPositions[i].x > 3000.0f) {
|
||||
this->initialPositions[i].y = (3000.0f * Rand_ZeroOne()) * Math_SinS(theta);
|
||||
this->initialPositions[i].z = (3000.0f * Rand_ZeroOne()) * Math_CosS(theta);
|
||||
} else {
|
||||
this->initialPositions[i].y = 3000.0f * Math_SinS(theta);
|
||||
this->initialPositions[i].z = 3000.0f * Math_CosS(theta);
|
||||
}
|
||||
break;
|
||||
|
||||
case EFF_DUST_TYPE_3:
|
||||
this->initialPositions[i].x = (Rand_ZeroOne() * 2500.0f) + 700.0f;
|
||||
if (this->initialPositions[i].x > 2000.0f) {
|
||||
this->initialPositions[i].y = (2000.0f * Rand_ZeroOne()) * Math_SinS(theta);
|
||||
this->initialPositions[i].z = (2000.0f * Rand_ZeroOne()) * Math_CosS(theta);
|
||||
} else {
|
||||
this->initialPositions[i].y = 2000.0f * Math_SinS(theta);
|
||||
this->initialPositions[i].z = 2000.0f * Math_CosS(theta);
|
||||
}
|
||||
break;
|
||||
|
||||
case EFF_DUST_TYPE_4:
|
||||
this->initialPositions[i].x = (Rand_ZeroOne() * 8500.0f) + 1700.0f;
|
||||
if (this->initialPositions[i].x > 5000.0f) {
|
||||
this->initialPositions[i].y = (4000.0f * Rand_ZeroOne()) * Math_SinS(theta);
|
||||
this->initialPositions[i].z = (4000.0f * Rand_ZeroOne()) * Math_CosS(theta);
|
||||
} else {
|
||||
this->initialPositions[i].y = 4000.0f * Math_SinS(theta);
|
||||
this->initialPositions[i].z = 4000.0f * Math_CosS(theta);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
this->distanceTraveled[i] = 0.0f;
|
||||
this->index += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EffDust_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EffDust* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
|
||||
void EffDust_DrawFunc_8099E4F4(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
EffDust* this = THIS;
|
||||
GlobalContext* globalCtx = globalCtx2;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Vec3f* initialPositions;
|
||||
f32* distanceTraveled;
|
||||
s32 i;
|
||||
f32 aux;
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_eff_dust.c", 425);
|
||||
|
||||
func_80093D18(gfxCtx);
|
||||
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 128, 128, 128, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 0);
|
||||
|
||||
initialPositions = this->initialPositions;
|
||||
distanceTraveled = this->distanceTraveled;
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, D_8099EB60);
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
if (*distanceTraveled < 1.0f) {
|
||||
aux = 1.0f - (*distanceTraveled * *distanceTraveled);
|
||||
Matrix_Translate(this->actor.world.pos.x + (initialPositions->x * ((this->dx * aux) + (1.0f - this->dx))),
|
||||
this->actor.world.pos.y + (initialPositions->y * ((this->dy * aux) + (1.0f - this->dy))),
|
||||
this->actor.world.pos.z + (initialPositions->z * ((this->dz * aux) + (1.0f - this->dz))),
|
||||
MTXMODE_NEW);
|
||||
|
||||
Matrix_Scale(this->scalingFactor, this->scalingFactor, this->scalingFactor, MTXMODE_APPLY);
|
||||
Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_dust.c", 449),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
|
||||
}
|
||||
|
||||
initialPositions++;
|
||||
distanceTraveled++;
|
||||
// Needed for matching.
|
||||
if (0) {}
|
||||
}
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 458);
|
||||
}
|
||||
|
||||
void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EffDust* this = THIS;
|
||||
GlobalContext* globalCtx2;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
f32* distanceTraveled;
|
||||
Vec3f* initialPositions;
|
||||
s32 i;
|
||||
f32 aux;
|
||||
Player* player = PLAYER;
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_eff_dust.c", 472);
|
||||
|
||||
globalCtx2 = globalCtx;
|
||||
|
||||
func_80093D18(gfxCtx);
|
||||
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
|
||||
if (player->unk_858 >= 0.85f) {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
|
||||
} else {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0);
|
||||
}
|
||||
|
||||
initialPositions = this->initialPositions;
|
||||
distanceTraveled = this->distanceTraveled;
|
||||
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, D_8099EB60);
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
if (*distanceTraveled < 1.0f) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, *distanceTraveled * 255);
|
||||
|
||||
// Needed to match.
|
||||
if (!this) {}
|
||||
|
||||
aux = 1.0f - (*distanceTraveled * *distanceTraveled);
|
||||
|
||||
Matrix_Mult(&player->mf_9E0, MTXMODE_NEW);
|
||||
|
||||
Matrix_Translate(initialPositions->x * ((this->dx * aux) + (1.0f - this->dx)),
|
||||
initialPositions->y * (1.0f - *distanceTraveled) + 320.0f,
|
||||
initialPositions->z * (1.0f - *distanceTraveled) + -20.0f, MTXMODE_APPLY);
|
||||
|
||||
Matrix_Scale(*distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor,
|
||||
*distanceTraveled * this->scalingFactor, MTXMODE_APPLY);
|
||||
|
||||
func_800D1FD4(&globalCtx2->mf_11DA0);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_dust.c", 506),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffSparklesDL));
|
||||
}
|
||||
|
||||
initialPositions++;
|
||||
distanceTraveled++;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 515);
|
||||
}
|
||||
|
||||
void EffDust_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EffDust* this = THIS;
|
||||
|
||||
this->drawFunc(thisx, globalCtx);
|
||||
}
|
||||
|
|
|
@ -6,11 +6,31 @@
|
|||
|
||||
struct EffDust;
|
||||
|
||||
typedef void (*EffDustActionFunc)(struct EffDust*, GlobalContext*);
|
||||
typedef void (*EffDustDrawFunc)(Actor*, GlobalContext*);
|
||||
|
||||
typedef struct EffDust {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ char unk_14C[0x41C];
|
||||
/* 0x014C */ f32 distanceTraveled[64]; // For each particle. Normalized. From 0.0f to 1.0f
|
||||
/* 0x024C */ Vec3f initialPositions[64]; // Array of position for each dust particle.
|
||||
/* 0x054C */ u8 index;
|
||||
/* 0x054D */ u8 life; // Only considered if actor.params is 2, 3 or 4.
|
||||
/* 0x0550 */ f32 dx; // Normalized. 0.0f to 1.0f
|
||||
/* 0x0554 */ f32 dy; // Normalized. 0.0f to 1.0f
|
||||
/* 0x0558 */ f32 dz; // Normalized. 0.0f to 1.0f
|
||||
/* 0x055C */ f32 scalingFactor;
|
||||
/* 0x0560 */ EffDustActionFunc actionFunc;
|
||||
/* 0x0564 */ EffDustDrawFunc drawFunc;
|
||||
} EffDust; // size = 0x0568
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ EFF_DUST_TYPE_0,
|
||||
/* 0x01 */ EFF_DUST_TYPE_1,
|
||||
/* 0x02 */ EFF_DUST_TYPE_2,
|
||||
/* 0x03 */ EFF_DUST_TYPE_3,
|
||||
/* 0x04 */ EFF_DUST_TYPE_4
|
||||
} EffDustType;
|
||||
|
||||
extern const ActorInit Eff_Dust_InitVars;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue