1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-03 01:54:37 +00:00

format files

Signed-off-by: angie <angheloalf95@gmail.com>
This commit is contained in:
angie 2021-01-23 01:20:46 -03:00
parent 82bba72375
commit 272fc5ca0f
No known key found for this signature in database
GPG key ID: E5212BA1B6FEA700

View file

@ -31,19 +31,9 @@ const ActorInit Eff_Dust_InitVars = {
(ActorFunc)EffDust_Draw,
};
static Gfx *D_8099EB60[] = {
0xDF000000, 0x00000000, 0x00000000, 0x00000000
};
enum DustEffect{
Effect_0 = 0,
Effect_1 = 1,
Effect_2 = 2,
Effect_3 = 3,
Effect_4 = 4
};
static Gfx* D_8099EB60[] = { 0xDF000000, 0x00000000, 0x00000000, 0x00000000 };
enum DustEffect { Effect_0 = 0, Effect_1 = 1, Effect_2 = 2, Effect_3 = 3, Effect_4 = 4 };
void EffDust_setUpdateFunc(EffDust* this, EffDustActionFunc callback_updateFunc) {
this->updateFunc = callback_updateFunc;
@ -53,9 +43,8 @@ void EffDust_setDrawFunc(EffDust* this, EffDustActionFunc callback_drawFunc) {
this->drawFunc = callback_drawFunc;
}
// Members initializer (?)
void EffDust_InitPosAndDistance(EffDust *this) {
void EffDust_InitPosAndDistance(EffDust* this) {
s32 i;
for (i = 0; i < 0x40; i++) {
@ -69,9 +58,8 @@ void EffDust_InitPosAndDistance(EffDust *this) {
this->index = 0;
}
void EffDust_Init(Actor *thisx, GlobalContext *globalCtx) {
EffDust *this = THIS;
void EffDust_Init(Actor* thisx, GlobalContext* globalCtx) {
EffDust* this = THIS;
enum DustEffect dust_effect;
dust_effect = this->actor.params;
@ -121,22 +109,19 @@ void EffDust_Init(Actor *thisx, GlobalContext *globalCtx) {
default:
SystemArena_FreeDebug(this, "../z_eff_dust.c", 202);
break;
}
this->life = 0xA;
}
void EffDust_Destroy(Actor *thisx, GlobalContext *globalCtx) {
void EffDust_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EffDust_UpdateFunc_8099DB28(EffDust *this, GlobalContext *globalCtx) {
void EffDust_UpdateFunc_8099DB28(EffDust* this, GlobalContext* globalCtx) {
s16 theta;
s16 fi;
f32 *distanceTraveled;
f32* distanceTraveled;
s32 i;
s32 j;
@ -153,7 +138,7 @@ void EffDust_UpdateFunc_8099DB28(EffDust *this, GlobalContext *globalCtx) {
}*/
}
for (j = 0; j < 3; j++){
for (j = 0; j < 3; j++) {
i = this->index & 0x3F;
if (this->distanceTraveled[i] >= 1.0f) {
// Spherical coordinate system.
@ -168,12 +153,11 @@ void EffDust_UpdateFunc_8099DB28(EffDust *this, GlobalContext *globalCtx) {
}
}
void EffDust_UpdateFunc_8099DD74(EffDust *this, GlobalContext *globalCtx) {
void EffDust_UpdateFunc_8099DD74(EffDust* this, GlobalContext* globalCtx) {
s16 theta;
s16 fi;
f32 *distanceTraveled;
f32* distanceTraveled;
s32 i;
s32 j;
@ -190,7 +174,7 @@ void EffDust_UpdateFunc_8099DD74(EffDust *this, GlobalContext *globalCtx) {
}*/
}
for (j = 0; j < 2; j++){
for (j = 0; j < 2; j++) {
i = this->index & 0x3F;
if (this->distanceTraveled[i] >= 1.0f) {
// Spherical coordinate system.
@ -205,14 +189,13 @@ void EffDust_UpdateFunc_8099DD74(EffDust *this, GlobalContext *globalCtx) {
}
}
void EffDust_UpdateFunc_8099DFC0(EffDust *this, GlobalContext *globalCtx) {
void EffDust_UpdateFunc_8099DFC0(EffDust* this, GlobalContext* globalCtx) {
s16 theta;
Player *player;
Actor *parent;
Player* player;
Actor* parent;
f32 *distanceTraveled;
f32* distanceTraveled;
s32 i;
s32 j;
@ -222,11 +205,10 @@ void EffDust_UpdateFunc_8099DFC0(EffDust *this, GlobalContext *globalCtx) {
parent = this->actor.parent;
distanceTraveled = this->distanceTraveled;
if(parent == NULL || parent->update == NULL || !(player->stateFlags1 & 0x1000)){
if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & 0x1000)) {
if (this->life != 0) {
this->life -= 1;
}
else {
} else {
Actor_Kill(&this->actor);
}
@ -249,7 +231,7 @@ void EffDust_UpdateFunc_8099DFC0(EffDust *this, GlobalContext *globalCtx) {
this->actor.posRot.pos = parent->posRot.pos;
for(j = 0; j < 3; j++){
for (j = 0; j < 3; j++) {
i = this->index & 0x3F;
if (this->distanceTraveled[i] >= 1.0f) {
@ -298,21 +280,19 @@ void EffDust_UpdateFunc_8099DFC0(EffDust *this, GlobalContext *globalCtx) {
}
}
void EffDust_Update(Actor *thisx, GlobalContext *globalCtx) {
EffDust *this = THIS;
void EffDust_Update(Actor* thisx, GlobalContext* globalCtx) {
EffDust* this = THIS;
this->updateFunc(this, globalCtx);
}
void EffDust_DrawFunc_8099E4F4(EffDust* this, GlobalContext* globalCtx) {
EffDust* this2;
void EffDust_DrawFunc_8099E4F4(EffDust *this, GlobalContext *globalCtx) {
EffDust *this2;
GlobalContext* glb_ctx;
GraphicsContext* gfx_ctx;
GlobalContext *glb_ctx;
GraphicsContext *gfx_ctx;
Vec3f *initialPositions;
f32 *distanceTraveled;
Vec3f* initialPositions;
f32* distanceTraveled;
s32 i;
@ -338,43 +318,47 @@ void EffDust_DrawFunc_8099E4F4(EffDust *this, GlobalContext *globalCtx) {
for (i = 0; i < 0x40; i++) {
if (*distanceTraveled < 1.0f) {
// Needed to match.
if (!this2) { }
if (!this2) {}
aux = 1.0f - (*distanceTraveled * *distanceTraveled);
Matrix_Translate(
this2->actor.posRot.pos.x + (initialPositions->x * ((this2->dx * aux) + (1.0f - this2->dx))),
this2->actor.posRot.pos.y + (initialPositions->y * ((this2->dy * aux) + (1.0f - this2->dy))),
this2->actor.posRot.pos.z + (initialPositions->z * ((this2->dz * aux) + (1.0f - this2->dz))),
MTXMODE_NEW
);
MTXMODE_NEW);
Matrix_Scale(this2->scalingFactor, this2->scalingFactor, this2->scalingFactor, MTXMODE_APPLY);
Matrix_Mult(&glb_ctx->mf_11DA0, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfx_ctx, "../z_eff_dust.c", 449), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfx_ctx, "../z_eff_dust.c", 449),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(D_04037880));
}
initialPositions++;
distanceTraveled++;
// Needed for matching.
if (1) { } { } if (1) { } if (1) { } if (1 != 0) { }
if (1) {}
{}
if (1) {}
if (1) {}
if (1 != 0) {}
}
CLOSE_DISPS(gfx_ctx, "../z_eff_dust.c", 458);
}
void EffDust_DrawFunc_8099E784(EffDust *this, GlobalContext *globalCtx) {
EffDust *this2;
GlobalContext *glb_ctx;
GraphicsContext *gfx_ctx;
void EffDust_DrawFunc_8099E784(EffDust* this, GlobalContext* globalCtx) {
EffDust* this2;
GlobalContext* glb_ctx;
GraphicsContext* gfx_ctx;
f32 *distanceTraveled;
Vec3f *initialPositions;
f32* distanceTraveled;
Vec3f* initialPositions;
s32 i;
f32 aux;
Player *player;
Player* player;
gfx_ctx = globalCtx->state.gfxCtx;
player = PLAYER;
@ -389,8 +373,7 @@ void EffDust_DrawFunc_8099E784(EffDust *this, GlobalContext *globalCtx) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
if (player->unk_858 >= 0.85f) {
gDPSetEnvColor(POLY_XLU_DISP++, 0xFF, 0x00, 0x00, 0x00);
}
else {
} else {
gDPSetEnvColor(POLY_XLU_DISP++, 0x00, 0x00, 0xFF, 0x00);
}
@ -405,24 +388,23 @@ void EffDust_DrawFunc_8099E784(EffDust *this, GlobalContext *globalCtx) {
// Needed to match.
this2 = this;
if (!this2) { }
if (!this2) {}
aux = 1.0f - (*distanceTraveled * *distanceTraveled);
Matrix_Mult(&player->mf_9E0, MTXMODE_NEW);
Matrix_Translate(
initialPositions->x * ((this2->dx * aux) + (1.0f - this2->dx)),
Matrix_Translate(initialPositions->x * ((this2->dx * aux) + (1.0f - this2->dx)),
initialPositions->y * (1.0f - *distanceTraveled) + 320.0f,
initialPositions->z * (1.0f - *distanceTraveled) + -20.0f,
MTXMODE_APPLY
);
initialPositions->z * (1.0f - *distanceTraveled) + -20.0f, MTXMODE_APPLY);
Matrix_Scale(*distanceTraveled * this2->scalingFactor, *distanceTraveled * this2->scalingFactor, *distanceTraveled * this2->scalingFactor, MTXMODE_APPLY);
Matrix_Scale(*distanceTraveled * this2->scalingFactor, *distanceTraveled * this2->scalingFactor,
*distanceTraveled * this2->scalingFactor, MTXMODE_APPLY);
func_800D1FD4(&glb_ctx->mf_11DA0);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfx_ctx, "../z_eff_dust.c", 506), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfx_ctx, "../z_eff_dust.c", 506),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(D_04037880));
}
@ -433,7 +415,7 @@ void EffDust_DrawFunc_8099E784(EffDust *this, GlobalContext *globalCtx) {
CLOSE_DISPS(gfx_ctx, "../z_eff_dust.c", 515);
}
void EffDust_Draw(Actor *thisx, GlobalContext *globalCtx) {
EffDust *this = THIS;
void EffDust_Draw(Actor* thisx, GlobalContext* globalCtx) {
EffDust* this = THIS;
this->drawFunc(this, globalCtx);
}