Merge pull request #414 from Cuyler36/ef_halloween_smoke_fix

ef_halloween_smoke fix, link ef_pun_sekimen
This commit is contained in:
Cuyler36
2024-08-31 16:21:42 -04:00
committed by GitHub
3 changed files with 83 additions and 51 deletions
+4
View File
@@ -1195,6 +1195,10 @@ ef_pun.c:
.text: [0x8061A650, 0x8061A824]
.rodata: [0x8064CAB8, 0x8064CAC0]
.data: [0x806D33D8, 0x806D33F0]
ef_pun_sekimen.c:
.text: [0x8061A824, 0x8061AA20]
.rodata: [0x8064CAC0, 0x8064CAD8]
.data: [0x806D33F0, 0x806D3408]
ef_tent_lamp.c:
.text: [0x80622304, 0x8062260C]
.rodata: [0x8064CF10, 0x8064CF38]
+47 -47
View File
@@ -2,47 +2,6 @@
#include "m_common_data.h"
static void eHalloween_Smoke_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHalloween_Smoke_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHalloween_Smoke_mv(eEC_Effect_c* effect, GAME* game);
static void eHalloween_Smoke_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_halloween_smoke = {
// clang-format off
&eHalloween_Smoke_init,
&eHalloween_Smoke_ct,
&eHalloween_Smoke_mv,
&eHalloween_Smoke_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eHalloween_Smoke_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_HALLOWEEN_SMOKE, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eHalloween_Smoke_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16 angle = *(s16*)ct_arg;
effect->timer = 18;
(effect->scale).x= (effect->scale).y= (effect->scale).z = 0.01f;
(effect->velocity).y = 0.25f;
(effect->velocity).x = 0.0f * sin_s(angle);
(effect->velocity).z = 0.0f * cos_s(angle);
(effect->acceleration).y = 0.075f;
(effect->acceleration).x = (effect->acceleration).z = 0.0f;
}
static void eHalloween_Smoke_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add (&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add (&effect->position, &effect->velocity, &effect->position);
}
extern Gfx ef_haro01_00_modelT[];
extern u8 ef_dust01_0[];
extern u8 ef_dust01_1[];
@@ -84,20 +43,61 @@ static u8 eHalloween_prim_f[] = {
};
// clang-format on
static void eHalloween_Smoke_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void eHalloween_Smoke_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void eHalloween_Smoke_mv(eEC_Effect_c* effect, GAME* game);
static void eHalloween_Smoke_dw(eEC_Effect_c* effect, GAME* game);
eEC_PROFILE_c iam_ef_halloween_smoke = {
// clang-format off
&eHalloween_Smoke_init,
&eHalloween_Smoke_ct,
&eHalloween_Smoke_mv,
&eHalloween_Smoke_dw,
eEC_IGNORE_DEATH,
eEC_NO_CHILD_ID,
eEC_DEFAULT_DEATH_DIST,
// clang-format on
};
static void eHalloween_Smoke_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
eEC_CLIP->make_effect_proc(eEC_EFFECT_HALLOWEEN_SMOKE, pos, NULL, game, &angle, item_name, prio, arg0, arg1);
}
static void eHalloween_Smoke_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
s16 angle = *(s16*)ct_arg;
effect->timer = 18;
(effect->scale).x = (effect->scale).y = (effect->scale).z = 0.01f;
(effect->velocity).y = 0.25f;
(effect->velocity).x = 0.0f * sin_s(angle);
(effect->velocity).z = 0.0f * cos_s(angle);
(effect->acceleration).y = 0.075f;
(effect->acceleration).x = (effect->acceleration).z = 0.0f;
}
static void eHalloween_Smoke_mv(eEC_Effect_c* effect, GAME* game) {
xyz_t_add(&effect->velocity, &effect->acceleration, &effect->velocity);
xyz_t_add(&effect->position, &effect->velocity, &effect->position);
}
static void eHalloween_Smoke_dw(eEC_Effect_c* effect, GAME* game) {
s16 frame = 18 - effect->timer;
int tex_idx = frame >> 1;
int tile_idx0 = eHalloween_2tile_texture_idx[tex_idx][0];
int tile_idx1 = eHalloween_2tile_texture_idx[tex_idx][1];
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_proc(game, &effect->position, &effect->scale);
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_8, eHalloween_texture_table[tile_idx0]);
gSPSegment(NEXT_POLY_XLU_DISP, G_MWO_SEGMENT_9, eHalloween_texture_table[tile_idx1]);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_1_TXT_SEG, eHalloween_texture_table[tile_idx0]);
gSPSegment(NEXT_POLY_XLU_DISP, ANIME_2_TXT_SEG, eHalloween_texture_table[tile_idx1]);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, eHalloween_prim_f[tex_idx], 200, 0, 255, 120);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_haro01_00_modelT);
CLOSE_DISP(game->graph);
}
+32 -4
View File
@@ -1,5 +1,7 @@
#include "ef_effect_control.h"
#include "m_common_data.h"
static void ePunRed_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1);
static void ePunRed_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg);
static void ePunRed_mv(eEC_Effect_c* effect, GAME* game);
@@ -18,17 +20,43 @@ eEC_PROFILE_c iam_ef_pun_sekimen = {
};
static void ePunRed_init(xyz_t pos, int prio, s16 angle, GAME* game, u16 item_name, s16 arg0, s16 arg1) {
// TODO
xyz_t ofs;
ofs.x = 0.0f;
ofs.y = -2.0f;
ofs.z = 25.0f;
eEC_CLIP->make_effect_proc(eEC_EFFECT_PUN_SEKIMEN, pos, &ofs, game, NULL, item_name, prio, 0, 0);
}
static void ePunRed_ct(eEC_Effect_c* effect, GAME* game, void* ct_arg) {
// TODO
effect->scale.x = 0.0105f;
effect->scale.y = 0.0105f;
effect->scale.z = 0.0105f;
effect->timer = 16;
}
static void ePunRed_mv(eEC_Effect_c* effect, GAME* game) {
// TODO
// nothing
}
extern Gfx ef_pun01_01_modelT[];
static void ePunRed_dw(eEC_Effect_c* effect, GAME* game) {
// TODO
int a;
xyz_t* scale;
s16 now_timer;
scale = &effect->scale;
now_timer = 16 - effect->timer;
a = (u8)eEC_CLIP->calc_adjust_proc(now_timer, 8, 16, 150.0f, 0.0f);
scale->z = scale->y = scale->x = eEC_CLIP->calc_adjust_proc(now_timer, 0, 16, 0.0105f, 0.0189f);
OPEN_DISP(game->graph);
eEC_CLIP->auto_matrix_xlu_offset_proc(game, &effect->position, scale, &effect->offset);
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 255, 255, 0, 0, a);
gSPDisplayList(NEXT_POLY_XLU_DISP, ef_pun01_01_modelT);
CLOSE_DISP(game->graph);
}