Effect Deadds OK (#1018)

* OK

* cleanup

* Fix merge

* Small cleanups
This commit is contained in:
Derek Hensley 2022-09-24 10:15:48 -07:00 committed by GitHub
parent fb4ca3fb17
commit 71e4046415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 107 additions and 12 deletions

View File

@ -1182,7 +1182,7 @@
<Texture Name="gameplay_keep_Tex_053140" OutName="tex_053140" Format="rgba16" Width="32" Height="32" Offset="0x53140" />
<Texture Name="gameplay_keep_Tex_053940" OutName="tex_053940" Format="i4" Width="64" Height="64" Offset="0x53940" />
<Texture Name="gameplay_keep_Tex_054140" OutName="tex_054140" Format="i4" Width="64" Height="64" Offset="0x54140" />
<DList Name="gameplay_keep_DL_054940" Offset="0x54940" />
<DList Name="gLensFlareCircleDL" Offset="0x54940" />
<DList Name="gameplay_keep_DL_0549A8" Offset="0x549A8" />
<DList Name="gEffSparklesDL" Offset="0x54A90" />
<Texture Name="gameplay_keep_Tex_054AF0" OutName="tex_054AF0" Format="i4" Width="16" Height="16" Offset="0x54AF0" />

3
spec
View File

@ -1938,8 +1938,7 @@ beginseg
name "ovl_Effect_Ss_Dead_Ds"
compress
include "build/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.o"
include "build/data/ovl_Effect_Ss_Dead_Ds/ovl_Effect_Ss_Dead_Ds.data.o"
include "build/data/ovl_Effect_Ss_Dead_Ds/ovl_Effect_Ss_Dead_Ds.reloc.o"
include "build/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/ovl_Effect_Ss_Dead_Ds_reloc.o"
endseg
beginseg

View File

@ -116,14 +116,13 @@ void EffectSsDeadDd_Draw(PlayState* play, u32 index, EffectSs* this) {
gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
gDPSetCombineLERP(POLY_XLU_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0,
PRIMITIVE, 0);
gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_054940);
gSPDisplayList(POLY_XLU_DISP++, gLensFlareCircleDL);
}
CLOSE_DISPS(gfxCtx);
}
void EffectSsDeadDd_Update(PlayState* play, u32 index, EffectSs* this) {
this->rScale += this->rScaleStep;
if (this->rScale < 0) {

View File

@ -1,27 +1,124 @@
/*
* File: z_eff_ss_dead_ds.c
* Overlay: ovl_Effect_Ss_Dead_Ds
* Description:
* Description: Burn mark on the floor
*/
#include "z_eff_ss_dead_ds.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#define rScale regs[0]
#define rTimer regs[1]
#define rRoll regs[2]
#define rPitch regs[3]
#define rYaw regs[4]
#define rAlpha regs[5]
#define rScaleStep regs[9]
#define rAlphaStep regs[10]
#define rHalfOfLife regs[11]
#define PARAMS ((EffectSsDeadDsInitParams*)initParamsx)
s32 EffectSsDeadDs_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
u32 EffectSsDeadDs_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
void EffectSsDeadDs_Update(PlayState* play, u32 index, EffectSs* this);
void EffectSsDeadDs_Draw(PlayState* play, u32 index, EffectSs* this);
#if 0
const EffectSsInit Effect_Ss_Dead_Ds_InitVars = {
EFFECT_SS_DEAD_DS,
EffectSsDeadDs_Init,
};
#endif
u32 EffectSsDeadDs_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) {
EffectSsDeadDsInitParams* initParams = PARAMS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Dead_Ds/EffectSsDeadDs_Init.s")
this->pos = initParams->pos;
this->velocity = initParams->velocity;
this->accel = initParams->accel;
this->life = initParams->life;
this->rScaleStep = initParams->scaleStep;
this->rHalfOfLife = initParams->life / 2;
this->rAlphaStep = initParams->alpha / this->rHalfOfLife;
this->draw = EffectSsDeadDs_Draw;
this->update = EffectSsDeadDs_Update;
this->rScale = initParams->scale;
this->rAlpha = initParams->alpha;
this->rTimer = 0;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Dead_Ds/EffectSsDeadDs_Draw.s")
return 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Dead_Ds/EffectSsDeadDs_Update.s")
void EffectSsDeadDs_Draw(PlayState* play, u32 index, EffectSs* this) {
s32 pad;
f32 scale;
s32 pad2[2];
MtxF mf;
f32 yIntersect;
Vec3f pos;
CollisionPoly* floorPoly;
OPEN_DISPS(play->state.gfxCtx);
scale = this->rScale * 0.01f;
func_8012C974(play->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, this->rAlpha);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 0);
pos = this->pos;
if (this->rTimer == 0) {
Vec3s rot;
Vec3f prevPos;
prevPos.x = pos.x - this->velocity.x;
prevPos.y = pos.y - this->velocity.y;
prevPos.z = pos.z - this->velocity.z;
if (BgCheck_EntitySphVsWall1(&play->colCtx, &this->pos, &pos, &prevPos, 1.5f, &floorPoly, 1.0f)) {
func_800C0094(floorPoly, this->pos.x, this->pos.y, this->pos.z, &mf);
Matrix_Put(&mf);
} else {
pos.y++;
yIntersect = BgCheck_EntityRaycastFloor1(&play->colCtx, &floorPoly, &pos);
if (floorPoly != NULL) {
func_800C0094(floorPoly, this->pos.x, yIntersect + 1.5f, this->pos.z, &mf);
Matrix_Put(&mf);
} else {
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_Get(&mf);
}
}
Matrix_MtxFToZYXRot(&mf, &rot, false);
this->rRoll = rot.x;
this->rPitch = rot.y;
this->rYaw = rot.z;
this->pos.y = mf.yw;
this->rTimer++;
}
Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
Matrix_RotateZYX(this->rRoll, this->rPitch, this->rYaw, MTXMODE_APPLY);
Matrix_RotateXFApply(1.57f); // (M_PI / 2)
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);
gDPSetCombineLERP(POLY_XLU_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0,
PRIMITIVE, 0);
gSPDisplayList(POLY_XLU_DISP++, gLensFlareCircleDL);
CLOSE_DISPS(play->state.gfxCtx);
}
void EffectSsDeadDs_Update(PlayState* play, u32 index, EffectSs* this) {
if (this->life < this->rHalfOfLife) {
this->rScale += this->rScaleStep;
if (this->rScale < 0) {
this->rScale = 0;
}
this->rAlpha -= this->rAlphaStep;
if (this->rAlpha < 0) {
this->rAlpha = 0;
}
}
}