mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-23 23:41:24 +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
|
@ -8,7 +8,7 @@
|
|||
#include "objects/object_poh/object_poh.h"
|
||||
#include "objects/object_po_composer/object_po_composer.h"
|
||||
|
||||
#define FLAGS 0x00001015
|
||||
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_12)
|
||||
|
||||
void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnPoh_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
@ -315,7 +315,7 @@ void func_80ADE368(EnPoh* this) {
|
|||
|
||||
void EnPoh_SetupInitialAction(EnPoh* this) {
|
||||
this->lightColor.a = 0;
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
if (this->infoIdx == EN_POH_INFO_NORMAL) {
|
||||
Animation_PlayOnceSetSpeed(&this->skelAnime, &gPoeAppearAnim, 0.0f);
|
||||
this->actionFunc = func_80ADEF38;
|
||||
|
@ -333,7 +333,7 @@ void func_80ADE48C(EnPoh* this) {
|
|||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
this->unk_198 = 0;
|
||||
this->actor.naviEnemyId = 0xFF;
|
||||
this->actor.flags &= ~1;
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
this->actionFunc = func_80ADF15C;
|
||||
}
|
||||
|
||||
|
@ -372,7 +372,7 @@ void EnPoh_SetupDeath(EnPoh* this, GlobalContext* globalCtx) {
|
|||
this->actor.draw = EnPoh_DrawSoul;
|
||||
this->actor.shape.shadowDraw = NULL;
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actor.flags |= 0x10;
|
||||
this->actor.flags |= ACTOR_FLAG_4;
|
||||
this->actor.gravity = -1.0f;
|
||||
this->actor.shape.yOffset = 1500.0f;
|
||||
this->actor.world.pos.y -= 15.0f;
|
||||
|
@ -435,7 +435,7 @@ void EnPoh_Talk(EnPoh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
this->unk_198 = 200;
|
||||
this->unk_195 = 32;
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
this->actionFunc = func_80ADFE80;
|
||||
}
|
||||
|
||||
|
@ -578,7 +578,7 @@ void func_80ADEF38(EnPoh* this, GlobalContext* globalCtx) {
|
|||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->lightColor.a = 255;
|
||||
this->visibilityTimer = Rand_S16Offset(700, 300);
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
EnPoh_SetupIdle(this);
|
||||
} else if (this->skelAnime.curFrame > 10.0f) {
|
||||
this->lightColor.a = ((this->skelAnime.curFrame - 10.0f) * 0.05f) * 255.0f;
|
||||
|
@ -593,7 +593,7 @@ void EnPoh_ComposerAppear(EnPoh* this, GlobalContext* globalCtx) {
|
|||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->lightColor.a = 255;
|
||||
this->visibilityTimer = Rand_S16Offset(700, 300);
|
||||
this->actor.flags |= 1;
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
EnPoh_SetupIdle(this);
|
||||
} else {
|
||||
this->lightColor.a = CLAMP_MAX((s32)(this->skelAnime.curFrame * 25.5f), 255);
|
||||
|
@ -775,14 +775,14 @@ void func_80ADFE80(EnPoh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
if (this->unk_198 == 0) {
|
||||
func_80ADE950(this, 1);
|
||||
this->actor.flags &= ~0x10000;
|
||||
this->actor.flags &= ~ACTOR_FLAG_16;
|
||||
return;
|
||||
}
|
||||
if (this->colliderCyl.base.ocFlags1 & OC1_HIT) {
|
||||
this->actor.flags |= 0x10000;
|
||||
this->actor.flags |= ACTOR_FLAG_16;
|
||||
func_8002F2F4(&this->actor, globalCtx);
|
||||
} else {
|
||||
this->actor.flags &= ~0x10000;
|
||||
this->actor.flags &= ~ACTOR_FLAG_16;
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base);
|
||||
}
|
||||
this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.home.pos.y;
|
||||
|
@ -927,7 +927,7 @@ void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->colliderCyl.dim.height = 55;
|
||||
this->colliderCyl.dim.yShift = 15;
|
||||
}
|
||||
this->actor.flags &= ~0x10;
|
||||
this->actor.flags &= ~ACTOR_FLAG_4;
|
||||
EnPoh_SetupInitialAction(this);
|
||||
}
|
||||
}
|
||||
|
@ -999,7 +999,7 @@ void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actionFunc(this, globalCtx);
|
||||
Actor_MoveForward(&this->actor);
|
||||
if (this->actionFunc == EnPoh_Attack && this->unk_198 < 10) {
|
||||
this->actor.flags |= 0x1000000;
|
||||
this->actor.flags |= ACTOR_FLAG_24;
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base);
|
||||
}
|
||||
Collider_UpdateCylinder(&this->actor, &this->colliderCyl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue