2022-03-21 21:51:23 -04:00
|
|
|
#include "global.h"
|
|
|
|
|
2023-05-30 15:05:04 -04:00
|
|
|
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA | ACTOR_FLAG_CAN_PRESS_SWITCH)
|
2022-03-21 21:51:23 -04:00
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void (*sPlayerCallInitFunc)(Actor* thisx, PlayState* play);
|
|
|
|
void (*sPlayerCallDestroyFunc)(Actor* thisx, PlayState* play);
|
|
|
|
void (*sPlayerCallUpdateFunc)(Actor* thisx, PlayState* play);
|
|
|
|
void (*sPlayerCallDrawFunc)(Actor* thisx, PlayState* play);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
2022-11-06 03:24:34 -05: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);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
2022-11-06 03:24:34 -05: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);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
const ActorInit Player_InitVars = {
|
|
|
|
ACTOR_PLAYER,
|
|
|
|
ACTORCAT_PLAYER,
|
|
|
|
FLAGS,
|
|
|
|
OBJECT_GAMEPLAY_KEEP,
|
|
|
|
sizeof(Player),
|
|
|
|
(ActorFunc)PlayerCall_Init,
|
|
|
|
(ActorFunc)PlayerCall_Destroy,
|
|
|
|
(ActorFunc)PlayerCall_Update,
|
|
|
|
(ActorFunc)PlayerCall_Draw,
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
void PlayerCall_InitFuncPtrs(void) {
|
|
|
|
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(Player_Init);
|
|
|
|
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(Player_Destroy);
|
|
|
|
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(Player_Update);
|
|
|
|
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(Player_Draw);
|
|
|
|
}
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void PlayerCall_Init(Actor* thisx, PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
|
|
|
PlayerCall_InitFuncPtrs();
|
2022-11-06 03:24:34 -05:00
|
|
|
sPlayerCallInitFunc(thisx, play);
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void PlayerCall_Destroy(Actor* thisx, PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
2022-11-06 03:24:34 -05:00
|
|
|
sPlayerCallDestroyFunc(thisx, play);
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void PlayerCall_Update(Actor* thisx, PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
2022-11-06 03:24:34 -05:00
|
|
|
sPlayerCallUpdateFunc(thisx, play);
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
void PlayerCall_Draw(Actor* thisx, PlayState* play) {
|
2022-03-21 21:51:23 -04:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
2022-11-06 03:24:34 -05:00
|
|
|
sPlayerCallDrawFunc(thisx, play);
|
2022-03-21 21:51:23 -04:00
|
|
|
}
|