mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-08-21 13:36:52 -04:00
Change Koinobori to use struct actor
This commit is contained in:
+2
-13
@@ -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
|
||||
|
||||
+3
-3
@@ -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"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user