1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-12 20:13:47 +00:00
oot/src/code/z_player_call.c
mzxrules cf1a39c26f
Reduce dependencies on global.h (10) (#2490)
* reduce z64.h size

* fix z_cheap_proc.inc.c

* ,bss

* remove temp delcaration
2025-02-26 17:18:30 -05:00

67 lines
2.3 KiB
C

#include "kaleido_manager.h"
#include "z64actor.h"
#include "z64actor_profile.h"
#include "z64play.h"
#include "z64player.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA | ACTOR_FLAG_CAN_PRESS_SWITCHES)
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:128 pal-1.1:128"
void (*sPlayerCallInitFunc)(Actor* thisx, PlayState* play);
void (*sPlayerCallDestroyFunc)(Actor* thisx, PlayState* play);
void (*sPlayerCallUpdateFunc)(Actor* thisx, PlayState* play);
void (*sPlayerCallDrawFunc)(Actor* thisx, PlayState* play);
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);
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);
ActorProfile Player_Profile = {
/**/ ACTOR_PLAYER,
/**/ ACTORCAT_PLAYER,
/**/ FLAGS,
/**/ OBJECT_GAMEPLAY_KEEP,
/**/ sizeof(Player),
/**/ PlayerCall_Init,
/**/ PlayerCall_Destroy,
/**/ PlayerCall_Update,
/**/ 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);
}
void PlayerCall_Init(Actor* thisx, PlayState* play) {
KaleidoScopeCall_LoadPlayer();
PlayerCall_InitFuncPtrs();
sPlayerCallInitFunc(thisx, play);
}
void PlayerCall_Destroy(Actor* thisx, PlayState* play) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallDestroyFunc(thisx, play);
}
void PlayerCall_Update(Actor* thisx, PlayState* play) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallUpdateFunc(thisx, play);
}
void PlayerCall_Draw(Actor* thisx, PlayState* play) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallDrawFunc(thisx, play);
}