Implement & link ef_namida

This commit is contained in:
Norgesnerd
2025-06-14 23:59:16 +02:00
parent d821976bee
commit 5d1f5e2834
2 changed files with 75 additions and 5 deletions
+1 -1
View File
@@ -1297,7 +1297,7 @@ config.libs = [
Object(NonMatching, "effect/ef_motiyuge.c"),
Object(Matching, "effect/ef_muka.c"),
Object(Matching, "effect/ef_naku.c"),
Object(NonMatching, "effect/ef_namida.c"),
Object(Matching, "effect/ef_namida.c"),
Object(Matching, "effect/ef_neboke.c"),
Object(NonMatching, "effect/ef_neboke_akubi.c"),
Object(NonMatching, "effect/ef_neboke_awa.c"),
+74 -4
View File
@@ -1,5 +1,12 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
#include "m_debug.h"
#include "m_rcp.h"
#include "sys_matrix.h"
extern Gfx ef_namida01_modelT[];
static void eNamida_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eNamida_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eNamida_mv(eEC_Effect_c* effect, GAME* game);
@@ -17,18 +24,81 @@ eEC_PROFILE_c iam_ef_namida = {
// clang-format on
};
typedef struct {
s16 angle;
s16 arg0;
} eNamida_dt_c;
static void eNamida_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
xyz_t ofs;
eNamida_dt_c data;
data.angle = angle;
data.arg0 = arg0;
ofs.x = GETREG(MYKREG, 0x18);
ofs.y = GETREG(MYKREG, 0x19);
ofs.z = GETREG(MYKREG, 0x1a) + 10.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_NAMIDA, pos, &ofs, game, &data, item_name, prio, 0, 0);
}
static void eNamida_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
eNamida_dt_c* data = (eNamida_dt_c*)ct_arg;
effect->timer = 30;
effect->effect_specific[0] = data->angle;
effect->effect_specific[1] = data->arg0;
eEC_CLIP->random_first_speed_proc(&effect->velocity, 1.85f, 40.0f, 40.0f);
if (effect->effect_specific[1] == 0) {
sMath_RotateZ(&effect->velocity, DEG2RAD(55.0f));
} else if (effect->effect_specific[1] == 1) {
sMath_RotateZ(&effect->velocity, DEG2RAD(-55.0f));
}
effect->acceleration.x = 0.0f;
effect->acceleration.y = -0.0675f;
effect->acceleration.z = 0.0f;
effect->scale.x = 0.0f;
effect->scale.y = 0.0f;
effect->scale.z = 0.0f;
}
static void eNamida_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
s16 timer = 30 - effect->timer;
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->offset, &effect->velocity, &effect->offset);
if (timer < 20) {
effect->scale.x = eEC_CLIP->calc_adjust_proc(timer, 0, 18, 0.0f, 0.0027f);
} else {
effect->scale.x = eEC_CLIP->calc_adjust_proc(timer, 20, 30, 0.0027f, 0.0f);
}
effect->scale.y = effect->scale.x;
effect->scale.z = effect->scale.x;
}
static void eNamida_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
s16 angle = effect->effect_specific[0];
xyz_t vec = effect->offset;
sMath_RotateY(&vec, SHORT2RAD_ANGLE2(angle));
OPEN_DISP(game->graph);
_texture_z_light_fog_prim_xlu(game->graph);
Matrix_translate(effect->position.x, effect->position.y, effect->position.z, FALSE);
Matrix_translate(vec.x, vec.y, vec.z, TRUE);
Matrix_mult(&((GAME_PLAY*)game)->billboard_matrix, TRUE);
Matrix_scale(effect->scale.x, effect->scale.y, effect->scale.z, TRUE);
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_namida01_modelT);
CLOSE_DISP(game->graph);
}