mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-08 18:42:59 -04:00
Effect Deaddb OK (#1037)
* OK * Add description * format * Fix EffectSsDeadDbInitParams size comment
This commit is contained in:
@@ -1075,17 +1075,17 @@
|
||||
<Texture Name="gEffLightning7Tex" OutName="eff_lightning_7" Format="i4" Width="32" Height="96" Offset="0x3E630" />
|
||||
<Texture Name="gEffLightning8Tex" OutName="eff_lightning_8" Format="i4" Width="32" Height="96" Offset="0x3EC30" />
|
||||
<DList Name="gEffLightningDL" Offset="0x3F230" />
|
||||
<Texture Name="gameplay_keep_Tex_03F300" OutName="tex_03F300" Format="i8" Width="32" Height="64" Offset="0x3F300" />
|
||||
<Texture Name="gameplay_keep_Tex_03FB00" OutName="tex_03FB00" Format="i8" Width="32" Height="64" Offset="0x3FB00" />
|
||||
<Texture Name="gameplay_keep_Tex_040300" OutName="tex_040300" Format="i8" Width="32" Height="64" Offset="0x40300" />
|
||||
<Texture Name="gameplay_keep_Tex_040B00" OutName="tex_040B00" Format="i8" Width="32" Height="64" Offset="0x40B00" />
|
||||
<Texture Name="gameplay_keep_Tex_041300" OutName="tex_041300" Format="i8" Width="32" Height="64" Offset="0x41300" />
|
||||
<Texture Name="gameplay_keep_Tex_041B00" OutName="tex_041B00" Format="i8" Width="32" Height="64" Offset="0x41B00" />
|
||||
<Texture Name="gameplay_keep_Tex_042300" OutName="tex_042300" Format="i8" Width="32" Height="64" Offset="0x42300" />
|
||||
<Texture Name="gameplay_keep_Tex_042B00" OutName="tex_042B00" Format="i8" Width="32" Height="64" Offset="0x42B00" />
|
||||
<Texture Name="gameplay_keep_Tex_043300" OutName="tex_043300" Format="i8" Width="32" Height="64" Offset="0x43300" />
|
||||
<Texture Name="gameplay_keep_Tex_043B00" OutName="tex_043B00" Format="i8" Width="32" Height="64" Offset="0x43B00" />
|
||||
<DList Name="gameplay_keep_DL_044300" Offset="0x44300" />
|
||||
<Texture Name="gEffEnemyDeathFlame1Tex" OutName="eff_enemy_death_flame_1" Format="i8" Width="32" Height="64" Offset="0x3F300" />
|
||||
<Texture Name="gEffEnemyDeathFlame2Tex" OutName="eff_enemy_death_flame_2" Format="i8" Width="32" Height="64" Offset="0x3FB00" />
|
||||
<Texture Name="gEffEnemyDeathFlame3Tex" OutName="eff_enemy_death_flame_3" Format="i8" Width="32" Height="64" Offset="0x40300" />
|
||||
<Texture Name="gEffEnemyDeathFlame4Tex" OutName="eff_enemy_death_flame_4" Format="i8" Width="32" Height="64" Offset="0x40B00" />
|
||||
<Texture Name="gEffEnemyDeathFlame5Tex" OutName="eff_enemy_death_flame_5" Format="i8" Width="32" Height="64" Offset="0x41300" />
|
||||
<Texture Name="gEffEnemyDeathFlame6Tex" OutName="eff_enemy_death_flame_6" Format="i8" Width="32" Height="64" Offset="0x41B00" />
|
||||
<Texture Name="gEffEnemyDeathFlame7Tex" OutName="eff_enemy_death_flame_7" Format="i8" Width="32" Height="64" Offset="0x42300" />
|
||||
<Texture Name="gEffEnemyDeathFlame8Tex" OutName="eff_enemy_death_flame_8" Format="i8" Width="32" Height="64" Offset="0x42B00" />
|
||||
<Texture Name="gEffEnemyDeathFlame9Tex" OutName="eff_enemy_death_flame_9" Format="i8" Width="32" Height="64" Offset="0x43300" />
|
||||
<Texture Name="gEffEnemyDeathFlame10Tex" OutName="eff_enemy_death_flame_10" Format="i8" Width="32" Height="64" Offset="0x43B00" />
|
||||
<DList Name="gEffEnemyDeathFlameDL" Offset="0x44300" />
|
||||
<Texture Name="gameplay_keep_Tex_0443B0" OutName="tex_0443B0" Format="i8" Width="32" Height="32" Offset="0x443B0" />
|
||||
<Texture Name="gameplay_keep_Tex_0447B0" OutName="tex_0447B0" Format="i8" Width="32" Height="32" Offset="0x447B0" />
|
||||
<Texture Name="gameplay_keep_Tex_044BB0" OutName="tex_044BB0" Format="i8" Width="32" Height="32" Offset="0x44BB0" />
|
||||
|
||||
@@ -1923,8 +1923,7 @@ beginseg
|
||||
name "ovl_Effect_Ss_Dead_Db"
|
||||
compress
|
||||
include "build/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.o"
|
||||
include "build/data/ovl_Effect_Ss_Dead_Db/ovl_Effect_Ss_Dead_Db.data.o"
|
||||
include "build/data/ovl_Effect_Ss_Dead_Db/ovl_Effect_Ss_Dead_Db.reloc.o"
|
||||
include "build/src/overlays/effects/ovl_Effect_Ss_Dead_Db/ovl_Effect_Ss_Dead_Db_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
||||
@@ -940,7 +940,7 @@ void EffectSsExtra_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* ac
|
||||
// EffectSsDeadDb Spawn Functions
|
||||
|
||||
void EffectSsDeadDb_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* prim,
|
||||
Color_RGBA8* env, s16 scale, s16 scaleStep, s32 unk) {
|
||||
Color_RGBA8* env, s16 scale, s16 scaleStep, s32 life) {
|
||||
EffectSsDeadDbInitParams initParams;
|
||||
|
||||
Math_Vec3f_Copy(&initParams.pos, pos);
|
||||
@@ -955,7 +955,7 @@ void EffectSsDeadDb_Spawn(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* a
|
||||
initParams.envColor.r = env->r;
|
||||
initParams.envColor.g = env->g;
|
||||
initParams.envColor.b = env->b;
|
||||
initParams.unk_30 = unk;
|
||||
initParams.life = life;
|
||||
|
||||
EffectSs_Spawn(play, EFFECT_SS_DEAD_DB, 120, &initParams);
|
||||
}
|
||||
|
||||
@@ -144,8 +144,8 @@ static DamageTable sDamageTable = {
|
||||
static CollisionCheckInfoInit sColChkInfoInit = { 2, 25, 100, MASS_IMMOVABLE };
|
||||
|
||||
TexturePtr D_808CD58C[] = {
|
||||
gameplay_keep_Tex_03F300, gameplay_keep_Tex_03FB00, gameplay_keep_Tex_040300, gameplay_keep_Tex_040B00,
|
||||
gameplay_keep_Tex_041300, gameplay_keep_Tex_041B00, gameplay_keep_Tex_042300, gameplay_keep_Tex_042B00,
|
||||
gEffEnemyDeathFlame1Tex, gEffEnemyDeathFlame2Tex, gEffEnemyDeathFlame3Tex, gEffEnemyDeathFlame4Tex,
|
||||
gEffEnemyDeathFlame5Tex, gEffEnemyDeathFlame6Tex, gEffEnemyDeathFlame7Tex, gEffEnemyDeathFlame8Tex,
|
||||
};
|
||||
|
||||
static InitChainEntry sInitChain[] = {
|
||||
@@ -532,7 +532,7 @@ void EnVm_Draw(Actor* thisx, PlayState* play) {
|
||||
gDPSetPrimColor(&gfx[3], 0, 0, 255, 255, 255, 168);
|
||||
gDPSetEnvColor(&gfx[4], 0, 0, 255, 0);
|
||||
gSPSegment(&gfx[5], 0x08, D_808CD58C[play->gameplayFrames & 7]);
|
||||
gSPDisplayList(&gfx[6], gameplay_keep_DL_044300);
|
||||
gSPDisplayList(&gfx[6], gEffEnemyDeathFlameDL);
|
||||
|
||||
POLY_XLU_DISP = &gfx[7];
|
||||
}
|
||||
|
||||
@@ -1,27 +1,129 @@
|
||||
/*
|
||||
* File: z_eff_ss_dead_db.c
|
||||
* Overlay: ovl_Effect_Ss_Dead_Db
|
||||
* Description:
|
||||
* Description: Enemy Death Flames
|
||||
*/
|
||||
|
||||
#include "z_eff_ss_dead_db.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define rScale regs[0]
|
||||
#define rTexIndex regs[1]
|
||||
#define rPrimColorR regs[2]
|
||||
#define rPrimColorG regs[3]
|
||||
#define rPrimColorB regs[4]
|
||||
#define rPrimColorA regs[5]
|
||||
#define rEnvColorR regs[6]
|
||||
#define rEnvColorG regs[7]
|
||||
#define rEnvColorB regs[8]
|
||||
#define rScaleStep regs[9]
|
||||
#define rTotalLife regs[11]
|
||||
|
||||
#define PARAMS ((EffectSsDeadDbInitParams*)initParamsx)
|
||||
|
||||
s32 EffectSsDeadDb_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
|
||||
u32 EffectSsDeadDb_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx);
|
||||
void EffectSsDeadDb_Update(PlayState* play, u32 index, EffectSs* this);
|
||||
void EffectSsDeadDb_Draw(PlayState* play, u32 index, EffectSs* this);
|
||||
|
||||
#if 0
|
||||
const EffectSsInit Effect_Ss_Dead_Db_InitVars = {
|
||||
EFFECT_SS_DEAD_DB,
|
||||
EffectSsDeadDb_Init,
|
||||
};
|
||||
|
||||
#endif
|
||||
static TexturePtr sTextures[] = {
|
||||
gEffEnemyDeathFlame1Tex, gEffEnemyDeathFlame2Tex, gEffEnemyDeathFlame3Tex, gEffEnemyDeathFlame4Tex,
|
||||
gEffEnemyDeathFlame5Tex, gEffEnemyDeathFlame6Tex, gEffEnemyDeathFlame7Tex, gEffEnemyDeathFlame8Tex,
|
||||
gEffEnemyDeathFlame9Tex, gEffEnemyDeathFlame10Tex,
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Dead_Db/EffectSsDeadDb_Init.s")
|
||||
u32 EffectSsDeadDb_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) {
|
||||
EffectSsDeadDbInitParams* initParams = PARAMS;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Dead_Db/EffectSsDeadDb_Draw.s")
|
||||
Math_Vec3f_Copy(&this->pos, &initParams->pos);
|
||||
Math_Vec3f_Copy(&this->velocity, &initParams->velocity);
|
||||
Math_Vec3f_Copy(&this->accel, &initParams->accel);
|
||||
this->gfx = gEffEnemyDeathFlameDL;
|
||||
this->life = initParams->life;
|
||||
this->flags = 4;
|
||||
this->rScaleStep = initParams->scaleStep;
|
||||
this->rTotalLife = initParams->life;
|
||||
this->draw = EffectSsDeadDb_Draw;
|
||||
this->update = EffectSsDeadDb_Update;
|
||||
this->rScale = initParams->scale;
|
||||
this->rTexIndex = 0;
|
||||
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;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Dead_Db/EffectSsDeadDb_Update.s")
|
||||
return 1;
|
||||
}
|
||||
|
||||
void EffectSsDeadDb_Draw(PlayState* play, u32 index, EffectSs* this) {
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
MtxF mfTrans;
|
||||
MtxF mfScale;
|
||||
MtxF mfResult;
|
||||
Mtx* mtx;
|
||||
f32 scale;
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
scale = this->rScale * 0.01f;
|
||||
|
||||
SkinMatrix_SetTranslate(&mfTrans, this->pos.x, this->pos.y, this->pos.z);
|
||||
SkinMatrix_SetScale(&mfScale, scale, scale, scale);
|
||||
SkinMatrix_MtxFMtxFMult(&mfTrans, &mfScale, &mfResult);
|
||||
|
||||
mtx = SkinMatrix_MtxFToNewMtx(gfxCtx, &mfResult);
|
||||
|
||||
if (mtx != NULL) {
|
||||
gSPMatrix(POLY_XLU_DISP++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_8012C974(gfxCtx);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, 0);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB,
|
||||
this->rPrimColorA);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sTextures[this->rTexIndex]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, this->gfx);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
|
||||
void EffectSsDeadDb_Update(PlayState* play, u32 index, EffectSs* this) {
|
||||
this->rTexIndex = (f32)((this->rTotalLife - this->life) * 9) / this->rTotalLife;
|
||||
this->rScale += this->rScaleStep;
|
||||
|
||||
this->rPrimColorR -= 10;
|
||||
if (this->rPrimColorR < 0) {
|
||||
this->rPrimColorR = 0;
|
||||
}
|
||||
|
||||
this->rPrimColorG -= 10;
|
||||
if (this->rPrimColorG < 0) {
|
||||
this->rPrimColorG = 0;
|
||||
}
|
||||
|
||||
this->rPrimColorB -= 10;
|
||||
if (this->rPrimColorB < 0) {
|
||||
this->rPrimColorB = 0;
|
||||
}
|
||||
|
||||
this->rEnvColorR -= 10;
|
||||
if (this->rEnvColorR < 0) {
|
||||
this->rEnvColorR = 0;
|
||||
}
|
||||
|
||||
this->rEnvColorG -= 10;
|
||||
if (this->rEnvColorG < 0) {
|
||||
this->rEnvColorG = 0;
|
||||
}
|
||||
|
||||
this->rEnvColorB -= 10;
|
||||
if (this->rEnvColorB < 0) {
|
||||
this->rEnvColorB = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ typedef struct {
|
||||
/* 0x26 */ s16 scaleStep;
|
||||
/* 0x28 */ Color_RGBA8 primColor;
|
||||
/* 0x2C */ Color_RGBA8 envColor;
|
||||
/* 0x30 */ s32 unk_30;
|
||||
} EffectSsDeadDbInitParams; // size = 0x30
|
||||
/* 0x30 */ s32 life;
|
||||
} EffectSsDeadDbInitParams; // size = 0x34
|
||||
|
||||
extern const EffectSsInit Effect_Ss_Dead_Db_InitVars;
|
||||
|
||||
|
||||
@@ -428,7 +428,6 @@ D_040377B0 = 0x040377B0;
|
||||
D_04037850 = 0x04037850;
|
||||
D_0403A0F0 = 0x0403A0F0;
|
||||
D_0403F230 = 0x0403F230;
|
||||
D_04044300 = 0x04044300;
|
||||
D_0404F250 = 0x0404F250;
|
||||
D_04050550 = 0x04050550;
|
||||
D_04050D10 = 0x04050D10;
|
||||
|
||||
Reference in New Issue
Block a user