item_inbox OK (#95)

* item_inbox OK

* renamed func_80945534 to suggested name
This commit is contained in:
kyleburnette
2021-04-30 20:36:55 -07:00
committed by GitHub
parent 536a484f73
commit 441f33968c
4 changed files with 33 additions and 11 deletions
@@ -9,7 +9,8 @@ void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx);
void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx);
/*
void ItemInbox_Idle(ItemInbox* this, GlobalContext* globalCtx);
const ActorInit Item_Inbox_InitVars = {
ACTOR_ITEM_INBOX,
ACTORCAT_NPC,
@@ -21,14 +22,33 @@ const ActorInit Item_Inbox_InitVars = {
(ActorFunc)ItemInbox_Update,
(ActorFunc)ItemInbox_Draw
};
*/
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/ItemInbox_Init.asm")
void ItemInbox_Init(Actor* thisx, GlobalContext* globalCtx) {
ItemInbox* this = THIS;
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/ItemInbox_Destroy.asm")
this->actionFunc = ItemInbox_Idle;
Actor_SetScale(&this->actor, 0.2f);
}
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/func_80945534.asm")
void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/ItemInbox_Update.asm")
void ItemInbox_Idle(ItemInbox* this, GlobalContext* globalCtx) {
if (Actor_GetChestFlag(globalCtx, (this->actor.params >> 8) & 0x1F)) {
Actor_MarkForDeath(&this->actor);
}
}
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Item_Inbox_0x809454F0/ItemInbox_Draw.asm")
void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx) {
ItemInbox* this = THIS;
this->actionFunc(this, globalCtx);
}
void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx) {
ItemInbox* this = THIS;
func_800B8050(&this->actor, globalCtx, 0);
func_800B8118(&this->actor, globalCtx, 0);
GetItem_Draw(globalCtx, this->actor.params & 0xFF);
}
@@ -5,9 +5,11 @@
struct ItemInbox;
typedef void (*ItemInboxActionFunc)(struct ItemInbox*, GlobalContext*);
typedef struct ItemInbox {
/* 0x000 */ Actor actor;
/* 0x144 */ char unk_144[0x4];
/* 0x144 */ ItemInboxActionFunc actionFunc;
} ItemInbox; // size = 0x148
extern const ActorInit Item_Inbox_InitVars;