1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 21:40:03 +00:00
oot/src/code/z_player_call.c

57 lines
1.8 KiB
C
Raw Normal View History

2020-03-17 04:31:30 +00:00
#include <global.h>
void (*sPlayerCallInitFunc)(void*, GlobalContext*);
void (*sPlayerCallDestroyFunc)(void*, GlobalContext*);
void (*sPlayerCallUpdateFunc)(void*, GlobalContext*);
void (*sPlayerCallDrawFunc)(void*, GlobalContext*);
void func_80846CD8(Player*, GlobalContext*);
void func_8084AB54(Player*, GlobalContext*);
void func_80849EA8(Player*, GlobalContext*);
void func_8084A5C4(Player*, GlobalContext*);
void PlayerCall_Init(Player* player, GlobalContext* globalCtx);
void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx);
void PlayerCall_Update(Player* player, GlobalContext* globalCtx);
void PlayerCall_Draw(Player* player, GlobalContext* globalCtx);
2020-03-22 21:19:43 +00:00
const ActorInit Player_InitVars = {
2020-03-17 04:31:30 +00:00
ACTOR_PLAYER,
ACTORTYPE_PLAYER,
0x6000035,
OBJECT_GAMEPLAY_KEEP,
sizeof(Player),
(ActorFunc)PlayerCall_Init,
(ActorFunc)PlayerCall_Destroy,
(ActorFunc)PlayerCall_Update,
(ActorFunc)PlayerCall_Draw,
};
2020-03-22 21:19:43 +00:00
void PlayerCall_InitFuncPtrs() {
2020-03-17 04:31:30 +00:00
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(func_80846CD8);
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(func_8084AB54);
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(func_80849EA8);
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(func_8084A5C4);
}
2020-03-22 21:19:43 +00:00
void PlayerCall_Init(Player* player, GlobalContext* globalCtx) {
2020-03-17 04:31:30 +00:00
KaleidoScopeCall_LoadPlayer();
PlayerCall_InitFuncPtrs();
sPlayerCallInitFunc(player, globalCtx);
}
2020-03-22 21:19:43 +00:00
void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx) {
2020-03-17 04:31:30 +00:00
KaleidoScopeCall_LoadPlayer();
sPlayerCallDestroyFunc(player, globalCtx);
}
2020-03-22 21:19:43 +00:00
void PlayerCall_Update(Player* player, GlobalContext* globalCtx) {
2020-03-17 04:31:30 +00:00
KaleidoScopeCall_LoadPlayer();
sPlayerCallUpdateFunc(player, globalCtx);
}
2020-03-22 21:19:43 +00:00
void PlayerCall_Draw(Player* player, GlobalContext* globalCtx) {
2020-03-17 04:31:30 +00:00
KaleidoScopeCall_LoadPlayer();
sPlayerCallDrawFunc(player, globalCtx);
}