1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 05:19:36 +00:00
oot/src/code/z_player_call.c
Roman971 f114df8929
More actor cleanup Part 2 (#116)
* Change all main actor functions to take a 'Actor* thisx' argument

* Change all actor callbacks to also take a 'Actor* thisx' argument
2020-05-04 15:02:51 -04:00

56 lines
2 KiB
C

#include <global.h>
void (*sPlayerCallInitFunc)(Actor* thisx, GlobalContext* globalCtx);
void (*sPlayerCallDestroyFunc)(Actor* thisx, GlobalContext* globalCtx);
void (*sPlayerCallUpdateFunc)(Actor* thisx, GlobalContext* globalCtx);
void (*sPlayerCallDrawFunc)(Actor* thisx, GlobalContext* globalCtx);
void func_80846CD8(Actor* thisx, GlobalContext* globalCtx);
void func_8084AB54(Actor* thisx, GlobalContext* globalCtx);
void func_80849EA8(Actor* thisx, GlobalContext* globalCtx);
void func_8084A5C4(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx);
void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Player_InitVars = {
ACTOR_PLAYER,
ACTORTYPE_PLAYER,
0x6000035,
OBJECT_GAMEPLAY_KEEP,
sizeof(Player),
(ActorFunc)PlayerCall_Init,
(ActorFunc)PlayerCall_Destroy,
(ActorFunc)PlayerCall_Update,
(ActorFunc)PlayerCall_Draw,
};
void PlayerCall_InitFuncPtrs() {
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(func_80846CD8);
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(func_8084AB54);
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(func_80849EA8);
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(func_8084A5C4);
}
void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
PlayerCall_InitFuncPtrs();
sPlayerCallInitFunc(thisx, globalCtx);
}
void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallDestroyFunc(thisx, globalCtx);
}
void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallUpdateFunc(thisx, globalCtx);
}
void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallDrawFunc(thisx, globalCtx);
}