diff --git a/include/ac_t_pistol.h b/include/ac_t_pistol.h index d69cc92f..28e8b6e6 100644 --- a/include/ac_t_pistol.h +++ b/include/ac_t_pistol.h @@ -2,8 +2,7 @@ #define AC_T_PISTOL_H #include "types.h" -#include "m_actor.h" -#include "libultra/ultratypes.h" +#include "ac_tools.h" #ifdef __cplusplus extern "C" { @@ -12,12 +11,7 @@ extern "C" { typedef void (*PISTOL_PROC)(ACTOR*); typedef struct t_pistol_s{ - ACTOR actor_class; - int unk174; - MtxF matrix_work; - int enable; - int unk1BC; - int process_id; + TOOLS_ACTOR tools_class; u8 pad2[0x8]; PISTOL_PROC proc; int current_id; diff --git a/include/ac_tools.h b/include/ac_tools.h index d68bec87..e29b2a18 100644 --- a/include/ac_tools.h +++ b/include/ac_tools.h @@ -66,10 +66,10 @@ typedef struct tools_s{ int enable; int unk1BC; int process_id; -}ACTOR_TOOLS; +}TOOLS_ACTOR; -typedef ACTOR_TOOLS* (*ToolBirthProc)(ToolName, int, ACTOR_TOOLS*, GAME_PLAY*, s16, int*); -typedef int (*ToolChgRequestModeProc)(ACTOR*, ACTOR_TOOLS*, int); +typedef TOOLS_ACTOR* (*ToolBirthProc)(ToolName, int, TOOLS_ACTOR*, GAME_PLAY*, s16, int*); +typedef int (*ToolChgRequestModeProc)(ACTOR*, TOOLS_ACTOR*, int); typedef struct ToolClip { ToolBirthProc aTOL_birth_proc; diff --git a/rel/ac_t_pistol.c b/rel/ac_t_pistol.c index 5c6287fa..2b31d29f 100644 --- a/rel/ac_t_pistol.c +++ b/rel/ac_t_pistol.c @@ -69,19 +69,19 @@ static void aTPT_setupAction(ACTOR* actor, int idx){ pistol->proc = process[idx]; pistol->current_id = idx; - pistol->process_id = idx; + pistol->tools_class.process_id = idx; scale = start_scale[idx]; - pistol->actor_class.scale.x = scale; - pistol->actor_class.scale.y = scale; - pistol->actor_class.scale.z = scale; + pistol->tools_class.actor_class.scale.x = scale; + pistol->tools_class.actor_class.scale.y = scale; + pistol->tools_class.actor_class.scale.z = scale; } static void aTPT_actor_move(ACTOR* actor, GAME* game){ PISTOL_ACTOR* pistol = (PISTOL_ACTOR*)actor; - int t = pistol->process_id; + int t = pistol->tools_class.process_id; if(t!= pistol->current_id){ aTPT_setupAction(actor, t); } @@ -96,18 +96,18 @@ static void aTPT_actor_draw(ACTOR* actor, GAME* game){ OPEN_DISP(graph); - if(pistol->enable == 1){ - Matrix_put(&pistol->matrix_work); - Matrix_Position_Zero(&pistol->actor_class.world.position); - pistol->enable = 0; + if(pistol->tools_class.enable == 1){ + Matrix_put(&pistol->tools_class.matrix_work); + Matrix_Position_Zero(&pistol->tools_class.actor_class.world.position); + pistol->tools_class.enable = 0; } else{ - Matrix_translate(pistol->actor_class.world.position.x, pistol->actor_class.world.position.y, - pistol->actor_class.world.position.z, FALSE); + Matrix_translate(pistol->tools_class.actor_class.world.position.x, pistol->tools_class.actor_class.world.position.y, + pistol->tools_class.actor_class.world.position.z, FALSE); Matrix_scale(0.01f, 0.01f, 0.01f, TRUE); } - Matrix_scale(pistol->actor_class.scale.x, pistol->actor_class.scale.y, pistol->actor_class.scale.z, TRUE); + Matrix_scale(pistol->tools_class.actor_class.scale.x, pistol->tools_class.actor_class.scale.y, pistol->tools_class.actor_class.scale.z, TRUE); _texture_z_light_fog_prim_npc(graph); gfxp = NOW_POLY_OPA_DISP; diff --git a/rel/ac_tools.c b/rel/ac_tools.c index 55a2775c..fcd38ae2 100644 --- a/rel/ac_tools.c +++ b/rel/ac_tools.c @@ -59,7 +59,7 @@ static void aTOL_check_data_bank(int id, ACTOR* actor){ } } -static ACTOR_TOOLS* aTOL_birth_proc(ToolName name, int id, ACTOR_TOOLS* tool, +static TOOLS_ACTOR* aTOL_birth_proc(ToolName name, int id, TOOLS_ACTOR* tool, GAME_PLAY* play, s16 arg, int* arg5){ static s16 profile_table[] = { mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, mAc_PROFILE_T_UMBRELLA, @@ -78,11 +78,11 @@ static ACTOR_TOOLS* aTOL_birth_proc(ToolName name, int id, ACTOR_TOOLS* tool, mAc_PROFILE_T_ZINNIA1, mAc_PROFILE_T_ZINNIA2, mAc_PROFILE_T_COBRA1, }; - ACTOR_TOOLS* child; + TOOLS_ACTOR* child; aTOL_check_data_bank(name, &tool->actor_class); - child = (ACTOR_TOOLS*)Actor_info_make_child_actor(&play->actor_info, &tool->actor_class, &play->game, + child = (TOOLS_ACTOR*)Actor_info_make_child_actor(&play->actor_info, &tool->actor_class, &play->game, profile_table[name], 0.0f, 0.0f, 0.0f, 0, 0, 0, -1, 0, arg, -1); if(child != NULL){ @@ -97,7 +97,7 @@ static ACTOR_TOOLS* aTOL_birth_proc(ToolName name, int id, ACTOR_TOOLS* tool, } -static int aTOL_chg_request_mode_proc(ACTOR* actor ,ACTOR_TOOLS* tool, int id){ +static int aTOL_chg_request_mode_proc(ACTOR* actor ,TOOLS_ACTOR* tool, int id){ if(actor != tool->actor_class.parent_actor){ return 0;