1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-08 07:20:16 +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

@ -17,7 +17,6 @@ void EnBird_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_809C1E00(EnBird* this, s16 params);
void func_809C1E40(EnBird* this, GlobalContext* globalCtx);
void EnBird_SetupAction(EnBird* this, ActorFunc actionFunc);
void func_809C1D60(EnBird* this, GlobalContext* globalCtx);
void func_809C1CAC(EnBird* this, s16 params);
@ -40,7 +39,7 @@ static InitChainEntry initChain[] = {
extern AnimationHeader D_0600006C;
extern SkeletonHeader D_06002190;
void EnBird_SetupAction(EnBird* this, ActorFunc actionFunc) {
void EnBird_SetupAction(EnBird* this, EnBirdActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
@ -98,7 +97,7 @@ void func_809C1D60(EnBird* this, GlobalContext* globalCtx) {
void func_809C1E00(EnBird* this, s16 params) {
this->unk_198 = Math_Rand_S16Offset(0x14, 0x2D);
EnBird_SetupAction(this, (ActorFunc)func_809C1E40);
EnBird_SetupAction(this, func_809C1E40);
}
void func_809C1E40(EnBird* this, GlobalContext* globalCtx) {

View file

@ -4,10 +4,14 @@
#include <ultra64.h>
#include <global.h>
typedef struct {
struct EnBird;
typedef void (*EnBirdActionFunc)(struct EnBird*, GlobalContext*);
typedef struct EnBird {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ ActorFunc actionFunc;
/* 0x0190 */ EnBirdActionFunc actionFunc;
/* 0x0194 */ u32 unk_194;
/* 0x0198 */ s32 unk_198;
/* 0x019C */ s16 unk_19C;