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:
parent
f114df8929
commit
1425678d8a
477 changed files with 1817 additions and 792 deletions
|
@ -51,7 +51,7 @@ void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (this->objBankIndex < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
this->actionFunc = (ActorFunc)func_80ABBB34;
|
||||
this->actionFunc = func_80ABBB34;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx) {
|
|||
this->actor.draw = EnNutsball_Draw;
|
||||
this->actor.shape.rot.y = 0;
|
||||
this->timer = 30;
|
||||
this->actionFunc = (ActorFunc)func_80ABBBA8;
|
||||
this->actionFunc = func_80ABBBA8;
|
||||
this->actor.speedXZ = 10.0f;
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Player* player = PLAYER;
|
||||
s32 pad;
|
||||
|
||||
if (!(player->stateFlags1 & 0x300000C0) || (this->actionFunc == (ActorFunc)func_80ABBB34)) {
|
||||
if (!(player->stateFlags1 & 0x300000C0) || (this->actionFunc == func_80ABBB34)) {
|
||||
this->actionFunc(this, globalCtx);
|
||||
|
||||
Actor_MoveForward(&this->actor);
|
||||
|
|
|
@ -4,11 +4,15 @@
|
|||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ ActorFunc actionFunc;
|
||||
/* 0x0150 */ s8 objBankIndex;
|
||||
/* 0x0152 */ s16 timer;
|
||||
struct EnNutsball;
|
||||
|
||||
typedef void (*EnNutsballActionFunc)(struct EnNutsball*, GlobalContext*);
|
||||
|
||||
typedef struct EnNutsball {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ EnNutsballActionFunc actionFunc;
|
||||
/* 0x0150 */ s8 objBankIndex;
|
||||
/* 0x0152 */ s16 timer;
|
||||
/* 0x0154 */ ColliderCylinder collider;
|
||||
} EnNutsball; // size = 0x01A0
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue