mirror of
https://github.com/HarbourMasters/2ship2harkinian.git
synced 2025-02-17 12:48:41 +00:00
Effect Firetail OK (#974)
* OK * description * gEffFire1DL * format * PR
This commit is contained in:
parent
db844b8ee8
commit
9f6bacbb88
@ -1343,8 +1343,8 @@
|
||||
<DList Name="gameplay_keep_DL_07D260" Offset="0x7D260" />
|
||||
<DList Name="gameplay_keep_DL_07D348" Offset="0x7D348" />
|
||||
<Texture Name="gameplay_keep_Tex_07D350" OutName="tex_07D350" Format="i8" Width="16" Height="32" Offset="0x7D350" />
|
||||
<DList Name="gGameplayKeepDrawFlameDL" Offset="0x7D590" />
|
||||
<DList Name="gameplay_keep_DL_07D650" Offset="0x7D650" />
|
||||
<DList Name="gEffFire1DL" Offset="0x7D590" />
|
||||
<DList Name="gEffFire2DL" Offset="0x7D650" />
|
||||
<Texture Name="gGameplayKeepFlameRippleTex" OutName="gameplay_keep_flame_ripple" Format="i4" Width="32" Height="64" Offset="0x7D710" />
|
||||
<Texture Name="gameplay_keep_Tex_07DB10" OutName="tex_07DB10" Format="i4" Width="32" Height="64" Offset="0x7DB10" />
|
||||
<Texture Name="gGameplayKeepFlameOutlineTex" OutName="gameplay_keep_flame_outline" Format="i8" Width="32" Height="64" Offset="0x7DF10" />
|
||||
|
3
spec
3
spec
@ -1917,8 +1917,7 @@ beginseg
|
||||
name "ovl_Effect_Ss_Fire_Tail"
|
||||
compress
|
||||
include "build/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.o"
|
||||
include "build/data/ovl_Effect_Ss_Fire_Tail/ovl_Effect_Ss_Fire_Tail.data.o"
|
||||
include "build/data/ovl_Effect_Ss_Fire_Tail/ovl_Effect_Ss_Fire_Tail.reloc.o"
|
||||
include "build/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/ovl_Effect_Ss_Fire_Tail_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
@ -4655,7 +4655,7 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -162,7 +162,8 @@ void FireObj_Draw(PlayState* play, FireObj* fire) {
|
||||
Matrix_Scale(fire->xScale, fire->yScale, 1.0f, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
}
|
||||
|
@ -625,7 +625,7 @@ void Boss06_Draw(Actor* thisx, PlayState* play2) {
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
|
||||
Matrix_Pop();
|
||||
}
|
||||
|
@ -699,7 +699,7 @@ void EnBb_Draw(Actor* thisx, PlayState* play) {
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (play->gameplayFrames * -20) & 0x1FF, 32, 128));
|
||||
currentMatrixState->mf[3][1] -= 47.0f * this->flameScaleY;
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
}
|
||||
|
||||
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos),
|
||||
|
@ -741,7 +741,7 @@ void EnBbfall_Draw(Actor* thisx, PlayState* play2) {
|
||||
currentMatrixState->mf[3][1] = pos->y;
|
||||
currentMatrixState->mf[3][2] = pos->z;
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
|
||||
opacity -= 35;
|
||||
if (opacity < 0) {
|
||||
|
@ -1444,7 +1444,7 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, PlayState* play) {
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, &gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
@ -1471,7 +1471,7 @@ void EnBigpo_RevealedFire(Actor* thisx, PlayState* play) {
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
gSPDisplayList(POLY_XLU_DISP++, &gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
@ -1000,7 +1000,7 @@ void EnDno_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, -frames * 20, 0x20, 0x80));
|
||||
gDPSetPrimColor(&gfxXlu[2], 0x80, 0x80, 255, 255, 0, 255);
|
||||
gDPSetEnvColor(&gfxXlu[3], 255, 0, 0, 0);
|
||||
gSPDisplayList(&gfxXlu[4], gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(&gfxXlu[4], gEffFire1DL);
|
||||
|
||||
POLY_XLU_DISP = gfxXlu + 5;
|
||||
|
||||
|
@ -1099,7 +1099,7 @@ void EnGs_Draw(Actor* thisx, PlayState* play) {
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, -frames * 20, 0x20, 0x80));
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
|
@ -174,7 +174,7 @@ void EnLight_Draw(Actor* thisx, PlayState* play) {
|
||||
gSPSegment(
|
||||
POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, (this->unk_144 * -20) & 0x1FF, 0x20, 0x80));
|
||||
sp68 = gGameplayKeepDrawFlameDL;
|
||||
sp68 = gEffFire1DL;
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, sp6C->unk_00.r, sp6C->unk_00.g, sp6C->unk_00.b, sp6C->unk_00.a);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, sp6C->unk_04.r, sp6C->unk_04.g, sp6C->unk_04.b, 0);
|
||||
} else {
|
||||
|
@ -1252,7 +1252,7 @@ void EnPoSisters_Draw(Actor* thisx, PlayState* play) {
|
||||
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
}
|
||||
|
||||
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos),
|
||||
|
@ -288,8 +288,10 @@ void ObjAqua_Draw(Actor* thisx, PlayState* play) {
|
||||
Matrix_RotateZS(rotation * -1, MTXMODE_APPLY);
|
||||
Matrix_Scale(10.0f / 13.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
Matrix_RotateYS(yaw, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ void ObjChan_DrawFire(ObjChan* this, PlayState* play) {
|
||||
gSPSegment(&dl[1], 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, -sp4C * 20, 32, 128));
|
||||
gDPSetPrimColor(&dl[2], 128, 128, 255, 255, 0, 255);
|
||||
gDPSetEnvColor(&dl[3], 255, 0, 0, 0);
|
||||
gSPDisplayList(&dl[4], &gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(&dl[4], gEffFire1DL);
|
||||
POLY_XLU_DISP = &dl[5];
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
|
@ -204,7 +204,7 @@ void ObjJgameLight_Draw(Actor* thisx, PlayState* play) {
|
||||
MTXMODE_APPLY);
|
||||
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
}
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
@ -315,8 +315,9 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) {
|
||||
Matrix_Translate(0.0f, OBJ_SYOKUDAI_FLAME_HEIGHT, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateYS(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - thisx->shape.rot.y), MTXMODE_APPLY);
|
||||
Matrix_Scale(flameScale, flameScale, flameScale, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
}
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
@ -1,27 +1,142 @@
|
||||
/*
|
||||
* File: z_eff_ss_fire_tail.c
|
||||
* Overlay: ovl_Effect_Ss_Fire_Tail
|
||||
* Description:
|
||||
* Description: Fire (burned by something)
|
||||
*/
|
||||
|
||||
#include "z_eff_ss_fire_tail.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define rScale regs[0]
|
||||
#define rLifespan regs[1]
|
||||
#define rReg2 regs[2]
|
||||
#define rReg3 regs[3]
|
||||
#define rPrimColorR regs[4]
|
||||
#define rPrimColorG regs[5]
|
||||
#define rPrimColorB regs[6]
|
||||
#define rEnvColorR regs[7]
|
||||
#define rEnvColorG regs[8]
|
||||
#define rEnvColorB regs[9]
|
||||
#define rReg10 regs[10]
|
||||
#define rBodyPart regs[11]
|
||||
#define rType regs[12]
|
||||
|
||||
#define PARAMS ((EffectSsFireTailInitParams*)initParamsx)
|
||||
|
||||
s32 EffectSsFireTail_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
|
||||
u32 EffectSsFireTail_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
|
||||
void EffectSsFireTail_Update(PlayState* play, u32 index, EffectSs* this);
|
||||
void EffectSsFireTail_Draw(PlayState* play, u32 index, EffectSs* this);
|
||||
|
||||
#if 0
|
||||
const EffectSsInit Effect_Ss_Fire_Tail_InitVars = {
|
||||
EFFECT_SS_FIRE_TAIL,
|
||||
EffectSsFireTail_Init,
|
||||
};
|
||||
|
||||
#endif
|
||||
u32 EffectSsFireTail_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) {
|
||||
EffectSsFireTailInitParams* initParams = PARAMS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Fire_Tail/EffectSsFireTail_Init.s")
|
||||
this->pos = initParams->pos;
|
||||
this->vec = initParams->unk_14;
|
||||
this->velocity.x = 0.0f;
|
||||
this->velocity.y = 0.0f;
|
||||
this->velocity.z = 0.0f;
|
||||
this->accel.x = 0.0f;
|
||||
this->accel.y = 0.0f;
|
||||
this->accel.z = 0.0f;
|
||||
this->life = initParams->life;
|
||||
this->actor = initParams->actor;
|
||||
this->draw = EffectSsFireTail_Draw;
|
||||
this->update = EffectSsFireTail_Update;
|
||||
this->rScale = initParams->scale * 1000.0f;
|
||||
this->rLifespan = initParams->life;
|
||||
this->rReg2 = -10;
|
||||
this->rReg3 = -15;
|
||||
if (initParams->unk_20 == 0) {
|
||||
initParams->unk_20 = 1;
|
||||
}
|
||||
this->rReg10 = initParams->unk_20;
|
||||
this->rPrimColorR = initParams->primColor.r;
|
||||
this->rPrimColorG = initParams->primColor.g;
|
||||
this->rPrimColorB = initParams->primColor.b;
|
||||
this->rEnvColorR = initParams->envColor.r;
|
||||
this->rEnvColorG = initParams->envColor.g;
|
||||
this->rEnvColorB = initParams->envColor.b;
|
||||
this->rBodyPart = initParams->bodyPart;
|
||||
this->rType = initParams->type;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Fire_Tail/EffectSsFireTail_Draw.s")
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Fire_Tail/EffectSsFireTail_Update.s")
|
||||
void EffectSsFireTail_Draw(PlayState* play, u32 index, EffectSs* this) {
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
s32 pad;
|
||||
s16 yawDiff;
|
||||
Vec3f scale;
|
||||
f32 temp1;
|
||||
f32 temp2;
|
||||
f32 dist;
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
scale.x = scale.y = scale.z = 0.0f;
|
||||
|
||||
if (this->actor != NULL) {
|
||||
this->vec = this->actor->velocity;
|
||||
|
||||
if (this->rBodyPart < 0) {
|
||||
Matrix_Translate(this->pos.x + this->actor->world.pos.x, this->pos.y + this->actor->world.pos.y,
|
||||
this->pos.z + this->actor->world.pos.z, MTXMODE_NEW);
|
||||
} else {
|
||||
Player* player = GET_PLAYER(play);
|
||||
s16 bodyPart = this->rBodyPart;
|
||||
|
||||
this->pos.x =
|
||||
player->bodyPartsPos[bodyPart].x - (Math_SinS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play))) * 5.0f);
|
||||
this->pos.y = player->bodyPartsPos[bodyPart].y;
|
||||
this->pos.z =
|
||||
player->bodyPartsPos[bodyPart].z - (Math_CosS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play))) * 5.0f);
|
||||
|
||||
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
|
||||
}
|
||||
} else {
|
||||
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
|
||||
}
|
||||
|
||||
yawDiff = Math_Vec3f_Yaw(&scale, &this->vec) - Camera_GetCamDirYaw(GET_ACTIVE_CAM(play));
|
||||
temp1 = fabsf(Math_CosS(yawDiff));
|
||||
temp2 = Math_SinS(yawDiff);
|
||||
dist = Math_Vec3f_DistXZ(&scale, &this->vec) / (this->rReg10 * 0.1f);
|
||||
Matrix_RotateYS(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000, MTXMODE_APPLY);
|
||||
Matrix_RotateZF(DEGF_TO_RADF(temp2 * this->rReg2 * dist), MTXMODE_APPLY);
|
||||
temp2 = 1.0f - ((f32)(this->life + 1) / this->rLifespan);
|
||||
temp2 = 1.0f - SQ(temp2);
|
||||
scale.x = scale.y = scale.z = temp2 * (this->rScale * (0.001f * 0.01f));
|
||||
Matrix_Scale(scale.x, scale.y, scale.z, MTXMODE_APPLY);
|
||||
temp1 = (this->rReg3 * 0.01f * temp1 * dist) + 1.0f;
|
||||
|
||||
if (temp1 < 0.1f) {
|
||||
temp1 = 0.1f;
|
||||
}
|
||||
|
||||
Matrix_Scale(1.0f, temp1, 1.0f / temp1, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_8012C2DC(play->state.gfxCtx);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, 0);
|
||||
gSPSegment(
|
||||
POLY_XLU_DISP++, 0x08,
|
||||
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (play->state.frames * -20) & 0x1FF, 32, 128));
|
||||
|
||||
if (this->rType != 0) {
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire2DL);
|
||||
} else {
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
|
||||
void EffectSsFireTail_Update(PlayState* play, u32 index, EffectSs* this) {
|
||||
this->rScale *= 0.9f;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ void EffectSsKFire_Draw(PlayState* play, u32 index, EffectSs* this) {
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user