diff --git a/include/ac_koinobori.h b/include/ac_koinobori.h index afc6ea3d..68dc9fd4 100644 --- a/include/ac_koinobori.h +++ b/include/ac_koinobori.h @@ -2,7 +2,7 @@ #define AC_KOINOBORI_H #include "types.h" -#include "m_actor.h" +#include "ac_structure.h" #include "c_keyframe.h" #ifdef __cplusplus @@ -11,20 +11,9 @@ extern "C" { extern ACTOR_PROFILE Koinobori_Profile; -typedef void (*KOINOBORI_PROC)(ACTOR*, GAME*); - /* sizeof(KOINOBORI_ACTOR) == 0x2DC */ typedef struct actor_koinobori_s{ - /* 0x000 */ ACTOR actor_class; - /* 0x174 */ int _174; // Unused - /* 0x178 */ cKF_SkeletonInfo_R_c keyframe; - /* 0x1E8 */ int _1E8; // Unused - /* 0x1EC */ s_xyz work[15]; - /* 0x246 */ s_xyz morph[15]; - /* 0x2A0 */ KOINOBORI_PROC action_proc; - /* 0x2A4 */ u8 _2A4[0x2B4 - 0x2A4]; // Unused - /* 0x2B4 */ int action; - /* 0x2B8 */ u8 _2B8[0x2DC - 0x2B8]; // Unused + STRUCTURE_ACTOR structure_class; } KOINOBORI_ACTOR; #ifdef __cplusplus diff --git a/src/ac_koinobori.c b/src/ac_koinobori.c index 0421229f..87be99ff 100644 --- a/src/ac_koinobori.c +++ b/src/ac_koinobori.c @@ -68,14 +68,14 @@ static void aKOI_actor_ct(ACTOR* actor, GAME* game) { actor->cull_height = 830.0f; actor->cull_radius = 480.0f; - cKF_SkeletonInfo_R_ct(&koinobori->keyframe, &cKF_bs_r_obj_e_koinobori, NULL, koinobori->work, koinobori->morph); + cKF_SkeletonInfo_R_ct(&koinobori->structure_class.keyframe, &cKF_bs_r_obj_e_koinobori, NULL, koinobori->structure_class.work_area, koinobori->structure_class.morph_area); aKOI_setup_action(koinobori, aKOI_ACTION_WAIT); - cKF_SkeletonInfo_R_play(&koinobori->keyframe); + cKF_SkeletonInfo_R_play(&koinobori->structure_class.keyframe); } static void aKOI_actor_dt(ACTOR* actor, GAME* game) { KOINOBORI_ACTOR* koinobori = (KOINOBORI_ACTOR*)actor; - cKF_SkeletonInfo_R_dt(&koinobori->keyframe); + cKF_SkeletonInfo_R_dt(&koinobori->structure_class.keyframe); } #include "../src/ac_koinobori_move.c_inc" diff --git a/src/ac_koinobori_draw.c_inc b/src/ac_koinobori_draw.c_inc index eb9fed33..f5cadc94 100644 --- a/src/ac_koinobori_draw.c_inc +++ b/src/ac_koinobori_draw.c_inc @@ -17,7 +17,7 @@ static void aKOI_actor_draw(ACTOR* actor, GAME* game) { koinobori = (KOINOBORI_ACTOR*)actor; graph = game->graph; - keyframe = &koinobori->keyframe; + keyframe = &koinobori->structure_class.keyframe; mtx = GRAPH_ALLOC_TYPE(graph, Mtx, keyframe->skeleton->num_shown_joints); if (mtx != NULL) { diff --git a/src/ac_koinobori_move.c_inc b/src/ac_koinobori_move.c_inc index 3844398c..af381f8b 100644 --- a/src/ac_koinobori_move.c_inc +++ b/src/ac_koinobori_move.c_inc @@ -2,11 +2,11 @@ static void aKOI_wait(ACTOR* actor, GAME* game) { } static void aKOI_setup_action(KOINOBORI_ACTOR* koinobori, int action) { - static KOINOBORI_PROC process[8] = { &aKOI_wait, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; + static aSTR_MOVE_PROC process[8] = { &aKOI_wait, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - cKF_SkeletonInfo_R_init(&koinobori->keyframe, koinobori->keyframe.skeleton, &cKF_ba_r_obj_e_koinobori, 1.0f, 1.0f, 1.0f, 0.5f, 0.0f, TRUE, NULL); - koinobori->action_proc = process[action]; - koinobori->action = action; + cKF_SkeletonInfo_R_init(&koinobori->structure_class.keyframe, koinobori->structure_class.keyframe.skeleton, &cKF_ba_r_obj_e_koinobori, 1.0f, 1.0f, 1.0f, 0.5f, 0.0f, TRUE, NULL); + koinobori->structure_class.action_proc = process[action]; + koinobori->structure_class.action = action; } static void aKOI_actor_move(ACTOR* actor, GAME* game) { @@ -14,8 +14,8 @@ static void aKOI_actor_move(ACTOR* actor, GAME* game) { KOINOBORI_ACTOR* koinobori = (KOINOBORI_ACTOR*)actor; GET_PLAYER_ACTOR(game_play); - cKF_SkeletonInfo_R_play(&koinobori->keyframe); - koinobori->action_proc(actor, game); + cKF_SkeletonInfo_R_play(&koinobori->structure_class.keyframe); + koinobori->structure_class.action_proc(actor, game); sAdo_OngenPos((u32)actor, 0x35, &actor->world.position); }