mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-02 22:14:33 +00:00
Doc/cleanup pass on effects 1 (#1421)
* Some doc/cleanup on `Effect_Ss_Fhg_Flash` * Some doc/cleanup on `Effect_Ss_Blast` * 11DA0 -> Billboard * doc three lerp funcs in effectss * Some doc/cleanup on `Effect_Ss_Bomb` * `rTexIdx` -> `rTexIndex` * lifespan * `LIFESPAN` -> `EFFSSBOMB_LIFESPAN` * --parentheses * Add todo about "having zapd forward declare static variables" * try rework comments on effects scale * lightning -> "a ball of electrical arcs" ?
This commit is contained in:
parent
4dea0bfb26
commit
d6207b17c2
22 changed files with 292 additions and 294 deletions
|
@ -4161,7 +4161,7 @@ void BossGanon_LightBall_Draw(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
} else if (this->unk_1A8 == 0) {
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
Matrix_RotateZ((this->actor.shape.rot.z / 32768.0f) * 3.1416f, MTXMODE_APPLY);
|
||||
Matrix_RotateZ((this->actor.shape.rot.z / (f32)0x8000) * 3.1416f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_boss_ganon.c", 9907),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGanondorfSquareDL);
|
||||
|
|
|
@ -122,7 +122,7 @@ void EnSsh_SpawnShockwave(EnSsh* this, PlayState* play) {
|
|||
pos.x = this->actor.world.pos.x;
|
||||
pos.y = this->actor.floorHeight;
|
||||
pos.z = this->actor.world.pos.z;
|
||||
EffectSsBlast_SpawnWhiteCustomScale(play, &pos, &zeroVec, &zeroVec, 100, 220, 8);
|
||||
EffectSsBlast_SpawnWhiteShockwaveSetScale(play, &pos, &zeroVec, &zeroVec, 100, 220, 8);
|
||||
}
|
||||
|
||||
s32 EnSsh_CreateBlureEffect(PlayState* play) {
|
||||
|
|
|
@ -161,7 +161,7 @@ void EnSt_SpawnBlastEffect(EnSt* this, PlayState* play) {
|
|||
blastPos.y = this->actor.floorHeight;
|
||||
blastPos.z = this->actor.world.pos.z;
|
||||
|
||||
EffectSsBlast_SpawnWhiteCustomScale(play, &blastPos, &zeroVec, &zeroVec, 100, 220, 8);
|
||||
EffectSsBlast_SpawnWhiteShockwaveSetScale(play, &blastPos, &zeroVec, &zeroVec, 100, 220, 8);
|
||||
}
|
||||
|
||||
void EnSt_SpawnDeadEffect(EnSt* this, PlayState* play) {
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
#include "z_eff_ss_blast.h"
|
||||
#include "assets/objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define rPrimColorR regs[0]
|
||||
#define rPrimColorG regs[1]
|
||||
#define rPrimColorB regs[2]
|
||||
#define rPrimColorA regs[3]
|
||||
#define rEnvColorR regs[4]
|
||||
#define rEnvColorG regs[5]
|
||||
#define rEnvColorB regs[6]
|
||||
#define rEnvColorA regs[7]
|
||||
#define rAlphaTarget regs[8]
|
||||
#define rInnerColorR regs[0]
|
||||
#define rInnerColorG regs[1]
|
||||
#define rInnerColorB regs[2]
|
||||
#define rInnerColorA regs[3]
|
||||
#define rOuterColorR regs[4]
|
||||
#define rOuterColorG regs[5]
|
||||
#define rOuterColorB regs[6]
|
||||
#define rOuterColorA regs[7]
|
||||
#define rAlphaStep regs[8]
|
||||
#define rScale regs[9]
|
||||
#define rScaleStep regs[10]
|
||||
#define rScaleStepDecay regs[11]
|
||||
|
@ -40,15 +40,15 @@ u32 EffectSsBlast_Init(PlayState* play, u32 index, EffectSs* this, void* initPar
|
|||
this->life = initParams->life;
|
||||
this->draw = EffectSsBlast_Draw;
|
||||
this->update = EffectSsBlast_Update;
|
||||
this->rPrimColorR = initParams->primColor.r;
|
||||
this->rPrimColorG = initParams->primColor.g;
|
||||
this->rPrimColorB = initParams->primColor.b;
|
||||
this->rPrimColorA = initParams->primColor.a;
|
||||
this->rEnvColorR = initParams->envColor.r;
|
||||
this->rEnvColorG = initParams->envColor.g;
|
||||
this->rEnvColorB = initParams->envColor.b;
|
||||
this->rEnvColorA = initParams->envColor.a;
|
||||
this->rAlphaTarget = initParams->primColor.a / initParams->life;
|
||||
this->rInnerColorR = initParams->innerColor.r;
|
||||
this->rInnerColorG = initParams->innerColor.g;
|
||||
this->rInnerColorB = initParams->innerColor.b;
|
||||
this->rInnerColorA = initParams->innerColor.a;
|
||||
this->rOuterColorR = initParams->outerColor.r;
|
||||
this->rOuterColorG = initParams->outerColor.g;
|
||||
this->rOuterColorB = initParams->outerColor.b;
|
||||
this->rOuterColorA = initParams->outerColor.a;
|
||||
this->rAlphaStep = initParams->innerColor.a / initParams->life;
|
||||
this->rScale = initParams->scale;
|
||||
this->rScaleStep = initParams->scaleStep;
|
||||
this->rScaleStepDecay = initParams->scaleStepDecay;
|
||||
|
@ -59,18 +59,19 @@ void EffectSsBlast_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
MtxF mf;
|
||||
s32 pad;
|
||||
f32 radius;
|
||||
f32 scale;
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../z_eff_ss_blast.c", 170);
|
||||
|
||||
radius = this->rScale * 0.0025f;
|
||||
scale = this->rScale * (1 / 400.0f);
|
||||
|
||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, this->rEnvColorA);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rOuterColorR, this->rOuterColorG, this->rOuterColorB, this->rOuterColorA);
|
||||
func_800BFCB8(play, &mf, &this->pos);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rInnerColorR, this->rInnerColorG, this->rInnerColorB,
|
||||
this->rInnerColorA);
|
||||
Matrix_Put(&mf);
|
||||
Matrix_Scale(radius, radius, radius, MTXMODE_APPLY);
|
||||
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_ss_blast.c", 199),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
|
||||
|
@ -79,9 +80,9 @@ void EffectSsBlast_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
}
|
||||
|
||||
void EffectSsBlast_Update(PlayState* play, u32 index, EffectSs* this) {
|
||||
Math_StepToS(&this->rPrimColorA, 0, this->rAlphaTarget);
|
||||
this->rScale += this->rScaleStep;
|
||||
Math_StepToS(&this->rInnerColorA, 0, this->rAlphaStep);
|
||||
|
||||
this->rScale += this->rScaleStep;
|
||||
if (this->rScaleStep != 0) {
|
||||
this->rScaleStep -= this->rScaleStepDecay;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ typedef struct {
|
|||
/* 0x00 */ Vec3f pos;
|
||||
/* 0x0C */ Vec3f velocity;
|
||||
/* 0x18 */ Vec3f accel;
|
||||
/* 0x24 */ Color_RGBA8 primColor;
|
||||
/* 0x28 */ Color_RGBA8 envColor;
|
||||
/* 0x24 */ Color_RGBA8 innerColor;
|
||||
/* 0x28 */ Color_RGBA8 outerColor;
|
||||
/* 0x2C */ s16 scale;
|
||||
/* 0x2E */ s16 scaleStep;
|
||||
/* 0x30 */ s16 scaleStepDecay;
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
#include "z_eff_ss_bomb.h"
|
||||
#include "assets/objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define EFFSSBOMB_LIFESPAN 20
|
||||
|
||||
#define rScale regs[0]
|
||||
#define rTexIdx regs[1]
|
||||
#define rTexIndex regs[1]
|
||||
|
||||
u32 EffectSsBomb_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
|
||||
void EffectSsBomb_Draw(PlayState* play, u32 index, EffectSs* this);
|
||||
|
@ -26,31 +28,32 @@ u32 EffectSsBomb_Init(PlayState* play, u32 index, EffectSs* this, void* initPara
|
|||
Math_Vec3f_Copy(&this->velocity, &initParams->velocity);
|
||||
Math_Vec3f_Copy(&this->accel, &initParams->accel);
|
||||
this->gfx = SEGMENTED_TO_VIRTUAL(gEffBombExplosion1DL);
|
||||
this->life = 20;
|
||||
this->life = EFFSSBOMB_LIFESPAN;
|
||||
this->draw = EffectSsBomb_Draw;
|
||||
this->update = EffectSsBomb_Update;
|
||||
this->rScale = 100;
|
||||
this->rTexIdx = 0;
|
||||
this->rTexIndex = 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void* sExplosionTextures[] = {
|
||||
gEffBombExplosion1Tex,
|
||||
gEffBombExplosion2Tex,
|
||||
gEffBombExplosion3Tex,
|
||||
gEffBombExplosion4Tex,
|
||||
};
|
||||
|
||||
void EffectSsBomb_Draw(PlayState* play, u32 index, EffectSs* this) {
|
||||
static void* explosionTextures[] = {
|
||||
gEffBombExplosion1Tex,
|
||||
gEffBombExplosion2Tex,
|
||||
gEffBombExplosion3Tex,
|
||||
gEffBombExplosion4Tex,
|
||||
};
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
MtxF mfResult;
|
||||
MtxF mfTrans11DA0;
|
||||
MtxF mfTransBillboard;
|
||||
Mtx* mtx;
|
||||
s32 pad;
|
||||
f32 scale;
|
||||
s16 color;
|
||||
s16 intensity;
|
||||
|
||||
if (1) {}
|
||||
|
||||
|
@ -60,8 +63,8 @@ void EffectSsBomb_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
|
||||
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
|
@ -69,12 +72,13 @@ void EffectSsBomb_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
|
||||
if (mtx != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(explosionTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sExplosionTextures[this->rTexIndex]));
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
Gfx_SetupDL_61Xlu(gfxCtx);
|
||||
color = this->life * 12.75f;
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, color, color, color, color);
|
||||
intensity = this->life * ((f32)255 / EFFSSBOMB_LIFESPAN);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, intensity, intensity, intensity, intensity);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
//! @bug env color is not set but used in gEffBombExplosion1DL
|
||||
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
}
|
||||
|
@ -83,11 +87,11 @@ void EffectSsBomb_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
}
|
||||
|
||||
void EffectSsBomb_Update(PlayState* play, u32 index, EffectSs* this) {
|
||||
if ((this->life < 21) && (this->life > 16)) {
|
||||
this->rTexIdx = (20 - this->life);
|
||||
if ((this->life <= EFFSSBOMB_LIFESPAN) && (this->life > (EFFSSBOMB_LIFESPAN - ARRAY_COUNT(sExplosionTextures)))) {
|
||||
this->rTexIndex = (EFFSSBOMB_LIFESPAN - this->life);
|
||||
} else {
|
||||
this->rScale += 0;
|
||||
this->rTexIdx = 3;
|
||||
this->rTexIndex = ARRAY_COUNT(sExplosionTextures) - 1;
|
||||
}
|
||||
|
||||
this->accel.x = ((Rand_ZeroOne() * 0.4f) - 0.2f);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "assets/objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define rScale regs[0]
|
||||
#define rTexIdx regs[1]
|
||||
#define rTexIndex regs[1]
|
||||
#define rPrimColorR regs[2]
|
||||
#define rPrimColorG regs[3]
|
||||
#define rPrimColorB regs[4]
|
||||
|
@ -68,7 +68,7 @@ void EffectSsBomb2_DrawFade(PlayState* play, u32 index, EffectSs* this) {
|
|||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
MtxF mfResult;
|
||||
MtxF mfTrans11DA0;
|
||||
MtxF mfTransBillboard;
|
||||
Mtx* mtx;
|
||||
s32 pad;
|
||||
f32 scale;
|
||||
|
@ -78,8 +78,8 @@ void EffectSsBomb2_DrawFade(PlayState* play, u32 index, EffectSs* this) {
|
|||
scale = this->rScale * 0.01f;
|
||||
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
|
||||
|
@ -89,7 +89,7 @@ void EffectSsBomb2_DrawFade(PlayState* play, u32 index, EffectSs* this) {
|
|||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB,
|
||||
this->rPrimColorA);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, 0);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(textures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(textures[this->rTexIndex]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ void EffectSsBomb2_DrawLayered(PlayState* play, u32 index, EffectSs* this) {
|
|||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
MtxF mfResult;
|
||||
MtxF mfTrans11DA0;
|
||||
MtxF mfTransBillboard;
|
||||
MtxF mtx2F;
|
||||
Mtx* mtx2;
|
||||
Mtx* mtx;
|
||||
|
@ -124,8 +124,8 @@ void EffectSsBomb2_DrawLayered(PlayState* play, u32 index, EffectSs* this) {
|
|||
scale = this->rScale * 0.01f;
|
||||
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
|
||||
|
@ -139,7 +139,7 @@ void EffectSsBomb2_DrawLayered(PlayState* play, u32 index, EffectSs* this) {
|
|||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB,
|
||||
this->rPrimColorA);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, 0);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(textures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(textures[this->rTexIndex]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffBombExplosion2DL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffBombExplosion3DL);
|
||||
|
||||
|
@ -167,7 +167,7 @@ void EffectSsBomb2_DrawLayered(PlayState* play, u32 index, EffectSs* this) {
|
|||
void EffectSsBomb2_Update(PlayState* play, u32 index, EffectSs* this) {
|
||||
s32 divisor;
|
||||
|
||||
this->rTexIdx = (23 - this->life) / 3;
|
||||
this->rTexIndex = (23 - this->life) / 3;
|
||||
this->rScale += this->rScaleStep;
|
||||
|
||||
if (this->rScaleStep == 30) {
|
||||
|
@ -178,21 +178,21 @@ void EffectSsBomb2_Update(PlayState* play, u32 index, EffectSs* this) {
|
|||
|
||||
if ((this->life < 23) && (this->life > 13)) {
|
||||
divisor = this->life - 13;
|
||||
this->rPrimColorR = func_80027DD4(this->rPrimColorR, 255, divisor);
|
||||
this->rPrimColorG = func_80027DD4(this->rPrimColorG, 255, divisor);
|
||||
this->rPrimColorB = func_80027DD4(this->rPrimColorB, 150, divisor);
|
||||
this->rPrimColorA = func_80027DD4(this->rPrimColorA, 255, divisor);
|
||||
this->rEnvColorR = func_80027DD4(this->rEnvColorR, 150, divisor);
|
||||
this->rEnvColorG = func_80027DD4(this->rEnvColorG, 0, divisor);
|
||||
this->rEnvColorB = func_80027DD4(this->rEnvColorB, 0, divisor);
|
||||
this->rPrimColorR = EffectSs_LerpInv(this->rPrimColorR, 255, divisor);
|
||||
this->rPrimColorG = EffectSs_LerpInv(this->rPrimColorG, 255, divisor);
|
||||
this->rPrimColorB = EffectSs_LerpInv(this->rPrimColorB, 150, divisor);
|
||||
this->rPrimColorA = EffectSs_LerpInv(this->rPrimColorA, 255, divisor);
|
||||
this->rEnvColorR = EffectSs_LerpInv(this->rEnvColorR, 150, divisor);
|
||||
this->rEnvColorG = EffectSs_LerpInv(this->rEnvColorG, 0, divisor);
|
||||
this->rEnvColorB = EffectSs_LerpInv(this->rEnvColorB, 0, divisor);
|
||||
} else if ((this->life < 14) && (this->life > -1)) {
|
||||
divisor = this->life + 1;
|
||||
this->rPrimColorR = func_80027DD4(this->rPrimColorR, 50, divisor);
|
||||
this->rPrimColorG = func_80027DD4(this->rPrimColorG, 50, divisor);
|
||||
this->rPrimColorB = func_80027DD4(this->rPrimColorB, 50, divisor);
|
||||
this->rPrimColorA = func_80027DD4(this->rPrimColorA, 150, divisor);
|
||||
this->rEnvColorR = func_80027DD4(this->rEnvColorR, 10, divisor);
|
||||
this->rEnvColorG = func_80027DD4(this->rEnvColorG, 10, divisor);
|
||||
this->rEnvColorB = func_80027DD4(this->rEnvColorB, 10, divisor);
|
||||
this->rPrimColorR = EffectSs_LerpInv(this->rPrimColorR, 50, divisor);
|
||||
this->rPrimColorG = EffectSs_LerpInv(this->rPrimColorG, 50, divisor);
|
||||
this->rPrimColorB = EffectSs_LerpInv(this->rPrimColorB, 50, divisor);
|
||||
this->rPrimColorA = EffectSs_LerpInv(this->rPrimColorA, 150, divisor);
|
||||
this->rEnvColorR = EffectSs_LerpInv(this->rEnvColorR, 10, divisor);
|
||||
this->rEnvColorG = EffectSs_LerpInv(this->rEnvColorG, 10, divisor);
|
||||
this->rEnvColorB = EffectSs_LerpInv(this->rEnvColorB, 10, divisor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "assets/objects/object_dodongo/object_dodongo.h"
|
||||
|
||||
#define rScale regs[0]
|
||||
#define rTexIdx regs[1]
|
||||
#define rTexIndex regs[1]
|
||||
#define rPrimColorR regs[2]
|
||||
#define rPrimColorG regs[3]
|
||||
#define rPrimColorB regs[4]
|
||||
|
@ -48,7 +48,7 @@ u32 EffectSsDFire_Init(PlayState* play, u32 index, EffectSs* this, void* initPar
|
|||
this->rObjBankIdx = objBankIndex;
|
||||
this->draw = EffectSsDFire_Draw;
|
||||
this->update = EffectSsDFire_Update;
|
||||
this->rTexIdx = ((s16)(play->state.frames % 4) ^ 3);
|
||||
this->rTexIndex = ((s16)(play->state.frames % 4) ^ 3);
|
||||
this->rPrimColorR = 255;
|
||||
this->rPrimColorG = 255;
|
||||
this->rPrimColorB = 50;
|
||||
|
@ -68,7 +68,7 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
MtxF mfResult;
|
||||
MtxF mfTrans11DA0;
|
||||
MtxF mfTransBillboard;
|
||||
s32 pad;
|
||||
void* object;
|
||||
Mtx* mtx;
|
||||
|
@ -84,8 +84,8 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
scale = this->rScale / 100.0f;
|
||||
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
|
||||
|
@ -96,7 +96,7 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB,
|
||||
this->rPrimColorA);
|
||||
gSegments[6] = VIRTUAL_TO_PHYSICAL(object);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIndex]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
|
||||
}
|
||||
}
|
||||
|
@ -105,8 +105,8 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
}
|
||||
|
||||
void EffectSsDFire_Update(PlayState* play, u32 index, EffectSs* this) {
|
||||
this->rTexIdx++;
|
||||
this->rTexIdx &= 3;
|
||||
this->rTexIndex++;
|
||||
this->rTexIndex &= 3;
|
||||
this->rScale += this->rScaleStep;
|
||||
|
||||
if (this->rFadeDelay >= this->life) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#define rEnvColorG regs[5]
|
||||
#define rEnvColorB regs[6]
|
||||
#define rEnvColorA regs[7]
|
||||
#define rTexIdx regs[8] // this reg is also used to set specific colors in the fire update function
|
||||
#define rTexIndex regs[8] // this reg is also used to set specific colors in the fire update function
|
||||
#define rScale regs[9]
|
||||
#define rScaleStep regs[10]
|
||||
#define rDrawFlags regs[11]
|
||||
|
@ -67,7 +67,7 @@ u32 EffectSsDust_Init(PlayState* play, u32 index, EffectSs* this, void* initPara
|
|||
|
||||
this->rPrimColorA = initParams->primColor.a;
|
||||
this->rEnvColorA = initParams->envColor.a;
|
||||
this->rTexIdx = 0;
|
||||
this->rTexIndex = 0;
|
||||
this->rScale = initParams->scale;
|
||||
this->rScaleStep = initParams->scaleStep;
|
||||
this->rLifespan = initParams->life;
|
||||
|
@ -84,7 +84,7 @@ void EffectSsDust_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
MtxF mfResult;
|
||||
MtxF mfTrans11DA0;
|
||||
MtxF mfTransBillboard;
|
||||
s32 pad;
|
||||
Mtx* mtx;
|
||||
f32 scale;
|
||||
|
@ -94,8 +94,8 @@ void EffectSsDust_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
scale = this->rScale * 0.0025f;
|
||||
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
|
||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
|
@ -103,7 +103,7 @@ void EffectSsDust_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
if (mtx != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTextures[this->rTexIndex]));
|
||||
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_0);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
|
||||
|
@ -134,12 +134,12 @@ void EffectSsDust_Update(PlayState* play, u32 index, EffectSs* this) {
|
|||
|
||||
if ((this->life <= this->rLifespan) && (this->life >= (this->rLifespan - 7))) {
|
||||
if (this->rLifespan >= 5) {
|
||||
this->rTexIdx = this->rLifespan - this->life;
|
||||
this->rTexIndex = this->rLifespan - this->life;
|
||||
} else {
|
||||
this->rTexIdx = ((this->rLifespan - this->life) * (8 / this->rLifespan));
|
||||
this->rTexIndex = (this->rLifespan - this->life) * (8 / this->rLifespan);
|
||||
}
|
||||
} else {
|
||||
this->rTexIdx = 7;
|
||||
this->rTexIndex = 7;
|
||||
}
|
||||
|
||||
this->rScale += this->rScaleStep;
|
||||
|
@ -150,7 +150,7 @@ void EffectSsDust_UpdateFire(PlayState* play, u32 index, EffectSs* this) {
|
|||
this->accel.x = (Rand_ZeroOne() * 0.4f) - 0.2f;
|
||||
this->accel.z = (Rand_ZeroOne() * 0.4f) - 0.2f;
|
||||
|
||||
switch (this->rTexIdx) {
|
||||
switch (this->rTexIndex) {
|
||||
case 0:
|
||||
this->rPrimColorR = 255;
|
||||
this->rPrimColorG = 150;
|
||||
|
@ -181,8 +181,8 @@ void EffectSsDust_UpdateFire(PlayState* play, u32 index, EffectSs* this) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (this->rTexIdx < 7) {
|
||||
this->rTexIdx++;
|
||||
if (this->rTexIndex < 7) {
|
||||
this->rTexIndex++;
|
||||
}
|
||||
|
||||
this->rScale += this->rScaleStep;
|
||||
|
|
|
@ -25,15 +25,16 @@ EffectSsInit Effect_Ss_Fhg_Flash_InitVars = {
|
|||
EffectSsFhgFlash_Init,
|
||||
};
|
||||
|
||||
static UNK_TYPE D_809A5178[258];
|
||||
static Gfx D_809A5100[15];
|
||||
// Should eventually come from assets/overlays/ovl_Effect_Ss_Fhg_Flash/ovl_Effect_Ss_Fhg_Flash.h
|
||||
//! TODO: investigate having ZAPD forward declare static variables
|
||||
static Gfx sShockDL[15];
|
||||
|
||||
u32 EffectSsFhgFlash_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) {
|
||||
EffectSsFhgFlashInitParams* initParams = (EffectSsFhgFlashInitParams*)initParamsx;
|
||||
s32 pad;
|
||||
s32 objBankIdx;
|
||||
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
|
||||
Vec3f sp34 = { 0.0f, -1000.0f, 0.0f };
|
||||
Vec3f farAwayVec = { 0.0f, -1000.0f, 0.0f };
|
||||
uintptr_t oldSeg6;
|
||||
|
||||
if (initParams->type == FHGFLASH_LIGHTBALL) {
|
||||
|
@ -69,17 +70,17 @@ u32 EffectSsFhgFlash_Init(PlayState* play, u32 index, EffectSs* this, void* init
|
|||
this->rParam = initParams->param;
|
||||
|
||||
if (initParams->param != FHGFLASH_SHOCK_NO_ACTOR) {
|
||||
this->pos = sp34;
|
||||
this->gfx = SEGMENTED_TO_VIRTUAL(D_809A5100);
|
||||
this->pos = farAwayVec; // Set the initial position to where the effect cannot be seen
|
||||
this->gfx = SEGMENTED_TO_VIRTUAL(sShockDL);
|
||||
} else {
|
||||
this->pos = initParams->pos;
|
||||
this->gfx = SEGMENTED_TO_VIRTUAL(D_809A5100);
|
||||
this->gfx = SEGMENTED_TO_VIRTUAL(sShockDL);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static Color_RGB8 sColors[] = {
|
||||
static Color_RGB8 sLightBallColors[] = {
|
||||
{ 165, 255, 61 }, { 0, 255, 255 }, { 255, 40, 0 }, { 255, 255, 0 }, { 0, 0, 255 },
|
||||
{ 255, 0, 255 }, { 255, 150, 0 }, { 0, 0, 0 }, { 0, 0, 0 },
|
||||
};
|
||||
|
@ -101,10 +102,11 @@ void EffectSsFhgFlash_DrawLightBall(PlayState* play, u32 index, EffectSs* this)
|
|||
gSPSegment(POLY_XLU_DISP++, 0x06, object);
|
||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, this->rAlpha);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, sColors[this->rParam].r, sColors[this->rParam].g, sColors[this->rParam].b, 0);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, sLightBallColors[this->rParam].r, sLightBallColors[this->rParam].g,
|
||||
sLightBallColors[this->rParam].b, 0);
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
Matrix_RotateZ((this->rXZRot / 32768.0f) * 3.1416f, MTXMODE_APPLY);
|
||||
Matrix_RotateZ((this->rXZRot / (f32)0x8000) * 3.1416f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_fhg_flash.c", 326),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
|
||||
|
@ -126,7 +128,7 @@ void EffectSsFhgFlash_DrawShock(PlayState* play, u32 index, EffectSs* this) {
|
|||
|
||||
if (this->rParam != FHGFLASH_SHOCK_NO_ACTOR) {
|
||||
Gfx_SetupDL_44Xlu(play->state.gfxCtx);
|
||||
Matrix_RotateX((this->rXZRot / 32768.0f) * 1.1416f, MTXMODE_APPLY);
|
||||
Matrix_RotateX((this->rXZRot / (f32)0x8000) * 1.1416f, MTXMODE_APPLY);
|
||||
gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_AA_ZB_XLU_DECAL2);
|
||||
} else {
|
||||
Gfx_SetupDL_25Xlu(play->state.gfxCtx);
|
||||
|
@ -137,7 +139,7 @@ void EffectSsFhgFlash_DrawShock(PlayState* play, u32 index, EffectSs* this) {
|
|||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, this->rAlpha);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 155, 0);
|
||||
Matrix_RotateZ((this->rXZRot / 32768.0f) * 3.1416f, MTXMODE_APPLY);
|
||||
Matrix_RotateZ((this->rXZRot / (f32)0x8000) * 3.1416f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_fhg_flash.c", 395),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
|
||||
|
@ -172,10 +174,10 @@ void EffectSsFhgFlash_UpdateShock(PlayState* play, u32 index, EffectSs* this) {
|
|||
s16 randBodyPart;
|
||||
Player* player;
|
||||
BossGanondrof* phantomGanon;
|
||||
s16 rand;
|
||||
s16 rotStep;
|
||||
|
||||
rand = (Rand_ZeroOne() * 20000.0f);
|
||||
this->rXZRot = (this->rXZRot + rand) + 0x4000;
|
||||
rotStep = Rand_ZeroOne() * 20000.0f;
|
||||
this->rXZRot += rotStep + 0x4000;
|
||||
|
||||
if (this->rParam == FHGFLASH_SHOCK_PLAYER) {
|
||||
player = GET_PLAYER(play);
|
||||
|
@ -201,55 +203,4 @@ void EffectSsFhgFlash_UpdateShock(PlayState* play, u32 index, EffectSs* this) {
|
|||
}
|
||||
}
|
||||
|
||||
static Vtx D_809A50C0[4] = {
|
||||
VTX(-10, -10, 0, 0, 1024, 0xFF, 0xFF, 0xFF, 0xFF),
|
||||
VTX(10, -10, 0, 1024, 1024, 0xFF, 0xFF, 0xFF, 0xFF),
|
||||
VTX(10, 10, 0, 1024, 0, 0xFF, 0xFF, 0xFF, 0xFF),
|
||||
VTX(-10, 10, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF),
|
||||
};
|
||||
|
||||
static Gfx D_809A5100[15] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsDPLoadTextureBlock(D_809A5178, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_MIRROR | G_TX_WRAP,
|
||||
G_TX_MIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD),
|
||||
gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0,
|
||||
COMBINED),
|
||||
gsSPClearGeometryMode(G_CULL_BACK | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR),
|
||||
gsSPVertex(D_809A50C0, 4, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
static UNK_TYPE D_809A5178[258] = {
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x005B3000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x000B0000, 0x07000000, 0x00000000, 0x00000000, 0x005BB64B, 0x3A000000, 0x00000000, 0x00000000,
|
||||
0x005B0000, 0x00000000, 0x00000000, 0x00000000, 0x001E00B6, 0xFF5B0000, 0x00000000, 0x00000000, 0x00251F0C,
|
||||
0x07000000, 0x0A000000, 0x00000000, 0x00000000, 0xB6FF0000, 0x00000000, 0x00000000, 0x00255B00, 0x071F1E14,
|
||||
0x0A000000, 0x00000000, 0x00000000, 0x00457350, 0x00000000, 0x00000000, 0x00295B8C, 0x5B5B0000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00455C39, 0x0F000000, 0x00000000, 0x0000A1FF, 0x5B000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x005B5B00, 0x00000000, 0x00000000, 0x005B311C, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x5BB60000, 0x00000000, 0x00000000, 0x5BB63100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFB60000,
|
||||
0x00000000, 0x00000046, 0xEA310000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0072B646, 0x00000000,
|
||||
0x0000B6A1, 0x81000000, 0x00000000, 0x00000000, 0x00000000, 0x000C0000, 0x00172E19, 0xBDAB5D41, 0x366BEAEA,
|
||||
0x81000000, 0x00000000, 0x00000000, 0x00000000, 0x06000000, 0x00000074, 0xFFFF0500, 0x0A2342B6, 0xFF000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x005B0000, 0x03030100, 0x00FF0700, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00020503, 0x00000000, 0x00466200, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00076200, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00002962, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00003EA1, 0x62000000, 0x00000000, 0x00000000, 0x0000002E, 0xB6350000,
|
||||
0x00000000, 0x00000000, 0x000000EA, 0x46000000, 0x00000000, 0x00000000, 0x00002EFF, 0xFF5A0000, 0x00000000,
|
||||
0x00000000, 0x000000FF, 0xFF001700, 0x00000000, 0x00000000, 0x01015BFF, 0xA1A10000, 0x00000000, 0x00000000,
|
||||
0x00030046, 0x97732100, 0x00000000, 0x00000000, 0x040CB65E, 0x4A5B4600, 0x00000000, 0x00000003, 0x0C0E8C46,
|
||||
0x1C035C00, 0x00000000, 0x00000017, 0x134F5B00, 0x00000046, 0x46000000, 0x00000000, 0x34D20000, 0x0401005B,
|
||||
0x00000000, 0x00000000, 0x5BB60000, 0x00000000, 0x30FCB600, 0x0000A1E7, 0x00000001, 0x0100141E, 0x5B000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x0000A1FF, 0x5B46FF00, 0x00000100, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x000000FC, 0xFFA13100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xB6000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
};
|
||||
#include "assets/overlays/ovl_Effect_Ss_Fhg_Flash/ovl_Effect_Ss_Fhg_Flash.c"
|
||||
|
|
|
@ -32,11 +32,9 @@ typedef enum {
|
|||
} FhgFlashLightBallParam;
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ FHGFLASH_SHOCK_NO_ACTOR,
|
||||
/* 0x01 */ FHGFLASH_SHOCK_PLAYER,
|
||||
/* 0x02 */ FHGFLASH_SHOCK_PG
|
||||
/* 0x00 */ FHGFLASH_SHOCK_NO_ACTOR, // Don't attach to any actor. Stays at a fixed position.
|
||||
/* 0x01 */ FHGFLASH_SHOCK_PLAYER, // Move to a random Player body part every frame.
|
||||
/* 0x02 */ FHGFLASH_SHOCK_PG // Move to a random Phantom Ganon body part every frame.
|
||||
} FhgFlashLightningParam;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#define rEnvColorR regs[3]
|
||||
#define rEnvColorG regs[4]
|
||||
#define rEnvColorA regs[5]
|
||||
#define rTexIdx regs[6]
|
||||
#define rTexIndex regs[6]
|
||||
#define rTimer regs[7]
|
||||
#define rUpdateRate regs[8]
|
||||
#define rDrawMode regs[9]
|
||||
|
@ -54,7 +54,7 @@ u32 EffectSsGMagma2_Init(PlayState* play, u32 index, EffectSs* this, void* initP
|
|||
this->draw = EffectSsGMagma2_Draw;
|
||||
this->update = EffectSsGMagma2_Update;
|
||||
this->gfx = SEGMENTED_TO_VIRTUAL(object_kingdodongo_DL_025A90);
|
||||
this->rTexIdx = 0;
|
||||
this->rTexIndex = 0;
|
||||
this->rDrawMode = initParams->drawMode;
|
||||
this->rUpdateRate = initParams->updateRate;
|
||||
this->rScale = initParams->scale;
|
||||
|
@ -97,7 +97,7 @@ void EffectSsGMagma2_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, 0, this->rPrimColorA);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, 0, this->rEnvColorA);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[this->rTexIndex]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_eff_ss_g_magma2.c", 311);
|
||||
|
@ -108,9 +108,9 @@ void EffectSsGMagma2_Update(PlayState* play, u32 index, EffectSs* this) {
|
|||
|
||||
if (this->rTimer >= 10) {
|
||||
this->rTimer -= 10;
|
||||
this->rTexIdx++;
|
||||
this->rTexIndex++;
|
||||
|
||||
if (this->rTexIdx >= 10) {
|
||||
if (this->rTexIndex >= 10) {
|
||||
this->life = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#define rEnvColorG regs[5]
|
||||
#define rEnvColorB regs[6]
|
||||
#define rEnvColorA regs[7]
|
||||
#define rTexIdx regs[8]
|
||||
#define rTexIndex regs[8]
|
||||
#define rScale regs[9]
|
||||
#define rScaleStep regs[10]
|
||||
|
||||
|
@ -57,7 +57,7 @@ u32 EffectSsGSpk_Init(PlayState* play, u32 index, EffectSs* this, void* initPara
|
|||
this->rEnvColorG = initParams->envColor.g;
|
||||
this->rEnvColorB = initParams->envColor.b;
|
||||
this->rEnvColorA = initParams->envColor.a;
|
||||
this->rTexIdx = 0;
|
||||
this->rTexIndex = 0;
|
||||
this->rScale = initParams->scale;
|
||||
this->rScaleStep = initParams->scaleStep;
|
||||
this->actor = initParams->actor;
|
||||
|
@ -76,7 +76,7 @@ void EffectSsGSpk_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
MtxF mfResult;
|
||||
MtxF mfTrans11DA0;
|
||||
MtxF mfTransBillboard;
|
||||
Mtx* mtx;
|
||||
f32 scale;
|
||||
s32 pad;
|
||||
|
@ -86,14 +86,14 @@ void EffectSsGSpk_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
scale = this->rScale * 0.0025f;
|
||||
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
|
||||
if (mtx != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sparkTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sparkTextures[this->rTexIndex]));
|
||||
Gfx_SetupDL_60NoCDXlu(gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, this->rEnvColorA);
|
||||
|
@ -122,8 +122,8 @@ void EffectSsGSpk_Update(PlayState* play, u32 index, EffectSs* this) {
|
|||
this->vec.x += this->accel.x;
|
||||
this->vec.z += this->accel.z;
|
||||
|
||||
this->rTexIdx++;
|
||||
this->rTexIdx &= 3;
|
||||
this->rTexIndex++;
|
||||
this->rTexIndex &= 3;
|
||||
this->rScale += this->rScaleStep;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ void EffectSsGSpk_UpdateNoAccel(PlayState* play, u32 index, EffectSs* this) {
|
|||
}
|
||||
}
|
||||
|
||||
this->rTexIdx++;
|
||||
this->rTexIdx &= 3;
|
||||
this->rTexIndex++;
|
||||
this->rTexIndex &= 3;
|
||||
this->rScale += this->rScaleStep;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "z_eff_ss_hitmark.h"
|
||||
#include "assets/objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define rTexIdx regs[0]
|
||||
#define rTexIndex regs[0]
|
||||
#define rType regs[1]
|
||||
#define rPrimColorR regs[2]
|
||||
#define rPrimColorG regs[3]
|
||||
|
@ -56,7 +56,7 @@ u32 EffectSsHitMark_Init(PlayState* play, u32 index, EffectSs* this, void* initP
|
|||
this->draw = EffectSsHitMark_Draw;
|
||||
this->update = EffectSsHitMark_Update;
|
||||
colorIdx = initParams->type * 4;
|
||||
this->rTexIdx = 0;
|
||||
this->rTexIndex = 0;
|
||||
this->rType = initParams->type;
|
||||
this->rPrimColorR = sColors[colorIdx].r;
|
||||
this->rPrimColorG = sColors[colorIdx].g;
|
||||
|
@ -74,7 +74,7 @@ void EffectSsHitMark_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
MtxF mfResult;
|
||||
MtxF mfTrans11DA0;
|
||||
MtxF mfTransBillboard;
|
||||
Mtx* mtx;
|
||||
f32 scale;
|
||||
s32 pad;
|
||||
|
@ -84,15 +84,15 @@ void EffectSsHitMark_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
|
||||
scale = this->rScale / 100.0f;
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfScale, &mfResult);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfScale, &mfResult);
|
||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
|
||||
if (mtx != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[(this->rType * 8) + (this->rTexIdx)]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sTextures[(this->rType * 8) + (this->rTexIndex)]));
|
||||
Gfx_SetupDL_61Xlu(gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, 0);
|
||||
|
@ -105,18 +105,18 @@ void EffectSsHitMark_Update(PlayState* play, u32 index, EffectSs* this) {
|
|||
s32 colorIdx;
|
||||
|
||||
if (this->rType == EFFECT_HITMARK_DUST) {
|
||||
this->rTexIdx = (15 - this->life) / 2;
|
||||
this->rTexIndex = (15 - this->life) / 2;
|
||||
} else {
|
||||
this->rTexIdx = 7 - this->life;
|
||||
this->rTexIndex = 7 - this->life;
|
||||
}
|
||||
|
||||
if (this->rTexIdx != 0) {
|
||||
if (this->rTexIndex != 0) {
|
||||
colorIdx = this->rType * 4 + 2;
|
||||
this->rPrimColorR = func_80027DD4(this->rPrimColorR, sColors[colorIdx].r, this->life + 1);
|
||||
this->rPrimColorG = func_80027DD4(this->rPrimColorG, sColors[colorIdx].g, this->life + 1);
|
||||
this->rPrimColorB = func_80027DD4(this->rPrimColorB, sColors[colorIdx].b, this->life + 1);
|
||||
this->rEnvColorR = func_80027DD4(this->rEnvColorR, sColors[colorIdx + 1].r, this->life + 1);
|
||||
this->rEnvColorG = func_80027DD4(this->rEnvColorG, sColors[colorIdx + 1].g, this->life + 1);
|
||||
this->rEnvColorB = func_80027DD4(this->rEnvColorB, sColors[colorIdx + 1].b, this->life + 1);
|
||||
this->rPrimColorR = EffectSs_LerpInv(this->rPrimColorR, sColors[colorIdx].r, this->life + 1);
|
||||
this->rPrimColorG = EffectSs_LerpInv(this->rPrimColorG, sColors[colorIdx].g, this->life + 1);
|
||||
this->rPrimColorB = EffectSs_LerpInv(this->rPrimColorB, sColors[colorIdx].b, this->life + 1);
|
||||
this->rEnvColorR = EffectSs_LerpInv(this->rEnvColorR, sColors[colorIdx + 1].r, this->life + 1);
|
||||
this->rEnvColorG = EffectSs_LerpInv(this->rEnvColorG, sColors[colorIdx + 1].g, this->life + 1);
|
||||
this->rEnvColorB = EffectSs_LerpInv(this->rEnvColorB, sColors[colorIdx + 1].b, this->life + 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,8 +81,8 @@ void EffectSsKiraKira_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
MtxF mfTrans;
|
||||
MtxF mfRotY;
|
||||
MtxF mfScale;
|
||||
MtxF mfTrans11DA0;
|
||||
MtxF mfTrans11DA0RotY;
|
||||
MtxF mfTransBillboard;
|
||||
MtxF mfTransBillboardRotY;
|
||||
MtxF mfResult;
|
||||
Mtx* mtx;
|
||||
|
||||
|
@ -94,9 +94,9 @@ void EffectSsKiraKira_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
|
||||
SkinMatrix_SetRotateZYX(&mfRotY, 0, 0, this->rYaw);
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, 1.0f);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfRotY, &mfTrans11DA0RotY);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0RotY, &mfScale, &mfResult);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfRotY, &mfTransBillboardRotY);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboardRotY, &mfScale, &mfResult);
|
||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
|
|
|
@ -76,8 +76,8 @@ void EffectSsLightning_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
MtxF mfRotate;
|
||||
MtxF mfTrans11DA0;
|
||||
MtxF mfTrans11DA0Rotate;
|
||||
MtxF mfTransBillboard;
|
||||
MtxF mfTransBillboardRotate;
|
||||
Mtx* mtx;
|
||||
f32 yScale;
|
||||
s16 texIdx;
|
||||
|
@ -96,9 +96,9 @@ void EffectSsLightning_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
xzScale = yScale * 0.6f;
|
||||
SkinMatrix_SetScale(&mfScale, xzScale, yScale, xzScale);
|
||||
SkinMatrix_SetRotateZYX(&mfRotate, this->vec.x, this->vec.y, this->rYaw);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTrans11DA0);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0, &mfRotate, &mfTrans11DA0Rotate);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans11DA0Rotate, &mfScale, &mfResult);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &play->billboardMtxF, &mfTransBillboard);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboard, &mfRotate, &mfTransBillboardRotate);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTransBillboardRotate, &mfScale, &mfResult);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#define rEnvColorG regs[5]
|
||||
#define rEnvColorB regs[6]
|
||||
#define rEnvColorA regs[7]
|
||||
#define rTexIdx regs[8]
|
||||
#define rTexIndex regs[8]
|
||||
#define rScale regs[9]
|
||||
|
||||
u32 EffectSsSibuki2_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
|
||||
|
@ -45,7 +45,7 @@ u32 EffectSsSibuki2_Init(PlayState* play, u32 index, EffectSs* this, void* initP
|
|||
this->rEnvColorG = 100;
|
||||
this->rEnvColorB = 100;
|
||||
this->rEnvColorA = 255;
|
||||
this->rTexIdx = 0;
|
||||
this->rTexIndex = 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -68,14 +68,14 @@ void EffectSsSibuki2_Draw(PlayState* play, u32 index, EffectSs* this) {
|
|||
Gfx_SetupDL_25Opa(gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, this->rEnvColorA);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(bubbleTextures[this->rTexIdx]));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(bubbleTextures[this->rTexIndex]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gEffUnusedBubblesDL));
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_eff_ss_sibuki2.c", 198);
|
||||
}
|
||||
|
||||
void EffectSsSibuki2_Update(PlayState* play, u32 index, EffectSs* this) {
|
||||
if (this->rTexIdx < 8) {
|
||||
this->rTexIdx++;
|
||||
if (this->rTexIndex < 8) {
|
||||
this->rTexIndex++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue