1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-23 07:21:19 +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:
Dragorn421 2021-12-06 01:11:38 +01:00 committed by GitHub
parent 79220ba58a
commit a9284494f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
439 changed files with 1342 additions and 1304 deletions

View file

@ -7,7 +7,7 @@
#include "z_en_tp.h"
#include "objects/object_tp/object_tp.h"
#define FLAGS 0x00000000
#define FLAGS 0
void EnTp_Init(Actor* thisx, GlobalContext* globalCtx);
void EnTp_Destroy(Actor* thisx, GlobalContext* globalCtx);
@ -153,7 +153,7 @@ void EnTp_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->collider.elements->dim.modelSphere.radius = this->collider.elements->dim.worldSphere.radius = 8;
EnTp_Head_SetupWait(this);
this->actor.focus.pos = this->actor.world.pos;
this->actor.flags |= 0x15;
this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4;
Actor_SetScale(&this->actor, 1.5f);
for (i = 0; i <= 6; i++) {
@ -169,7 +169,7 @@ void EnTp_Init(Actor* thisx, GlobalContext* globalCtx2) {
Actor_SetScale(&next->actor, 0.3f);
if (i == 2) {
next->actor.flags |= 0x15;
next->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4;
next->unk_150 = 1; // Why?
}
@ -209,13 +209,13 @@ void EnTp_Tail_FollowHead(EnTp* this, GlobalContext* globalCtx) {
}
} else {
if (this->unk_150 != 0) {
this->actor.flags |= 1;
this->actor.flags |= ACTOR_FLAG_0;
}
if (this->head->unk_150 != 0) {
this->actor.speedXZ = this->red = this->actor.velocity.y = this->heightPhase = 0.0f;
if (this->actor.world.pos.y < this->head->actor.home.pos.y) {
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
}
this->actor.world.pos = this->actor.parent->prevPos;
@ -348,7 +348,7 @@ void EnTp_Fragment_SetupFade(EnTp* this) {
this->actor.velocity.x = (Rand_ZeroOne() - 0.5f) * 1.5f;
this->actor.velocity.y = (Rand_ZeroOne() - 0.5f) * 1.5f;
this->actor.velocity.z = (Rand_ZeroOne() - 0.5f) * 1.5f;
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
EnTp_SetupAction(this, EnTp_Fragment_Fade);
}
@ -592,7 +592,7 @@ void EnTp_UpdateDamage(EnTp* this, GlobalContext* globalCtx) {
}
if (this->actor.colChkInfo.health == 0) {
this->actor.flags &= ~1;
this->actor.flags &= ~ACTOR_FLAG_0;
head = this->head;
if (head->actor.params <= TAILPASARAN_HEAD) {