diff --git a/include/m_bg_item.h b/include/m_bg_item.h index e90fd1c0..9bdc02b1 100644 --- a/include/m_bg_item.h +++ b/include/m_bg_item.h @@ -8,16 +8,12 @@ extern "C" { #endif -extern ACTOR* mBI_search_bg_item(Actor_info* info); -extern void mBI_make_bg_item(GAME_PLAY* play); extern void mBI_change_bg_item(GAME_PLAY* play); extern void mBI_ct(); extern void mBI_move(GAME_PLAY* play); typedef void (*BI_PROC)(GAME_PLAY*); -extern BI_PROC mBI_make_proc; - #ifdef __cplusplus } #endif diff --git a/rel/m_bg_item.c b/rel/m_bg_item.c index 8263d7a3..bd6b9c94 100644 --- a/rel/m_bg_item.c +++ b/rel/m_bg_item.c @@ -3,53 +3,65 @@ #include "m_common_data.h" #include "m_name_table.h" -BI_PROC mBI_make_proc; +static BI_PROC mBI_make_proc; +static ACTOR* mBI_search_bg_item(Actor_info* info) { + static const s16 name_data[] = { + mAc_PROFILE_BGCHERRYITEM, + mAc_PROFILE_BGITEM, + mAc_PROFILE_BGWINTERITEM, + mAc_PROFILE_BGXMASITEM + }; + + ACTOR* actor; + int i; -ACTOR* mBI_search_bg_item(Actor_info* info){ - static const s16 name_data[] = { - 0x4f, 0x1, 0x50,0x51 - }; + for (i = 0; i < 4; i++) { + actor = Actor_info_name_search(info,name_data[i], ACTOR_PART_ITEM); + if (actor != NULL) { + break; + } + } + + return actor; +} + +static void mBI_make_bg_item(GAME_PLAY* play) { + if (mBI_search_bg_item(&play->actor_info) == NULL) { + Actor_info_make_actor( + &play->actor_info, + &play->game, + Common_Get(bg_item_profile), + 0.0f, 0.0f, 0.0f, + 0, 0, 0, + -1, -1, + -1, + EMPTY_NO, + -1, + -1, + -1 + ); - int i; - for( i = 0; i < 4; i++){ - if(Actor_info_name_search(info,name_data[i], ACTOR_PART_ITEM) != 0){ - return; - } - } -} - -void mBI_make_bg_item(GAME_PLAY* play){ - - - if(mBI_search_bg_item(&play->actor_info) == NULL){ - - Actor_info_make_actor(&play->actor_info, &play->game, Common_Get(bg_item_profile),0, - 0.0f,0.0f,0,0,0 ,-1, -1,-1, EMPTY_NO,-1,-1,-1); - mBI_make_proc = NULL; - } -} - -void mBI_change_bg_item(GAME_PLAY* play){ - - ACTOR* actor = mBI_search_bg_item(&play->actor_info); - - if(actor != NULL){ - Actor_delete(actor); - mBI_make_proc = mBI_make_bg_item; - Common_Set(bg_item_profile, Common_Get(time.bgitem_profile)); - } -} - -void mBI_ct(){ - mBI_make_proc = NULL; - + } } -void mBI_move(GAME_PLAY* play){ +extern void mBI_change_bg_item(GAME_PLAY* play) { + ACTOR* actor = mBI_search_bg_item(&play->actor_info); + + if (actor != NULL) { + Actor_delete(actor); + mBI_make_proc = mBI_make_bg_item; + Common_Set(bg_item_profile, Common_Get(time.bgitem_profile)); + } +} - if(mBI_make_proc != NULL){ - mBI_make_proc(play); - } -} \ No newline at end of file +extern void mBI_ct() { + mBI_make_proc = NULL; +} + +extern void mBI_move(GAME_PLAY* play) { + if (mBI_make_proc != NULL) { + (*mBI_make_proc)(play); + } +} diff --git a/rel/m_scene_ftr.c b/rel/m_scene_ftr.c index e3c7283e..e0ab371f 100644 --- a/rel/m_scene_ftr.c +++ b/rel/m_scene_ftr.c @@ -3,6 +3,8 @@ #include "m_scene.h" #include "m_play.h" +/* @unused ? mScn_Dma2Bank(...) */ + static void mScn_KeepMyRoomBankNew(Object_Exchange_c* exchange, s16 bank_id, size_t size) { Object_Bank_c* bank = exchange->banks + exchange->bank_idx; @@ -30,6 +32,8 @@ extern void mScn_ObtainCarpetBank(GAME_PLAY* play) { } } +/* @unused extern ? mScn_ObtainFurnitureBank(...) */ + extern void mScn_ObtainMyRoomBank(GAME_PLAY* play) { mScn_ObtainCarpetBank(play); }