From 4f903baa6b948f36f0fd970ec51cd45090d6f414 Mon Sep 17 00:00:00 2001 From: Cuyler36 <24523422+Cuyler36@users.noreply.github.com> Date: Sat, 17 Aug 2024 16:59:13 -0400 Subject: [PATCH] Match m_player_draw.c_inc, fix player actor types --- include/m_player.h | 127 ++++++- src/m_player.c | 747 ++++++++++++++++++++-------------------- src/m_player_call.c | 18 +- src/m_player_draw.c_inc | 377 ++++++++++++++++++++ 4 files changed, 885 insertions(+), 384 deletions(-) diff --git a/include/m_player.h b/include/m_player.h index f571a96f..8fe0d25b 100644 --- a/include/m_player.h +++ b/include/m_player.h @@ -28,7 +28,36 @@ typedef struct player_actor_s PLAYER_ACTOR; #define mPlayer_FORCE_POSITION_ANGLE_ROTY (1 << 5) #define mPlayer_FORCE_POSITION_ANGLE_ROTZ (1 << 6) -#define mPlayer_JOINT_NUM 26 +enum { + mPlayer_JOINT_ROOT, + mPlayer_JOINT_BASE, + mPlayer_JOINT_LFOOT_BASE, + mPlayer_JOINT_LFOOT1, + mPlayer_JOINT_LFOOT2, + mPlayer_JOINT_LFOOT3, + mPlayer_JOINT_RFOOT_BASE, + mPlayer_JOINT_RFOOT1, + mPlayer_JOINT_RFOOT2, + mPlayer_JOINT_RFOOT3, + mPlayer_JOINT_TAIL_BASE, + mPlayer_JOINT_TAIL1, + mPlayer_JOINT_TAIL2, + mPlayer_JOINT_CHEST, + mPlayer_JOINT_LARM_BASE, + mPlayer_JOINT_LARM1, + mPlayer_JOINT_LARM2, + mPlayer_JOINT_RARM_BASE, + mPlayer_JOINT_RARM1, + mPlayer_JOINT_RARM2, + mPlayer_JOINT_HAND, + mPlayer_JOINT_HEAD_BASE, + mPlayer_JOINT_MOUTH_BASE, + mPlayer_JOINT_MOUTH, + mPlayer_JOINT_HEAD, + mPlayer_JOINT_FEEL, + + mPlayer_JOINT_NUM +}; enum { mPlayer_ADDRESSABLE_TRUE, @@ -1236,11 +1265,76 @@ typedef struct player_main_return_outdoor2_s { int prev_main_index; } mPlayer_main_return_outdoor2_c; +typedef struct player_main_pickup_s { + xyz_t target_pos; + xyz_t item_pos; + xyz_t item_offset; + f32 scale; + f32 timer; + mActor_name_t item; + int ftr_flag; + int exchange_flag; +} mPlayer_main_pickup_c; + +typedef struct player_main_pickup_jump_s { + xyz_t target_pos; + xyz_t item_pos; + xyz_t item_offset; + f32 scale; + mActor_name_t item; + int exchange_flag; +} mPlayer_main_pickup_jump_c; + +typedef struct player_main_get_scoop_s { + xyz_t target_pos; + mActor_name_t item; + f32 scale; + int success_flag; + f32 timer; + int msg_mode; + int submenu_flag; +} mPlayer_main_get_scoop_c; + +typedef struct player_main_putaway_scoop_s { + xyz_t target_pos; + mActor_name_t item; + f32 scale; + int submenu_flag; +} mPlayer_main_putaway_scoop_c; + +typedef struct player_main_wash_car_s { + int anime_idx; + int change_anime_idx; + int counter; + xyz_t ret_pos; + s16 ret_angle_y; + ACTOR* control_actor; + int ret_order; + int effect_flag; +} mPlayer_main_wash_car_c; + +typedef struct player_main_demo_geton_boat_sitdown_s { + s16 angle_z; +} mPlayer_main_demo_geton_boat_sitdown_c; + +typedef struct player_main_demo_getoff_boat_standup_s { + xyz_t pos; + s16 angle_y; + s16 angle_z; +} mPlayer_main_demo_getoff_boat_standup_c; + typedef union { mPlayer_main_intro_c intro; mPlayer_main_return_demo_c return_demo; mPlayer_main_return_outdoor_c return_outdoor; mPlayer_main_return_outdoor2_c return_outdoor2; + mPlayer_main_pickup_c pickup; + mPlayer_main_pickup_jump_c pickup_jump; + mPlayer_main_get_scoop_c get_scoop; + mPlayer_main_putaway_scoop_c putaway_scoop; + mPlayer_main_wash_car_c wash_car; + mPlayer_main_demo_geton_boat_sitdown_c demo_geton_boat_sitdown; + mPlayer_main_demo_getoff_boat_standup_c demo_getoff_boat_standup; u8 force_size[72]; // TEMP } mPlayer_main_data; @@ -1255,8 +1349,8 @@ struct player_actor_s { /* 0x0000 */ ACTOR actor_class; /* 0x0174 */ cKF_SkeletonInfo_R_c keyframe0; /* 0x01E4 */ cKF_SkeletonInfo_R_c keyframe1; - /* 0x0252 */ s_xyz joint_data[27]; - /* 0x02F4 */ s_xyz morph_data[27]; + /* 0x0252 */ s_xyz joint_data[mPlayer_JOINT_NUM + 1]; + /* 0x02F4 */ s_xyz morph_data[mPlayer_JOINT_NUM + 1]; /* 0x0398 */ Mtx work_mtx[2][13]; /* swapped between frames */ /* 0x0A18 */ cKF_SkeletonInfo_R_c item_keyframe; /* for item animations */ /* 0x0A88 */ s_xyz item_joint_data[8]; @@ -1297,7 +1391,8 @@ struct player_actor_s { /* 0x0E50 */ xyz_t net_bot_col_pos; /* 0x0E5C */ s_xyz net_angle; /* 0x0E64 */ ACTOR* umbrella_actor; - /* 0x0E68 */ u8 _0E68[0x1010 - 0x0E68]; // TODO + /* 0x0E68 */ u8 _0E68[0x1004 - 0x0E68]; // TODO + /* 0x1004 */ xyz_t scoop_pos; /* 0x1010 */ ClObjPipe_c col_pipe; /* 0x102C */ xyz_t head_pos; /* 0x1038 */ xyz_t feel_pos; @@ -1306,9 +1401,29 @@ struct player_actor_s { /* 0x105C */ xyz_t left_hand_pos; /* 0x1068 */ MtxF right_hand_mtx; /* 0x10A8 */ MtxF left_hand_mtx; - /* 0x10E8 */ u8 _10E8[0x1174 - 0x10E8]; // TODO + /* 0x10E8 */ xyz_t right_foot_pos; + /* 0x10F4 */ xyz_t left_foot_pos; + /* 0x1100 */ s_xyz right_foot_angle; + /* 0x1106 */ s_xyz left_foot_angle; + /* 0x110C */ int draw_effect_idx; // subtract 1 for the effect id + /* 0x1110 */ s8 part_table[mPlayer_JOINT_NUM + 1]; + /* 0x112B */ s8 item_kind; + /* 0x112C */ int item_matrix_set; + /* 0x1130 */ xyz_t net_start_pos; + /* 0x113C */ xyz_t net_end_pos; + /* 0x1148 */ xyz_t other_item_start_pos; + /* 0x1154 */ xyz_t other_item_end_pos; + /* 0x1160 */ f32 other_item_move_dist; + /* 0x1164 */ s_xyz windmill_param; + /* 0x116A */ s_xyz windmill_angle; + /* 0x1170 */ int balloon_start_pos_set_flag; /* 0x1174 */ ACTOR* balloon_actor; - /* 0x1178 */ u8 _1178[0x11B4 - 0x1178]; // TODO + /* 0x1178 */ u8 _1178[0x1198 - 0x1178]; // TODO + /* 0x1198 */ s8 _1198; + /* 0x119A */ s_xyz head_angle; + /* 0x11A0 */ xyz_t force_position; + /* 0x11AC */ s_xyz force_angle; + /* 0x11B2 */ u8 force_position_angle_flag; /* 0x11B4 */ f32 shake_tree_timer[3]; /* 0x11C0 */ int shake_tree_ut_x[3]; /* 0x11CC */ int shake_tree_ut_z[3]; diff --git a/src/m_player.c b/src/m_player.c index dacf0daf..05c43db1 100644 --- a/src/m_player.c +++ b/src/m_player.c @@ -4,6 +4,9 @@ #include "m_common_data.h" #include "m_actor_shadow.h" #include "m_bgm.h" +#include "sys_matrix.h" +#include "ac_tools.h" +#include "m_rcp.h" /* Common */ #include "../src/m_player_controller.c_inc" @@ -152,11 +155,11 @@ /* TODO: looks like all the c_inc files are included before the player funcs in this file based on rodata ordering */ -static void Player_actor_ct_forCorect(PLAYER_ACTOR* player, GAME* game); -static void Player_actor_set_eye_pattern(PLAYER_ACTOR* player, int idx); -static void Player_actor_set_mouth_pattern(PLAYER_ACTOR* player, int idx); -static void Player_actor_Set_old_sound_frame_counter(PLAYER_ACTOR* player); -static void Player_actor_change_proc_index(PLAYER_ACTOR* player, GAME* game); +static void Player_actor_ct_forCorect(ACTOR* actorx, GAME* game); +static void Player_actor_set_eye_pattern(ACTOR* actorx, int idx); +static void Player_actor_set_mouth_pattern(ACTOR* actorx, int idx); +static void Player_actor_Set_old_sound_frame_counter(ACTOR* actorx); +static void Player_actor_change_proc_index(ACTOR* actorx, GAME* game); static int Player_actor_request_main_invade_all(GAME*, int); static int Player_actor_request_main_refuse(GAME*, int); @@ -234,7 +237,8 @@ static int Player_actor_request_main_walk_all(GAME*, xyz_t*, f32, int, int); static int Player_actor_request_main_run_all(GAME*, f32, int, int); static int Player_actor_request_main_dash_all(GAME*, f32, int, int); -static void Player_actor_init_value(PLAYER_ACTOR* player, GAME* game) { +static void Player_actor_init_value(ACTOR* actorx, GAME* game) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; GAME_PLAY* play = (GAME_PLAY*)game; int* shake_tree_table_ut_x_p; int* shake_tree_table_ut_z_p; @@ -246,10 +250,9 @@ static void Player_actor_init_value(PLAYER_ACTOR* player, GAME* game) { player->actor_class.scale.x = 0.01f; player->actor_class.scale.y = 0.01f; player->actor_class.scale.z = 0.01f; - player->balloon_actor = - Actor_info_make_actor(&play->actor_info, game, mAc_PROFILE_BALLOON, player->actor_class.world.position.x, - player->actor_class.world.position.y, player->actor_class.world.position.z, 0, 0, 0, -1, - -1, -1, EMPTY_NO, -1, -1, -1); + player->balloon_actor = Actor_info_make_actor(&play->actor_info, game, mAc_PROFILE_BALLOON, + actorx->world.position.x, actorx->world.position.y, + actorx->world.position.z, 0, 0, 0, -1, -1, -1, EMPTY_NO, -1, -1, -1); player->animation0_idx = -1; player->animation1_idx = -1; player->_0DBC = -1; @@ -258,9 +261,9 @@ static void Player_actor_init_value(PLAYER_ACTOR* player, GAME* game) { player->item_shape_type[2] = -1; player->item_shape_type[3] = -1; - Player_actor_ct_forCorect(player, game); - Player_actor_set_eye_pattern(player, 0); - Player_actor_set_mouth_pattern(player, 0); + Player_actor_ct_forCorect(actorx, game); + Player_actor_set_eye_pattern(actorx, 0); + Player_actor_set_mouth_pattern(actorx, 0); player->request_main_invade_all_proc = &Player_actor_request_main_invade_all; player->request_main_refuse_all_proc = &Player_actor_request_main_refuse; @@ -346,38 +349,40 @@ static void Player_actor_init_value(PLAYER_ACTOR* player, GAME* game) { *radio_exercise_command_ring_buffer_p++ = -1; } - Player_actor_Set_old_sound_frame_counter(player); + Player_actor_Set_old_sound_frame_counter(actorx); } -static void Player_actor_ct(PLAYER_ACTOR* player, GAME* game) { +extern void Player_actor_ct(ACTOR* actorx, GAME* game) { GAME_PLAY* play = (GAME_PLAY*)game; if (mEv_CheckTitleDemo() > 0) { - player->actor_class.status_data.weight = 255; + actorx->status_data.weight = 255; } else { - player->actor_class.status_data.weight = 50; + actorx->status_data.weight = 50; } - Player_actor_init_value(player, game); + Player_actor_init_value(actorx, game); Common_Set(player_actor_exists, TRUE); - Player_actor_Check_player_sunburn_for_ct(player); // + Player_actor_Check_player_sunburn_for_ct(actorx); // mPlib_change_player_face(game); // - Player_actor_ct_other_func1(player, game); // - Player_actor_set_eye_PositionAndAngle(player); // + Player_actor_ct_other_func1(actorx, game); // + Player_actor_set_eye_PositionAndAngle(actorx); // Camera2_request_main_normal(play, 1, 1); - Shape_Info_init(&player->actor_class, 0.0f, &mAc_ActorShadowCircle, 18.0f, 18.0f); - player->actor_class.shape_info.ofs_y = 200.0f; + Shape_Info_init(actorx, 0.0f, &mAc_ActorShadowCircle, 18.0f, 18.0f); + actorx->shape_info.ofs_y = 200.0f; mPlib_Clear_change_data_from_submenu(); // Player_actor_request_main_dma(game, 41); // - Player_actor_change_proc_index(player, game); // + Player_actor_change_proc_index(actorx, game); // } -static void Player_actor_dt(PLAYER_ACTOR* player, GAME* game) { - Player_actor_dt_forCorect(player, game); // +extern void Player_actor_dt(ACTOR* actorx, GAME* game) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + + Player_actor_dt_forCorect(actorx, game); // Common_Set(player_actor_exists, FALSE); mPlib_cancel_player_warp_forEvent(); // - Player_actor_Reset_bee_chase(player); // - Player_actor_Check_player_sunburn_for_dt(player); // + Player_actor_Reset_bee_chase(actorx); // + Player_actor_Check_player_sunburn_for_dt(actorx); // if (mEv_CheckTitleDemo() <= 0 && player->bgm_volume_mode != mPlayer_BGM_VOLUME_MODE_NORMAL) { switch (player->bgm_volume_mode) { @@ -391,17 +396,17 @@ static void Player_actor_dt(PLAYER_ACTOR* player, GAME* game) { } } -typedef void (*mPlayer_REQUEST_MAIN_CHANGE_FROM_SUBMENU_PROC)(PLAYER_ACTOR*, GAME*); +typedef void (*mPlayer_REQUEST_MAIN_CHANGE_FROM_SUBMENU_PROC)(ACTOR*, GAME*); -static void Player_actor_request_main_wait_from_submenu(PLAYER_ACTOR*, GAME*); -static void Player_actor_request_main_putin_scoop_from_submenu(PLAYER_ACTOR*, GAME*); -static void Player_actor_request_main_give_from_submenu(PLAYER_ACTOR*, GAME*); -static void Player_actor_request_main_demo_wait_from_submenu(PLAYER_ACTOR*, GAME*); -static void Player_actor_request_main_release_creature_from_submenu(PLAYER_ACTOR*, GAME*); -static void Player_actor_request_main_mail_land_from_submenu(PLAYER_ACTOR*, GAME*); -static void Player_actor_request_main_demo_get_golden_item_from_submenu(PLAYER_ACTOR*, GAME*); +static void Player_actor_request_main_wait_from_submenu(ACTOR*, GAME*); +static void Player_actor_request_main_putin_scoop_from_submenu(ACTOR*, GAME*); +static void Player_actor_request_main_give_from_submenu(ACTOR*, GAME*); +static void Player_actor_request_main_demo_wait_from_submenu(ACTOR*, GAME*); +static void Player_actor_request_main_release_creature_from_submenu(ACTOR*, GAME*); +static void Player_actor_request_main_mail_land_from_submenu(ACTOR*, GAME*); +static void Player_actor_request_main_demo_get_golden_item_from_submenu(ACTOR*, GAME*); -static void Player_actor_request_main_change_from_submenu(PLAYER_ACTOR* player, GAME* game) { +static void Player_actor_request_main_change_from_submenu(ACTOR* actorx, GAME* game) { static const mPlayer_REQUEST_MAIN_CHANGE_FROM_SUBMENU_PROC proc[] = { NULL, NULL, @@ -534,7 +539,7 @@ static void Player_actor_request_main_change_from_submenu(PLAYER_ACTOR* player, return; } - (*proc[idx])(player, game); + (*proc[idx])(actorx, game); } mPlib_Clear_change_data_from_submenu(); @@ -559,70 +564,70 @@ static void Player_actor_request_change_item(GAME* game) { } } -typedef void (*mPlayer_SETTLE_MAIN_PROC)(PLAYER_ACTOR*, GAME*); +typedef void (*mPlayer_SETTLE_MAIN_PROC)(ACTOR*, GAME*); -static void Player_actor_settle_main_Walk(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Turn_dash(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Wade(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Outdoor(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Push(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Pull(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Open_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Wait_open_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Close_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Lie_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Roll_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Standup_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Pickup_jump(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Pickup_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Pickup_exchange(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Sitdown(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Standup(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Reflect_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Broken_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Slip_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Swing_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Notice_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Collect_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Fly_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Notice_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Reflect_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Get_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Talk(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Recieve_putaway(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Give_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Takeout_item(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_geton_train(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_getoff_train(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_wade(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Release_creature(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Wash_car(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Rotate_octagon(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Throw_money(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Pray(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Mail_jump(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Ready_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Fall_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Struggle_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Climbup_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Notice_bee(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Shock(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Knock_door(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Wade_snowball(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Complete_payment(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Fail_emu(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Notice_mosquito(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Switch_on_lighthouse(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Radio_exercise(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_geton_boat(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_geton_boat_wade(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_getoff_boat_standup(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_getoff_boat(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_get_golden_item(PLAYER_ACTOR*, GAME*); -static void Player_actor_settle_main_Demo_get_golden_item2(PLAYER_ACTOR*, GAME*); +static void Player_actor_settle_main_Walk(ACTOR*, GAME*); +static void Player_actor_settle_main_Turn_dash(ACTOR*, GAME*); +static void Player_actor_settle_main_Wade(ACTOR*, GAME*); +static void Player_actor_settle_main_Outdoor(ACTOR*, GAME*); +static void Player_actor_settle_main_Push(ACTOR*, GAME*); +static void Player_actor_settle_main_Pull(ACTOR*, GAME*); +static void Player_actor_settle_main_Open_furniture(ACTOR*, GAME*); +static void Player_actor_settle_main_Wait_open_furniture(ACTOR*, GAME*); +static void Player_actor_settle_main_Close_furniture(ACTOR*, GAME*); +static void Player_actor_settle_main_Lie_bed(ACTOR*, GAME*); +static void Player_actor_settle_main_Roll_bed(ACTOR*, GAME*); +static void Player_actor_settle_main_Standup_bed(ACTOR*, GAME*); +static void Player_actor_settle_main_Pickup_jump(ACTOR*, GAME*); +static void Player_actor_settle_main_Pickup_furniture(ACTOR*, GAME*); +static void Player_actor_settle_main_Pickup_exchange(ACTOR*, GAME*); +static void Player_actor_settle_main_Sitdown(ACTOR*, GAME*); +static void Player_actor_settle_main_Standup(ACTOR*, GAME*); +static void Player_actor_settle_main_Reflect_axe(ACTOR*, GAME*); +static void Player_actor_settle_main_Broken_axe(ACTOR*, GAME*); +static void Player_actor_settle_main_Slip_net(ACTOR*, GAME*); +static void Player_actor_settle_main_Swing_net(ACTOR*, GAME*); +static void Player_actor_settle_main_Notice_net(ACTOR*, GAME*); +static void Player_actor_settle_main_Collect_rod(ACTOR*, GAME*); +static void Player_actor_settle_main_Fly_rod(ACTOR*, GAME*); +static void Player_actor_settle_main_Notice_rod(ACTOR*, GAME*); +static void Player_actor_settle_main_Reflect_scoop(ACTOR*, GAME*); +static void Player_actor_settle_main_Get_scoop(ACTOR*, GAME*); +static void Player_actor_settle_main_Talk(ACTOR*, GAME*); +static void Player_actor_settle_main_Recieve_putaway(ACTOR*, GAME*); +static void Player_actor_settle_main_Give_wait(ACTOR*, GAME*); +static void Player_actor_settle_main_Takeout_item(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_wait(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_geton_train(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_getoff_train(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_wade(ACTOR*, GAME*); +static void Player_actor_settle_main_Release_creature(ACTOR*, GAME*); +static void Player_actor_settle_main_Wash_car(ACTOR*, GAME*); +static void Player_actor_settle_main_Rotate_octagon(ACTOR*, GAME*); +static void Player_actor_settle_main_Throw_money(ACTOR*, GAME*); +static void Player_actor_settle_main_Pray(ACTOR*, GAME*); +static void Player_actor_settle_main_Mail_jump(ACTOR*, GAME*); +static void Player_actor_settle_main_Ready_pitfall(ACTOR*, GAME*); +static void Player_actor_settle_main_Fall_pitfall(ACTOR*, GAME*); +static void Player_actor_settle_main_Struggle_pitfall(ACTOR*, GAME*); +static void Player_actor_settle_main_Climbup_pitfall(ACTOR*, GAME*); +static void Player_actor_settle_main_Notice_bee(ACTOR*, GAME*); +static void Player_actor_settle_main_Shock(ACTOR*, GAME*); +static void Player_actor_settle_main_Knock_door(ACTOR*, GAME*); +static void Player_actor_settle_main_Wade_snowball(ACTOR*, GAME*); +static void Player_actor_settle_main_Complete_payment(ACTOR*, GAME*); +static void Player_actor_settle_main_Fail_emu(ACTOR*, GAME*); +static void Player_actor_settle_main_Notice_mosquito(ACTOR*, GAME*); +static void Player_actor_settle_main_Switch_on_lighthouse(ACTOR*, GAME*); +static void Player_actor_settle_main_Radio_exercise(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_geton_boat(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_geton_boat_wade(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_getoff_boat_standup(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_getoff_boat(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_get_golden_item(ACTOR*, GAME*); +static void Player_actor_settle_main_Demo_get_golden_item2(ACTOR*, GAME*); -static void Player_actor_settle_main(PLAYER_ACTOR* player, GAME* game) { +static void Player_actor_settle_main(ACTOR* actorx, GAME* game) { static const mPlayer_SETTLE_MAIN_PROC proc[] = { NULL, NULL, @@ -747,142 +752,143 @@ static void Player_actor_settle_main(PLAYER_ACTOR* player, GAME* game) { NULL, }; + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; int idx = player->now_main_index; if (mPlayer_MAIN_INDEX_VALID(idx) != FALSE) { if (proc[idx] != NULL) { - (*proc[idx])(player, game); + (*proc[idx])(actorx, game); } - Player_actor_settle_main_other_func2(player, game); // + Player_actor_settle_main_other_func2(actorx, game); // } } -typedef void (*mPlayer_SETUP_MAIN_PROC)(PLAYER_ACTOR*, GAME*); +typedef void (*mPlayer_SETUP_MAIN_PROC)(ACTOR*, GAME*); -static void Player_actor_setup_main_Dma(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Intro(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Refuse(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Refuse_pickup(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Return_demo(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Return_outdoor(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Return_outdoor2(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Walk(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Run(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Dash(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Tumble(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Tumble_getup(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Turn_dash(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Fall(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Wade(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Door(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Outdoor(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Invade(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Hold(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Push(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Pull(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Rotate_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Open_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Wait_open_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Close_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Lie_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Wait_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Roll_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Standup_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Pickup(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Pickup_jump(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Pickup_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Pickup_exchange(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Sitdown(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Sitdown_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Standup(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Swing_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Air_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Reflect_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Broken_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Slip_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Ready_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Ready_walk_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Swing_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Pull_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Stop_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Notice_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Putaway_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Ready_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Cast_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Air_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Relax_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Collect_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Vib_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Fly_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Notice_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Putaway_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Dig_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Fill_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Reflect_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Air_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Get_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Putaway_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Putin_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Talk(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Recieve_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Recieve_stretch(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Recieve(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Recieve_putaway(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Give(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Give_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Takeout_item(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Putin_item(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_walk(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_geton_train(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_geton_train_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_getoff_train(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_standing_train(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_wade(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Hide(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Groundhog(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Release_creature(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Wash_car(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Tired(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Rotate_octagon(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Throw_money(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Pray(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Shake_tree(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Mail_jump(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Mail_land(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Ready_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Fall_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Struggle_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Climbup_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Stung_bee(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Notice_bee(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Remove_grass(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Shock(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Knock_door(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Change_cloth(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Push_snowball(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Rotate_umbrella(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Wade_snowball(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Complete_payment(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Fail_emu(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Stung_mosquito(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Notice_mosquito(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Swing_fan(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Switch_on_lighthouse(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Radio_exercise(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_geton_boat(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_geton_boat_sitdown(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_geton_boat_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_geton_boat_wade(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_getoff_boat_standup(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_getoff_boat(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_get_golden_item(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_get_golden_item2(PLAYER_ACTOR*, GAME*); -static void Player_actor_setup_main_Demo_get_golden_axe_wait(PLAYER_ACTOR*, GAME*); +static void Player_actor_setup_main_Dma(ACTOR*, GAME*); +static void Player_actor_setup_main_Intro(ACTOR*, GAME*); +static void Player_actor_setup_main_Refuse(ACTOR*, GAME*); +static void Player_actor_setup_main_Refuse_pickup(ACTOR*, GAME*); +static void Player_actor_setup_main_Return_demo(ACTOR*, GAME*); +static void Player_actor_setup_main_Return_outdoor(ACTOR*, GAME*); +static void Player_actor_setup_main_Return_outdoor2(ACTOR*, GAME*); +static void Player_actor_setup_main_Wait(ACTOR*, GAME*); +static void Player_actor_setup_main_Walk(ACTOR*, GAME*); +static void Player_actor_setup_main_Run(ACTOR*, GAME*); +static void Player_actor_setup_main_Dash(ACTOR*, GAME*); +static void Player_actor_setup_main_Tumble(ACTOR*, GAME*); +static void Player_actor_setup_main_Tumble_getup(ACTOR*, GAME*); +static void Player_actor_setup_main_Turn_dash(ACTOR*, GAME*); +static void Player_actor_setup_main_Fall(ACTOR*, GAME*); +static void Player_actor_setup_main_Wade(ACTOR*, GAME*); +static void Player_actor_setup_main_Door(ACTOR*, GAME*); +static void Player_actor_setup_main_Outdoor(ACTOR*, GAME*); +static void Player_actor_setup_main_Invade(ACTOR*, GAME*); +static void Player_actor_setup_main_Hold(ACTOR*, GAME*); +static void Player_actor_setup_main_Push(ACTOR*, GAME*); +static void Player_actor_setup_main_Pull(ACTOR*, GAME*); +static void Player_actor_setup_main_Rotate_furniture(ACTOR*, GAME*); +static void Player_actor_setup_main_Open_furniture(ACTOR*, GAME*); +static void Player_actor_setup_main_Wait_open_furniture(ACTOR*, GAME*); +static void Player_actor_setup_main_Close_furniture(ACTOR*, GAME*); +static void Player_actor_setup_main_Lie_bed(ACTOR*, GAME*); +static void Player_actor_setup_main_Wait_bed(ACTOR*, GAME*); +static void Player_actor_setup_main_Roll_bed(ACTOR*, GAME*); +static void Player_actor_setup_main_Standup_bed(ACTOR*, GAME*); +static void Player_actor_setup_main_Pickup(ACTOR*, GAME*); +static void Player_actor_setup_main_Pickup_jump(ACTOR*, GAME*); +static void Player_actor_setup_main_Pickup_furniture(ACTOR*, GAME*); +static void Player_actor_setup_main_Pickup_exchange(ACTOR*, GAME*); +static void Player_actor_setup_main_Sitdown(ACTOR*, GAME*); +static void Player_actor_setup_main_Sitdown_wait(ACTOR*, GAME*); +static void Player_actor_setup_main_Standup(ACTOR*, GAME*); +static void Player_actor_setup_main_Swing_axe(ACTOR*, GAME*); +static void Player_actor_setup_main_Air_axe(ACTOR*, GAME*); +static void Player_actor_setup_main_Reflect_axe(ACTOR*, GAME*); +static void Player_actor_setup_main_Broken_axe(ACTOR*, GAME*); +static void Player_actor_setup_main_Slip_net(ACTOR*, GAME*); +static void Player_actor_setup_main_Ready_net(ACTOR*, GAME*); +static void Player_actor_setup_main_Ready_walk_net(ACTOR*, GAME*); +static void Player_actor_setup_main_Swing_net(ACTOR*, GAME*); +static void Player_actor_setup_main_Pull_net(ACTOR*, GAME*); +static void Player_actor_setup_main_Stop_net(ACTOR*, GAME*); +static void Player_actor_setup_main_Notice_net(ACTOR*, GAME*); +static void Player_actor_setup_main_Putaway_net(ACTOR*, GAME*); +static void Player_actor_setup_main_Ready_rod(ACTOR*, GAME*); +static void Player_actor_setup_main_Cast_rod(ACTOR*, GAME*); +static void Player_actor_setup_main_Air_rod(ACTOR*, GAME*); +static void Player_actor_setup_main_Relax_rod(ACTOR*, GAME*); +static void Player_actor_setup_main_Collect_rod(ACTOR*, GAME*); +static void Player_actor_setup_main_Vib_rod(ACTOR*, GAME*); +static void Player_actor_setup_main_Fly_rod(ACTOR*, GAME*); +static void Player_actor_setup_main_Notice_rod(ACTOR*, GAME*); +static void Player_actor_setup_main_Putaway_rod(ACTOR*, GAME*); +static void Player_actor_setup_main_Dig_scoop(ACTOR*, GAME*); +static void Player_actor_setup_main_Fill_scoop(ACTOR*, GAME*); +static void Player_actor_setup_main_Reflect_scoop(ACTOR*, GAME*); +static void Player_actor_setup_main_Air_scoop(ACTOR*, GAME*); +static void Player_actor_setup_main_Get_scoop(ACTOR*, GAME*); +static void Player_actor_setup_main_Putaway_scoop(ACTOR*, GAME*); +static void Player_actor_setup_main_Putin_scoop(ACTOR*, GAME*); +static void Player_actor_setup_main_Talk(ACTOR*, GAME*); +static void Player_actor_setup_main_Recieve_wait(ACTOR*, GAME*); +static void Player_actor_setup_main_Recieve_stretch(ACTOR*, GAME*); +static void Player_actor_setup_main_Recieve(ACTOR*, GAME*); +static void Player_actor_setup_main_Recieve_putaway(ACTOR*, GAME*); +static void Player_actor_setup_main_Give(ACTOR*, GAME*); +static void Player_actor_setup_main_Give_wait(ACTOR*, GAME*); +static void Player_actor_setup_main_Takeout_item(ACTOR*, GAME*); +static void Player_actor_setup_main_Putin_item(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_wait(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_walk(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_geton_train(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_geton_train_wait(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_getoff_train(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_standing_train(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_wade(ACTOR*, GAME*); +static void Player_actor_setup_main_Hide(ACTOR*, GAME*); +static void Player_actor_setup_main_Groundhog(ACTOR*, GAME*); +static void Player_actor_setup_main_Release_creature(ACTOR*, GAME*); +static void Player_actor_setup_main_Wash_car(ACTOR*, GAME*); +static void Player_actor_setup_main_Tired(ACTOR*, GAME*); +static void Player_actor_setup_main_Rotate_octagon(ACTOR*, GAME*); +static void Player_actor_setup_main_Throw_money(ACTOR*, GAME*); +static void Player_actor_setup_main_Pray(ACTOR*, GAME*); +static void Player_actor_setup_main_Shake_tree(ACTOR*, GAME*); +static void Player_actor_setup_main_Mail_jump(ACTOR*, GAME*); +static void Player_actor_setup_main_Mail_land(ACTOR*, GAME*); +static void Player_actor_setup_main_Ready_pitfall(ACTOR*, GAME*); +static void Player_actor_setup_main_Fall_pitfall(ACTOR*, GAME*); +static void Player_actor_setup_main_Struggle_pitfall(ACTOR*, GAME*); +static void Player_actor_setup_main_Climbup_pitfall(ACTOR*, GAME*); +static void Player_actor_setup_main_Stung_bee(ACTOR*, GAME*); +static void Player_actor_setup_main_Notice_bee(ACTOR*, GAME*); +static void Player_actor_setup_main_Remove_grass(ACTOR*, GAME*); +static void Player_actor_setup_main_Shock(ACTOR*, GAME*); +static void Player_actor_setup_main_Knock_door(ACTOR*, GAME*); +static void Player_actor_setup_main_Change_cloth(ACTOR*, GAME*); +static void Player_actor_setup_main_Push_snowball(ACTOR*, GAME*); +static void Player_actor_setup_main_Rotate_umbrella(ACTOR*, GAME*); +static void Player_actor_setup_main_Wade_snowball(ACTOR*, GAME*); +static void Player_actor_setup_main_Complete_payment(ACTOR*, GAME*); +static void Player_actor_setup_main_Fail_emu(ACTOR*, GAME*); +static void Player_actor_setup_main_Stung_mosquito(ACTOR*, GAME*); +static void Player_actor_setup_main_Notice_mosquito(ACTOR*, GAME*); +static void Player_actor_setup_main_Swing_fan(ACTOR*, GAME*); +static void Player_actor_setup_main_Switch_on_lighthouse(ACTOR*, GAME*); +static void Player_actor_setup_main_Radio_exercise(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_geton_boat(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_geton_boat_sitdown(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_geton_boat_wait(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_geton_boat_wade(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_getoff_boat_standup(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_getoff_boat(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_get_golden_item(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_get_golden_item2(ACTOR*, GAME*); +static void Player_actor_setup_main_Demo_get_golden_axe_wait(ACTOR*, GAME*); -static int Player_actor_change_main_index(PLAYER_ACTOR* player, GAME* game) { +static int Player_actor_change_main_index(ACTOR* actorx, GAME* game) { static const mPlayer_SETUP_MAIN_PROC proc[] = { &Player_actor_setup_main_Dma, &Player_actor_setup_main_Intro, @@ -1006,6 +1012,7 @@ static int Player_actor_change_main_index(PLAYER_ACTOR* player, GAME* game) { &Player_actor_setup_main_Demo_get_golden_item2, &Player_actor_setup_main_Demo_get_golden_axe_wait, }; + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; if (player->requested_main_index_changed) { int idx = player->requested_main_index; @@ -1014,151 +1021,153 @@ static int Player_actor_change_main_index(PLAYER_ACTOR* player, GAME* game) { return FALSE; } - idx = Player_actor_CheckAndRequest_KnockDoor(player, game, - Player_actor_CheckAndRequest_ItemInOut(player, game, idx)); // - Player_actor_Set_bgm_volume(player, idx); // - Player_actor_settle_main(player, game); - Player_actor_Reset_unable_hand_item_in_demo(player, idx); // - Player_actor_Reset_able_hand_all_item_in_demo(player, idx); // - Player_actor_Reset_able_force_speak_label(player, idx); // - Player_actor_change_main_index_other_func1(player, game); // - (*proc[idx])(player, game); - Player_actor_change_main_index_other_func2(player, game); // + idx = Player_actor_CheckAndRequest_KnockDoor(actorx, game, + Player_actor_CheckAndRequest_ItemInOut(actorx, game, idx)); // + Player_actor_Set_bgm_volume(actorx, idx); // + Player_actor_settle_main(actorx, game); + Player_actor_Reset_unable_hand_item_in_demo(actorx, idx); // + Player_actor_Reset_able_hand_all_item_in_demo(actorx, idx); // + Player_actor_Reset_able_force_speak_label(actorx, idx); // + Player_actor_change_main_index_other_func1(actorx, game); // + (*proc[idx])(actorx, game); + Player_actor_change_main_index_other_func2(actorx, game); // return TRUE; } return FALSE; } -static void Player_actor_change_proc_index(PLAYER_ACTOR* player, GAME* game) { - player->changed_main_index = Player_actor_change_main_index(player, game); +static void Player_actor_change_proc_index(ACTOR* actorx, GAME* game) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + + player->changed_main_index = Player_actor_change_main_index(actorx, game); } -typedef void (*mPlayer_MAIN_PROC)(PLAYER_ACTOR*, GAME*); +typedef void (*mPlayer_MAIN_PROC)(ACTOR*, GAME*); -static void Player_actor_main_Dma(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Intro(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Refuse(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Refuse_pickup(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Return_demo(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Return_outdoor(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Return_outdoor2(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Walk(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Run(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Dash(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Tumble(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Tumble_getup(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Turn_dash(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Fall(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Wade(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Door(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Outdoor(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Invade(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Hold(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Push(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Pull(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Rotate_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Open_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Wait_open_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Close_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Lie_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Wait_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Roll_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Standup_bed(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Pickup(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Pickup_jump(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Pickup_furniture(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Pickup_exchange(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Sitdown(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Sitdown_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Standup(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Swing_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Air_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Reflect_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Broken_axe(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Slip_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Ready_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Ready_walk_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Swing_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Pull_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Stop_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Notice_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Putaway_net(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Ready_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Cast_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Air_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Relax_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Collect_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Vib_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Fly_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Notice_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Putaway_rod(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Dig_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Fill_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Reflect_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Air_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Get_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Putaway_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Putin_scoop(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Talk(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Recieve_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Recieve_stretch(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Recieve(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Recieve_putaway(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Give(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Give_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Takeout_item(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Putin_item(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_walk(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_geton_train(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_geton_train_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_getoff_train(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_standing_train(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_wade(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Hide(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Groundhog(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Release_creature(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Wash_car(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Tired(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Rotate_octagon(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Throw_money(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Pray(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Shake_tree(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Mail_jump(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Mail_land(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Ready_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Fall_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Struggle_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Climbup_pitfall(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Stung_bee(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Notice_bee(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Remove_grass(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Shock(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Knock_door(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Change_cloth(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Push_snowball(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Rotate_umbrella(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Wade_snowball(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Complete_payment(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Fail_emu(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Stung_mosquito(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Notice_mosquito(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Swing_fan(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Switch_on_lighthouse(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Radio_exercise(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_geton_boat(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_geton_boat_sitdown(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_geton_boat_wait(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_geton_boat_wade(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_getoff_boat_standup(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_getoff_boat(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_get_golden_item(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_get_golden_item2(PLAYER_ACTOR*, GAME*); -static void Player_actor_main_Demo_get_golden_axe_wait(PLAYER_ACTOR*, GAME*); +static void Player_actor_main_Dma(ACTOR*, GAME*); +static void Player_actor_main_Intro(ACTOR*, GAME*); +static void Player_actor_main_Refuse(ACTOR*, GAME*); +static void Player_actor_main_Refuse_pickup(ACTOR*, GAME*); +static void Player_actor_main_Return_demo(ACTOR*, GAME*); +static void Player_actor_main_Return_outdoor(ACTOR*, GAME*); +static void Player_actor_main_Return_outdoor2(ACTOR*, GAME*); +static void Player_actor_main_Wait(ACTOR*, GAME*); +static void Player_actor_main_Walk(ACTOR*, GAME*); +static void Player_actor_main_Run(ACTOR*, GAME*); +static void Player_actor_main_Dash(ACTOR*, GAME*); +static void Player_actor_main_Tumble(ACTOR*, GAME*); +static void Player_actor_main_Tumble_getup(ACTOR*, GAME*); +static void Player_actor_main_Turn_dash(ACTOR*, GAME*); +static void Player_actor_main_Fall(ACTOR*, GAME*); +static void Player_actor_main_Wade(ACTOR*, GAME*); +static void Player_actor_main_Door(ACTOR*, GAME*); +static void Player_actor_main_Outdoor(ACTOR*, GAME*); +static void Player_actor_main_Invade(ACTOR*, GAME*); +static void Player_actor_main_Hold(ACTOR*, GAME*); +static void Player_actor_main_Push(ACTOR*, GAME*); +static void Player_actor_main_Pull(ACTOR*, GAME*); +static void Player_actor_main_Rotate_furniture(ACTOR*, GAME*); +static void Player_actor_main_Open_furniture(ACTOR*, GAME*); +static void Player_actor_main_Wait_open_furniture(ACTOR*, GAME*); +static void Player_actor_main_Close_furniture(ACTOR*, GAME*); +static void Player_actor_main_Lie_bed(ACTOR*, GAME*); +static void Player_actor_main_Wait_bed(ACTOR*, GAME*); +static void Player_actor_main_Roll_bed(ACTOR*, GAME*); +static void Player_actor_main_Standup_bed(ACTOR*, GAME*); +static void Player_actor_main_Pickup(ACTOR*, GAME*); +static void Player_actor_main_Pickup_jump(ACTOR*, GAME*); +static void Player_actor_main_Pickup_furniture(ACTOR*, GAME*); +static void Player_actor_main_Pickup_exchange(ACTOR*, GAME*); +static void Player_actor_main_Sitdown(ACTOR*, GAME*); +static void Player_actor_main_Sitdown_wait(ACTOR*, GAME*); +static void Player_actor_main_Standup(ACTOR*, GAME*); +static void Player_actor_main_Swing_axe(ACTOR*, GAME*); +static void Player_actor_main_Air_axe(ACTOR*, GAME*); +static void Player_actor_main_Reflect_axe(ACTOR*, GAME*); +static void Player_actor_main_Broken_axe(ACTOR*, GAME*); +static void Player_actor_main_Slip_net(ACTOR*, GAME*); +static void Player_actor_main_Ready_net(ACTOR*, GAME*); +static void Player_actor_main_Ready_walk_net(ACTOR*, GAME*); +static void Player_actor_main_Swing_net(ACTOR*, GAME*); +static void Player_actor_main_Pull_net(ACTOR*, GAME*); +static void Player_actor_main_Stop_net(ACTOR*, GAME*); +static void Player_actor_main_Notice_net(ACTOR*, GAME*); +static void Player_actor_main_Putaway_net(ACTOR*, GAME*); +static void Player_actor_main_Ready_rod(ACTOR*, GAME*); +static void Player_actor_main_Cast_rod(ACTOR*, GAME*); +static void Player_actor_main_Air_rod(ACTOR*, GAME*); +static void Player_actor_main_Relax_rod(ACTOR*, GAME*); +static void Player_actor_main_Collect_rod(ACTOR*, GAME*); +static void Player_actor_main_Vib_rod(ACTOR*, GAME*); +static void Player_actor_main_Fly_rod(ACTOR*, GAME*); +static void Player_actor_main_Notice_rod(ACTOR*, GAME*); +static void Player_actor_main_Putaway_rod(ACTOR*, GAME*); +static void Player_actor_main_Dig_scoop(ACTOR*, GAME*); +static void Player_actor_main_Fill_scoop(ACTOR*, GAME*); +static void Player_actor_main_Reflect_scoop(ACTOR*, GAME*); +static void Player_actor_main_Air_scoop(ACTOR*, GAME*); +static void Player_actor_main_Get_scoop(ACTOR*, GAME*); +static void Player_actor_main_Putaway_scoop(ACTOR*, GAME*); +static void Player_actor_main_Putin_scoop(ACTOR*, GAME*); +static void Player_actor_main_Talk(ACTOR*, GAME*); +static void Player_actor_main_Recieve_wait(ACTOR*, GAME*); +static void Player_actor_main_Recieve_stretch(ACTOR*, GAME*); +static void Player_actor_main_Recieve(ACTOR*, GAME*); +static void Player_actor_main_Recieve_putaway(ACTOR*, GAME*); +static void Player_actor_main_Give(ACTOR*, GAME*); +static void Player_actor_main_Give_wait(ACTOR*, GAME*); +static void Player_actor_main_Takeout_item(ACTOR*, GAME*); +static void Player_actor_main_Putin_item(ACTOR*, GAME*); +static void Player_actor_main_Demo_wait(ACTOR*, GAME*); +static void Player_actor_main_Demo_walk(ACTOR*, GAME*); +static void Player_actor_main_Demo_geton_train(ACTOR*, GAME*); +static void Player_actor_main_Demo_geton_train_wait(ACTOR*, GAME*); +static void Player_actor_main_Demo_getoff_train(ACTOR*, GAME*); +static void Player_actor_main_Demo_standing_train(ACTOR*, GAME*); +static void Player_actor_main_Demo_wade(ACTOR*, GAME*); +static void Player_actor_main_Hide(ACTOR*, GAME*); +static void Player_actor_main_Groundhog(ACTOR*, GAME*); +static void Player_actor_main_Release_creature(ACTOR*, GAME*); +static void Player_actor_main_Wash_car(ACTOR*, GAME*); +static void Player_actor_main_Tired(ACTOR*, GAME*); +static void Player_actor_main_Rotate_octagon(ACTOR*, GAME*); +static void Player_actor_main_Throw_money(ACTOR*, GAME*); +static void Player_actor_main_Pray(ACTOR*, GAME*); +static void Player_actor_main_Shake_tree(ACTOR*, GAME*); +static void Player_actor_main_Mail_jump(ACTOR*, GAME*); +static void Player_actor_main_Mail_land(ACTOR*, GAME*); +static void Player_actor_main_Ready_pitfall(ACTOR*, GAME*); +static void Player_actor_main_Fall_pitfall(ACTOR*, GAME*); +static void Player_actor_main_Struggle_pitfall(ACTOR*, GAME*); +static void Player_actor_main_Climbup_pitfall(ACTOR*, GAME*); +static void Player_actor_main_Stung_bee(ACTOR*, GAME*); +static void Player_actor_main_Notice_bee(ACTOR*, GAME*); +static void Player_actor_main_Remove_grass(ACTOR*, GAME*); +static void Player_actor_main_Shock(ACTOR*, GAME*); +static void Player_actor_main_Knock_door(ACTOR*, GAME*); +static void Player_actor_main_Change_cloth(ACTOR*, GAME*); +static void Player_actor_main_Push_snowball(ACTOR*, GAME*); +static void Player_actor_main_Rotate_umbrella(ACTOR*, GAME*); +static void Player_actor_main_Wade_snowball(ACTOR*, GAME*); +static void Player_actor_main_Complete_payment(ACTOR*, GAME*); +static void Player_actor_main_Fail_emu(ACTOR*, GAME*); +static void Player_actor_main_Stung_mosquito(ACTOR*, GAME*); +static void Player_actor_main_Notice_mosquito(ACTOR*, GAME*); +static void Player_actor_main_Swing_fan(ACTOR*, GAME*); +static void Player_actor_main_Switch_on_lighthouse(ACTOR*, GAME*); +static void Player_actor_main_Radio_exercise(ACTOR*, GAME*); +static void Player_actor_main_Demo_geton_boat(ACTOR*, GAME*); +static void Player_actor_main_Demo_geton_boat_sitdown(ACTOR*, GAME*); +static void Player_actor_main_Demo_geton_boat_wait(ACTOR*, GAME*); +static void Player_actor_main_Demo_geton_boat_wade(ACTOR*, GAME*); +static void Player_actor_main_Demo_getoff_boat_standup(ACTOR*, GAME*); +static void Player_actor_main_Demo_getoff_boat(ACTOR*, GAME*); +static void Player_actor_main_Demo_get_golden_item(ACTOR*, GAME*); +static void Player_actor_main_Demo_get_golden_item2(ACTOR*, GAME*); +static void Player_actor_main_Demo_get_golden_axe_wait(ACTOR*, GAME*); -static void Player_actor_move(PLAYER_ACTOR* player, GAME* game) { +extern void Player_actor_move(ACTOR* actorx, GAME* game) { static const mPlayer_MAIN_PROC proc[] = { &Player_actor_main_Dma, &Player_actor_main_Intro, @@ -1282,23 +1291,24 @@ static void Player_actor_move(PLAYER_ACTOR* player, GAME* game) { &Player_actor_main_Demo_get_golden_item2, &Player_actor_main_Demo_get_golden_axe_wait, }; + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; int idx; - Player_actor_move_other_func1(player, game); // + Player_actor_move_other_func1(actorx, game); // idx = player->now_main_index; if (mPlayer_MAIN_INDEX_VALID(idx) == FALSE || proc[idx] == NULL) { return; } - (*proc[idx])(player, game); - Player_actor_move_other_func2(player, game); // + (*proc[idx])(actorx, game); + Player_actor_move_other_func2(actorx, game); // } -typedef void (*mPlayer_DRAW_PROC)(PLAYER_ACTOR*, GAME*); +typedef void (*mPlayer_DRAW_PROC)(ACTOR*, GAME*); -static void Player_actor_draw_Normal(PLAYER_ACTOR*, GAME*); +static void Player_actor_draw_Normal(ACTOR*, GAME*); -static void Player_actor_draw(PLAYER_ACTOR* player, GAME* game) { +extern void Player_actor_draw(ACTOR* actorx, GAME* game) { static const s8 data[] = { mPlayer_DRAW_TYPE_NONE, mPlayer_DRAW_TYPE_NORMAL, mPlayer_DRAW_TYPE_NORMAL, mPlayer_DRAW_TYPE_NORMAL, mPlayer_DRAW_TYPE_NORMAL, mPlayer_DRAW_TYPE_NORMAL, mPlayer_DRAW_TYPE_NORMAL, mPlayer_DRAW_TYPE_NORMAL, @@ -1338,14 +1348,15 @@ static void Player_actor_draw(PLAYER_ACTOR* player, GAME* game) { &Player_actor_draw_Normal, }; + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; int main_idx = player->now_main_index; if (mPlayer_MAIN_INDEX_VALID(main_idx) != FALSE) { int draw_idx = data[main_idx]; if (draw_idx >= 0 && draw_idx < mPlayer_DRAW_TYPE_NUM && proc[draw_idx] != NULL) { - (*proc[draw_idx])(player, game); - Player_actor_draw_other_func2(player, game); // + (*proc[draw_idx])(actorx, game); + Player_actor_draw_other_func2(actorx, game); // } } } diff --git a/src/m_player_call.c b/src/m_player_call.c index 92511a2a..f78d58e5 100644 --- a/src/m_player_call.c +++ b/src/m_player_call.c @@ -4,12 +4,10 @@ #include "m_name_table.h" #include "m_play.h" -typedef void (*PLAYER_ACTOR_PROC)(PLAYER_ACTOR*, GAME*); - -PLAYER_ACTOR_PROC Player_actor_ct_func; -PLAYER_ACTOR_PROC Player_actor_dt_func; -PLAYER_ACTOR_PROC Player_actor_move_func; -PLAYER_ACTOR_PROC Player_actor_draw_func; +static mActor_proc Player_actor_ct_func; +static mActor_proc Player_actor_dt_func; +static mActor_proc Player_actor_move_func; +static mActor_proc Player_actor_draw_func; void Player_actor_ct_call(ACTOR* actor, GAME* game); void Player_actor_dt_call(ACTOR* actor, GAME* game); @@ -45,26 +43,26 @@ static void Player_actor_ct_call(ACTOR* actor, GAME* game) { load_player(&play->submenu); initfunc(play); - Player_actor_ct_func((PLAYER_ACTOR*)actor, game); + Player_actor_ct_func(actor, game); } static void Player_actor_dt_call(ACTOR* actor, GAME* game) { GAME_PLAY* play = (GAME_PLAY*)game; load_player(&play->submenu); - Player_actor_dt_func((PLAYER_ACTOR*)actor, game); + Player_actor_dt_func(actor, game); } static void Player_actor_move_call(ACTOR* actor, GAME* game) { GAME_PLAY* play = (GAME_PLAY*)game; load_player(&play->submenu); - Player_actor_move_func((PLAYER_ACTOR*)actor, game); + Player_actor_move_func(actor, game); } static void Player_actor_draw_call(ACTOR* actor, GAME* game) { GAME_PLAY* play = (GAME_PLAY*)game; load_player(&play->submenu); - Player_actor_draw_func((PLAYER_ACTOR*)actor, game); + Player_actor_draw_func(actor, game); } diff --git a/src/m_player_draw.c_inc b/src/m_player_draw.c_inc index e69de29b..46d993ac 100644 --- a/src/m_player_draw.c_inc +++ b/src/m_player_draw.c_inc @@ -0,0 +1,377 @@ +static void Player_actor_draw_Before_head(ACTOR* actorx, GAME* game, cKF_SkeletonInfo_R_c* kf, Gfx** gfx_pp, u8* flag, + s_xyz* rot, xyz_t* pos) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + s_xyz* head_angle = &player->head_angle; + + if (head_angle->x != 0 || head_angle->y != 0 || head_angle->z != 0) { + Matrix_push(); + Matrix_mult(&MtxF_clear, 0); + Matrix_softcv3_mult(&ZeroVec, rot); + Matrix_RotateX(head_angle->x, 1); + Matrix_RotateY(head_angle->y, 1); + Matrix_to_rotate2_new(get_Matrix_now(), rot, 0); + Matrix_pull(); + } +} + +typedef void (*mPlayer_DRAW_BEFORE_PROC)(ACTOR*, GAME*, cKF_SkeletonInfo_R_c*, Gfx**, u8*, s_xyz*, xyz_t*); + +static int Player_actor_draw_Before(GAME* game, cKF_SkeletonInfo_R_c* kf, int joint_no, Gfx** gfx_pp, u8* work_flag, + void* arg, s_xyz* rot, xyz_t* pos) { + // clang-format off + static mPlayer_DRAW_BEFORE_PROC proc[] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + &Player_actor_draw_Before_head, + NULL, + }; + // clang-format on + + ACTOR* actorx = (ACTOR*)arg; + + if (joint_no >= 0 && joint_no < mPlayer_JOINT_NUM && proc[joint_no] != NULL) { + (*proc[joint_no])(actorx, game, kf, gfx_pp, work_flag, rot, pos); + } + + return TRUE; +} + +static void Player_actor_draw_After_Culc_FootMarkPos(xyz_t* pos, s_xyz* rot) { + Matrix_Position_Zero(pos); + Matrix_to_rotate_new(get_Matrix_now(), rot, 0); +} + +static void Player_actor_draw_After_head(ACTOR* actorx, GAME* game, cKF_SkeletonInfo_R_c* kf, Gfx** gfx_pp, u8* flag, + s_xyz* rot, xyz_t* pos) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + + Matrix_Position_Zero(&player->head_pos); +} + +static void Player_actor_draw_After_Lfoot3(ACTOR* actorx, GAME* game, cKF_SkeletonInfo_R_c* kf, Gfx** gfx_pp, u8* flag, + s_xyz* rot, xyz_t* pos) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + + Player_actor_draw_After_Culc_FootMarkPos(&player->left_foot_pos, &player->left_foot_angle); +} + +static void Player_actor_draw_After_Larm2(ACTOR* actorx, GAME* game, cKF_SkeletonInfo_R_c* kf, Gfx** gfx_pp, u8* flag, + s_xyz* rot, xyz_t* pos) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + + if (player->item_matrix_set) { + HANDOVERITEM_ACTOR* hoi_actor = Common_Get(clip).handOverItem_clip->handOverItem_p; + + if (hoi_actor != NULL) { + Matrix_get(&hoi_actor->tools_class.matrix_work); + hoi_actor->tools_class.init_matrix = TRUE; + } + + player->item_matrix_set = FALSE; + } + + Matrix_Position_VecX(&player->left_hand_pos, 1100.0f); + Matrix_get(&player->left_hand_mtx); +} + +static void Player_actor_draw_After_Rfoot3(ACTOR* actorx, GAME* game, cKF_SkeletonInfo_R_c* kf, Gfx** gfx_pp, u8* flag, + s_xyz* rot, xyz_t* pos) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + + Player_actor_draw_After_Culc_FootMarkPos(&player->right_foot_pos, &player->right_foot_angle); +} + +static void Player_actor_draw_After_feel(ACTOR* actorx, GAME* game, cKF_SkeletonInfo_R_c* kf, Gfx** gfx_pp, u8* flag, + s_xyz* rot, xyz_t* pos) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + xyz_t* feel_pos = &player->feel_pos; + + Matrix_Position_Zero(feel_pos); + if (player->draw_effect_idx > 0) { + Common_Get(clip).effect_clip->effect_make_proc(player->draw_effect_idx - 1, *feel_pos, 2, + player->actor_class.shape_info.rotation.y, game, RSV_NO, 0, 0); + player->draw_effect_idx = 0; + } + + if (mPlib_get_player_actor_main_index(game) == mPlayer_INDEX_WASH_CAR) { + mPlayer_main_wash_car_c* wash_car = &player->main_data.wash_car; + + if (wash_car->effect_flag) { + Common_Get(clip).effect_clip->effect_make_proc(eEC_EFFECT_ASE2, *feel_pos, 2, 0, game, RSV_NO, 0, 0); + wash_car->effect_flag = FALSE; + } + } +} + +static void Player_actor_draw_After_hand(ACTOR* actorx, GAME* game, cKF_SkeletonInfo_R_c* kf, Gfx** gfx_pp, u8* flag, + s_xyz* rot, xyz_t* pos) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + xyz_t last_hand_pos = player->right_hand_pos; + + Matrix_Position_Zero(&player->right_hand_pos); + player->right_hand_move.x = player->right_hand_pos.x - last_hand_pos.x; + player->right_hand_move.y = player->right_hand_pos.y - last_hand_pos.y; + player->right_hand_move.z = player->right_hand_pos.z - last_hand_pos.z; + Matrix_get(&player->right_hand_mtx); +} + +typedef void (*mPlayer_DRAW_AFTER_PROC)(ACTOR*, GAME*, cKF_SkeletonInfo_R_c*, Gfx**, u8*, s_xyz*, xyz_t*); + +static int Player_actor_draw_After(GAME* game, cKF_SkeletonInfo_R_c* kf, int joint_no, Gfx** gfx_pp, u8* work_flag, + void* arg, s_xyz* rot, xyz_t* pos) { + // clang-format off + static mPlayer_DRAW_AFTER_PROC proc[] = { + NULL, + NULL, + NULL, + NULL, + NULL, + &Player_actor_draw_After_Lfoot3, + NULL, + NULL, + NULL, + &Player_actor_draw_After_Rfoot3, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + &Player_actor_draw_After_Larm2, + NULL, + NULL, + NULL, + &Player_actor_draw_After_hand, + NULL, + NULL, + NULL, + &Player_actor_draw_After_head, + &Player_actor_draw_After_feel, + }; + // clang-format on + + ACTOR* actorx = (ACTOR*)arg; + + if (joint_no >= 0 && joint_no < mPlayer_JOINT_NUM && proc[joint_no] != NULL) { + (*proc[joint_no])(actorx, game, kf, gfx_pp, work_flag, rot, pos); + } + + return TRUE; +} + +static void Player_actor_draw_Normal(ACTOR* actorx, GAME* game) { + PLAYER_ACTOR* player = (PLAYER_ACTOR*)actorx; + int buf_idx = game->frame_counter % 2; + int now_main_index = player->now_main_index; + cKF_SkeletonInfo_R_c* kf = &player->keyframe0; + Mtx* mtx = player->work_mtx[buf_idx]; + u8* eye_tex_p; + u8* mouth_tex_p; + GRAPH* graph; + int moving_in_boat; + GAME_PLAY* play = (GAME_PLAY*)game; + + eye_tex_p = Player_actor_Get_eye_tex_p(player); + mouth_tex_p = Player_actor_Get_mouth_tex_p(player); + graph = game->graph; + moving_in_boat = FALSE; + + _texture_z_light_fog_prim(graph); + OPEN_POLY_OPA_DISP(graph); + + if (now_main_index == mPlayer_INDEX_DEMO_GETON_BOAT_SITDOWN || + now_main_index == mPlayer_INDEX_DEMO_GETON_BOAT_WAIT || now_main_index == mPlayer_INDEX_DEMO_GETON_BOAT_WADE || + now_main_index == mPlayer_INDEX_DEMO_GETOFF_BOAT_STANDUP) { + moving_in_boat = TRUE; + } + + if (moving_in_boat) { + s16 boat_angle_z; + + if (now_main_index == mPlayer_INDEX_DEMO_GETON_BOAT_SITDOWN) { + boat_angle_z = -player->main_data.demo_geton_boat_sitdown.angle_z; + } else if (now_main_index == mPlayer_INDEX_DEMO_GETOFF_BOAT_STANDUP) { + boat_angle_z = -player->main_data.demo_getoff_boat_standup.angle_z; + } else { + boat_angle_z = -player->boat_angleZ; + } + + Matrix_push(); + Matrix_RotateZ(boat_angle_z, 1); + } + + gSPSegment(POLY_OPA_DISP++, ANIME_1_TXT_SEG, eye_tex_p); + gSPSegment(POLY_OPA_DISP++, ANIME_2_TXT_SEG, mouth_tex_p); + gSPSegment(POLY_OPA_DISP++, ANIME_3_TXT_SEG, mPlib_get_player_tex_p(game)); + gSPSegment(POLY_OPA_DISP++, ANIME_4_TXT_SEG, mPlib_get_player_pallet_p(game)); + gSPSegment(POLY_OPA_DISP++, ANIME_5_TXT_SEG, mPlib_get_player_face_pallet_p(game)); + + CLOSE_POLY_OPA_DISP(graph); + + if (player->change_color_flag) { + int color_frame = (int)(player->change_color_timer / 9.96f); + + if ((color_frame & 1)) { + player->change_color_near = 1; + player->change_color_far = 1; + } else { + static const int color_data[4][3] = { + { 255, 255, 100 }, // r + { 100, 255, 100 }, // g + { 255, 255, 100 }, // b + { 255, 100, 100 }, // a? + }; + + int color_idx = color_frame / 2; + + if (color_idx >= 0 && color_idx < 4) { + xyz_t diff; + f32 diff_len; + View* v = &play->view; + xyz_t* eye_p = &v->eye; + + player->change_color_rgb[0] = color_data[0][color_idx]; + player->change_color_rgb[1] = color_data[1][color_idx]; + player->change_color_rgb[2] = color_data[2][color_idx]; + + diff.x = v->center.x - eye_p->x; + diff.y = v->center.y - eye_p->y; + diff.z = v->center.z - eye_p->z; + diff_len = Math3DVecLength(&diff); + + if (diff_len > 0.0f) { + f32 dx = player->actor_class.world.position.x - eye_p->x; + f32 dy = player->actor_class.world.position.y - eye_p->y; + f32 dz = player->actor_class.world.position.z - eye_p->z; + + f32 percent = (dx * diff.x + dy * diff.y + dz * diff.z) / diff_len; + f32 t0; + f32 t1; + f32 t2; + + t0 = diff_len - 352.0f; + t1 = diff_len * 0.25f; + t2 = 2.0f / 14.1f; + + player->change_color_near = (int)(210.0f + (diff_len - percent) / diff_len); + player->change_color_far = + player->change_color_near + (int)(780.0f + t0 * (t2 / 2.0f) + t1 * (t2 / 2.0f)); + } else { + player->change_color_near = 1; + player->change_color_far = 1; + } + } else { + player->change_color_near = 1; + player->change_color_far = 1; + } + } + + OPEN_DISP(graph); + SET_POLY_OPA_DISP(gfx_set_fog_nosync(NOW_POLY_OPA_DISP, player->change_color_rgb[0], + player->change_color_rgb[1], player->change_color_rgb[2], 255, + player->change_color_near, player->change_color_far)); + CLOSE_DISP(graph); + } + + cKF_Si3_draw_R_SV(game, kf, mtx, &Player_actor_draw_Before, &Player_actor_draw_After, player); + + if (player->change_color_flag) { + /* Revert to standard fog color */ + OPEN_DISP(graph); + SET_POLY_OPA_DISP(gfx_set_fog_nosync(NOW_POLY_OPA_DISP, play->global_light.fogColor[0], + play->global_light.fogColor[1], play->global_light.fogColor[2], 0, + play->global_light.fogNear, play->global_light.fogFar)); + CLOSE_DISP(graph); + } + + Player_actor_Item_draw(player, game); + + { + mActor_name_t item = EMPTY_NO; + f32 item_scale = 0.0f; + xyz_t* item_pos_p = NULL; + int flag = FALSE; + mPlayer_main_pickup_jump_c* main_pickup_jump = NULL; + + if (mPlib_get_player_actor_main_index(game) == mPlayer_INDEX_PICKUP) { + if (player->main_data.pickup.exchange_flag == FALSE) { + item = player->main_data.pickup.item; + item_scale = player->main_data.pickup.scale; + item_pos_p = &player->main_data.pickup.item_pos; + } + } else if (mPlib_get_player_actor_main_index(game) == mPlayer_INDEX_PICKUP_JUMP) { + mPlayer_main_pickup_jump_c* main_pickup_jump2 = &player->main_data.pickup_jump; + + if (main_pickup_jump2->exchange_flag == FALSE) { + main_pickup_jump = main_pickup_jump2; + item = main_pickup_jump2->item; + item_scale = main_pickup_jump2->scale; + item_pos_p = &main_pickup_jump2->item_pos; + flag = TRUE; + } + } else if (mPlib_get_player_actor_main_index(game) == mPlayer_INDEX_GET_SCOOP) { + item = player->main_data.get_scoop.item; + item_scale = player->main_data.get_scoop.scale; + if (player->keyframe0.frame_control.current_frame <= 42.0f) { + item_pos_p = &player->scoop_pos; + } else { + item_pos_p = &player->left_hand_pos; + } + } else if (mPlib_get_player_actor_main_index(game) == mPlayer_INDEX_PUTAWAY_SCOOP) { + item = player->main_data.putaway_scoop.item; + item_scale = player->main_data.putaway_scoop.scale; + item_pos_p = &player->left_hand_pos; + } + + if (item_scale > 0.0f && item != EMPTY_NO && item_pos_p != NULL) { + if (mFI_GET_TYPE(mFI_GetFieldId()) == mFI_FIELD_FG) { + if (Common_Get(clip).bg_item_clip != NULL && Common_Get(clip).bg_item_clip->single_draw_proc != NULL) { + Common_Get(clip).bg_item_clip->single_draw_proc(game, item, item_pos_p, item_scale, NULL, NULL, + NULL); + } + } else { + if (Common_Get(clip).shop_goods_clip != NULL && + Common_Get(clip).shop_goods_clip->single_draw_proc != NULL) { + s16 item_angle_y; + int uz; + int ux; + + if (main_pickup_jump != NULL && mFI_Wpos2UtNum(&ux, &uz, main_pickup_jump->target_pos)) { + item_angle_y = Common_Get(clip).shop_goods_clip->single_get_angle_y_proc(uz, ux, flag); + } else { + item_angle_y = 0; + } + + Common_Get(clip).shop_goods_clip->single_draw_proc(game, item, item_pos_p, item_scale, item_angle_y, + flag); + } + } + } + } + + if (moving_in_boat) { + Matrix_pull(); + } +}