mirror of https://github.com/zeldaret/mm.git
Effect_Ss_Stick (#464)
* Effect_Ss_Stick OK * fix spec * space between declarations and code * Gfx -> Gfx[], fix spacing * add deku stick to description * add fragment to file description * use autogenned gameplay_keep symbol
This commit is contained in:
parent
70419d6044
commit
1a08089da0
|
@ -1260,7 +1260,7 @@ extern UNK_PTR D_801C02F8;
|
|||
// extern UNK_TYPE1 D_801C07F0;
|
||||
// extern UNK_TYPE1 D_801C0820;
|
||||
// extern UNK_TYPE1 D_801C0838;
|
||||
// extern UNK_TYPE1 D_801C0850;
|
||||
extern Gfx D_801C0850[];
|
||||
// extern UNK_TYPE1 D_801C0860;
|
||||
extern UNK_PTR D_801C0870;
|
||||
// extern UNK_TYPE1 D_801C0890;
|
||||
|
@ -3773,7 +3773,7 @@ extern u16 gFramebuffer0[SCREEN_HEIGHT][SCREEN_WIDTH];
|
|||
// keep objects
|
||||
|
||||
extern Gfx D_040008D0[];
|
||||
extern UNK_TYPE D_040032B0;
|
||||
extern Gfx D_040032B0[];
|
||||
extern UNK_TYPE D_0400CF58;
|
||||
extern UNK_TYPE D_0400CF88;
|
||||
extern UNK_TYPE D_0400CF98;
|
||||
|
|
3
spec
3
spec
|
@ -1948,8 +1948,7 @@ beginseg
|
|||
name "ovl_Effect_Ss_Stick"
|
||||
compress
|
||||
include "build/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.o"
|
||||
include "build/data/ovl_Effect_Ss_Stick/ovl_Effect_Ss_Stick.data.o"
|
||||
include "build/data/ovl_Effect_Ss_Stick/ovl_Effect_Ss_Stick.reloc.o"
|
||||
include "build/src/overlays/effects/ovl_Effect_Ss_Stick/ovl_Effect_Ss_Stick_reloc.o"
|
||||
endseg
|
||||
|
||||
beginseg
|
||||
|
|
|
@ -1,27 +1,57 @@
|
|||
/*
|
||||
* File: z_eff_ss_stick.c
|
||||
* Overlay: ovl_Effect_Ss_Stick
|
||||
* Description:
|
||||
* Description: Breaking Deku Stick Fragment
|
||||
*/
|
||||
|
||||
#include "z_eff_ss_stick.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
|
||||
#define PARAMS ((EffectSsStickInitParams*)initParamsx)
|
||||
|
||||
s32 EffectSsStick_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx);
|
||||
u32 EffectSsStick_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx);
|
||||
void EffectSsStick_Update(GlobalContext* globalCtx, u32 index, EffectSs* this);
|
||||
void EffectSsStick_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this);
|
||||
|
||||
#if 0
|
||||
const EffectSsInit Effect_Ss_Stick_InitVars = {
|
||||
EFFECT_SS_STICK,
|
||||
EffectSsStick_Init,
|
||||
};
|
||||
|
||||
#endif
|
||||
u32 EffectSsStick_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx) {
|
||||
EffectSsStickInitParams* params = PARAMS;
|
||||
Vec3f pos;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Stick/EffectSsStick_Init.s")
|
||||
this->regs[0] = Object_GetIndex(&globalCtx->objectCtx, GAMEPLAY_KEEP);
|
||||
pos = params->pos;
|
||||
this->pos = pos;
|
||||
this->vec = pos;
|
||||
this->regs[1] = params->yaw;
|
||||
this->velocity.x = Math_SinS(params->yaw) * 6.0f;
|
||||
this->velocity.z = Math_CosS(params->yaw) * 6.0f;
|
||||
this->life = 20;
|
||||
this->draw = EffectSsStick_Draw;
|
||||
this->update = EffectSsStick_Update;
|
||||
this->velocity.y = 26.0f;
|
||||
this->accel.y = -4.0f;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Stick/EffectSsStick_Draw.s")
|
||||
void EffectSsStick_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
s32 pad;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Effect_Ss_Stick/EffectSsStick_Update.s")
|
||||
OPEN_DISPS(gfxCtx);
|
||||
Matrix_InsertTranslation(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(0.01f, 0.0025f, 0.01f, MTXMODE_APPLY);
|
||||
Matrix_InsertRotation(0, this->regs[1], 0, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
func_8012C28C(gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->regs[0]].segment);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0C, D_801C0850);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_0032B0);
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
|
||||
void EffectSsStick_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
}
|
||||
|
|
|
@ -8,6 +8,4 @@ typedef struct {
|
|||
/* 0x0C */ s16 yaw;
|
||||
} EffectSsStickInitParams; // size = 0x10
|
||||
|
||||
extern const EffectSsInit Effect_Ss_Stick_InitVars;
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue