mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-23 15:55:47 +00:00
* Remove `(ActorFunc)` casts in initvars, use `/**/` trick for format Achieved by using the following regex: (ActorInit.*)(\n\s+)(.*)(\n\s+)(.*)(\n\s+)(.*)(\n\s+)(.*)(\n\s+)(.*)(\n\s+)(?:\(ActorFunc\))?(.*)(\n\s+)(?:\(ActorFunc\))?(.*)(\n\s+)(?:\(ActorFunc\))?(.*)(\n\s+)(?:\(ActorFunc\))?(.*\n\};) replaced with $1$2/**/ $3$4/**/ $5$6/**/ $7$8/**/ $9$10/**/ $11$12/**/ $13$14/**/ $15$16/**/ $17$18/**/ $19 plus a change from /**/ to #if 0 #endif in docs/ * Manual fixes
58 lines
1.9 KiB
C
58 lines
1.9 KiB
C
#include "global.h"
|
|
|
|
#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);
|
|
|
|
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);
|
|
|
|
ActorInit Player_InitVars = {
|
|
/**/ 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);
|
|
}
|