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

@ -29,18 +29,19 @@ s16 objectIds[] = {
OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF, OBJECT_GEFF,
};
ActorFunc scaleFuncs[] = {
(ActorFunc)func_80978030, (ActorFunc)func_80978030, (ActorFunc)func_80978030,
(ActorFunc)func_80978030, (ActorFunc)func_80978030, (ActorFunc)func_80978030,
(ActorFunc)func_80978030, (ActorFunc)func_80978030, (ActorFunc)func_80978030,
DemoGeffInitFunc initFuncs[] = {
func_80978030, func_80978030, func_80978030, func_80978030, func_80978030,
func_80978030, func_80978030, func_80978030, func_80978030,
};
ActorFunc actionFuncs[] = {
(ActorFunc)func_809783D4,
(ActorFunc)func_80978308,
DemoGeffActionFunc actionFuncs[] = {
func_809783D4,
func_80978308,
};
ActorFunc drawFuncs[] = {
(ActorFunc)func_809784D4,
(ActorFunc)func_80978344,
DemoGeffDrawFunc drawFuncs[] = {
func_809784D4,
func_80978344,
};
const ActorInit Demo_Geff_InitVars = {
@ -178,13 +179,13 @@ void func_80978344(DemoGeff* this, GlobalContext* globalCtx) {
void func_80978370(DemoGeff* this, GlobalContext* globalCtx) {
s16 params = this->actor.params;
ActorFunc actorFunc = scaleFuncs[params];
if (actorFunc == NULL) {
DemoGeffInitFunc initFunc = initFuncs[params];
if (initFunc == NULL) {
osSyncPrintf(VT_FGCOL(RED) " Demo_Geff_main_init:初期化処理がおかしいarg_data = %d!\n" VT_RST, params);
Actor_Kill(&this->actor);
return;
}
actorFunc(this, globalCtx);
initFunc(this, globalCtx);
}
void func_809783D4(DemoGeff* this, GlobalContext* globalCtx) {

View file

@ -6,7 +6,13 @@
#include "../ovl_Demo_Gt/z_demo_gt.h"
typedef struct {
struct DemoGeff;
typedef void (*DemoGeffInitFunc)(struct DemoGeff*, GlobalContext*);
typedef void (*DemoGeffActionFunc)(struct DemoGeff*, GlobalContext*);
typedef void (*DemoGeffDrawFunc)(struct DemoGeff*, GlobalContext*);
typedef struct DemoGeff {
/* 0x0000 */ Actor actor;
/* 0x014C */ s32 action;
/* 0x0150 */ s32 drawConfig;