diff --git a/common.py b/common.py index 3104e7e5..ba7810c9 100644 --- a/common.py +++ b/common.py @@ -365,7 +365,8 @@ TRK_CFLAGS = [ BASE_REL_CFLAGS = CFLAGS + [ "-sdata 0", f"-sdata2 {REL_SDATA2_SIZE}", - "-pool off" + "-pool off", + "-sym on" ] + REL_DEFINES LOCAL_CFLAGS = [ diff --git a/config/rel_slices.yml b/config/rel_slices.yml index fc74f351..c7b9ff28 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -204,6 +204,10 @@ m_random_field/mRF_MakePerfectBit.c: .text: [0x8050B1AC, 0x8050B1D4] m_random_field/mRF_GetRandomStepMode.c: .text: [0x8050B284, 0x8050B2C0] +ac_douzou.c: + .text: [0x805AD6D8, 0x805AE704] + .rodata: [0x8064A7C0, 0x8064A7E8] + .data: [0x806C4DF0, 0x806C5018] ac_structure.c: .text: [0x805BCA00, 0x805BD06C] .rodata: [0x8064AC30, 0x8064AC38] diff --git a/include/ac_douzou.h b/include/ac_douzou.h index 68e45763..a13a4c0f 100644 --- a/include/ac_douzou.h +++ b/include/ac_douzou.h @@ -3,6 +3,7 @@ #include "types.h" #include "m_actor.h" +#include "ac_structure.h" #ifdef __cplusplus extern "C" { diff --git a/include/ac_structure.h b/include/ac_structure.h index c1d27c81..69f19ec3 100644 --- a/include/ac_structure.h +++ b/include/ac_structure.h @@ -4,6 +4,7 @@ #include "types.h" #include "m_actor.h" #include "m_actor_dlftbls.h" +#include "c_keyframe.h" #ifdef __cplusplus extern "C" { @@ -34,7 +35,7 @@ enum structure_type { aSTR_TYPE_POLICE_BOX, aSTR_TYPE_FALLS, aSTR_TYPE_FALLSESW, - aSTR_TYPE_SIGN, + aSTR_TYPE_RESERVE, aSTR_TYPE_SHRINE, aSTR_TYPE_BRSHOP, aSTR_TYPE_BUGGY, @@ -73,6 +74,109 @@ enum structure_type { aSTR_TYPE_NUM }; +enum structure_palette { + aSTR_PAL_HOUSE1_A, + aSTR_PAL_HOUSE1_B, + aSTR_PAL_HOUSE1_C, + aSTR_PAL_HOUSE1_D, + aSTR_PAL_HOUSE1_E, + aSTR_PAL_HOUSE2_A, + aSTR_PAL_HOUSE2_B, + aSTR_PAL_HOUSE2_C, + aSTR_PAL_HOUSE2_D, + aSTR_PAL_HOUSE2_E, + aSTR_PAL_HOUSE3_A, + aSTR_PAL_HOUSE3_B, + aSTR_PAL_HOUSE3_C, + aSTR_PAL_HOUSE3_D, + aSTR_PAL_HOUSE3_E, + aSTR_PAL_HOUSE4_A, + aSTR_PAL_HOUSE4_B, + aSTR_PAL_HOUSE4_C, + aSTR_PAL_HOUSE4_D, + aSTR_PAL_HOUSE4_E, + aSTR_PAL_HOUSE5_A, + aSTR_PAL_HOUSE5_B, + aSTR_PAL_HOUSE5_C, + aSTR_PAL_HOUSE5_D, + aSTR_PAL_HOUSE5_E, + aSTR_PAL_MYHOME_A, + aSTR_PAL_MYHOME_B, + aSTR_PAL_MYHOME_C, + aSTR_PAL_MYHOME_D, + aSTR_PAL_MYHOME_E, + aSTR_PAL_MYHOME_F, + aSTR_PAL_MYHOME_G, + aSTR_PAL_MYHOME_H, + aSTR_PAL_MYHOME_I, + aSTR_PAL_MYHOME_J, + aSTR_PAL_MYHOME_K, + aSTR_PAL_MYHOME_L, + aSTR_PAL_SHOP1, + aSTR_PAL_SHOP2, + aSTR_PAL_SHOP3, + aSTR_PAL_SHOP4, + aSTR_PAL_POST_OFFICE, + aSTR_PAL_STATION1_A, + aSTR_PAL_STATION1_B, + aSTR_PAL_STATION1_C, + aSTR_PAL_STATION1_D, + aSTR_PAL_STATION1_E, + aSTR_PAL_STATION2_A, + aSTR_PAL_STATION2_B, + aSTR_PAL_STATION2_C, + aSTR_PAL_STATION2_D, + aSTR_PAL_STATION2_E, + aSTR_PAL_STATION3_A, + aSTR_PAL_STATION3_B, + aSTR_PAL_STATION3_C, + aSTR_PAL_STATION3_D, + aSTR_PAL_STATION3_E, + aSTR_PAL_TRAIN1_A1, + aSTR_PAL_TRAIN1_A2, + aSTR_PAL_POLICE_BOX, + aSTR_PAL_FALLS, + aSTR_PAL_FALLSESW, + aSTR_PAL_RESERVE, + aSTR_PAL_SHRINE, + aSTR_PAL_BR_SHOP, + aSTR_PAL_BUGGY, + aSTR_PAL_S_CAR, + aSTR_PAL_KAMAKURA, + aSTR_PAL_GOZA, + aSTR_PAL_RADIO, + aSTR_PAL_YATAI, + aSTR_PAL_TUKIMI, + aSTR_PAL_TUKIMI2, + aSTR_PAL_MIKUJI, + aSTR_PAL_COUNT, + aSTR_PAL_COUNT02, + aSTR_PAL_KAGO_R, + aSTR_PAL_KAGO_W, + aSTR_PAL_TURI, + aSTR_PAL_TURI2, + aSTR_PAL_KOINOBORI_A, + aSTR_PAL_DUMP, + aSTR_PAL_WINDMILL_A, + aSTR_PAL_WINDMILL_B, + aSTR_PAL_WINDMILL_C, + aSTR_PAL_WINDMILL_D, + aSTR_PAL_WINDMILL_E, + aSTR_PAL_01_LOTUS, + aSTR_PAL_MIKANBOX, + aSTR_PAL_DOUZOU_DAI, + aSTR_PAL_TOUDAI, + aSTR_PAL_MUSEUM, + aSTR_PAL_BRIDGE_A, + aSTR_PAL_TAILOR, + aSTR_PAL_FLAG, + aSTR_PAL_BOAT, + aSTR_PAL_MYHOME_ISLAND, + aSTR_PAL_HOUSE_I, + + aSTR_PAL_NUM +}; + typedef struct actor_structure_control_s STRUCTURE_CONTROL_ACTOR; typedef struct actor_structure_s STRUCTURE_ACTOR; @@ -83,11 +187,35 @@ typedef STRUCTURE_ACTOR* (*aSTR_GET_ACTOR_AREA_PROC)(); typedef void (*aSTR_FREE_ACTOR_AREA_PROC)(STRUCTURE_ACTOR*); typedef u16* (*aSTR_GET_PAL_SEGMENT_PROC)(s16); +typedef void (*aSTR_MOVE_PROC)(ACTOR*, GAME*); + struct actor_structure_s { ACTOR actor_class; - u8 _174[0x2B0 - 0x174]; + int keyframe_state; + cKF_SkeletonInfo_R_c keyframe; + int keyframe_saved_keyframe; + s_xyz work_area[15]; + s_xyz morph_area[15]; + aSTR_MOVE_PROC action_proc; + int _2A4; + int structure_type; /* aSTR_TYPE_* */ + int structure_pal; /* aSTR_PAL_* */ int request_type; - u8 _2B4[0x2DC - 0x2B4]; + int action; + + /* general purpose members with unique usage between structure actors */ + int arg0; + int arg1; + int arg2; + int arg3; + + /* general purpose float members with unique usage between structure actors*/ + f32 arg0_f; + f32 arg1_f; + f32 arg2_f; + f32 arg3_f; + + u32 season; }; typedef struct actor_overlay_info_s { diff --git a/include/bg_item_h.h b/include/bg_item_h.h new file mode 100644 index 00000000..ed9ed9dc --- /dev/null +++ b/include/bg_item_h.h @@ -0,0 +1,32 @@ +#ifndef BG_ITEM_H_H +#define BG_ITEM_H_H + +#include "types.h" +#include "PR/mbi.h" +#include "game_h.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct background_item_shadow_s { + u32 vtx_num; + u8* vtx_fix_flags; + f32 size; + Vtx* vtx; + Gfx* gfx; +} bIT_ShadowData_c; + +typedef void (*bIT_SHADOW_DRAW_PROC)(GAME*, bIT_ShadowData_c*, int); + +typedef struct background_item_clip_s { + void* _00; + bIT_SHADOW_DRAW_PROC draw_shadow_proc; + void* _08[(0x54 - 0x08) / sizeof(void*)]; +} bIT_Clip_c; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/ef_effect_control.h b/include/ef_effect_control.h index 3e5c0978..e9d3d153 100644 --- a/include/ef_effect_control.h +++ b/include/ef_effect_control.h @@ -15,7 +15,7 @@ enum effect_type { eEC_EFFECT_MUKA, eEC_EFFECT_WARAU, /* TODO: finish */ - + eEC_DOUZOU_LIGHT = 101, eEC_EFFECT_NUM = 126 }; diff --git a/include/m_actor.h b/include/m_actor.h index 9ab3d4cc..0877f2a0 100644 --- a/include/m_actor.h +++ b/include/m_actor.h @@ -20,6 +20,7 @@ typedef void (*mActor_proc)(ACTOR*, GAME*); #define ACTOR_STATE_NONE 0 #define ACTOR_STATE_NO_MOVE_WHILE_CULLED (1 << 4) #define ACTOR_STATE_NO_DRAW_WHILE_CULLED (1 << 5) +#define ACTOR_STATE_11 (1 << 11) #define ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES (1 << 29) #define ACTOR_OBJ_BANK_NONE 0 @@ -401,6 +402,7 @@ extern void Actor_world_to_eye(ACTOR* actor, f32 eye_height); extern void Shape_Info_init(ACTOR* actor, f32 y_ofs, mActor_shadow_proc shadow_proc, f32 shadow_sizeX, f32 shadow_sizeZ); extern void Actor_position_moveF(ACTOR* actor); extern ACTOR* Actor_info_make_actor(Actor_info* actor_info, GAME* game, s16 profile, f32 x, f32 y, f32 z, short rot_x, short rot_y, short rot_z, s8 block_x, s8 block_z, s16 mvactor_list_no, mActor_name_t actor_name, s16 arg, s8 npc_idx, int data_bank); +extern void Setpos_HiliteReflect_init(xyz_t* wpos, GAME_PLAY* play); extern void mAc_ActorShadowCircle(ACTOR* actor, LightsN* lightsN, GAME_PLAY* play); extern void mAc_ActorShadowEllipse(ACTOR* actor, LightsN* lightsN, GAME_PLAY* play); diff --git a/include/m_clip.h b/include/m_clip.h index a34a5234..1a4566d6 100644 --- a/include/m_clip.h +++ b/include/m_clip.h @@ -9,6 +9,7 @@ #include "ac_animal_logo.h" #include "ef_effect_control.h" #include "m_demo.h" +#include "bg_item_h.h" #ifdef __cplusplus extern "C" { @@ -18,7 +19,9 @@ extern "C" { typedef struct clip_s { /* 0x000 */ void* _000[(0x040 - 0x000) / sizeof(void*)]; /* 0x040 */ aTR0_Clip_c* train0_clip; - /* 0x044 */ void* _044[(0x07C - 0x044) / sizeof(void*)]; + /* 0x044 */ void* _044[(0x074 - 0x044) / sizeof(void*)]; + /* 0x074 */ bIT_Clip_c* bg_item_clip; + /* 0x078 */ void* _078; /* 0x07C */ aINS_Clip_c* insect_clip; /* 0x080 */ void* _080[(0x08C - 0x080) / sizeof(void*)]; /* 0x08C */ aSTR_Clip_c* structure_clip; diff --git a/include/m_collision_bg.h b/include/m_collision_bg.h index ba4cdcea..3f39f4af 100644 --- a/include/m_collision_bg.h +++ b/include/m_collision_bg.h @@ -102,6 +102,7 @@ extern f32 mCoBG_GetBgY_OnlyCenter_FromWpos2(xyz_t wpos, f32 foot_dist); extern int mCoBG_Attribute2CheckPlant(u32 attribute, const xyz_t* wpos); extern void mCoBG_BgCheckControll(xyz_t* reverse_pos, ACTOR* actor, f32 check_range, f32 offset_y, s16 wall_attr_check, s16 no_reverse, s16 check_type); extern int mCoBG_Height2GetLayer(f32 height); +extern void mCoBG_SetPlussOffset(xyz_t wpos, s16 offset, s16 new_attrib); extern f32 mCoBG_GetWaterHeight_File(xyz_t wpos, char* file, int line); #define mCoBG_GetWaterHeight(wpos) mCoBG_GetWaterHeight_File(wpos, __FILE__, __LINE__) diff --git a/include/m_demo.h b/include/m_demo.h index bb2dd07e..05f5e5b0 100644 --- a/include/m_demo.h +++ b/include/m_demo.h @@ -8,6 +8,43 @@ extern "C" { #endif +enum demo_type { + mDemo_TYPE_NONE, + mDemo_TYPE_SCROLL, + mDemo_TYPE_2, + mDemo_TYPE_DOOR, + mDemo_TYPE_4, + mDemo_TYPE_SCROLL2, + mDemo_TYPE_DOOR2, + mDemo_TYPE_TALK, + mDemo_TYPE_SPEAK, + mDemo_TYPE_REPORT, + mDemo_TYPE_SPEECH, + mDemo_TYPE_OUTDOOR, + mDemo_TYPE_12, + mDemo_TYPE_EVENTMSG, + mDemo_TYPE_EVENTMSG2, + mDemo_TYPE_15, + mDemo_TYPE_SCROLL3, + + mDemo_TYPE_NUM +}; + +enum demo_order_type { + mDemo_ORDER_PLAYER, + mDemo_ORDER_1, + mDemo_ORDER_2, + mDemo_ORDER_3, + mDemo_ORDER_NPC0, + mDemo_ORDER_NPC1, + mDemo_ORDER_NPC2, + mDemo_ORDER_7, + mDemo_ORDER_8, + mDemo_ORDER_QUEST, + + mDemo_ORDER_NUM +}; + typedef void (*mDemo_REQUEST_PROC)(ACTOR*); typedef struct demo_clip_s { @@ -33,6 +70,10 @@ extern ACTOR* mDemo_Get_talk_actor(); extern void mDemo_Set_OrderValue(int type, int idx, u16 value); extern u16 mDemo_Get_OrderValue(int type, int idx); extern void mDemo_Set_talk_return_demo_wait(u8 value); +extern void mDemo_Set_talk_turn(u8 value); +extern void mDemo_Set_talk_display_name(u8 value); +extern void mDemo_Set_camera(u8 value); +extern void mDemo_Set_talk_window_color(rgba_t* color); #ifdef __cplusplus } diff --git a/include/m_field_info.h b/include/m_field_info.h index 51496059..abf0ac12 100644 --- a/include/m_field_info.h +++ b/include/m_field_info.h @@ -140,6 +140,8 @@ extern mFI_sound_source_info_c* mFI_GetSoundSourcePBlockNum(int block_x,int bloc extern int mFI_Wpos2UtNum(int* ut_x, int* ut_z, xyz_t wpos); extern void mFI_ClearFieldData(); extern int mFI_SetFG_common(mActor_name_t item, xyz_t wpos, int update); +extern mActor_name_t* mFI_GetUnitFG(xyz_t wpos); +extern void mFI_Wpos2DepositOFF(xyz_t wpos); extern void mFI_PrintNowBGNum(gfxprint_t* gfxprint); extern void mFI_PrintFgAttr(gfxprint_t* gfxprint); diff --git a/include/m_name_table.h b/include/m_name_table.h index 16e203ad..2a61b686 100644 --- a/include/m_name_table.h +++ b/include/m_name_table.h @@ -678,8 +678,9 @@ extern int mNT_check_unknown(mActor_name_t item_no); #define DUMMY_START 0xF000 #define DUMMY_HANIWA0 0xF0FB #define DUMMY_HANIWA1 (DUMMY_HANIWA0 + 1) -#define DUMMY_HANIWA2 (DUMMY_HANIWA2 + 1) +#define DUMMY_HANIWA2 (DUMMY_HANIWA1 + 1) #define DUMMY_HANIWA3 (DUMMY_HANIWA2 + 1) +#define DUMMY_DOUZOU 0xF11D #define RSV_DOOR 0xFE1B #define RSV_WALL_NO 0xFFFE /* interior wall item, no collision */ diff --git a/include/m_player.h b/include/m_player.h index 01d6e0aa..9769178d 100644 --- a/include/m_player.h +++ b/include/m_player.h @@ -11,14 +11,23 @@ extern "C" { typedef struct player_actor_s PLAYER_ACTOR; +#define mPlayer_FORCE_POSITION_ANGLE_NONE 0 +// where is (1 << 0) ?? +#define mPlayer_FORCE_POSITION_ANGLE_POSX (1 << 1) +#define mPlayer_FORCE_POSITION_ANGLE_POSY (1 << 2) +#define mPlayer_FORCE_POSITION_ANGLE_POSZ (1 << 3) +#define mPlayer_FORCE_POSITION_ANGLE_ROTX (1 << 4) +#define mPlayer_FORCE_POSITION_ANGLE_ROTY (1 << 5) +#define mPlayer_FORCE_POSITION_ANGLE_ROTZ (1 << 6) + /* sizeof(struct player_actor_s) == 0x13A8 */ struct player_actor_s { /* 0x0000 */ ACTOR actor_class; /* 0x0174 */ u8 tmp0174[0x1300 - 0x0174]; - /* 0x1300 */ void* (*get_door_label_proc)(GAME*); - /* 0x1304 */ u8 tmp1304[0x1310- 0x1304]; - /* 0x1310 */ void (*update_Rot_Pos_actor_proc)(GAME*, xyz_t*, s_xyz*, int); - /* 0x1314 */ u32 pad; + /* 0x1300 */ void* (*get_door_label_proc)(GAME*); + /* 0x1304 */ u8 tmp1304[0x1310 - 0x1304]; + /* 0x1310 */ void (*Set_force_position_angle_proc)(GAME*, const xyz_t*, const s_xyz*, u8); + /* 0x1314 */ u8 (*Get_force_position_angle_proc)(GAME*, xyz_t*, s_xyz*); /* 0x1318 */ int (*Get_WadeEndPos_proc)(GAME*, xyz_t*); /* 0x131C */ u8 tmp131C[0x13A8 - 0x131C]; /* TODO: finish */ diff --git a/include/m_player_lib.h b/include/m_player_lib.h index 84ae0f78..799fc064 100644 --- a/include/m_player_lib.h +++ b/include/m_player_lib.h @@ -19,6 +19,7 @@ extern void mPlib_request_main_wait_type3(GAME_PLAY* play); extern void mPlib_Set_able_force_speak_label(ACTOR* actor); extern int mPlib_request_main_demo_walk_type1(GAME* game, f32 goal_x, f32 goal_z, f32 speed, int flag); extern void mPlib_Set_goal_player_demo_walk(f32 goal_x, f32 goal_z, f32 speed); +extern void mPlib_Set_able_hand_all_item_in_demo(s8 enable); #ifdef __cplusplus } diff --git a/include/m_private.h b/include/m_private.h index f5cea0af..44b0c8e3 100644 --- a/include/m_private.h +++ b/include/m_private.h @@ -232,6 +232,7 @@ extern void mPr_RandomSetPlayerData_title_demo(); extern int mPr_GetPossessionItemSumWithCond(Private_c* priv, mActor_name_t item_no, u32 cond); extern int mPr_SetFreePossessionItem(Private_c* priv, mActor_name_t item_no, u32 cond); extern void mPr_CopyPlayerName(u8* dst, Private_c* private_p); +extern int mPr_GetPlayerName(u8* buf, int player_no); #ifdef __cplusplus } diff --git a/include/sys_matrix.h b/include/sys_matrix.h index 2f1b3798..50b234f6 100644 --- a/include/sys_matrix.h +++ b/include/sys_matrix.h @@ -26,7 +26,7 @@ extern void Matrix_RotateX(s16 x, int flag); extern void Matrix_RotateY(s16 x, int flag); extern void Matrix_RotateZ(s16 x, int flag); extern void Matrix_rotateXYZ(s16 x, s16 y, s16 z, int flag); -extern void Matrix_softcv3_mult(xyz_t* src, s_xyz* dest); +extern void Matrix_softcv3_mult(xyz_t* pos, s_xyz* rot); extern void Matrix_softcv3_load(s_xyz* src, f32 x, f32 y, f32 z); extern Mtx* _MtxF_to_Mtx(MtxF* src, Mtx* dest); extern Mtx* _Matrix_to_Mtx(Mtx* dest); diff --git a/rel/ac_douzou.c b/rel/ac_douzou.c new file mode 100644 index 00000000..2eefc68c --- /dev/null +++ b/rel/ac_douzou.c @@ -0,0 +1,196 @@ +#include "ac_douzou.h" + +#include "m_time.h" +#include "m_common_data.h" +#include "m_name_table.h" +#include "m_house.h" + +static void aDOU_actor_ct(ACTOR*, GAME*); +static void aDOU_actor_dt(ACTOR*, GAME*); +static void aDOU_actor_init(ACTOR*, GAME*); +static void aDOU_actor_draw(ACTOR*, GAME*); + +ACTOR_PROFILE Douzou_Profile = { + mAc_PROFILE_DOUZOU, + ACTOR_PART_ITEM, + ACTOR_STATE_11, + DOUZOU, + ACTOR_OBJ_BANK_3, + sizeof(STRUCTURE_ACTOR), + + &aDOU_actor_ct, + &aDOU_actor_dt, + &aDOU_actor_init, + &aDOU_actor_draw, + NULL +}; + +extern u8 obj_s_douzou_b1_tex_pic_i4[]; +extern u8 obj_s_douzou_b2_tex_pic_i4[]; +extern u8 obj_s_douzou_b3_tex_pic_i4[]; +extern u8 obj_s_douzou_b4_tex_pic_i4[]; +extern u8 obj_s_douzou_b5_tex_pic_i4[]; +extern u8 obj_s_douzou_b6_tex_pic_i4[]; +extern u8 obj_s_douzou_b7_tex_pic_i4[]; +extern u8 obj_s_douzou_b8_tex_pic_i4[]; +extern u8 obj_s_douzou_g1_tex_pic_i4[]; +extern u8 obj_s_douzou_g2_tex_pic_i4[]; +extern u8 obj_s_douzou_g3_tex_pic_i4[]; +extern u8 obj_s_douzou_g4_tex_pic_i4[]; +extern u8 obj_s_douzou_g5_tex_pic_i4[]; +extern u8 obj_s_douzou_g6_tex_pic_i4[]; +extern u8 obj_s_douzou_b7_tex_pic_i4[]; +extern u8 obj_s_douzou_g8_tex_pic_i4[]; + +extern u8 obj_w_douzou_b1_tex_pic_i4[]; +extern u8 obj_w_douzou_b2_tex_pic_i4[]; +extern u8 obj_w_douzou_b3_tex_pic_i4[]; +extern u8 obj_w_douzou_b4_tex_pic_i4[]; +extern u8 obj_w_douzou_b5_tex_pic_i4[]; +extern u8 obj_w_douzou_b6_tex_pic_i4[]; +extern u8 obj_w_douzou_b7_tex_pic_i4[]; +extern u8 obj_w_douzou_b8_tex_pic_i4[]; +extern u8 obj_w_douzou_g1_tex_pic_i4[]; +extern u8 obj_w_douzou_g2_tex_pic_i4[]; +extern u8 obj_w_douzou_g3_tex_pic_i4[]; +extern u8 obj_w_douzou_g4_tex_pic_i4[]; +extern u8 obj_w_douzou_g5_tex_pic_i4[]; +extern u8 obj_w_douzou_g6_tex_pic_i4[]; +extern u8 obj_w_douzou_b7_tex_pic_i4[]; +extern u8 obj_w_douzou_g8_tex_pic_i4[]; + +static u8* eye_tbl[2 * (mPr_SEX_NUM * mPr_FACE_TYPE_NUM)] = { + obj_s_douzou_b1_tex_pic_i4, + obj_s_douzou_b2_tex_pic_i4, + obj_s_douzou_b3_tex_pic_i4, + obj_s_douzou_b4_tex_pic_i4, + obj_s_douzou_b5_tex_pic_i4, + obj_s_douzou_b6_tex_pic_i4, + obj_s_douzou_b7_tex_pic_i4, + obj_s_douzou_b8_tex_pic_i4, + obj_s_douzou_g1_tex_pic_i4, + obj_s_douzou_g2_tex_pic_i4, + obj_s_douzou_g3_tex_pic_i4, + obj_s_douzou_g4_tex_pic_i4, + obj_s_douzou_g5_tex_pic_i4, + obj_s_douzou_g6_tex_pic_i4, + obj_s_douzou_b7_tex_pic_i4, + obj_s_douzou_g8_tex_pic_i4, + + obj_w_douzou_b1_tex_pic_i4, + obj_w_douzou_b2_tex_pic_i4, + obj_w_douzou_b3_tex_pic_i4, + obj_w_douzou_b4_tex_pic_i4, + obj_w_douzou_b5_tex_pic_i4, + obj_w_douzou_b6_tex_pic_i4, + obj_w_douzou_b7_tex_pic_i4, + obj_w_douzou_b8_tex_pic_i4, + obj_w_douzou_g1_tex_pic_i4, + obj_w_douzou_g2_tex_pic_i4, + obj_w_douzou_g3_tex_pic_i4, + obj_w_douzou_g4_tex_pic_i4, + obj_w_douzou_g5_tex_pic_i4, + obj_w_douzou_g6_tex_pic_i4, + obj_w_douzou_b7_tex_pic_i4, + obj_w_douzou_g8_tex_pic_i4, +}; + +extern u8 obj_s_douzou_bm1_tex_pic_i4[]; +extern u8 obj_s_douzou_bm2_tex_pic_i4[]; +extern u8 obj_s_douzou_gm1_tex_pic_i4[]; +extern u8 obj_s_douzou_gm2_tex_pic_i4[]; + +extern u8 obj_w_douzou_bm1_tex_pic_i4[]; +extern u8 obj_w_douzou_bm2_tex_pic_i4[]; +extern u8 obj_w_douzou_gm1_tex_pic_i4[]; +extern u8 obj_w_douzou_gm2_tex_pic_i4[]; + +static u8* mouth_tbl[2 * (mPr_SEX_NUM * mPr_FACE_TYPE_NUM)] = { + obj_s_douzou_bm2_tex_pic_i4, + obj_s_douzou_bm1_tex_pic_i4, + obj_s_douzou_bm1_tex_pic_i4, + obj_s_douzou_bm2_tex_pic_i4, + obj_s_douzou_bm1_tex_pic_i4, + obj_s_douzou_bm1_tex_pic_i4, + obj_s_douzou_bm1_tex_pic_i4, + obj_s_douzou_bm2_tex_pic_i4, + obj_s_douzou_gm1_tex_pic_i4, + obj_s_douzou_gm1_tex_pic_i4, + obj_s_douzou_gm1_tex_pic_i4, + obj_s_douzou_gm1_tex_pic_i4, + obj_s_douzou_gm2_tex_pic_i4, + obj_s_douzou_gm1_tex_pic_i4, + obj_s_douzou_gm1_tex_pic_i4, + obj_s_douzou_gm1_tex_pic_i4, + + obj_w_douzou_bm2_tex_pic_i4, + obj_w_douzou_bm1_tex_pic_i4, + obj_w_douzou_bm1_tex_pic_i4, + obj_w_douzou_bm2_tex_pic_i4, + obj_w_douzou_bm1_tex_pic_i4, + obj_w_douzou_bm1_tex_pic_i4, + obj_w_douzou_bm1_tex_pic_i4, + obj_w_douzou_bm2_tex_pic_i4, + obj_w_douzou_gm1_tex_pic_i4, + obj_w_douzou_gm1_tex_pic_i4, + obj_w_douzou_gm1_tex_pic_i4, + obj_w_douzou_gm1_tex_pic_i4, + obj_w_douzou_gm2_tex_pic_i4, + obj_w_douzou_gm1_tex_pic_i4, + obj_w_douzou_gm1_tex_pic_i4, + obj_w_douzou_gm1_tex_pic_i4 +}; + +static f32 zpostbl[mHS_HOUSE_NUM] = { 200.0f, 200.0f, 280.0f, 280.0f }; +static f32 xpostbl[mHS_HOUSE_NUM] = { 0.0f, 200.0f, -40.0f, 160.0f }; + +extern Vtx obj_s_douzou_shadow_v[]; +extern Gfx obj_s_douzou_shadow_model[]; +static u8 aDOU_vtx_fix_flg_tbl[8] = { TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE }; +static bIT_ShadowData_c aDOU_shadow_data = { + 8, aDOU_vtx_fix_flg_tbl, + 60.0f, + obj_s_douzou_shadow_v, + obj_s_douzou_shadow_model +}; + +extern cKF_Skeleton_R_c cKF_bs_r_obj_s_douzou; +extern cKF_Skeleton_R_c cKF_bs_r_obj_w_douzou; + +static void aDOU_set_bgOffset(ACTOR*, int); +static void aDOU_setup_action(ACTOR*, int); +static void aDOU_keep_item(ACTOR*); + +#pragma pool_data on +static void aDOU_actor_ct(ACTOR* actor, GAME* game) { + static cKF_Skeleton_R_c* skl[2] = { &cKF_bs_r_obj_s_douzou, &cKF_bs_r_obj_w_douzou }; + + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + xyz_t wpos; + + douzou->season = Common_Get(time).season; + cKF_SkeletonInfo_R_ct(&douzou->keyframe, skl[douzou->season == mTM_SEASON_WINTER], NULL, douzou->work_area, douzou->morph_area); + aDOU_set_bgOffset(actor, 1); + + wpos.x = actor->world_position.x + xpostbl[0]; + wpos.y = actor->world_position.y; + wpos.z = actor->world_position.z + zpostbl[0]; + + actor->world_position.y = mCoBG_GetBgY_OnlyCenter_FromWpos2(wpos, 0.0f); + actor->cull_width = 850.0f; + actor->cull_radius = 850.0f; + + aDOU_setup_action((ACTOR*)douzou, 0); + cKF_SkeletonInfo_R_play(&douzou->keyframe); + aDOU_keep_item(actor); +} +#pragma pool_data reset + +static void aDOU_actor_dt(ACTOR* actor, GAME* game) { + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + + cKF_SkeletonInfo_R_dt(&douzou->keyframe); +} + +#include "../rel/ac_douzou_move.c_inc" +#include "../rel/ac_douzou_draw.c_inc" diff --git a/rel/ac_douzou_draw.c_inc b/rel/ac_douzou_draw.c_inc new file mode 100644 index 00000000..ab08b31e --- /dev/null +++ b/rel/ac_douzou_draw.c_inc @@ -0,0 +1,149 @@ +#include "c_keyframe.h" +#include "sys_matrix.h" +#include "m_rcp.h" +#include "bg_item_h.h" +#include "m_house.h" + +#pragma pool_data on +static int aDOU_actor_draw_before(GAME* game, cKF_SkeletonInfo_R_c* keyframe, int joint_idx, Gfx** joint_shape, u8* joint_flags, void* arg, s_xyz* joint_rot, xyz_t* joint_pos) { + static rgba_t primcolor[mHS_HOUSE_NUM] = { + { 255, 255, 0, 255 }, + { 200, 200, 255, 255 }, + { 255, 100, 50, 255 }, + { 0, 255, 40, 255 } + }; + + static rgba_t envcolor[mHS_HOUSE_NUM] = { + { 100, 30, 0, 255 }, + { 80, 80, 100, 255 }, + { 40, 20, 0, 255 }, + { 0, 30, 30, 255 } + }; + + static f32 scltbl[mHS_HOUSE_NUM] = { + 1.00f, + 0.85f, + 0.70f, + 0.55f + }; + + GRAPH* graph = game->graph; + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)arg; + int draw = FALSE; + int color = douzou->arg1; + + if (joint_idx == 2) { + f32 scale = scltbl[color]; + Matrix_scale(scale, scale, scale, 1); + } + + /* Decide which sex of model to draw (keyframes [2, 4] are male, [5, 7] are female) */ + if (joint_idx == 2 || joint_idx == 3 || joint_idx == 4) { + /* Male actor draw check */ + if (douzou->arg0 >= mPr_FACE_TYPE_NUM) { + *joint_shape = NULL; + } + else { + draw = TRUE; + } + } + else if (joint_idx == 5 || joint_idx == 6 || joint_idx == 7) { + /* Female actor draw check */ + if (douzou->arg0 <= mPr_FACE_TYPE7) { + *joint_shape = NULL; + } + else { + draw = TRUE; + } + } + + if (draw || joint_idx == 8) { + Gfx* gfx; + OPEN_DISP(graph); + + gfx = NOW_POLY_OPA_DISP; + gDPPipeSync(gfx++); + gDPSetEnvColor(gfx++, envcolor[color].r, envcolor[color].g, envcolor[color].b, 255); + gDPSetPrimColor(gfx++, 0, 255, primcolor[color].r, primcolor[color].g, primcolor[color].b, primcolor[color].a); + SET_POLY_OPA_DISP(gfx); + + CLOSE_DISP(graph); + } + + return TRUE; +} +#pragma pool_data reset + +#pragma pool_data on +static void aDOU_actor_draw(ACTOR* actor, GAME* game) { + GAME_PLAY* play = (GAME_PLAY*)game; + GRAPH* graph = game->graph; + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + cKF_SkeletonInfo_R_c* keyframe = &douzou->keyframe; + u16* pal = (*Common_Get(clip).structure_clip->get_pal_segment_proc)(aSTR_PAL_DOUZOU_DAI); + int disp_joints = keyframe->skeleton->num_shown_joints; + Mtx* m; + int i; + + _texture_z_light_fog_prim(graph); + + for (i = 0; i < mHS_HOUSE_NUM; i++) { + int type; + int eye_type; + int mouth_type; + if (aDOU_set_check(i)) { + m = GRAPH_ALLOC_TYPE(graph, Mtx, disp_joints); + + if (m == NULL) { + return; + } + + douzou->arg0 = aDOU_get_douzou_type(i); + type = douzou->arg0; + mouth_type = type; + eye_type = type; + + if (douzou->season == mTM_SEASON_WINTER) { + mouth_type = type + mPr_SEX_NUM * mPr_FACE_TYPE_NUM; + eye_type = type + mPr_SEX_NUM * mPr_FACE_TYPE_NUM; + } + + douzou->arg1 = aDOU_get_color(i); + + Matrix_push(); + + { + Gfx* gfx; + + OPEN_DISP(graph); + gfx = NOW_POLY_OPA_DISP; + + gDPPipeSync(gfx++); + + gSPSegment(gfx++, G_MWO_SEGMENT_A, pal); + gSPSegment(gfx++, G_MWO_SEGMENT_8, eye_tbl[eye_type]); + gSPSegment(gfx++, G_MWO_SEGMENT_9, mouth_tbl[mouth_type]); + + Matrix_translate(xpostbl[i] * 100.0f, 0.0f, zpostbl[i] * 100.0f, 1); + + SET_POLY_OPA_DISP(gfx); + CLOSE_DISP(graph); + } + + { + xyz_t wpos; + + xyz_t_move(&wpos, &actor->world_position); + wpos.x += xpostbl[i]; + wpos.z += zpostbl[i]; + + Setpos_HiliteReflect_init(&wpos, play); + } + + cKF_Si3_draw_R_SV(game, keyframe, m, &aDOU_actor_draw_before, NULL, actor); + (*Common_Get(clip).bg_item_clip->draw_shadow_proc)(game, &aDOU_shadow_data, FALSE); + Matrix_pull(); + } + } +} +#pragma pool_data reset diff --git a/rel/ac_douzou_move.c_inc b/rel/ac_douzou_move.c_inc new file mode 100644 index 00000000..b7589ecd --- /dev/null +++ b/rel/ac_douzou_move.c_inc @@ -0,0 +1,297 @@ +#include "m_home.h" +#include "m_house.h" +#include "m_event.h" +#include "m_land.h" +#include "m_private.h" +#include "m_field_info.h" +#include "m_police_box.h" +#include "ef_effect_control.h" +#include "sys_matrix.h" +#include "m_collision_bg.h" +#include "m_msg.h" +#include "libc64/qrand.h" +#include "m_demo.h" +#include "m_player_lib.h" + +static int aDOU_set_check(int house_no) { + int player_no = mHS_get_pl_no(house_no); + Private_c* priv = Save_GetPointer(private[player_no]); + mHm_hs_c* house = Save_GetPointer(homes[house_no]); + + if (mEv_CheckTitleDemo() != 0 && mEv_CheckTitleDemo() != -1 && mEv_CheckTitleDemo() != -9) { + return FALSE; + } + else if (mLd_PlayerManKindCheckNo(player_no) || mPr_CheckPrivate(priv) == FALSE) { + return FALSE; + } + else if (mPr_NullCheckPersonalID(&house->ownerID) == FALSE && house->size_info.next_size == mHm_HOMESIZE_STATUE) { + return TRUE; + } + else { + return FALSE; + } +} + +static int aDOU_get_color(int house_no) { + return Save_Get(homes[house_no]).size_info.statue_rank; +} + +static int aDOU_get_douzou_type(int house_no) { + int player_no = mHS_get_pl_no(house_no); + Private_c* priv = Save_GetPointer(private[player_no]); + s8 sex = mPr_SEX_MALE; + s8 face = mPr_FACE_TYPE0; + + if (mLd_PlayerManKindCheckNo(player_no) == FALSE && mPr_CheckPrivate(priv)) { + sex = priv->gender; + face = priv->face; + } + + return sex * mPr_FACE_TYPE_NUM + face; +} + +static void KeepItem(xyz_t pos) { + mActor_name_t* unit_fg = mFI_GetUnitFG(pos); + if (unit_fg != NULL) { + mFI_Wpos2DepositOFF(pos); + mPB_keep_item(*unit_fg); + mFI_SetFG_common(EMPTY_NO, pos, TRUE); + } +} + +static void aDOU_keep_item(ACTOR* actor) { + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + xyz_t wpos; + int i; + + for (i = 0; i < mHS_HOUSE_NUM; i++) { + if (aDOU_set_check(i)) { + xyz_t_move(&wpos, &actor->world_position); + wpos.x += xpostbl[i]; + wpos.z += zpostbl[i]; + KeepItem(wpos); + } + } +} + +#pragma pool_data on +static int aDOU_setEffect_sub(ACTOR* actor, GAME* game, int house_no, int color) { + static xyz_t offset_tbl[mHS_HOUSE_NUM] = { + { 1.0f, 68.0f, 14.0f }, + { 1.0f, 62.0f, 12.0f }, + { 1.0f, 56.0f, 10.0f }, + { 1.0f, 50.0f, 8.0f } + }; + + static xyz_t mult_p_tbl[mHS_HOUSE_NUM] = { + { 26.0f, 42.0f, 0.0f }, + { 23.0f, 38.0f, 0.0f }, + { 20.0f, 34.0f, 0.0f }, + { 17.0f, 30.0f, 0.0f } + }; + + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + xyz_t ofs; + xyz_t eff_pos; + xyz_t wpos; + + Matrix_push(); + + /* Initialize base position */ + xyz_t_move(&wpos, &actor->world_position); + wpos.x += xpostbl[house_no]; + wpos.z += zpostbl[house_no]; + Matrix_translate(wpos.x, wpos.y, wpos.z, 0); + + /* Initialize effect offset */ + xyz_t_move(&ofs, &offset_tbl[color]); + + /* Randomize effect offset */ + ofs.x += mult_p_tbl[color].x * (fqrand() - 0.5f); + ofs.y += mult_p_tbl[color].y * (fqrand() - 0.5f); + ofs.z += mult_p_tbl[color].z * (fqrand() - 0.5f); + + /* Move effect offset into a world position */ + Matrix_Position(&ofs, &eff_pos); + + /* Spawn effect */ + (*Common_Get(clip).effect_clip->effect_make_proc)(eEC_DOUZOU_LIGHT, eff_pos, 1, 0, game, DOUZOU, color, 0); + + Matrix_pull(); + + return TRUE; +} +#pragma pool_data reset + +static void aDOU_setEffect(ACTOR* actor, GAME* game) { + static f32 b_timetbl[mHS_HOUSE_NUM] = { 5.0f, 15.0f, 20.0f, 30.0f }; + static f32 r_timetbl[mHS_HOUSE_NUM] = { 10.0f, 30.0f, 40.0f, 60.0f }; + + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + + s16 time_tbl[mHS_HOUSE_NUM]; + int i; + + time_tbl[0] = douzou->arg0_f; + time_tbl[1] = douzou->arg1_f; + time_tbl[2] = douzou->arg2_f; + time_tbl[3] = douzou->arg3_f; + + for (i = 0; i < mHS_HOUSE_NUM; i++) { + if (aDOU_set_check(i)) { + if (time_tbl[i] == 0) { + int color = aDOU_get_color(i); + time_tbl[i] = (b_timetbl[color] + r_timetbl[color] * fqrand()); + aDOU_setEffect_sub(actor, game, i, color); + } + else { + time_tbl[i]--; + } + } + } + + douzou->arg0_f = time_tbl[0]; + douzou->arg1_f = time_tbl[1]; + douzou->arg2_f = time_tbl[2]; + douzou->arg3_f = time_tbl[3]; +} + +static void aDOU_set_bgOffset(ACTOR* actor, int height) { + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + xyz_t wpos; + s16 ofs = height == 0 ? 9 : 9; + int i; + for (i = 0; i < mHS_HOUSE_NUM; i++) { + if (aDOU_set_check(i)) { + xyz_t_move(&wpos, &actor->home_position); + wpos.x += xpostbl[i]; + wpos.z += zpostbl[i]; + + mCoBG_SetPlussOffset(wpos, ofs, 100); + } + } +} + +static void aDOU_set_talk_info(ACTOR* actor) { + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + mMsg_Window_c* msg_win = mMsg_Get_base_window_p(); + int player_no = mHS_get_pl_no(douzou->arg2); + u8 player_name[PLAYER_NAME_LEN]; + rgba_t window_color; + + if (mLd_PlayerManKindCheckNo(player_no) == FALSE && mPr_GetPlayerName(player_name, player_no)) { + mMsg_Set_free_str(msg_win, 0, player_name, PLAYER_NAME_LEN); + } + + mDemo_Set_talk_turn(FALSE); + mDemo_Set_msg_num(0x136B); + mDemo_Set_talk_display_name(FALSE); + mDemo_Set_camera(TRUE); + mPlib_Set_able_hand_all_item_in_demo(TRUE); + mDemo_Set_ListenAble(); + + window_color.r = 185; + window_color.g = 60; + window_color.b = 40; + window_color.a = 255; + + mDemo_Set_talk_window_color(&window_color); +} + +static void aDOU_wait(ACTOR* actor, GAME* game) { + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + GAME_PLAY* play = (GAME_PLAY*)game; + PLAYER_ACTOR* player = get_player_actor_withoutCheck(play); + xyz_t wpos; + xyz_t t_wpos; + s16 target; + s16 now_angle; + s_xyz target_rot; + int i; + + if (mDemo_Check(mDemo_TYPE_SPEAK, actor) == TRUE) { + i = douzou->arg2; + + xyz_t_move(&wpos, &actor->world_position); + wpos.x += xpostbl[i]; + wpos.z += zpostbl[i]; + + target = search_position_angleY(&player->actor_class.world_position, &wpos); + now_angle = player->actor_class.shape_info.rotation.y; + add_calc_short_angle2(&now_angle, target, 0.3f, 0x1000, 0); + target_rot.x = player->actor_class.shape_info.rotation.x; + target_rot.y = now_angle; + target_rot.z = player->actor_class.shape_info.rotation.z; + + (*get_player_actor_withoutCheck((GAME_PLAY*)gamePT)->Set_force_position_angle_proc)(gamePT, NULL, &target_rot, mPlayer_FORCE_POSITION_ANGLE_ROTY); + } + else { + if (chkTrigger(BUTTON_A)) { + if (ABS(player->actor_class.shape_info.rotation.y) >= 0x6000 && mDemo_Get_talk_actor() == NULL) { + s_xyz test; + f32 dist_xz; + s16 angle_y; + + xyz_t_move(&t_wpos, &actor->world_position); + + for (i = 0; i < mHS_HOUSE_NUM; i++) { + if (aDOU_set_check(i)) { + wpos.x = t_wpos.x + xpostbl[i]; + wpos.z = t_wpos.z + zpostbl[i]; + + dist_xz = search_position_distanceXZ(&player->actor_class.world_position, &wpos); + now_angle = search_position_angleY(&wpos, &player->actor_class.world_position); + + + if (dist_xz > 50.0f) { + continue; + } + + if (ABS((int)now_angle) > 0x1800) { + continue; + } + + /* resetti check in the train station acre */ + if (Common_Get(reset_flag) == TRUE) { + Common_Set(reset_type, 4); + return; + } + + douzou->arg2 = i; // set current statue idx + mDemo_Request(mDemo_TYPE_SPEAK, actor, &aDOU_set_talk_info); // tell game to process demo sequence + return; + } + } + } + } + } +} + +extern cKF_Animation_R_c cKF_ba_r_obj_s_douzou; +extern cKF_Animation_R_c cKF_ba_r_obj_w_douzou; + +static void aDOU_setup_action(ACTOR* actor, int action) { + static cKF_Animation_R_c* ani[2] = { &cKF_ba_r_obj_s_douzou, &cKF_ba_r_obj_w_douzou }; + static aSTR_MOVE_PROC process[1] = { &aDOU_wait }; + + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + + cKF_SkeletonInfo_R_init(&douzou->keyframe, douzou->keyframe.skeleton, ani[douzou->season == mTM_SEASON_WINTER], 1.0f, 1.0f, 1.0f, 0.5f, 0.0f, cKF_FRAMECONTROL_REPEAT, NULL); + douzou->action_proc = process[action]; + douzou->action = action; +} + +static void aDOU_actor_move(ACTOR* actor, GAME* game) { + STRUCTURE_ACTOR* douzou = (STRUCTURE_ACTOR*)actor; + + douzou->keyframe_state = cKF_SkeletonInfo_R_play(&douzou->keyframe); + douzou->keyframe_saved_keyframe = douzou->keyframe.frame_control.current_frame; + (*douzou->action_proc)((ACTOR*)douzou, game); + aDOU_setEffect(actor, game); +} + +static void aDOU_actor_init(ACTOR* actor, GAME* game) { + mFI_SetFG_common(DUMMY_DOUZOU, actor->home_position, FALSE); + aDOU_actor_move(actor, game); + actor->mv_proc = &aDOU_actor_move; +} diff --git a/rel/ac_haniwa.c b/rel/ac_haniwa.c index 7d93a752..0f6d2547 100644 --- a/rel/ac_haniwa.c +++ b/rel/ac_haniwa.c @@ -358,13 +358,13 @@ static void aHNW_dance(ACTOR* actor, GAME* game) { aHNW_setupAction(actor, game, aHNW_ACTION_WAIT); } else { - if (mDemo_Check(7, (ACTOR*)haniwa) == TRUE && mDemo_Check_ListenAble() == FALSE) { + if (mDemo_Check(mDemo_TYPE_TALK, (ACTOR*)haniwa) == TRUE && mDemo_Check_ListenAble() == FALSE) { int msg_idx = aHNW_decide_msg_idx_dance(actor); mDemo_Set_ListenAble(); aHNW_setupAction(actor, game, next_act_idx[msg_idx]); } else if (aHNW_check_house_door((ACTOR*)haniwa, game) == FALSE) { - mDemo_Request(7, (ACTOR*)haniwa, &aHNW_set_talk_info_dance); + mDemo_Request(mDemo_TYPE_TALK, (ACTOR*)haniwa, &aHNW_set_talk_info_dance); } } } @@ -382,7 +382,7 @@ static void aHNW_check_proceeds(ACTOR* actor, GAME* game) { HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor; - if (mDemo_Get_OrderValue(4, 9)) { + if (mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9)) { int house_idx = haniwa->house_idx; Haniwa_c* house_haniwa = &Save_Get(homes[house_idx]).haniwa; int handover_state; @@ -397,7 +397,7 @@ static void aHNW_check_proceeds(ACTOR* actor, GAME* game) { mMsg_Set_continue_msg_num(mMsg_Get_base_window_p(), msg_no[handover_state]); aHNW_setupAction(actor, game, next_act_idx[handover_state]); - mDemo_Set_OrderValue(4, 9, 0); + mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0); } } @@ -405,7 +405,7 @@ static void aHNW_talk_with_master(ACTOR* actor, GAME* game) { HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor; mMsg_Window_c* msg_win = mMsg_Get_base_window_p(); - if (mDemo_Get_OrderValue(4, 9) && mMsg_Check_MainNormalContinue(msg_win) == TRUE) { + if (mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9) && mMsg_Check_MainNormalContinue(msg_win) == TRUE) { int action = -1; switch (mChoice_Get_ChoseNum(mChoice_Get_base_window_p())) { @@ -436,7 +436,7 @@ static void aHNW_talk_with_master(ACTOR* actor, GAME* game) { } if (action != -1) { - mDemo_Set_OrderValue(4, 9, 0); + mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0); aHNW_setupAction(actor, game, action); } } @@ -446,7 +446,7 @@ static void aHNW_talk_with_master2(ACTOR* actor, GAME* game) { HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor; mMsg_Window_c* msg_win = mMsg_Get_base_window_p(); - if (mDemo_Get_OrderValue(4, 9) && mMsg_Check_MainNormalContinue(msg_win) == TRUE) { + if (mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9) && mMsg_Check_MainNormalContinue(msg_win) == TRUE) { int action = -1; switch (mChoice_Get_ChoseNum(mChoice_Get_base_window_p())) { @@ -477,14 +477,14 @@ static void aHNW_talk_with_master2(ACTOR* actor, GAME* game) { } if (action != -1) { - mDemo_Set_OrderValue(4, 9, 0); + mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0); aHNW_setupAction(actor, game, action); } } } static void aHNW_talk_end_wait(ACTOR* actor, GAME* game) { - if (mDemo_Check(7, actor) == FALSE) { + if (mDemo_Check(mDemo_TYPE_TALK, actor) == FALSE) { aHNW_setupAction(actor, game, aHNW_ACTION_DANCE); } } @@ -555,7 +555,7 @@ static void aHNW_menu_end_wait(ACTOR* actor, GAME* game) { static void aHNW_talk_with_guest(ACTOR* actor, GAME* game) { HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor; - if (mDemo_Get_OrderValue(4, 0)) { + if (mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 0)) { mMsg_Window_c* msg_win = mMsg_Get_base_window_p(); if (mMsg_Check_MainNormalContinue(msg_win) == TRUE) { int action = -1; @@ -582,7 +582,7 @@ static void aHNW_talk_with_guest(ACTOR* actor, GAME* game) { } if (action != -1) { - mDemo_Set_OrderValue(4, 0, 0); + mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 0, 0); aHNW_setupAction(actor, game, action); } } @@ -613,7 +613,7 @@ static void aHNW_menu_end_wait_for_guest(ACTOR* actor, GAME* game) { static void aHNW_save_check(ACTOR* actor, GAME* game) { HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor; mMsg_Window_c* msg_win = mMsg_Get_base_window_p(); - int order_value = mDemo_Get_OrderValue(4, 9); + int order_value = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9); int action = -1; if (order_value && mMsg_Check_MainNormalContinue(msg_win) == TRUE) { @@ -635,7 +635,7 @@ static void aHNW_save_check(ACTOR* actor, GAME* game) { } if (action != -1) { - mDemo_Set_OrderValue(4, 9, 0); + mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0); aHNW_setupAction(actor, game, action); } } @@ -644,7 +644,7 @@ static void aHNW_save_check(ACTOR* actor, GAME* game) { static void aHNW_roof_check(ACTOR* actor, GAME* game) { HANIWA_ACTOR* haniwa = (HANIWA_ACTOR*)actor; mMsg_Window_c* msg_win = mMsg_Get_base_window_p(); - int order_value = mDemo_Get_OrderValue(4, 9); + int order_value = mDemo_Get_OrderValue(mDemo_ORDER_NPC0, 9); int action = -1; if (order_value && mMsg_Check_MainNormalContinue(msg_win) == TRUE) { @@ -672,7 +672,7 @@ static void aHNW_roof_check(ACTOR* actor, GAME* game) { } if (action != -1) { - mDemo_Set_OrderValue(4, 9, 0); + mDemo_Set_OrderValue(mDemo_ORDER_NPC0, 9, 0); aHNW_setupAction(actor, game, action); } } @@ -686,7 +686,7 @@ static void aHNW_save_end_wait(ACTOR* actor, GAME* game) { mBGMPsComp_make_ps_demo(0x41, 0x168); } - if (mDemo_Check(7, actor) == FALSE) { + if (mDemo_Check(mDemo_TYPE_TALK, actor) == FALSE) { aHNW_setupAction(actor, game, aHNW_ACTION_PL_APPROACH_DOOR); aHNW_set_save_permission(); } diff --git a/rel/ac_sample.c b/rel/ac_sample.c index a5af5664..42216fdb 100644 --- a/rel/ac_sample.c +++ b/rel/ac_sample.c @@ -72,8 +72,8 @@ static void Ac_Sample_Actor_main_wait(SAMPLE_ACTOR* actor, GAME_PLAY* play) { Actor_world_to_eye((ACTOR*)actor, 48.0f); Ac_Sample_Excute_Corect(actor, play); - if (mDemo_Check(7, (ACTOR*)actor) == FALSE) { - mDemo_Request(7, (ACTOR*)actor, &Ac_Sample_Actor_wait_demo_ct); + if (mDemo_Check(mDemo_TYPE_TALK, (ACTOR*)actor) == FALSE) { + mDemo_Request(mDemo_TYPE_TALK, (ACTOR*)actor, &Ac_Sample_Actor_wait_demo_ct); } else { actor->main_action = 1; @@ -85,7 +85,7 @@ static void Ac_Sample_Actor_main_talk(SAMPLE_ACTOR* actor, GAME_PLAY* play) { Actor_world_to_eye((ACTOR*)actor, 48.0f); Ac_Sample_Excute_Corect(actor, play); - if (mDemo_Check(7, (ACTOR*)actor)) { + if (mDemo_Check(mDemo_TYPE_TALK, (ACTOR*)actor)) { s16 angle = add_calc_short_angle2(&actor->actor_class.shape_info.rotation.y, actor->actor_class.player_angle_y, 1.0f, 5000, 100); actor->actor_class.world_rotation.y = actor->actor_class.shape_info.rotation.y; diff --git a/rel/ac_structure.c b/rel/ac_structure.c index 424d346c..92bb269b 100644 --- a/rel/ac_structure.c +++ b/rel/ac_structure.c @@ -83,95 +83,95 @@ static u16* aSTR_get_pal_segment(s16 structure_type) { typedef struct structure_setup_info_s { s16 profile; s16 structure_type; // aSTR_TYPE_* - s16 pal_no; + s16 pal_no; // aSTR_PAL_* s16 pad; } aSTR_setup_info; static STRUCTURE_ACTOR* aSTR_setupActor_proc(GAME* game, mActor_name_t structure_name, s16 arg, f32 x, f32 z) { static aSTR_setup_info setupInfo_table[] = { - { mAc_PROFILE_MYHOUSE, 5, 25, 0 }, - { mAc_PROFILE_MYHOUSE, 5, 26, 0 }, - { mAc_PROFILE_MYHOUSE, 5, 27, 0 }, - { mAc_PROFILE_MYHOUSE, 5, 28, 0 }, - { mAc_PROFILE_SHOP, 8, 37, 0 }, - { mAc_PROFILE_CONVENI, 9, 38, 0 }, - { mAc_PROFILE_SUPER, 10, 39, 0 }, - { mAc_PROFILE_DEPART, 11, 40, 0 }, - { mAc_PROFILE_POST_OFFICE, 12, 41, 0 }, - { mAc_PROFILE_STATION, 13, 42, 0 }, - { mAc_PROFILE_TRAIN0, 16, 57, 0 }, - { mAc_PROFILE_TRAIN1, 17, 58, 0 }, - { mAc_PROFILE_POLICE_BOX, 18, 59, 0 }, - { mAc_PROFILE_FALLS, 19, 60, 0 }, - { mAc_PROFILE_FALLSESW, 20, 61, 0 }, - { mAc_PROFILE_FALLSESW, 20, 61, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, - { mAc_PROFILE_SHRINE, 22, 63, 0 }, - { mAc_PROFILE_BRSHOP, 23, 64, 0 }, - { mAc_PROFILE_BUGGY, 24, 65, 0 }, - { mAc_PROFILE_S_CAR, 25, 66, 0 }, - { mAc_PROFILE_KAMAKURA, 26, 67, 0 }, - { mAc_PROFILE_GOZA, 27, 68, 0 }, - { mAc_PROFILE_GOZA, 27, 68, 0 }, - { mAc_PROFILE_RADIO, 28, 69, 0 }, - { mAc_PROFILE_YATAI, 29, 70, 0 }, - { mAc_PROFILE_YATAI, 29, 70, 0 }, - { mAc_PROFILE_TUKIMI, 30, 71, 0 }, - { mAc_PROFILE_TUKIMI, 31, 72, 0 }, - { mAc_PROFILE_MIKUJI, 32, 73, 0 }, - { mAc_PROFILE_COUNT, 33, 74, 0 }, - { mAc_PROFILE_COUNT02, 34, 75, 0 }, - { mAc_PROFILE_TAMA, 35, 76, 0 }, - { mAc_PROFILE_TAMA, 36, 77, 0 }, - { mAc_PROFILE_KAGO, 35, 76, 0 }, - { mAc_PROFILE_KAGO, 36, 77, 0 }, - { mAc_PROFILE_TURI, 37, 78, 0 }, - { mAc_PROFILE_TURI, 38, 79, 0 }, - { mAc_PROFILE_KOINOBORI, 39, 80, 0 }, - { mAc_PROFILE_DUMP, 40, 81, 0 }, - { mAc_PROFILE_WINDMILL, 41, 82, 0 }, - { mAc_PROFILE_WINDMILL, 41, 83, 0 }, - { mAc_PROFILE_WINDMILL, 41, 84, 0 }, - { mAc_PROFILE_WINDMILL, 41, 85, 0 }, - { mAc_PROFILE_WINDMILL, 41, 86, 0 }, - { mAc_PROFILE_LOTUS, 42, 87, 0 }, - { mAc_PROFILE_MIKANBOX, 43, 88, 0 }, - { mAc_PROFILE_DOUZOU, 44, 89, 0 }, - { mAc_PROFILE_TOUDAI, 45, 90, 0 }, - { mAc_PROFILE_GHOG, 46, 91, 0 }, - { mAc_PROFILE_HTABLE, 47, 91, 0 }, - { mAc_PROFILE_HTABLE, 47, 91, 0 }, - { mAc_PROFILE_HTABLE, 47, 91, 0 }, - { mAc_PROFILE_TENT, 26, 67, 0 }, - { mAc_PROFILE_MUSEUM, 48, 91, 0 }, - { mAc_PROFILE_BRIDGE_A, 49, 92, 0 }, - { mAc_PROFILE_BRIDGE_A, 49, 92, 0 }, - { mAc_PROFILE_NEEDLEWORK_SHOP, 51, 93, 0 }, - { mAc_PROFILE_FLAG, 52, 94, 0 }, - { mAc_PROFILE_BOAT, 53, 95, 0 }, - { mAc_PROFILE_COTTAGE_MY, 54, 96, 0 }, - { mAc_PROFILE_COTTAGE_NPC, 55, 97, 0 }, - { mAc_PROFILE_RESERVE, 21, 62, 0 }, + { mAc_PROFILE_MYHOUSE, aSTR_TYPE_MYHOME, aSTR_PAL_MYHOME_A, 0 }, + { mAc_PROFILE_MYHOUSE, aSTR_TYPE_MYHOME, aSTR_PAL_MYHOME_B, 0 }, + { mAc_PROFILE_MYHOUSE, aSTR_TYPE_MYHOME, aSTR_PAL_MYHOME_C, 0 }, + { mAc_PROFILE_MYHOUSE, aSTR_TYPE_MYHOME, aSTR_PAL_MYHOME_D, 0 }, + { mAc_PROFILE_SHOP, aSTR_TYPE_SHOP1, aSTR_PAL_SHOP1, 0 }, + { mAc_PROFILE_CONVENI, aSTR_TYPE_SHOP2, aSTR_PAL_SHOP2, 0 }, + { mAc_PROFILE_SUPER, aSTR_TYPE_SHOP3, aSTR_PAL_SHOP3, 0 }, + { mAc_PROFILE_DEPART, aSTR_TYPE_SHOP4, aSTR_PAL_SHOP4, 0 }, + { mAc_PROFILE_POST_OFFICE, aSTR_TYPE_POST_OFFICE, aSTR_PAL_POST_OFFICE, 0 }, + { mAc_PROFILE_STATION, aSTR_TYPE_STATION1, aSTR_PAL_STATION1_A, 0 }, + { mAc_PROFILE_TRAIN0, aSTR_TYPE_TRAIN0, aSTR_PAL_TRAIN1_A1, 0 }, + { mAc_PROFILE_TRAIN1, aSTR_TYPE_TRAIN1, aSTR_PAL_TRAIN1_A2, 0 }, + { mAc_PROFILE_POLICE_BOX, aSTR_TYPE_POLICE_BOX, aSTR_PAL_POLICE_BOX, 0 }, + { mAc_PROFILE_FALLS, aSTR_TYPE_FALLS, aSTR_PAL_FALLS, 0 }, + { mAc_PROFILE_FALLSESW, aSTR_TYPE_FALLSESW, aSTR_PAL_FALLSESW, 0 }, + { mAc_PROFILE_FALLSESW, aSTR_TYPE_FALLSESW, aSTR_PAL_FALLSESW, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, + { mAc_PROFILE_SHRINE, aSTR_TYPE_SHRINE, aSTR_PAL_SHRINE, 0 }, + { mAc_PROFILE_BRSHOP, aSTR_TYPE_BRSHOP, aSTR_PAL_BR_SHOP, 0 }, + { mAc_PROFILE_BUGGY, aSTR_TYPE_BUGGY, aSTR_PAL_BUGGY, 0 }, + { mAc_PROFILE_S_CAR, aSTR_TYPE_S_CAR, aSTR_PAL_S_CAR, 0 }, + { mAc_PROFILE_KAMAKURA, aSTR_TYPE_KAMAKURA, aSTR_PAL_KAMAKURA, 0 }, + { mAc_PROFILE_GOZA, aSTR_TYPE_GOZA, aSTR_PAL_GOZA, 0 }, + { mAc_PROFILE_GOZA, aSTR_TYPE_GOZA, aSTR_PAL_GOZA, 0 }, + { mAc_PROFILE_RADIO, aSTR_TYPE_RADIO, aSTR_PAL_RADIO, 0 }, + { mAc_PROFILE_YATAI, aSTR_TYPE_YATAI, aSTR_PAL_YATAI, 0 }, + { mAc_PROFILE_YATAI, aSTR_TYPE_YATAI, aSTR_PAL_YATAI, 0 }, + { mAc_PROFILE_TUKIMI, aSTR_TYPE_TUKIMI, aSTR_PAL_TUKIMI, 0 }, + { mAc_PROFILE_TUKIMI, aSTR_TYPE_TUKIMI2, aSTR_PAL_TUKIMI2, 0 }, + { mAc_PROFILE_MIKUJI, aSTR_TYPE_MIKUJI, aSTR_PAL_MIKUJI, 0 }, + { mAc_PROFILE_COUNT, aSTR_TYPE_COUNT, aSTR_PAL_COUNT, 0 }, + { mAc_PROFILE_COUNT02, aSTR_TYPE_COUNT02, aSTR_PAL_COUNT02, 0 }, + { mAc_PROFILE_TAMA, aSTR_TYPE_SPORTSFAIR_A, aSTR_PAL_KAGO_R, 0 }, + { mAc_PROFILE_TAMA, aSTR_TYPE_SPORTSFAIR_B, aSTR_PAL_KAGO_W, 0 }, + { mAc_PROFILE_KAGO, aSTR_TYPE_SPORTSFAIR_A, aSTR_PAL_KAGO_R, 0 }, + { mAc_PROFILE_KAGO, aSTR_TYPE_SPORTSFAIR_B, aSTR_PAL_KAGO_W, 0 }, + { mAc_PROFILE_TURI, aSTR_TYPE_TURI, aSTR_PAL_TURI, 0 }, + { mAc_PROFILE_TURI, aSTR_TYPE_TURI2, aSTR_PAL_TURI2, 0 }, + { mAc_PROFILE_KOINOBORI, aSTR_TYPE_KOINOBORI, aSTR_PAL_KOINOBORI_A, 0 }, + { mAc_PROFILE_DUMP, aSTR_TYPE_DUMP, aSTR_PAL_DUMP, 0 }, + { mAc_PROFILE_WINDMILL, aSTR_TYPE_WINDMILL, aSTR_PAL_WINDMILL_A, 0 }, + { mAc_PROFILE_WINDMILL, aSTR_TYPE_WINDMILL, aSTR_PAL_WINDMILL_B, 0 }, + { mAc_PROFILE_WINDMILL, aSTR_TYPE_WINDMILL, aSTR_PAL_WINDMILL_C, 0 }, + { mAc_PROFILE_WINDMILL, aSTR_TYPE_WINDMILL, aSTR_PAL_WINDMILL_D, 0 }, + { mAc_PROFILE_WINDMILL, aSTR_TYPE_WINDMILL, aSTR_PAL_WINDMILL_E, 0 }, + { mAc_PROFILE_LOTUS, aSTR_TYPE_LOTUS, aSTR_PAL_01_LOTUS, 0 }, + { mAc_PROFILE_MIKANBOX, aSTR_TYPE_MIKANBOX, aSTR_PAL_MIKANBOX, 0 }, + { mAc_PROFILE_DOUZOU, aSTR_TYPE_DOUZOU, aSTR_PAL_DOUZOU_DAI, 0 }, + { mAc_PROFILE_TOUDAI, aSTR_TYPE_TOUDAI, aSTR_PAL_TOUDAI, 0 }, + { mAc_PROFILE_GHOG, aSTR_TYPE_GHOG, aSTR_PAL_MUSEUM, 0 }, + { mAc_PROFILE_HTABLE, aSTR_TYPE_HTABLE, aSTR_PAL_MUSEUM, 0 }, + { mAc_PROFILE_HTABLE, aSTR_TYPE_HTABLE, aSTR_PAL_MUSEUM, 0 }, + { mAc_PROFILE_HTABLE, aSTR_TYPE_HTABLE, aSTR_PAL_MUSEUM, 0 }, + { mAc_PROFILE_TENT, aSTR_TYPE_KAMAKURA, aSTR_PAL_KAMAKURA, 0 }, + { mAc_PROFILE_MUSEUM, aSTR_TYPE_MUSEUM, aSTR_PAL_MUSEUM, 0 }, + { mAc_PROFILE_BRIDGE_A, aSTR_TYPE_BRIDGE_A, aSTR_PAL_BRIDGE_A, 0 }, + { mAc_PROFILE_BRIDGE_A, aSTR_TYPE_BRIDGE_A, aSTR_PAL_BRIDGE_A, 0 }, + { mAc_PROFILE_NEEDLEWORK_SHOP, aSTR_TYPE_NEEDLEWORK_SHOP, aSTR_PAL_TAILOR, 0 }, + { mAc_PROFILE_FLAG, aSTR_TYPE_FLAG, aSTR_PAL_FLAG, 0 }, + { mAc_PROFILE_BOAT, aSTR_TYPE_BOAT, aSTR_PAL_BOAT, 0 }, + { mAc_PROFILE_COTTAGE_MY, aSTR_TYPE_COTTAGE_MY, aSTR_PAL_MYHOME_ISLAND, 0 }, + { mAc_PROFILE_COTTAGE_NPC, aSTR_TYPE_COTTAGE_NPC, aSTR_PAL_HOUSE_I, 0 }, + { mAc_PROFILE_RESERVE, aSTR_TYPE_RESERVE, aSTR_PAL_RESERVE, 0 }, }; STRUCTURE_ACTOR* str_actor; diff --git a/rel/sys_matrix.c b/rel/sys_matrix.c index efb90233..f70dfc19 100644 --- a/rel/sys_matrix.c +++ b/rel/sys_matrix.c @@ -382,45 +382,45 @@ void Matrix_rotateXYZ(s16 x, s16 y, s16 z, int mode){ } } -void Matrix_softcv3_mult(xyz_t* src, s_xyz* dest) { +void Matrix_softcv3_mult(xyz_t* pos, s_xyz* rot) { MtxF* curm = Matrix_now; f32 sin, cos; f32 fp, st2; - sin = sin_s(dest->z); - cos = cos_s(dest->z); + sin = sin_s(rot->z); + cos = cos_s(rot->z); fp = curm->xx; st2 = curm->xy; - curm->xw = curm->xw + (fp * src->x + st2 * src->y + curm->xz * src->z); + curm->xw = curm->xw + (fp * pos->x + st2 * pos->y + curm->xz * pos->z); curm->xx = (fp * cos) + (st2 * sin); curm->xy = -(fp * sin) + (st2 * cos); fp = curm->yx; st2 = curm->yy; - curm->yw = curm->yw + (fp * src->x + st2 * src->y + curm->yz * src->z); + curm->yw = curm->yw + (fp * pos->x + st2 * pos->y + curm->yz * pos->z); curm->yx = (fp * cos) + (st2 * sin); curm->yy = -(fp * sin) + (st2 * cos); fp = curm->zx; st2 = curm->zy; - curm->zw = curm->zw + (curm->zx * src->x + curm->zy * src->y + curm->zz * src->z); + curm->zw = curm->zw + (curm->zx * pos->x + curm->zy * pos->y + curm->zz * pos->z); curm->zx = (fp * cos) + (st2 * sin); curm->zy = -(fp * sin) + (st2 * cos); fp = curm->wx; st2 = curm->wy; - curm->ww = curm->ww + (curm->wx * src->x + curm->wy * src->y + curm->wz * src->z); + curm->ww = curm->ww + (curm->wx * pos->x + curm->wy * pos->y + curm->wz * pos->z); curm->wx = (fp * cos) + (st2 * sin); curm->wy = -(fp * sin) + (st2 * cos); - if(dest->y != 0){ + if(rot->y != 0){ - sin = sin_s(dest->y); - cos = cos_s(dest->y); + sin = sin_s(rot->y); + cos = cos_s(rot->y); fp = curm->xx; st2 = curm->xz; @@ -445,9 +445,9 @@ void Matrix_softcv3_mult(xyz_t* src, s_xyz* dest) { } - if(dest->x != 0){ - sin = sin_s(dest->x); - cos = cos_s(dest->x); + if(rot->x != 0){ + sin = sin_s(rot->x); + cos = cos_s(rot->x); fp = curm->xy; st2 = curm->xz;