2020-10-03 17:22:44 +02:00
|
|
|
#include "global.h"
|
2020-03-17 00:31:30 -04:00
|
|
|
|
2021-12-06 01:11:38 +01:00
|
|
|
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25 | ACTOR_FLAG_26)
|
2020-09-19 03:45:39 +02:00
|
|
|
|
2022-05-21 14:23:43 -04: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);
|
2020-03-17 00:31:30 -04:00
|
|
|
|
2022-05-21 14:23:43 -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
|
|
|
|
2022-05-21 14:23:43 -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-09-19 03:45:39 +02:00
|
|
|
|
2022-10-25 01:29:38 +02:00
|
|
|
ActorInit Player_InitVars = {
|
2023-10-30 15:19:16 +01:00
|
|
|
/**/ ACTOR_PLAYER,
|
|
|
|
/**/ ACTORCAT_PLAYER,
|
|
|
|
/**/ FLAGS,
|
|
|
|
/**/ OBJECT_GAMEPLAY_KEEP,
|
|
|
|
/**/ sizeof(Player),
|
|
|
|
/**/ PlayerCall_Init,
|
|
|
|
/**/ PlayerCall_Destroy,
|
|
|
|
/**/ PlayerCall_Update,
|
|
|
|
/**/ PlayerCall_Draw,
|
2020-03-17 00:31:30 -04:00
|
|
|
};
|
|
|
|
|
2021-02-14 00:49:40 +00:00
|
|
|
void PlayerCall_InitFuncPtrs(void) {
|
2020-09-19 03:45:39 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-05-21 14:23:43 -04:00
|
|
|
void PlayerCall_Init(Actor* thisx, PlayState* play) {
|
2020-03-17 00:31:30 -04:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
|
|
|
PlayerCall_InitFuncPtrs();
|
2022-05-21 14:23:43 -04:00
|
|
|
sPlayerCallInitFunc(thisx, play);
|
2020-03-17 00:31:30 -04:00
|
|
|
}
|
|
|
|
|
2022-05-21 14:23:43 -04:00
|
|
|
void PlayerCall_Destroy(Actor* thisx, PlayState* play) {
|
2020-03-17 00:31:30 -04:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
2022-05-21 14:23:43 -04:00
|
|
|
sPlayerCallDestroyFunc(thisx, play);
|
2020-03-17 00:31:30 -04:00
|
|
|
}
|
|
|
|
|
2022-05-21 14:23:43 -04:00
|
|
|
void PlayerCall_Update(Actor* thisx, PlayState* play) {
|
2020-03-17 00:31:30 -04:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
2022-05-21 14:23:43 -04:00
|
|
|
sPlayerCallUpdateFunc(thisx, play);
|
2020-03-17 00:31:30 -04:00
|
|
|
}
|
|
|
|
|
2022-05-21 14:23:43 -04:00
|
|
|
void PlayerCall_Draw(Actor* thisx, PlayState* play) {
|
2020-03-17 00:31:30 -04:00
|
|
|
KaleidoScopeCall_LoadPlayer();
|
2022-05-21 14:23:43 -04:00
|
|
|
sPlayerCallDrawFunc(thisx, play);
|
2020-03-17 00:31:30 -04:00
|
|
|
}
|