2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-09-19 01:45:39 +00:00
|
|
|
#define FLAGS 0x06000035
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
void (*sPlayerCallInitFunc)(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void (*sPlayerCallDestroyFunc)(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void (*sPlayerCallUpdateFunc)(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void (*sPlayerCallDrawFunc)(Actor* thisx, GlobalContext* globalCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
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);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-09-19 01:45:39 +00:00
|
|
|
void Player_Init(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void Player_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void Player_Update(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void Player_Draw(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
const ActorInit Player_InitVars = {
|
2020-03-17 04:31:30 +00:00
|
|
|
ACTOR_PLAYER,
|
2021-01-18 21:04:04 +00:00
|
|
|
ACTORCAT_PLAYER,
|
2020-09-19 01:45:39 +00:00
|
|
|
FLAGS,
|
2020-03-17 04:31:30 +00:00
|
|
|
OBJECT_GAMEPLAY_KEEP,
|
|
|
|
sizeof(Player),
|
|
|
|
(ActorFunc)PlayerCall_Init,
|
|
|
|
(ActorFunc)PlayerCall_Destroy,
|
|
|
|
(ActorFunc)PlayerCall_Update,
|
|
|
|
(ActorFunc)PlayerCall_Draw,
|
|
|
|
};
|
|
|
|
|
2021-02-14 00:49:40 +00:00
|
|
|
void PlayerCall_InitFuncPtrs(void) {
|
2020-09-19 01:45:39 +00:00
|
|
|
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(Player_Init);
|
|
|
|
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(Player_Destroy);
|
|
|
|
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(Player_Update);
|
|
|
|
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(Player_Draw);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
|
|
|
PlayerCall_InitFuncPtrs();
|
2020-05-04 19:02:51 +00:00
|
|
|
sPlayerCallInitFunc(thisx, globalCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
2020-05-04 19:02:51 +00:00
|
|
|
sPlayerCallDestroyFunc(thisx, globalCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
2020-05-04 19:02:51 +00:00
|
|
|
sPlayerCallUpdateFunc(thisx, globalCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
2020-05-04 19:02:51 +00:00
|
|
|
sPlayerCallDrawFunc(thisx, globalCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|