Scaffold all furniture actor files

This commit is contained in:
Cuyler36
2024-03-03 18:43:10 -05:00
parent 106a4a511c
commit 22815e7b1d
697 changed files with 18083 additions and 143 deletions
+105 -106
View File
@@ -13,43 +13,43 @@ extern "C" {
typedef struct furniture_actor_s FTR_ACTOR;
enum {
aFTR_SHAPE_TYPEB_90, /* 2x1 (facing up)*/
aFTR_SHAPE_TYPEB_180, /* 2x1 [- *] */
aFTR_SHAPE_TYPEB_270, /* 2x1 (facing down) */
aFTR_SHAPE_TYPEB_0, /* 2x1 [* -] */
aFTR_SHAPE_TYPEA, /* 1x1 */
aFTR_SHAPE_TYPEC, /* 2x2 */
aFTR_SHAPE_TYPEB_90, /* 2x1 (facing up)*/
aFTR_SHAPE_TYPEB_180, /* 2x1 [- *] */
aFTR_SHAPE_TYPEB_270, /* 2x1 (facing down) */
aFTR_SHAPE_TYPEB_0, /* 2x1 [* -] */
aFTR_SHAPE_TYPEA, /* 1x1 */
aFTR_SHAPE_TYPEC, /* 2x2 */
aFTR_SHAPE_TYPE_NUM
aFTR_SHAPE_TYPE_NUM
};
enum {
aFTR_INTERACTION_STORAGE_DRAWERS, // dressers
aFTR_INTERACTION_STORAGE_WARDROBE, // double doors
aFTR_INTERACTION_STORAGE_CLOSET, // single door
aFTR_INTERACTION_MUSIC_DISK,
aFTR_INTERACTION_NO_COLLISION,
aFTR_INTERACTION_HANIWA,
aFTR_INTERACTION_FISH,
aFTR_INTERACTION_INSECT,
aFTR_INTERACTION_MANNEKIN,
aFTR_INTERACTION_UMBRELLA,
aFTR_INTERACTION_FOSSIL,
aFTR_INTERACTION_FAMICOM,
aFTR_INTERACTION_START_DISABLED, // mainly used for TVs to be off when placed
// there may be more types, but I didn't see any
aFTR_INTERACTION_STORAGE_DRAWERS, // dressers
aFTR_INTERACTION_STORAGE_WARDROBE, // double doors
aFTR_INTERACTION_STORAGE_CLOSET, // single door
aFTR_INTERACTION_MUSIC_DISK,
aFTR_INTERACTION_NO_COLLISION,
aFTR_INTERACTION_HANIWA,
aFTR_INTERACTION_FISH,
aFTR_INTERACTION_INSECT,
aFTR_INTERACTION_MANNEKIN,
aFTR_INTERACTION_UMBRELLA,
aFTR_INTERACTION_FOSSIL,
aFTR_INTERACTION_FAMICOM,
aFTR_INTERACTION_START_DISABLED, // mainly used for TVs to be off when placed
// there may be more types, but I didn't see any
aFTR_INTERACTION_NUM
aFTR_INTERACTION_NUM
};
enum {
aFTR_CONTACT_ACTION_CHAIR_UNIDIRECTIONAL, // only can sit from the front
aFTR_CONTACT_ACTION_CHAIR_MULTIDIRECTIONAL, // can sit from any direction
aFTR_CONTACT_ACTION_CHAIR_SOFA, // cam sit anywhere from the front
aFTR_CONTACT_ACTION_BED_SINGLE, // single bed (can't roll)
aFTR_CONTACT_ACTION_BED_DOUBLE, // double bed (can roll)
aFTR_CONTACT_ACTION_CHAIR_UNIDIRECTIONAL, // only can sit from the front
aFTR_CONTACT_ACTION_CHAIR_MULTIDIRECTIONAL, // can sit from any direction
aFTR_CONTACT_ACTION_CHAIR_SOFA, // cam sit anywhere from the front
aFTR_CONTACT_ACTION_BED_SINGLE, // single bed (can't roll)
aFTR_CONTACT_ACTION_BED_DOUBLE, // double bed (can roll)
aFTR_CONTACT_ACTION_NUM
aFTR_CONTACT_ACTION_NUM
};
typedef void (*aFTR_FTR_CT_PROC)(FTR_ACTOR*, u8*);
@@ -59,99 +59,98 @@ typedef void (*aFTR_FTR_DT_PROC)(FTR_ACTOR*, u8*);
typedef void (*aFTR_FTR_DMA_PROC)(mActor_name_t, u8*);
typedef struct ftr_vtbl_s {
aFTR_FTR_CT_PROC ct_proc;
aFTR_FTR_MOVE_PROC move_proc;
aFTR_FTR_DRAW_PROC draw_proc;
aFTR_FTR_DT_PROC dt_proc;
aFTR_FTR_DMA_PROC dma_proc;
aFTR_FTR_CT_PROC ct_proc;
aFTR_FTR_MOVE_PROC move_proc;
aFTR_FTR_DRAW_PROC draw_proc;
aFTR_FTR_DT_PROC dt_proc;
aFTR_FTR_DMA_PROC dma_proc;
} aFTR_vtable_c;
typedef struct ftr_rig_s {
cKF_Skeleton_R_c* skeleton;
cKF_Animation_R_c* animation;
f32 speed;
cKF_Skeleton_R_c* skeleton;
cKF_Animation_R_c* animation;
f32 speed;
} aFTR_rig_c;
typedef struct ftr_tex_animation_s {
u8** animation;
int animation_count;
u8** animation;
int animation_count;
} aFTR_tex_anim_c;
typedef struct ftr_profile_s {
Gfx* opaque0;
Gfx* opaque1;
Gfx* translucent0;
Gfx* translucent1;
u8* texture;
u16* palette;
aFTR_rig_c* rig;
aFTR_tex_anim_c* tex_anim;
f32 height;
f32 scale;
u8 shape; /* aFTR_SHAPE_TYPE* */
u8 move_bg_type; /* mCoBG_FTR_TYPE* */
u8 check_rotation; /* when non-zero extra checks are performed for items in the way during rotation? */
u8 kankyo_map; /* lighting map */
u8 contact_action; /* action on contact */
u16 interaction_type; /* action when interacting */
aFTR_vtable_c* vtable; /* unique furniture functions */
Gfx* opaque0;
Gfx* opaque1;
Gfx* translucent0;
Gfx* translucent1;
u8* texture;
u16* palette;
aFTR_rig_c* rig;
aFTR_tex_anim_c* tex_anim;
f32 height;
f32 scale;
u8 shape; /* aFTR_SHAPE_TYPE* */
u8 move_bg_type; /* mCoBG_FTR_TYPE* */
u8 check_rotation; /* when non-zero extra checks are performed for items in the way during rotation? */
u8 kankyo_map; /* lighting map */
u8 contact_action; /* action on contact */
u16 interaction_type; /* action when interacting */
aFTR_vtable_c* vtable; /* unique furniture functions */
} aFTR_PROFILE;
typedef struct furniture_collision_s {
f32 start[2]; /* starting xz pos */
f32 end[2]; /* ending xz pos */
f32 normal[2]; /* xz normal */
f32 height; /* collision y */
f32 edge_contact_ratio; /* percentage of the xz collision in contact with edge to count as collision */
f32 start[2]; /* starting xz pos */
f32 end[2]; /* ending xz pos */
f32 normal[2]; /* xz normal */
f32 height; /* collision y */
f32 edge_contact_ratio; /* percentage of the xz collision in contact with edge to count as collision */
} aFTR_collision_c;
struct furniture_actor_s {
u16 name;
u16 _004;
int id;
xyz_t position;
xyz_t last_position;
xyz_t target_position;
int target_distance; /* distance to target position */
f32 player_distance; /* distance to the player */
f32 angle_y; /* current Y angle */
f32 angle_y_target; /* goal Y angle */
s16 state;
u8 shape_type; /* current size & shape (rotation) */
u8 original_shape_type; /* original size & shape (rotation) */
xyz_t base_position;
aFTR_collision_c edge_collision[4]; /* collision for each edge */
s16 collision_direction;
int move_bg_idx;
mCoBG_bg_regist_c bg_register;
mCoBG_bg_contact_c bg_contact;
s16 s_angle_y; /* current Y angle but 'binangle' format */
f32 collision_scale;
u8 switch_bit; /* furniture on/off state */
u8 switch_changed_flag; /* signal that the on/off state is toggled */
s8 haniwa_step;
s16 haniwa_state;
cKF_SkeletonInfo_R_c keyframe; /* for actor animations */
s_xyz joint[9];
s_xyz morph[9];
Mtx skeleton_mtx[2][12];
cKF_TextureAnimation_c tex_animation; /* used for texture animations like TVs */
xyz_t scale;
f32 birth_scale_modifier; /* modifies scale for "birth" animation */
s16 birth_anim_counter;
s16 birth_anim_step;
s16 rotation_delay_timer;
s16 dynamic_work_s[5]; /* reserved for any use by each unique furniture actor */
f32 dynamic_work_f[2]; /* reserved for any use by each unique furniture actor */
s16 layer; /* layer the furniture actor resides on */
s16 _83E;
s16 open_music_disk; /* set when a music player is interacted with */
s16 dust_timer;
mActor_name_t items[mCoBG_LAYER_NUM - 1]; /* used for holding items (music players & wardrobes) */
int _84C;
u16* pal_p; /* used for furniture actors with dynamic palettes such as the structure model items */
int _854;
u16 name;
s16 ctr_type; // 0 = GAME's frame counter, 1 = GAME_PLAY's frame counter
int id;
xyz_t position;
xyz_t last_position;
xyz_t target_position;
int target_distance; /* distance to target position */
f32 player_distance; /* distance to the player */
f32 angle_y; /* current Y angle */
f32 angle_y_target; /* goal Y angle */
s16 state;
u8 shape_type; /* current size & shape (rotation) */
u8 original_shape_type; /* original size & shape (rotation) */
xyz_t base_position;
aFTR_collision_c edge_collision[4]; /* collision for each edge */
s16 collision_direction;
int move_bg_idx;
mCoBG_bg_regist_c bg_register;
mCoBG_bg_contact_c bg_contact;
s16 s_angle_y; /* current Y angle but 'binangle' format */
f32 collision_scale;
u8 switch_bit; /* furniture on/off state */
u8 switch_changed_flag; /* signal that the on/off state is toggled */
s8 haniwa_step;
s16 haniwa_state;
cKF_SkeletonInfo_R_c keyframe; /* for actor animations */
s_xyz joint[9];
s_xyz morph[9];
Mtx skeleton_mtx[2][12];
cKF_TextureAnimation_c tex_animation; /* used for texture animations like TVs */
xyz_t scale;
f32 birth_scale_modifier; /* modifies scale for "birth" animation */
s16 birth_anim_counter;
s16 birth_anim_step;
s16 rotation_delay_timer;
s16 dynamic_work_s[5]; /* reserved for any use by each unique furniture actor */
f32 dynamic_work_f[2]; /* reserved for any use by each unique furniture actor */
s16 layer; /* layer the furniture actor resides on */
s16 _83E;
s16 open_music_disk; /* set when a music player is interacted with */
s16 dust_timer;
mActor_name_t items[mCoBG_LAYER_NUM - 1]; /* used for holding items (music players & wardrobes) */
int _84C;
u16* pal_p; /* used for furniture actors with dynamic palettes such as the structure model items */
int _854;
};
#ifdef __cplusplus
+42 -37
View File
@@ -13,55 +13,61 @@ extern "C" {
typedef struct my_room_actor_s MY_ROOM_ACTOR;
typedef struct my_room_clock_info_s {
int tick0; /* set on frame 15 */
int tick1; /* set on frame 45 */
int tick_stop; /* set on frame 0 */
int frame; /* 0-119 */
int tick0; /* set on frame 15 */
int tick1; /* set on frame 45 */
int tick_stop; /* set on frame 0 */
int frame; /* 0-119 */
} aMR_clock_info_c;
typedef int (*aMR_JUDGE_BREED_NEW_FTR_PROC)(GAME_PLAY* play, u16 ftr_no, int* ut_x, int* ut_z, u16* rotation, int* square_offset, int* layer);
typedef int (*aMR_JUDGE_BREED_NEW_FTR_PROC)(GAME_PLAY* play, u16 ftr_no, int* ut_x, int* ut_z, u16* rotation,
int* square_offset, int* layer);
typedef mActor_name_t (*aMR_SEARCH_PICKUP_FURNITURE_PROC)(GAME_PLAY* play);
typedef void (*aMR_FURNITURE2ITEMBAG_PROC)(GAME_PLAY* play);
typedef int (*aMR_JUDGE_PLAYER_ACTION_PROC)(xyz_t* wpos0, xyz_t* wpos1, int ftr_actor_idx);
typedef void (*aMR_PLAYER_MOVE_FURNITURE_PROC)(int ftr_actor_idx, xyz_t* wpos);
typedef int (*aMR_FTR_ID_2_WPOS_PROC)(xyz_t* wpos, int ftr_id);
typedef int (*aMR_UNIT_NUM_2_FTR_ITEMNO_FTRID_PROC)(mActor_name_t* ftr_item_no, int* ftr_id, int ut_x, int ut_z, s16 layer);
typedef int (*aMR_UNIT_NUM_2_FTR_ITEMNO_FTRID_PROC)(mActor_name_t* ftr_item_no, int* ftr_id, int ut_x, int ut_z,
s16 layer);
typedef void (*aMR_FTR_ID_2_EXTINGUISH_FURNITURE_PROC)(int ftr_id);
typedef void (*aMR_REDMA_FTR_BANK_PROC)();
typedef int (*aMR_RESERVE_FURNITURE_PROC)(GAME_PLAY* play, u16 ftr_no, int judge_res, int ut_x, int ut_z, u16 rotation, int square_offset, int layer);
typedef int (*aMR_RESERVE_FURNITURE_PROC)(GAME_PLAY* play, u16 ftr_no, int judge_res, int ut_x, int ut_z, u16 rotation,
int square_offset, int layer);
typedef int (*aMR_COUNT_FRIEND_FURNITURE_PROC)(FTR_ACTOR* ftr_actor, u8 switch_on);
typedef int (*aMR_JUDGE_PLACE_2ND_LAYER_PROC)(int ut_x, int ut_z);
typedef void (*aMR_OPEN_CLOSE_COMMON_MOVE_PROC)(FTR_ACTOR* ftr_actor, ACTOR* actor, GAME* game, f32 start_frame, f32 end_frame);
typedef void (*aMR_OPEN_CLOSE_COMMON_MOVE_PROC)(FTR_ACTOR* ftr_actor, ACTOR* actor, GAME* game, f32 start_frame,
f32 end_frame);
typedef void (*aMR_FAMICOM_EMU_COMMON_MOVE_PROC)(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, int rom_no,
int agb_rom_no);
typedef struct my_room_clip_s {
MY_ROOM_ACTOR* my_room_actor_p;
aMR_JUDGE_BREED_NEW_FTR_PROC judge_breed_new_ftr_proc;
aMR_SEARCH_PICKUP_FURNITURE_PROC search_pickup_ftr_proc;
aMR_FURNITURE2ITEMBAG_PROC ftr2itemBag_proc;
aMR_JUDGE_PLAYER_ACTION_PROC judge_player_action_proc;
aMR_PLAYER_MOVE_FURNITURE_PROC player_move_ftr_proc;
aMR_FTR_ID_2_WPOS_PROC ftrId2wpos_proc;
aMR_UNIT_NUM_2_FTR_ITEMNO_FTRID_PROC unitNum2ftrItemNoftrId_proc;
aMR_FTR_ID_2_EXTINGUISH_FURNITURE_PROC ftrId2extinguishFtr_proc;
aMR_REDMA_FTR_BANK_PROC redma_ftr_bank_proc;
aMR_RESERVE_FURNITURE_PROC reserve_ftr_proc;
aMR_COUNT_FRIEND_FURNITURE_PROC count_friend_ftr_proc;
aMR_JUDGE_PLACE_2ND_LAYER_PROC judge_place_2nd_layer_proc;
aMR_OPEN_CLOSE_COMMON_MOVE_PROC open_close_common_move_proc;
/* TODO: function definitions */
void* get_bed_action_proc;
void* mini_disk_common_move_proc;
void* famicom_emum_common_move_proc;
void* set_leaf_proc;
void* ftr2leaf_proc;
void* leaf_start_pos_proc;
void* pickup_ftr_layer_proc;
void* leaf_pickuped_proc;
void* ftrNo2bankAddress_proc;
void* call_sit_down_ongen_pos_se_proc;
aMR_clock_info_c* clock_info_p; /* used for playing the clock tick? sfx */
void* sound_melody_proc;
void* check_danna_kill_proc;
MY_ROOM_ACTOR* my_room_actor_p;
aMR_JUDGE_BREED_NEW_FTR_PROC judge_breed_new_ftr_proc;
aMR_SEARCH_PICKUP_FURNITURE_PROC search_pickup_ftr_proc;
aMR_FURNITURE2ITEMBAG_PROC ftr2itemBag_proc;
aMR_JUDGE_PLAYER_ACTION_PROC judge_player_action_proc;
aMR_PLAYER_MOVE_FURNITURE_PROC player_move_ftr_proc;
aMR_FTR_ID_2_WPOS_PROC ftrId2wpos_proc;
aMR_UNIT_NUM_2_FTR_ITEMNO_FTRID_PROC unitNum2ftrItemNoftrId_proc;
aMR_FTR_ID_2_EXTINGUISH_FURNITURE_PROC ftrId2extinguishFtr_proc;
aMR_REDMA_FTR_BANK_PROC redma_ftr_bank_proc;
aMR_RESERVE_FURNITURE_PROC reserve_ftr_proc;
aMR_COUNT_FRIEND_FURNITURE_PROC count_friend_ftr_proc;
aMR_JUDGE_PLACE_2ND_LAYER_PROC judge_place_2nd_layer_proc;
aMR_OPEN_CLOSE_COMMON_MOVE_PROC open_close_common_move_proc;
/* TODO: function definitions */
void* get_bed_action_proc;
void* mini_disk_common_move_proc;
void* set_leaf_proc;
void* ftr2leaf_proc;
void* leaf_start_pos_proc;
void* pickup_ftr_layer_proc;
void* leaf_pickuped_proc;
aMR_FAMICOM_EMU_COMMON_MOVE_PROC famicom_emu_common_move_proc;
void* ftrNo2bankAddress_proc;
void* call_sit_down_ongen_pos_se_proc;
aMR_clock_info_c* clock_info_p; /* used for playing the clock tick? sfx */
void* sound_melody_proc;
void* check_danna_kill_proc;
} aMR_Clip_c;
/* TODO: my room actor */
@@ -77,4 +83,3 @@ extern mActor_name_t aMR_FurnitureFg_to_FurnitureFgWithDirect(mActor_name_t ftr,
#endif
#endif
+15
View File
@@ -0,0 +1,15 @@
#ifndef F_FURNITURE_H
#define F_FURNITURE_H
#include "types.h"
#include "ac_furniture.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif