link m_bg_item

This commit is contained in:
Prakxo
2023-09-09 18:52:47 +02:00
parent 59544e5ebe
commit d0e60827b2
3 changed files with 67 additions and 0 deletions
+4
View File
@@ -34,6 +34,10 @@ m_banti.c:
.rodata: [0x80641388, 0x806413E0]
.data: [0x8064F548, 0x8064F658]
.bss: [0x8125A830, 0x8125AC80]
m_bg_item.c:
.text: [0x80378858, 0x803789F8]
.rodata: [0x806413E0, 0x806413F0]
.bss: [0x81263080, 0x81263088]
m_calendar.c:
.text: [0x8037D190, 0x8037DA54]
m_cockroach.c:
+8
View File
@@ -2,14 +2,22 @@
#define M_BG_ITEM_H
#include "types.h"
#include "m_actor.h"
#ifdef __cplusplus
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
+55
View File
@@ -0,0 +1,55 @@
#include "m_bg_item.h"
#include "m_common_data.h"
#include "m_name_table.h"
BI_PROC mBI_make_proc;
ACTOR* mBI_search_bg_item(Actor_info* info){
static const s16 name_data[] = {
0x4f, 0x1, 0x50,0x51
};
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){
if(mBI_make_proc != NULL){
mBI_make_proc(play);
}
}