1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-09 00:00:44 +00:00

More actor cleanup Part 3 (#118)

* Add custom types for actor specific functions (like actions)

* Add a forward struct declaration for all other actors
This commit is contained in:
Roman971 2020-05-06 00:53:15 +02:00 committed by GitHub
parent f114df8929
commit 1425678d8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
477 changed files with 1817 additions and 792 deletions

View file

@ -15,7 +15,6 @@ void BgMjin_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgMjin_Update(Actor* thisx, GlobalContext* globalCtx);
void BgMjin_Draw(Actor* thisx, GlobalContext* globalCtx);
void BgMjin_SetupAction(BgMjin* this, ActorFunc actionFunc);
void func_808A0850(BgMjin* this, GlobalContext* globalCtx);
void func_808A0920(BgMjin* this, GlobalContext* globalCtx);
@ -46,7 +45,7 @@ static InitChainEntry initChain[] = {
static s16 objectTbl[] = { OBJECT_MJIN_FLASH, OBJECT_MJIN_DARK, OBJECT_MJIN_FLAME,
OBJECT_MJIN_ICE, OBJECT_MJIN_SOUL, OBJECT_MJIN_WIND };
void BgMjin_SetupAction(BgMjin* this, ActorFunc actionFunc) {
void BgMjin_SetupAction(BgMjin* this, BgMjinActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
@ -60,7 +59,7 @@ void BgMjin_Init(Actor* thisx, GlobalContext* globalCtx) {
if (objBankIndex < 0) {
Actor_Kill(thisx);
} else {
BgMjin_SetupAction(this, &func_808A0850);
BgMjin_SetupAction(this, func_808A0850);
}
}
@ -84,7 +83,7 @@ void func_808A0850(BgMjin* this, GlobalContext* globalCtx) {
DynaPolyInfo_Alloc(collision, &local_c);
this->dyna.dynaPolyId =
DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c);
BgMjin_SetupAction(this, &func_808A0920);
BgMjin_SetupAction(this, func_808A0920);
this->dyna.actor.draw = BgMjin_Draw;
}
}

View file

@ -4,10 +4,14 @@
#include <ultra64.h>
#include <global.h>
typedef struct {
struct BgMjin;
typedef void (*BgMjinActionFunc)(struct BgMjin*, GlobalContext*);
typedef struct BgMjin {
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ s8 objBankIndex;
/* 0x0168 */ ActorFunc actionFunc;
/* 0x0168 */ BgMjinActionFunc actionFunc;
} BgMjin; // size = 0x016C
extern const ActorInit Bg_Mjin_InitVars;