diff --git a/include/z64actor.h b/include/z64actor.h index b3e1fe77e0..5d072d253a 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -370,6 +370,8 @@ typedef struct ActorSharedMemoryEntry { /* 0x4 */ void* ptr; } ActorSharedMemoryEntry; // size = 0x8 +#define SWITCH_FLAG_NONE -1 + typedef struct ActorContextSceneFlags { /* 0x00 */ u32 switches[4]; // First 0x40 are permanent, second 0x40 are temporary /* 0x10 */ u32 chest; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index e1c13ae4a8..b484846879 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -728,7 +728,7 @@ void Target_Update(TargetContext* targetCtx, Player* player, Actor* lockOnActor, * Tests if a current scene switch flag is set. */ s32 Flags_GetSwitch(PlayState* play, s32 flag) { - if ((flag >= 0) && (flag < 0x80)) { + if ((flag > SWITCH_FLAG_NONE) && (flag < 0x80)) { return play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] & (1 << (flag & 0x1F)); } return 0; @@ -738,7 +738,7 @@ s32 Flags_GetSwitch(PlayState* play, s32 flag) { * Sets a current scene switch flag. */ void Flags_SetSwitch(PlayState* play, s32 flag) { - if ((flag >= 0) && (flag < 0x80)) { + if ((flag > SWITCH_FLAG_NONE) && (flag < 0x80)) { play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] |= 1 << (flag & 0x1F); } } @@ -747,7 +747,7 @@ void Flags_SetSwitch(PlayState* play, s32 flag) { * Unsets a current scene switch flag. */ void Flags_UnsetSwitch(PlayState* play, s32 flag) { - if ((flag >= 0) && (flag < 0x80)) { + if ((flag > SWITCH_FLAG_NONE) && (flag < 0x80)) { play->actorCtx.sceneFlags.switches[(flag & ~0x1F) >> 5] &= ~(1 << (flag & 0x1F)); } } diff --git a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c index 18063efce9..cbeea4911a 100644 --- a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c +++ b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c @@ -74,7 +74,7 @@ void BgF40Switch_CheckAll(BgF40Switch* this, PlayState* play) { } if (actorAsSwitch->isPressed) { switchFlag = BGF40SWITCH_GET_SWITCH_FLAG(&actorAsSwitch->dyna.actor); - if ((switchFlag >= 0) && (switchFlag < 0x80)) { + if ((switchFlag > SWITCH_FLAG_NONE) && (switchFlag < 0x80)) { pressedSwitchFlags[(switchFlag & ~0x1F) >> 5] |= 1 << (switchFlag & 0x1F); if (!actorAsSwitch->wasPressed && (actorAsSwitch->actionFunc == BgF40Switch_IdleUnpressed) && !Flags_GetSwitch(play, switchFlag)) { @@ -88,7 +88,7 @@ void BgF40Switch_CheckAll(BgF40Switch* this, PlayState* play) { if ((actor->id == ACTOR_BG_F40_SWITCH) && (actor->room == this->dyna.actor.room) && (actor->update != NULL)) { switchFlag = BGF40SWITCH_GET_SWITCH_FLAG(actor); - if ((switchFlag >= 0) && (switchFlag < 0x80) && Flags_GetSwitch(play, switchFlag) && + if ((switchFlag > SWITCH_FLAG_NONE) && (switchFlag < 0x80) && Flags_GetSwitch(play, switchFlag) && !(pressedSwitchFlags[(switchFlag & ~0x1F) >> 5] & (1 << (switchFlag & 0x1F)))) { Flags_UnsetSwitch(play, switchFlag); } diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index f2089ca030..eb1d5761e6 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -40,8 +40,8 @@ void ElfMsg_SetupAction(ElfMsg* this, ElfMsgActionFunc actionFunc) { } s32 func_8092DF9C(ElfMsg* this, PlayState* play) { - if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y < 0x81) && - (Flags_GetSwitch(play, this->actor.home.rot.y - 1))) { + if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) && + Flags_GetSwitch(play, this->actor.home.rot.y - 1)) { (void)"共倒れ"; // "Collapse together" if (ELFMSG_GET_SWITCH_FLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG_GET_SWITCH_FLAG(&this->actor)); @@ -144,7 +144,7 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) { } if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { + Flags_GetSwitch(play, -1 - this->actor.home.rot.y)) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 552478acec..409202468a 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -40,8 +40,8 @@ void ElfMsg2_SetupAction(ElfMsg2* this, ElfMsg2ActionFunc actionFunc) { } s32 func_8096EC4C(ElfMsg2* this, PlayState* play) { - if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y < 0x81) && - (Flags_GetSwitch(play, this->actor.home.rot.y - 1))) { + if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) && + Flags_GetSwitch(play, this->actor.home.rot.y - 1)) { (void)"共倒れ"; // "Collapse together" if (ELFMSG2_GET_SWITCH_FLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG2_GET_SWITCH_FLAG(&this->actor)); @@ -135,7 +135,7 @@ void func_8096EF98(ElfMsg2* this, PlayState* play) { void func_8096EFD0(ElfMsg2* this, PlayState* play) { if ((this->actor.home.rot.y < 0) && (this->actor.home.rot.y >= -0x80) && - (Flags_GetSwitch(play, -this->actor.home.rot.y - 1))) { + Flags_GetSwitch(play, -this->actor.home.rot.y - 1)) { ElfMsg2_SetupAction(this, func_8096EF98); this->actor.flags |= (ACTOR_FLAG_40000 | ACTOR_FLAG_TARGETABLE); this->actor.textId = func_8096EE50(this); diff --git a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c index b7b349dfeb..ba8256361d 100644 --- a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c +++ b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c @@ -39,8 +39,8 @@ void ElfMsg3_SetupAction(ElfMsg3* this, ElfMsg3ActionFunc actionFunc) { } s32 func_80A2CD1C(ElfMsg3* this, PlayState* play) { - if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y < 0x81) && - (Flags_GetSwitch(play, this->actor.home.rot.y - 1))) { + if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) && + Flags_GetSwitch(play, this->actor.home.rot.y - 1)) { (void)"共倒れ"; // "Collapse together" if (ELFMSG3_GET_SWITCH_FLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG3_GET_SWITCH_FLAG(&this->actor)); @@ -142,7 +142,7 @@ void ElfMsg3_Update(Actor* thisx, PlayState* play) { } if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { + Flags_GetSwitch(play, -1 - this->actor.home.rot.y)) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c index 423f8c3519..5f1f0d3dce 100644 --- a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c +++ b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c @@ -40,8 +40,8 @@ static InitChainEntry sInitChain[] = { }; s32 func_80AFD380(ElfMsg4* this, PlayState* play) { - if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y < 0x81) && - (Flags_GetSwitch(play, this->actor.home.rot.y - 1))) { + if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) && + Flags_GetSwitch(play, this->actor.home.rot.y - 1)) { (void)"共倒れ"; // "Collapse together" if (ELFMSG4_GET_SWITCH_FLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG4_GET_SWITCH_FLAG(&this->actor)); @@ -169,7 +169,7 @@ void ElfMsg4_Update(Actor* thisx, PlayState* play) { } if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -1 - this->actor.home.rot.y))) { + Flags_GetSwitch(play, -1 - this->actor.home.rot.y)) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c index c44ab8e0a9..236933fc9b 100644 --- a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c +++ b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c @@ -35,8 +35,8 @@ static InitChainEntry sInitChainsInitChain[] = { }; s32 func_80AFD990(ElfMsg5* this, PlayState* play) { - if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y < 0x81) && - (Flags_GetSwitch(play, this->actor.home.rot.y - 1))) { + if ((this->actor.home.rot.y > 0) && (this->actor.home.rot.y <= 0x80) && + Flags_GetSwitch(play, this->actor.home.rot.y - 1)) { (void)"共倒れ"; // Collapse together if (ELFMSG5_GET_SWITCH_FLAG(&this->actor) != 0x7F) { Flags_SetSwitch(play, ELFMSG5_GET_SWITCH_FLAG(&this->actor)); @@ -87,7 +87,7 @@ void ElfMsg5_Update(Actor* thisx, PlayState* play) { ElfMsg5* this = THIS; if ((this->actor.home.rot.y >= 0) || (this->actor.home.rot.y < -0x80) || - (Flags_GetSwitch(play, -this->actor.home.rot.y - 1))) { + Flags_GetSwitch(play, -this->actor.home.rot.y - 1)) { this->actionFunc(this, play); } } diff --git a/src/overlays/actors/ovl_En_Bal/z_en_bal.c b/src/overlays/actors/ovl_En_Bal/z_en_bal.c index 490517e09a..95b4951246 100644 --- a/src/overlays/actors/ovl_En_Bal/z_en_bal.c +++ b/src/overlays/actors/ovl_En_Bal/z_en_bal.c @@ -864,7 +864,7 @@ void EnBal_TryPurchaseMap(EnBal* this, PlayState* play) { void EnBal_HandleConversation(EnBal* this, PlayState* play) { if (((this->textId != 0x1D07) || Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) && - (Message_ShouldAdvance(play))) { + Message_ShouldAdvance(play)) { switch (this->textId) { case 0x1D00: Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, TINGLE_ANIM_TALK); diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index e754ff5b85..4fa521de3d 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -222,7 +222,7 @@ void EnBigpo_Init(Actor* thisx, PlayState* play2) { this->mainColor.b = 210; this->mainColor.a = 0; // fully invisible - if ((this->switchFlag != 0xFF) && (Flags_GetSwitch(play, this->switchFlag))) { + if ((this->switchFlag != BIG_POE_SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); } @@ -756,7 +756,7 @@ void EnBigpo_SetupLanternDrop(EnBigpo* this, PlayState* play) { void EnBigpo_LanternFalling(EnBigpo* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND || this->actor.floorHeight == BGCHECK_Y_MIN) { - if (this->switchFlag != 0xFF) { + if (this->switchFlag != BIG_POE_SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h index d5bdaf1e8f..6fd0db8a33 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.h @@ -8,6 +8,10 @@ struct EnBigpo; typedef void (*EnBigPoActionFunc)(struct EnBigpo*, PlayState*); +#define BIG_POE_GET_SWITCH_FLAG(thisx) (u8)((thisx)->params >> 0x8) + +#define BIG_POE_SWITCH_FLAG_NONE 0xFF + typedef enum BigPoeBodyPart { /* 0 */ BIG_POE_BODYPART_0, /* 1 */ BIG_POE_BODYPART_1, @@ -75,6 +79,4 @@ typedef enum EnBigpoType { /* 5 */ BIG_POE_TYPE_UNK5 } EnBigpoType; -#define BIG_POE_GET_SWITCH_FLAG(thisx) (u8)((thisx)->params >> 0x8) - #endif // Z_EN_BIGPO_H diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c index 1e322650e4..90d8673f62 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c @@ -97,8 +97,8 @@ void EnDaiku2_Init(Actor* thisx, PlayState* play) { return; } - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == ENDAIKU2_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } else if (Flags_GetSwitch(play, this->switchFlag)) { this->unk_25C = this->path->count - 1; func_80BE61D0(this); @@ -185,7 +185,7 @@ s32 func_80BE64C0(EnDaiku2* this, PlayState* play) { Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); bomb = (EnBom*)Actor_FindNearby(play, &this->actor, -1, ACTORCAT_EXPLOSIVES, BREG(7) + 240.0f); Math_Vec3f_Copy(&this->actor.world.pos, &sp30); - if ((this->switchFlag >= 0) && !Flags_GetSwitch(play, this->switchFlag) && (bomb != NULL) && + if ((this->switchFlag > SWITCH_FLAG_NONE) && !Flags_GetSwitch(play, this->switchFlag) && (bomb != NULL) && (bomb->actor.id == ACTOR_EN_BOM)) { if (!bomb->isPowderKeg) { this->actor.textId = 0x32D3; @@ -228,7 +228,7 @@ void func_80BE65B4(EnDaiku2* this, PlayState* play) { } this->unk_264 = 1.0f; - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { this->unk_28A = 5; if (this->animIndex != ENDAIKU2_ANIM_10) { EnDaiku2_ChangeAnim(this, ENDAIKU2_ANIM_10); @@ -251,7 +251,7 @@ void func_80BE66E4(EnDaiku2* this, PlayState* play) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.home.rot.y, 1, 0xBB8, 0x0); if (sp98 != 2) { - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { this->unk_28A = 5; if (this->animIndex != ENDAIKU2_ANIM_10) { EnDaiku2_ChangeAnim(this, ENDAIKU2_ANIM_10); @@ -433,7 +433,7 @@ void func_80BE6EF0(EnDaiku2* this, PlayState* play) { EnDaiku2_ChangeAnim(this, ENDAIKU2_ANIM_3); } - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { this->unk_28A = 5; if (this->animIndex != ENDAIKU2_ANIM_10) { EnDaiku2_ChangeAnim(this, ENDAIKU2_ANIM_10); diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.h b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.h index c047b6577b..a462d854f6 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.h +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.h @@ -12,6 +12,7 @@ typedef void (*EnDaiku2ActionFunc)(struct EnDaiku2*, PlayState*); #define ENDAIKU2_GET_PATH_INDEX(thisx) (((thisx)->params >> 7) & 0x3F) #define ENDAIKU2_GET_8000(thisx) (((thisx)->params >> 15) & 0x1) +#define ENDAIKU2_SWITCH_FLAG_NONE 0x7F #define ENDAIKU2_PATH_INDEX_NONE 0x3F typedef struct EnDaiku2Effect { diff --git a/src/overlays/actors/ovl_En_Egol/z_en_egol.c b/src/overlays/actors/ovl_En_Egol/z_en_egol.c index 775a14eb52..9d5c148f9b 100644 --- a/src/overlays/actors/ovl_En_Egol/z_en_egol.c +++ b/src/overlays/actors/ovl_En_Egol/z_en_egol.c @@ -482,10 +482,10 @@ void EnEgol_Init(Actor* thisx, PlayState* play) { EYEGORE_SET_SPH_DIM(this->bodyCollider.elements[5], 2100, -300, 0, 37, 1.0f); this->switchFlag = EYEGORE_GET_SWITCH_FLAG(&this->actor); - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == EYEGORE_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag > -1) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); return; } @@ -1096,7 +1096,7 @@ void EnEgol_Death(EnEgol* this, PlayState* play) { Play_SetCameraAtEye(play, this->subCamId, &this->subCamEye, &this->subCamAt); Play_SetCameraFov(play, this->subCamId, this->subCamFov); if ((this->action == EYEGORE_ACTION_DEAD) && (this->waitTimer == 1)) { - if (this->switchFlag > -1) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } CutsceneManager_Stop(this->actor.csId); diff --git a/src/overlays/actors/ovl_En_Egol/z_en_egol.h b/src/overlays/actors/ovl_En_Egol/z_en_egol.h index 0861ce5808..66c8289227 100644 --- a/src/overlays/actors/ovl_En_Egol/z_en_egol.h +++ b/src/overlays/actors/ovl_En_Egol/z_en_egol.h @@ -12,6 +12,7 @@ typedef void (*EnEgolActionFunc)(struct EnEgol*, PlayState*); #define EYEGORE_GET_SWITCH_FLAG(thisx) (((thisx)->params >> 6) & 0x7F) #define EYEGORE_PATH_INDEX_NONE 0x3F +#define EYEGORE_SWITCH_FLAG_NONE 0x7F #define EYEGORE_PARAMS(switch, pathIndex) ((((switch) & 0x7F) << 6) | ((pathIndex) & 0x3F)) diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index c840c33e16..e56252b434 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -117,11 +117,11 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) { this->scale = 0.1f; this->switchFlag = ENCOUNT2_GET_SWITCH_FLAG(&this->dyna.actor); - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == ENCOUNT2_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->dyna.actor); return; } @@ -180,7 +180,7 @@ void EnEncount2_Popped(EnEncount2* this, PlayState* play) { void EnEncount2_Die(EnEncount2* this, PlayState* play) { if (this->deathTimer == 0) { - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index 0a9cb13943..12eb624284 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -7,6 +7,10 @@ struct EnEncount2; typedef void (*EnEncount2ActionFunc)(struct EnEncount2*, PlayState*); +#define ENCOUNT2_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) + +#define ENCOUNT2_SWITCH_FLAG_NONE 0x7F + typedef struct EnEncount2Effect{ /* 0x00 */ u8 isEnabled; /* 0x04 */ Vec3f pos; @@ -33,6 +37,4 @@ typedef struct EnEncount2 { /* 0x01D0 */ EnEncount2Effect effects[EN_ENCOUNT2_EFFECT_COUNT]; } EnEncount2; // size = 0x2A70 -#define ENCOUNT2_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) - #endif // Z_EN_ENCOUNT2_H diff --git a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c index fa37bcb38c..61ff3039f9 100644 --- a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c +++ b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c @@ -49,10 +49,10 @@ void EnEncount3_Init(Actor* thisx, PlayState* play) { } else if (this->unk16C > 1000.0f) { this->unk16C = 1000.0f; } - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == ENCOUNT3_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); } this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON; @@ -71,7 +71,7 @@ void func_809AD058(EnEncount3* this) { } void func_809AD084(EnEncount3* this, PlayState* play) { - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); return; } @@ -94,7 +94,7 @@ void func_809AD084(EnEncount3* this, PlayState* play) { void func_809AD194(EnEncount3* this, PlayState* play) { if (this->unk14E == 0) { this->unk178 = 0.0f; - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } this->actionFunc = func_809AD1EC; diff --git a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.h b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.h index 9e8bd01ad0..cd1df694b9 100644 --- a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.h +++ b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.h @@ -13,6 +13,8 @@ typedef void (*EnEncount3ActionFunc)(struct EnEncount3*, PlayState*); #define ENCOUNT3_GET_ROTZ(thisx) ((thisx)->world.rot.z) +#define ENCOUNT3_SWITCH_FLAG_NONE 0x7F + typedef struct EnEncount3 { /* 0x000 */ Actor actor; /* 0x144 */ EnEncount3ActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c index 077273309b..376401ae40 100644 --- a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c +++ b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c @@ -43,12 +43,12 @@ void EnEncount4_Init(Actor* thisx, PlayState* play) { s32 pad; EnEncount4* this = THIS; - this->unk_148 = ENENCOUNT4_GET_F000(thisx); - this->switchFlag = ENENCOUNT4_GET_FLAG(thisx); - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + this->unk_148 = ENCOUNT4_GET_F000(thisx); + this->switchFlag = ENCOUNT4_GET_SWITCH_FLAG(thisx); + if (this->switchFlag == ENCOUNT4_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); return; } @@ -64,7 +64,7 @@ void func_809C3FD8(EnEncount4* this, PlayState* play) { Actor* actor; this->unk_14E = 0; - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { this->timer = 100; this->actionFunc = func_809C464C; } else { @@ -89,7 +89,7 @@ void func_809C4078(EnEncount4* this, PlayState* play) { s32 i; EnBsb* captainKeeta = this->captainKeeta; - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { this->timer = 100; this->actionFunc = func_809C464C; } else if (BREG(1) == 0) { @@ -135,7 +135,7 @@ void func_809C42A8(EnEncount4* this, PlayState* play) { CollisionPoly* colPoly; s32 bgId; - if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { this->timer = 100; this->actionFunc = func_809C464C; @@ -185,12 +185,12 @@ void func_809C42A8(EnEncount4* this, PlayState* play) { } void func_809C4598(EnEncount4* this, PlayState* play) { - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { this->timer = 100; this->actionFunc = func_809C464C; } else if (this->unk_14E >= 2) { this->timer = 100; - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } this->actionFunc = func_809C464C; diff --git a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.h b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.h index a692f796a9..64dfdff929 100644 --- a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.h +++ b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.h @@ -10,8 +10,10 @@ struct EnEncount4; typedef void (*EnEncount4ActionFunc)(struct EnEncount4*, PlayState*); -#define ENENCOUNT4_GET_FLAG(thisx) ((thisx)->params & 0x7F) -#define ENENCOUNT4_GET_F000(thisx) (((thisx)->params >> 0xC) & 0xF) +#define ENCOUNT4_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) +#define ENCOUNT4_GET_F000(thisx) (((thisx)->params >> 0xC) & 0xF) + +#define ENCOUNT4_SWITCH_FLAG_NONE 0x7F typedef struct EnEncount4 { /* 0x000 */ Actor actor; diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c index 48f75aa687..ef88474f84 100644 --- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c +++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c @@ -115,11 +115,11 @@ void EnHiddenNuts_Init(Actor* thisx, PlayState* play) { this->pathIndex = ENHIDDENNUTS_GET_PATH_INDEX(&this->actor); this->switchFlag = ENHIDDENNUTS_GET_SWITCH_FLAG(&this->actor); - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == ENHIDDENNUTS_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); return; } @@ -411,7 +411,7 @@ void func_80BDBB48(EnHiddenNuts* this, PlayState* play) { } void func_80BDBE70(EnHiddenNuts* this, PlayState* play) { - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } EnHiddenNuts_ChangeAnim(this, ENHIDDENNUTS_ANIM_8); diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h index 7df4b5f015..517ade9648 100644 --- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h +++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.h @@ -11,6 +11,7 @@ typedef void (*EnHiddenNutsActionFunc)(struct EnHiddenNuts*, PlayState*); #define ENHIDDENNUTS_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) #define ENHIDDENNUTS_GET_PATH_INDEX(thisx) (((thisx)->params >> 7) & 0x1F) +#define ENHIDDENNUTS_SWITCH_FLAG_NONE 0x7F #define ENHIDDENNUTS_PATH_INDEX_NONE 0x1F #define ENHIDDENNUTS_PATH_INDEX_NONE_ALT 0x3F diff --git a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c index dcecdac43b..a9cf2e351a 100644 --- a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c +++ b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.c @@ -80,7 +80,7 @@ void func_80C2590C(EnInvisibleRuppe* this, PlayState* play) { break; } - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } @@ -98,11 +98,11 @@ void EnInvisibleRuppe_Init(Actor* thisx, PlayState* play) { this->switchFlag = INVISIBLERUPPE_GET_SWITCH_FLAG(&this->actor); - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == INVISIBLERUPPE_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.h b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.h index 2257a649a6..1e6ae328e0 100644 --- a/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.h +++ b/src/overlays/actors/ovl_En_Invisible_Ruppe/z_en_invisible_ruppe.h @@ -10,6 +10,8 @@ typedef void (*EnInvisibleRuppeActionFunc)(struct EnInvisibleRuppe*, PlayState*) #define INVISIBLERUPPE_GET_3(thisx) ((thisx)->params & 3) #define INVISIBLERUPPE_GET_SWITCH_FLAG(thisx) (((thisx)->params & 0x1FC) >> 2) +#define INVISIBLERUPPE_SWITCH_FLAG_NONE 0x7F + typedef struct EnInvisibleRuppe { /* 0x000 */ Actor actor; /* 0x144 */ ColliderCylinder collider; diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c index abba3efaca..59ba5feb42 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -287,11 +287,11 @@ void EnKaizoku_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->picto.actor, 0.0125f); this->picto.actor.flags |= ACTOR_FLAG_CANT_LOCK_ON; this->picto.actor.flags &= ~ACTOR_FLAG_TARGETABLE; - if (this->switchFlag == 127) { - this->switchFlag = -1; + if (this->switchFlag == KAIZOKU_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->picto.actor); return; } @@ -867,7 +867,7 @@ void func_80B86B74(EnKaizoku* this, PlayState* play) { this->subCamId = SUB_CAM_ID_DONE; func_800B7298(play, &this->picto.actor, PLAYER_CSMODE_END); CutsceneManager_Stop(this->csId); - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } Actor_Kill(&this->picto.actor); diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h index 423819eb31..15562ee2e9 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h @@ -5,13 +5,15 @@ #include "z64snap.h" #include "objects/object_kz/object_kz.h" -#define KAIZOKU_GET_EXIT_INDEX(thisx) ((thisx)->params & 0x3F) -#define KAIZOKU_GET_SWITCH_FLAG(thisx) (((thisx)->params >> 6) & 0x7F) - struct EnKaizoku; typedef void (*EnKaizokuActionFunc)(struct EnKaizoku*, PlayState*); +#define KAIZOKU_GET_EXIT_INDEX(thisx) ((thisx)->params & 0x3F) +#define KAIZOKU_GET_SWITCH_FLAG(thisx) (((thisx)->params >> 6) & 0x7F) + +#define KAIZOKU_SWITCH_FLAG_NONE 0x7F + typedef enum EnKaizokuAnimation { /* 0 */ EN_KAIZOKU_ANIM_0, /* 1 */ EN_KAIZOKU_ANIM_1, diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c index 880f48e82d..09358e0348 100644 --- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c +++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c @@ -113,13 +113,13 @@ void EnLookNuts_Init(Actor* thisx, PlayState* play) { Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON; this->pathIndex = LOOKNUTS_GET_PATH_INDEX(&this->actor); - this->switchFlag = LOOKNUTS_GET_SCENE_FLAG(&this->actor); + this->switchFlag = LOOKNUTS_GET_SWITCH_FLAG(&this->actor); this->spawnIndex = LOOKNUTS_GET_SPAWN_INDEX(&this->actor); - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == LOOKNUTS_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h index 92c24cfbde..1cce177d4f 100644 --- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h +++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.h @@ -9,9 +9,10 @@ struct EnLookNuts; typedef void (*EnLookNutsActionFunc)(struct EnLookNuts*, PlayState*); #define LOOKNUTS_GET_SPAWN_INDEX(thisx) (((thisx)->params >> 0xC) & 0xF) -#define LOOKNUTS_GET_SCENE_FLAG(thisx) ((thisx)->params & 0x7F) +#define LOOKNUTS_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) #define LOOKNUTS_GET_PATH_INDEX(thisx) (((thisx)->params >> 0x7) & 0x1F) +#define LOOKNUTS_SWITCH_FLAG_NONE 0x7F #define LOOKNUTS_PATH_INDEX_NONE 0x1F typedef struct EnLookNuts { diff --git a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c index 82e25a95d2..1a2925f65e 100644 --- a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c +++ b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c @@ -897,7 +897,7 @@ void EnMnk_Monkey_Run(EnMnk* this, PlayState* play) { this->picto.actor.speed = 0.0f; if (MONKEY_GET_TYPE(&this->picto.actor) == MONKEY_OUTSIDECHAMBER) { switchFlag = MONKEY_GET_SWITCH_FLAG(&this->picto.actor); - if (switchFlag != 0x7F) { + if (switchFlag != MONKEY_SWITCH_FLAG_NONE) { Flags_SetSwitch(play, switchFlag + 1); } Actor_Kill(&this->picto.actor); diff --git a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.h b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.h index a9493208f7..42a23f99c3 100644 --- a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.h +++ b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.h @@ -14,6 +14,7 @@ typedef void (*EnMnkFunc)(PlayState*, struct EnMnk*); #define MONKEY_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) #define MONKEY_GET_PATH_INDEX(thisx) (((thisx)->params & 0xF800) >> 11) +#define MONKEY_SWITCH_FLAG_NONE 0x7F #define MONKEY_PATH_INDEX_NONE 0x1F typedef enum { diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 9119e06094..4b225880b0 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -50,8 +50,8 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { } this->unk154 = zRot * 50.0f; this->unk158 = i * 50.0f; - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == ENOKARINATAG_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } if (this->unk14A == 0xF) { this->unk14A = -1; @@ -66,7 +66,7 @@ void func_8093E518(EnOkarinaTag* this, PlayState* play) { s16 yDiff; u16 var_v1; - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { if (this->unk148 == 0) { if (Flags_GetSwitch(play, this->switchFlag)) { return; @@ -122,7 +122,7 @@ void func_8093E68C(EnOkarinaTag* this, PlayState* play) { (play->msgCtx.ocarinaMode == OCARINA_MODE_PLAYED_SUNS) || (play->msgCtx.ocarinaMode == OCARINA_MODE_PLAYED_STORMS) || (play->msgCtx.ocarinaMode == OCARINA_MODE_F)))) { - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { switch (this->unk148) { case 0: Flags_SetSwitch(play, this->switchFlag); diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h index 4c968b3621..649f3b3da3 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h @@ -11,6 +11,8 @@ typedef void (*EnOkarinaTagActionFunc)(struct EnOkarinaTag*, PlayState*); #define ENOKARINATAG_GET_780(thisx) (((thisx)->params >> 0x7) & 0xF) #define ENOKARINATAG_GET_F800(thisx) (((thisx)->params >> 0xB) & 0x1F) +#define ENOKARINATAG_SWITCH_FLAG_NONE 0x7F + typedef struct EnOkarinaTag { /* 0x000 */ Actor actor; /* 0x144 */ EnOkarinaTagActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c index 4e666ed5ce..eb6907c7c2 100644 --- a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c +++ b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c @@ -102,7 +102,7 @@ void func_80B11F78(EnOnpuman* this, PlayState* play) { void func_80B1202C(EnOnpuman* this, PlayState* play2) { PlayState* play = play2; - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && (Message_ShouldAdvance(play))) { + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { switch (play->msgCtx.currentTextId) { case 0x8D4: this->unk_2A4 |= 1; @@ -138,7 +138,7 @@ void func_80B1202C(EnOnpuman* this, PlayState* play2) { } void func_80B1217C(EnOnpuman* this, PlayState* play) { - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && (Message_ShouldAdvance(play))) { + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_5) && Message_ShouldAdvance(play)) { this->actionFunc = func_80B121D8; Message_CloseTextbox(play); } diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.c b/src/overlays/actors/ovl_En_Raf/z_en_raf.c index 1c6a669a25..a7b7d9c137 100644 --- a/src/overlays/actors/ovl_En_Raf/z_en_raf.c +++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.c @@ -225,8 +225,8 @@ void EnRaf_Init(Actor* thisx, PlayState* play) { this->mainType = EN_RAF_GET_TYPE(&this->dyna.actor); this->reviveTimer = EN_RAF_GET_REVIVE_TIMER(&this->dyna.actor); this->switchFlag = EN_RAF_GET_SWITCH_FLAG(&this->dyna.actor); - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == EN_RAF_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } if (this->reviveTimer == 31) { @@ -235,7 +235,7 @@ void EnRaf_Init(Actor* thisx, PlayState* play) { this->reviveTimer = 30; } - if (((this->switchFlag >= 0) || (this->mainType == EN_RAF_TYPE_DORMANT) || + if (((this->switchFlag > SWITCH_FLAG_NONE) || (this->mainType == EN_RAF_TYPE_DORMANT) || CHECK_WEEKEVENTREG(WEEKEVENTREG_12_01)) && (Flags_GetSwitch(play, this->switchFlag) || (this->mainType == EN_RAF_TYPE_DORMANT))) { s32 i; @@ -515,7 +515,7 @@ void EnRaf_Explode(EnRaf* this, PlayState* play) { CLEAR_TAG_PARAMS(CLEAR_TAG_SMALL_EXPLOSION)); Actor_PlaySfx(&this->dyna.actor, NA_SE_IT_BOMB_EXPLOSION); Actor_PlaySfx(&this->dyna.actor, NA_SE_EN_SUISEN_DEAD); - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } @@ -579,7 +579,7 @@ void EnRaf_Convulse(EnRaf* this, PlayState* play) { if (this->endFrame <= curFrame) { this->chewCount++; if (this->chewCount > (BREG(2) + 2)) { - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.h b/src/overlays/actors/ovl_En_Raf/z_en_raf.h index a025046ab3..ca60912330 100644 --- a/src/overlays/actors/ovl_En_Raf/z_en_raf.h +++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.h @@ -8,6 +8,8 @@ #define EN_RAF_GET_REVIVE_TIMER(thisx) (((thisx)->params >> 7) & 0x1F) #define EN_RAF_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) +#define EN_RAF_SWITCH_FLAG_NONE 0x7F + typedef enum { /* 0 */ EN_RAF_TYPE_NORMAL, /* 1 */ EN_RAF_TYPE_DORMANT, // Spawns without trap, so it can't eat bombs/player diff --git a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c index f7ec8f5097..cd2b366340 100644 --- a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c +++ b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c @@ -1122,7 +1122,7 @@ void EnSGoro_WinterShrineGoron_Idle(EnSGoro* this, PlayState* play) { } void EnSGoro_WinterShrineGoron_Talk(EnSGoro* this, PlayState* play) { - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && (Message_ShouldAdvance(play))) { + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { if (this->actionFlags & EN_S_GORO_ACTIONFLAG_LASTMESSAGE) { this->actionFlags &= ~EN_S_GORO_ACTIONFLAG_LASTMESSAGE; this->actionFlags &= ~EN_S_GORO_ACTIONFLAG_ENGAGED; @@ -1230,7 +1230,7 @@ void EnSGoro_ShopGoron_Talk(EnSGoro* this, PlayState* play) { this->textId = EnSGoro_BombshopGoron_NextTextId(this, play); Message_StartTextbox(play, this->textId, &this->actor); } - } else if ((talkState == TEXT_STATE_CHOICE) && (Message_ShouldAdvance(play))) { + } else if ((talkState == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) { switch (play->msgCtx.choiceIndex) { case 0: this->bombbuyFlags |= EN_S_GORO_BOMBBUYFLAG_YESBUY; diff --git a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c index 6a1b68bbce..99c5441a6a 100644 --- a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c +++ b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c @@ -107,10 +107,10 @@ void EnStopheishi_Init(Actor* thisx, PlayState* play) { this->switchFlag = ENSTOPHEISHI_GET_SWITCH_FLAG(&this->actor); this->unk_288 = (this->actor.world.rot.z * 40.0f) + 50.0f; this->actor.world.rot.z = 0; - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == ENSTOPHEISHI_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h index 651a664960..34cb9bf564 100644 --- a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h +++ b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.h @@ -11,6 +11,8 @@ typedef void (*EnStopheishiActionFunc)(struct EnStopheishi*, PlayState*); #define ENSTOPHEISHI_GET_SWITCH_FLAG(thisx) (((thisx)->params) & 0x3F) #define ENSTOPHEISHI_GET_F000(thisx) ((((thisx)->params) >> 0xC) & 0xF) +#define ENSTOPHEISHI_SWITCH_FLAG_NONE 0x7F + typedef struct EnStopheishi { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c index 34ebe1d802..667f5d8c45 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c @@ -264,11 +264,11 @@ void EnTalkGibud_Init(Actor* thisx, PlayState* play) { this->requestedItemIndex = EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_MILK; } - if (this->switchFlag == 0xFF) { - this->switchFlag = -1; + if (this->switchFlag == EN_TALK_GIBUD_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag != -1) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag != SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); } @@ -880,7 +880,7 @@ void EnTalkGibud_Disappear(EnTalkGibud* this, PlayState* play) { player->stateFlags1 |= PLAYER_STATE1_20000000; this->disappearanceTimer--; } else { - if (this->switchFlag != -1) { + if (this->switchFlag != SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } player->stateFlags1 &= ~PLAYER_STATE1_20; diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h index 06ccd3914c..eb11218017 100644 --- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h +++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h @@ -7,6 +7,8 @@ #define EN_TALK_GIBUD_REQUESTED_ITEM_INDEX(thisx) ((thisx)->params & 0xF) #define EN_TALK_GIBUD_GET_SWITCH_FLAG(thisx) (((thisx)->params & 0xFF0) >> 4) +#define EN_TALK_GIBUD_SWITCH_FLAG_NONE 0xFF + struct EnTalkGibud; typedef void (*EnTalkGibudActionFunc)(struct EnTalkGibud*, PlayState*); diff --git a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c index 8ae7b0de4e..c44ec14422 100644 --- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c +++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c @@ -339,8 +339,8 @@ void EnWiz_Init(Actor* thisx, PlayState* play) { this->switchFlag = EN_WIZ_GET_SWITCH_FLAG(&this->actor); this->type = EN_WIZ_GET_TYPE(&this->actor); - if (this->switchFlag == 0x7F) { - this->switchFlag = -1; + if (this->switchFlag == EN_WIZ_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } if ((this->type == EN_WIZ_TYPE_FIRE) || (this->type == EN_WIZ_TYPE_FIRE_NO_BGM)) { @@ -352,7 +352,7 @@ void EnWiz_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.health = 6; } - if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) { + if ((this->switchFlag > SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->actor); return; } @@ -1201,7 +1201,7 @@ void EnWiz_Dead(EnWiz* this, PlayState* play) { EnWiz_SelectPlatform(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_EXTINCT); Actor_Kill(&this->actor); - if (this->switchFlag >= 0) { + if (this->switchFlag > SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } } diff --git a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.h b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.h index fa7156fc58..ea17a254dc 100644 --- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.h +++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.h @@ -7,6 +7,8 @@ #define EN_WIZ_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) #define EN_WIZ_GET_TYPE(thisx) (((thisx)->params >> 8) & 0xFF) +#define EN_WIZ_SWITCH_FLAG_NONE 0x7F + typedef enum { /* 0 */ EN_WIZ_TYPE_FIRE, /* 1 */ EN_WIZ_TYPE_ICE, diff --git a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c index a809da57a3..ba4782d020 100644 --- a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c +++ b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c @@ -33,7 +33,7 @@ void ObjDemo_Init(Actor* thisx, PlayState* play) { ObjDemo* this = THIS; thisx->params = OBJDEMO_GET_SWITCH_FLAG_MASK(thisx); - if ((OBJDEMO_GET_SWITCH_FLAG(thisx) != 0xFF) && (Flags_GetSwitch(play, OBJDEMO_GET_SWITCH_FLAG(thisx)))) { + if ((OBJDEMO_GET_SWITCH_FLAG(thisx) != 0xFF) && Flags_GetSwitch(play, OBJDEMO_GET_SWITCH_FLAG(thisx))) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c index 8802a257dd..a76476bde4 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c @@ -115,11 +115,11 @@ void ObjHakaisi_Init(Actor* thisx, PlayState* play) { this->switchFlag = OBJHAKAISI_GET_SWITCH_FLAG(thisx); this->csId = this->dyna.actor.csId; - if (this->switchFlag == 0xFF) { - this->switchFlag = -1; + if (this->switchFlag == OBJHAKAISI_SWITCH_FLAG_NONE) { + this->switchFlag = SWITCH_FLAG_NONE; } - if ((this->switchFlag != -1) && Flags_GetSwitch(play, this->switchFlag)) { + if ((this->switchFlag != SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(&this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h index 7ee84768ac..937b3d64e7 100644 --- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h +++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.h @@ -10,6 +10,8 @@ typedef void (*ObjHakaisiActionFunc)(struct ObjHakaisi*, PlayState*); #define OBJHAKAISI_GET_FF(thisx) ((thisx)->params & 0xFF) #define OBJHAKAISI_GET_SWITCH_FLAG(thisx) (((thisx)->params & 0xFF00) >> 8) +#define OBJHAKAISI_SWITCH_FLAG_NONE 0xFF + typedef struct ObjHakaisi { /* 0x000 */ DynaPolyActor dyna; /* 0x15C */ ObjHakaisiActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 8df527f371..c98645d172 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -115,7 +115,7 @@ void ObjIcePoly_Init(Actor* thisx, PlayState* play) { thisx->shape.rot.x = 0x500; thisx->shape.rot.z = -0x500; - if (((this->switchFlag != 0xFF) && Flags_GetSwitch(play, this->switchFlag)) || + if (((this->switchFlag != OBJICEPOLY_SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) || ((play->sceneId == SCENE_KAJIYA) && CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE))) { Actor_Kill(thisx); return; @@ -219,7 +219,7 @@ void func_80931A38(ObjIcePoly* this, PlayState* play) { } } while (actor != NULL); } - } else if ((this->switchFlag != 0xFF) && Flags_GetSwitch(play, this->switchFlag)) { + } else if ((this->switchFlag != OBJICEPOLY_SWITCH_FLAG_NONE) && Flags_GetSwitch(play, this->switchFlag)) { CutsceneManager_Queue(this->actor.csId); this->unk_14A = 1; this->actionFunc = func_80931E58; @@ -328,7 +328,7 @@ void func_80931EEC(ObjIcePoly* this, PlayState* play) { if (this->unk_14A == 0) { CutsceneManager_Stop(this->actor.csId); - if (this->switchFlag != 0xFF) { + if (this->switchFlag != OBJICEPOLY_SWITCH_FLAG_NONE) { Flags_SetSwitch(play, this->switchFlag); } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h index 3e59cd92e6..acf62bb91b 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h @@ -9,6 +9,8 @@ typedef void (*ObjIcePolyActionFunc)(struct ObjIcePoly*, PlayState*); #define OBJICEPOLY_GET_SWITCH_FLAG(thisx) (((thisx)->params >> 8) & 0xFF) +#define OBJICEPOLY_SWITCH_FLAG_NONE 0xFF + typedef struct ObjIcePoly { /* 0x000 */ Actor actor; /* 0x144 */ ObjIcePolyActionFunc actionFunc; diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 9e92dcb115..61822bde7c 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -101,7 +101,7 @@ void ObjLift_Init(Actor* thisx, PlayState* play) { this->unk_178 = this->dyna.actor.home.rot.z; this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - if ((this->unk_178 <= 0) && (Flags_GetSwitch(play, OBJLIFT_GET_SWITCH_FLAG(&this->dyna.actor)))) { + if ((this->unk_178 <= 0) && Flags_GetSwitch(play, OBJLIFT_GET_SWITCH_FLAG(&this->dyna.actor))) { Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c index b5ba514188..569a6e6f25 100644 --- a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c +++ b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c @@ -75,7 +75,7 @@ void ObjOcarinalift_Init(Actor* thisx, PlayState* play) { this->unk170 = Lib_SegmentedToVirtual(path->points); func_80AC94C0(this, this->unk168); if ((OBJOCARINALIFT_GET_C(&this->dyna.actor) != OBJOCARINALIFT_PARAM_1) && - (Flags_GetSwitch(play, OBJOCARINALIFT_GET_SWITCH_FLAG(&this->dyna.actor)))) { + Flags_GetSwitch(play, OBJOCARINALIFT_GET_SWITCH_FLAG(&this->dyna.actor))) { func_80AC96B4(this); } else { func_80AC9AB8(this); diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index cbd94d8081..43bf3cb216 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -105,8 +105,8 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); if (OBJ_SYOKUDAI_GET_START_LIT(thisx) || - ((type != OBJ_SYOKUDAI_TYPE_NO_SWITCH || switchFlag != 0x7F) && Flags_GetSwitch(play, switchFlag))) { - + (((type != OBJ_SYOKUDAI_TYPE_NO_SWITCH) || (switchFlag != OBJ_SYOKUDAI_SWITCH_FLAG_NONE)) && + Flags_GetSwitch(play, switchFlag))) { s32 groupSize = OBJ_SYOKUDAI_GET_GROUP_SIZE(thisx); this->snuffTimer = OBJ_SYOKUDAI_SNUFF_NEVER; @@ -239,7 +239,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { player->unk_B28 = 0xC8; } if (groupSize == 0) { - if ((type == OBJ_SYOKUDAI_TYPE_NO_SWITCH) && (switchFlag == 0x7F)) { + if ((type == OBJ_SYOKUDAI_TYPE_NO_SWITCH) && (switchFlag == OBJ_SYOKUDAI_SWITCH_FLAG_NONE)) { this->snuffTimer = OBJ_SYOKUDAI_SNUFF_NEVER; } else if (thisx->csId >= 0) { this->pendingAction = OBJ_SYOKUDAI_PENDING_ACTION_CUTSCENE_AND_SWITCH; @@ -267,9 +267,11 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->standCollider.base); Collider_UpdateCylinder(thisx, &this->flameCollider); CollisionCheck_SetAC(play, &play->colChkCtx, &this->flameCollider.base); - if ((this->snuffTimer > OBJ_SYOKUDAI_SNUFF_OUT) && (--this->snuffTimer == OBJ_SYOKUDAI_SNUFF_OUT) && - (type != OBJ_SYOKUDAI_TYPE_SWITCH_CAUSES_FLAME)) { - sNumLitTorchesInGroup--; + if (this->snuffTimer > OBJ_SYOKUDAI_SNUFF_OUT) { + this->snuffTimer--; + if ((this->snuffTimer == OBJ_SYOKUDAI_SNUFF_OUT) && (type != OBJ_SYOKUDAI_TYPE_SWITCH_CAUSES_FLAME)) { + sNumLitTorchesInGroup--; + } } if (this->snuffTimer != OBJ_SYOKUDAI_SNUFF_OUT) { s32 pad2; diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h index d49f38289a..2ea8dc2fc8 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h @@ -5,6 +5,13 @@ struct ObjSyokudai; +#define OBJ_SYOKUDAI_GET_TYPE(thisx) ((thisx)->params >> 0xC) +#define OBJ_SYOKUDAI_GET_START_LIT(thisx) ((thisx)->params & 0x800) +#define OBJ_SYOKUDAI_GET_GROUP_SIZE(thisx) (((thisx)->params >> 7) & 0xF) +#define OBJ_SYOKUDAI_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) + +#define OBJ_SYOKUDAI_SWITCH_FLAG_NONE 0x7F + typedef struct ObjSyokudai { /* 0x000 */ Actor actor; /* 0x144 */ ColliderCylinder standCollider; @@ -48,11 +55,6 @@ typedef enum { #define OBJ_SYOKUDAI_SNUFF_TIMER_JUST_LIT_BONUS 10 #define OBJ_SYOKUDAI_LIGHT_RADIUS_MAX 250 -#define OBJ_SYOKUDAI_GET_TYPE(thisx) ((thisx)->params >> 0xC) -#define OBJ_SYOKUDAI_GET_START_LIT(thisx) ((thisx)->params & 0x800) -#define OBJ_SYOKUDAI_GET_GROUP_SIZE(thisx) (((thisx)->params >> 7) & 0xF) -#define OBJ_SYOKUDAI_GET_SWITCH_FLAG(thisx) ((thisx)->params & 0x7F) - #define OBJ_SYOKUDAI_SNUFF_TIMER_INITIAL(groupSize) ((groupSize * 50) + 100) #endif // Z_OBJ_SYOKUDAI_H