1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-11 07:55:22 +00:00
oot/src/code/z_player_call.c

59 lines
1.9 KiB
C
Raw Normal View History

#include "global.h"
2020-03-17 00:31:30 -04:00
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25 | ACTOR_FLAG_26)
void (*sPlayerCallInitFunc)(Actor* thisx, PlayState* play);
void (*sPlayerCallDestroyFunc)(Actor* thisx, PlayState* play);
void (*sPlayerCallUpdateFunc)(Actor* thisx, PlayState* play);
void (*sPlayerCallDrawFunc)(Actor* thisx, PlayState* play);
2020-03-17 00:31:30 -04:00
void PlayerCall_Init(Actor* thisx, PlayState* play);
void PlayerCall_Destroy(Actor* thisx, PlayState* play);
void PlayerCall_Update(Actor* thisx, PlayState* play);
void PlayerCall_Draw(Actor* thisx, PlayState* play);
2020-03-17 00:31:30 -04:00
void Player_Init(Actor* thisx, PlayState* play);
void Player_Destroy(Actor* thisx, PlayState* play);
void Player_Update(Actor* thisx, PlayState* play);
void Player_Draw(Actor* thisx, PlayState* play);
2020-03-22 22:19:43 +01:00
const ActorInit Player_InitVars = {
2020-03-17 00:31:30 -04:00
ACTOR_PLAYER,
ACTORCAT_PLAYER,
FLAGS,
2020-03-17 00:31:30 -04:00
OBJECT_GAMEPLAY_KEEP,
sizeof(Player),
(ActorFunc)PlayerCall_Init,
(ActorFunc)PlayerCall_Destroy,
(ActorFunc)PlayerCall_Update,
(ActorFunc)PlayerCall_Draw,
};
void PlayerCall_InitFuncPtrs(void) {
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(Player_Init);
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(Player_Destroy);
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(Player_Update);
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(Player_Draw);
2020-03-17 00:31:30 -04:00
}
void PlayerCall_Init(Actor* thisx, PlayState* play) {
2020-03-17 00:31:30 -04:00
KaleidoScopeCall_LoadPlayer();
PlayerCall_InitFuncPtrs();
sPlayerCallInitFunc(thisx, play);
2020-03-17 00:31:30 -04:00
}
void PlayerCall_Destroy(Actor* thisx, PlayState* play) {
2020-03-17 00:31:30 -04:00
KaleidoScopeCall_LoadPlayer();
sPlayerCallDestroyFunc(thisx, play);
2020-03-17 00:31:30 -04:00
}
void PlayerCall_Update(Actor* thisx, PlayState* play) {
2020-03-17 00:31:30 -04:00
KaleidoScopeCall_LoadPlayer();
sPlayerCallUpdateFunc(thisx, play);
2020-03-17 00:31:30 -04:00
}
void PlayerCall_Draw(Actor* thisx, PlayState* play) {
2020-03-17 00:31:30 -04:00
KaleidoScopeCall_LoadPlayer();
sPlayerCallDrawFunc(thisx, play);
2020-03-17 00:31:30 -04:00
}