mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-07 14:50:15 +00:00
More actor cleanup Part 1 (#107)
* Fix naming and structs in z_en_item00.c and z_en_a_keep.c * Decompile init vars in z_en_item00.c and z_en_a_keep.c * Create missing .h files for the last few actors * Fix some collider member names in actor structs * Fix old actors not properly using "actionFunc" / "SetupAction" * Remove some local temporary actor structs * Fix some actor header includes to be absolute instead of relative
This commit is contained in:
parent
2b38920d7e
commit
3ca6082084
47 changed files with 625 additions and 582 deletions
|
@ -4,28 +4,7 @@
|
|||
* Description: A brown bird. Tweet tweet.
|
||||
*/
|
||||
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0190 */ ActorFunc updateFunc;
|
||||
/* 0x0194 */ u32 unk_194;
|
||||
/* 0x0198 */ s32 unk_198;
|
||||
/* 0x019C */ s16 unk_19C;
|
||||
/* 0x019E */ char unk_19E[0x2];
|
||||
/* 0x01A0 */ f32 unk_1A0;
|
||||
/* 0x01A4 */ f32 unk_1A4;
|
||||
/* 0x01A8 */ f32 unk_1A8;
|
||||
/* 0x01AC */ f32 unk_1AC;
|
||||
/* 0x01B0 */ f32 unk_1B0;
|
||||
/* 0x01B4 */ f32 unk_1B4;
|
||||
/* 0x01B8 */ f32 unk_1B8;
|
||||
/* 0x01BC */ f32 unk_1BC;
|
||||
/* 0x01C0 */ s16 unk_1C0;
|
||||
/* 0x01C2 */ char unk_1C2[0x1A];
|
||||
} EnBird; // size = 0x01C4
|
||||
#include "z_en_bird.h"
|
||||
|
||||
#define FLAGS 0x00000000
|
||||
|
||||
|
@ -35,7 +14,7 @@ void EnBird_Update(EnBird* this, GlobalContext* globalCtx);
|
|||
void EnBird_Draw(EnBird* this, GlobalContext* globalCtx);
|
||||
void func_809C1E00(EnBird* this, s16 params);
|
||||
void func_809C1E40(EnBird* this, GlobalContext* globalCtx);
|
||||
void EnBird_SetNewUpdate(EnBird* this, ActorFunc updateFunc);
|
||||
void EnBird_SetupAction(EnBird* this, ActorFunc actionFunc);
|
||||
void func_809C1D60(EnBird* this, GlobalContext* globalCtx);
|
||||
void func_809C1CAC(EnBird* this, s16 params);
|
||||
|
||||
|
@ -58,8 +37,8 @@ static InitChainEntry initChain[] = {
|
|||
extern AnimationHeader D_0600006C;
|
||||
extern SkeletonHeader D_06002190;
|
||||
|
||||
void EnBird_SetNewUpdate(EnBird* this, ActorFunc newUpdateFunc) {
|
||||
this->updateFunc = newUpdateFunc;
|
||||
void EnBird_SetupAction(EnBird* this, ActorFunc actionFunc) {
|
||||
this->actionFunc = actionFunc;
|
||||
}
|
||||
|
||||
void EnBird_Init(EnBird* this, GlobalContext* globalCtx) {
|
||||
|
@ -91,7 +70,7 @@ void func_809C1CAC(EnBird* this, s16 params) {
|
|||
|
||||
this->unk_198 = Math_Rand_S16Offset(5, 0x23);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, anim, playbackSpeed, 0.0f, frameCount, 0, 0.0f);
|
||||
EnBird_SetNewUpdate(this, func_809C1D60);
|
||||
EnBird_SetupAction(this, func_809C1D60);
|
||||
}
|
||||
|
||||
void func_809C1D60(EnBird* this, GlobalContext* globalCtx) {
|
||||
|
@ -114,7 +93,7 @@ void func_809C1D60(EnBird* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_809C1E00(EnBird* this, s16 params) {
|
||||
this->unk_198 = Math_Rand_S16Offset(0x14, 0x2D);
|
||||
EnBird_SetNewUpdate(this, (ActorFunc)func_809C1E40);
|
||||
EnBird_SetupAction(this, (ActorFunc)func_809C1E40);
|
||||
}
|
||||
|
||||
void func_809C1E40(EnBird* this, GlobalContext* globalCtx) {
|
||||
|
@ -140,7 +119,7 @@ void func_809C1E40(EnBird* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnBird_Update(EnBird* this, GlobalContext* globalCtx) {
|
||||
this->unk_1B4 += this->unk_1B8;
|
||||
this->updateFunc(this, globalCtx);
|
||||
this->actionFunc(this, globalCtx);
|
||||
}
|
||||
|
||||
void EnBird_Draw(EnBird* this, GlobalContext* globalCtx) {
|
||||
|
|
29
src/overlays/actors/ovl_En_Bird/z_en_bird.h
Normal file
29
src/overlays/actors/ovl_En_Bird/z_en_bird.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#ifndef _Z_EN_BIRD_H_
|
||||
#define _Z_EN_BIRD_H_
|
||||
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0190 */ ActorFunc actionFunc;
|
||||
/* 0x0194 */ u32 unk_194;
|
||||
/* 0x0198 */ s32 unk_198;
|
||||
/* 0x019C */ s16 unk_19C;
|
||||
/* 0x019E */ char unk_19E[0x2];
|
||||
/* 0x01A0 */ f32 unk_1A0;
|
||||
/* 0x01A4 */ f32 unk_1A4;
|
||||
/* 0x01A8 */ f32 unk_1A8;
|
||||
/* 0x01AC */ f32 unk_1AC;
|
||||
/* 0x01B0 */ f32 unk_1B0;
|
||||
/* 0x01B4 */ f32 unk_1B4;
|
||||
/* 0x01B8 */ f32 unk_1B8;
|
||||
/* 0x01BC */ f32 unk_1BC;
|
||||
/* 0x01C0 */ s16 unk_1C0;
|
||||
/* 0x01C2 */ char unk_1C2[0x1A];
|
||||
} EnBird; // size = 0x01DC
|
||||
|
||||
extern const ActorInit En_Bird_InitVars;
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue