mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 22:41:14 +00:00
Use defines for actor flags (#873)
* Add ACTOR_FLAG_ defines * Add ACTOR_FLAGS_ALL macro and use ACTOR_FLAG_* constants everywhere * Remove unused ACTOR_FLAG_* constants * actor flags in bigokuta & ko * actor flags in obj_mure * actor flags in stalfos, twinrova & ganon2 * actor flags in morpha & barinade * name some previously missed actor flags * found some comments using hex for actor flags * Actor flags in ovl_En_Ganon_Mant * Actor flags in EnWf * Flags in en_zf * Actor flags in BossGanon (FeelsOKMan) * Remove `ACTOR_FLAG_NONE` * Wrap expansion of `FLAGS` in parentheses * `ACTOR_FLAGS_ALL` -> `CHECK_FLAG_ALL` * Move `CHECK_FLAG_ALL` to `macros.h` * Run formatter
This commit is contained in:
parent
79220ba58a
commit
a9284494f2
439 changed files with 1342 additions and 1304 deletions
|
@ -2,7 +2,7 @@
|
|||
#include "overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h"
|
||||
#include "objects/object_skj/object_skj.h"
|
||||
|
||||
#define FLAGS 0x02000015
|
||||
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_25)
|
||||
|
||||
void EnSkj_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnSkj_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
@ -289,7 +289,7 @@ static InitChainEntry sInitChain[] = {
|
|||
ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
static s32 D_80B01EA0; // gets set if actor flags & 0x100 is set
|
||||
static s32 D_80B01EA0; // gets set if ACTOR_FLAG_8 is set
|
||||
|
||||
void EnSkj_ChangeAnim(EnSkj* this, u8 animIndex) {
|
||||
f32 endFrame = Animation_GetLastFrame(sSkullKidAnimations[animIndex].animation);
|
||||
|
@ -381,7 +381,7 @@ void EnSkj_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
this->actor.destroy = NULL;
|
||||
this->actor.draw = NULL;
|
||||
this->actor.update = EnSkj_SariasSongShortStumpUpdate;
|
||||
this->actor.flags &= ~5;
|
||||
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2);
|
||||
this->actor.flags |= 0;
|
||||
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_PROP);
|
||||
break;
|
||||
|
@ -392,7 +392,7 @@ void EnSkj_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
this->actor.destroy = NULL;
|
||||
this->actor.draw = NULL;
|
||||
this->actor.update = EnSkj_OcarinaMinigameShortStumpUpdate;
|
||||
this->actor.flags &= ~5;
|
||||
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2);
|
||||
this->actor.flags |= 0;
|
||||
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_PROP);
|
||||
this->actor.focus.pos.x = 1230.0f;
|
||||
|
@ -414,13 +414,13 @@ void EnSkj_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gSkullKidSkel, &gSkullKidPlayFluteAnim, this->jointTable,
|
||||
this->morphTable, 19);
|
||||
if ((type >= 0) && (type < 3)) {
|
||||
this->actor.flags &= ~5;
|
||||
this->actor.flags |= 9;
|
||||
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2);
|
||||
this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3;
|
||||
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_NPC);
|
||||
}
|
||||
|
||||
if ((type < 0) || (type >= 7)) {
|
||||
this->actor.flags &= ~0x02000000;
|
||||
this->actor.flags &= ~ACTOR_FLAG_25;
|
||||
}
|
||||
|
||||
if ((type > 0) && (type < 3)) {
|
||||
|
@ -1213,14 +1213,14 @@ void EnSkj_SariasSongWaitForTextClear(EnSkj* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnSkj_OcarinaGameSetupWaitForPlayer(EnSkj* this) {
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
EnSkj_ChangeAnim(this, SKJ_ANIM_WAIT);
|
||||
EnSkj_SetupAction(this, SKJ_ACTION_OCARINA_GAME_WAIT_FOR_PLAYER);
|
||||
}
|
||||
|
||||
void EnSkj_OcarinaGameWaitForPlayer(EnSkj* this, GlobalContext* globalCtx) {
|
||||
if (this->playerInRange) {
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
EnSkj_SetupAction(this, SKJ_ACTION_OCARINA_GAME_IDLE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue