diff --git a/soh/include/functions.h b/soh/include/functions.h index 611b55be31..3e2954b774 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -691,7 +691,7 @@ u32 func_80041EC8(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_IsHorseBlocked(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 func_80041F10(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u16 SurfaceType_GetSfx(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -u32 SurfaceType_GetSlope(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 SurfaceType_GetFloorEffect(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_GetLightSettingIndex(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_GetEcho(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_IsHookshotSurface(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); @@ -734,7 +734,7 @@ Vec3s Camera_Update(Camera* camera); void Camera_Finish(Camera* camera); s32 Camera_ChangeMode(Camera* camera, s16 mode); s32 Camera_CheckValidMode(Camera* camera, s16 mode); -s32 Camera_ChangeSetting(Camera* camera, s16 setting); +s32 Camera_RequestSetting(Camera* camera, s16 setting); s32 Camera_ChangeDataIdx(Camera* camera, s32 camDataIdx); s16 Camera_GetInputDirYaw(Camera* camera); Vec3s* Camera_GetCamDir(Vec3s* dir, Camera* camera); @@ -1061,7 +1061,7 @@ void Map_Destroy(PlayState* play); void Map_Init(PlayState* play); void Minimap_Draw(PlayState* play); void Map_Update(PlayState* play); -void Interface_ChangeAlpha(u16 alphaType); +void Interface_ChangeHudVisibilityMode(u16 alphaType); void Interface_SetSceneRestrictions(PlayState* play); void Inventory_SwapAgeEquipment(void); void Interface_InitHorsebackArchery(PlayState* play); @@ -1468,7 +1468,7 @@ void TransitionFade_Draw(void* this, Gfx** gfxP); s32 TransitionFade_IsDone(void* this); void TransitionFade_SetColor(void* this, u32 color); void TransitionFade_SetType(void* this, s32 type); -void ShrinkWindow_SetVal(s32 value); +void Letterbox_SetSizeTarget(s32 value); u32 ShrinkWindow_GetVal(void); void ShrinkWindow_SetCurrentVal(s32 nowVal); u32 ShrinkWindow_GetCurrentVal(void); @@ -1563,7 +1563,7 @@ void Play_SaveSceneFlags(PlayState* play); void Play_SetupRespawnPoint(PlayState* play, s32 respawnMode, s32 playerParams); void Play_TriggerVoidOut(PlayState* play); void Play_TriggerRespawn(PlayState* play); -s32 func_800C0CB8(PlayState* play); +s32 Play_CamIsNotFixed(PlayState* play); s32 FrameAdvance_IsEnabled(PlayState* play); s32 func_800C0D34(PlayState* play, Actor* actor, s16* yaw); s32 func_800C0DB4(PlayState* play, Vec3f* pos); @@ -2051,7 +2051,7 @@ void AudioSeq_ResetSequencePlayer(SequencePlayer* seqPlayer); void AudioSeq_InitSequencePlayerChannels(s32 playerIdx); void AudioSeq_InitSequencePlayers(void); void func_800ECC04(u16); -void Audio_OcaSetInstrument(u8); +void AudioOcarina_SetInstrument(u8); void Audio_OcaSetSongPlayback(s8 songIdxPlusOne, s8 playbackState); void Audio_OcaSetRecordingState(u8); OcarinaStaff* Audio_OcaGetRecordingStaff(void); @@ -2078,8 +2078,8 @@ void func_800F436C(Vec3f*, u16 sfxId, f32 arg2); void func_800F4414(Vec3f*, u16 sfxId, f32 arg2); void Audio_PlaySoundRiver(Vec3f* pos, f32 freqScale); void Audio_PlaySoundWaterfall(Vec3f* pos, f32 freqScale); -void func_800F47BC(void); -void func_800F47FC(void); +void Audio_SetBgmVolumeOffDuringFanfare(void); +void Audio_SetBgmVolumeOnDuringFanfare(void); void func_800F483C(u8 targetVol, u8 volFadeTimer); void func_800F4870(u8); void func_800F4A54(u8); diff --git a/soh/include/z64.h b/soh/include/z64.h index 9e46d3c28c..451d6f6d54 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -1461,7 +1461,7 @@ typedef struct PlayState { /* 0x11DE0 */ Mtx* billboardMtx; /* 0x11DE4 */ u32 gameplayFrames; /* 0x11DE8 */ u8 linkAgeOnLoad; - /* 0x11DE9 */ u8 unk_11DE9; + /* 0x11DE9 */ u8 haltAllActors; /* 0x11DEA */ u8 curSpawn; /* 0x11DEB */ u8 numSetupActors; /* 0x11DEC */ u8 numRooms; diff --git a/soh/include/z64actor.h b/soh/include/z64actor.h index 1fbc688b28..d0ca3dfb62 100644 --- a/soh/include/z64actor.h +++ b/soh/include/z64actor.h @@ -209,6 +209,17 @@ typedef struct { // Flag controlling the use of `Actor.sfx`. Do not use directly. See Actor_PlaySfx_FlaggedTimer #define ACTOR_FLAG_SFX_TIMER (1 << 28) +#define BGCHECKFLAG_GROUND (1 << 0) // Standing on the ground +#define BGCHECKFLAG_GROUND_TOUCH (1 << 1) // Has touched the ground (only active for 1 frame) +#define BGCHECKFLAG_GROUND_LEAVE (1 << 2) // Has left the ground (only active for 1 frame) +#define BGCHECKFLAG_WALL (1 << 3) // Touching a wall +#define BGCHECKFLAG_CEILING (1 << 4) // Touching a ceiling +#define BGCHECKFLAG_WATER (1 << 5) // In water +#define BGCHECKFLAG_WATER_TOUCH (1 << 6) // Has touched water (reset when leaving water) +#define BGCHECKFLAG_GROUND_STRICT (1 << 7) // Strictly on ground (BGCHECKFLAG_GROUND has some leeway) +#define BGCHECKFLAG_CRUSHED (1 << 8) // Crushed between a floor and ceiling (triggers a void for player) +#define BGCHECKFLAG_PLAYER_WALL_INTERACT (1 << 9) // Only set/used by player, related to interacting with walls + typedef struct Actor { /* 0x000 */ s16 id; // Actor ID /* 0x002 */ u8 category; // Actor category. Refer to the corresponding enum for values diff --git a/soh/include/z64audio.h b/soh/include/z64audio.h index 371d9da000..a953d28e43 100644 --- a/soh/include/z64audio.h +++ b/soh/include/z64audio.h @@ -1115,6 +1115,19 @@ typedef enum { /* -1 */ OCARINA_NOTE_INVALID = 0xFF } OcarinaNoteIdx; +typedef enum OcarinaInstrumentId { + /* 0 */ OCARINA_INSTRUMENT_OFF, + /* 1 */ OCARINA_INSTRUMENT_DEFAULT, + /* 2 */ OCARINA_INSTRUMENT_MALON, + /* 3 */ OCARINA_INSTRUMENT_WHISTLE, + /* 4 */ OCARINA_INSTRUMENT_HARP, + /* 5 */ OCARINA_INSTRUMENT_GRIND_ORGAN, + /* 6 */ OCARINA_INSTRUMENT_FLUTE, + /* 7 */ OCARINA_INSTRUMENT_MAX, + /* 7 */ OCARINA_INSTRUMENT_DEFAULT_COPY1 = OCARINA_INSTRUMENT_MAX, // Unused but present in Sequence 0 table + /* 8 */ OCARINA_INSTRUMENT_DEFAULT_COPY2 = OCARINA_INSTRUMENT_MAX + 1 // Unused but present in Sequence 0 table +} OcarinaInstrumentId; + typedef struct { char* seqData; int32_t seqDataSize; diff --git a/soh/include/z64camera.h b/soh/include/z64camera.h index 98797f0a6a..885bec2b14 100644 --- a/soh/include/z64camera.h +++ b/soh/include/z64camera.h @@ -22,6 +22,12 @@ #define PARENT_CAM(cam) ((cam)->play->cameraPtrs[(cam)->parentCamIdx]) #define CHILD_CAM(cam) ((cam)->play->cameraPtrs[(cam)->childCamIdx]) +#define CAM_DATA_SET_0 (1 << 0) +#define CAM_DATA_SET_1 (1 << 1) +#define CAM_DATA_SET_2 (1 << 2) +#define CAM_DATA_SET_3 (1 << 3) +#define CAM_DATA_SET_4 (1 << 4) + typedef enum { /* 0x00 */ CAM_SET_NONE, /* 0x01 */ CAM_SET_NORMAL0, @@ -634,6 +640,22 @@ typedef struct { { yawUpdateRateTarget, CAM_DATA_YAW_UPDATE_RATE_TARGET }, \ { flags, CAM_DATA_FLAGS } +typedef enum CameraItemType { + /* 1 */ CAM_ITEM_TYPE_1 = 1, + /* 2 */ CAM_ITEM_TYPE_2, + /* 3 */ CAM_ITEM_TYPE_3, + /* 4 */ CAM_ITEM_TYPE_4, + /* 5 */ CAM_ITEM_TYPE_5, + /* 8 */ CAM_ITEM_TYPE_8 = 8, + /* 9 */ CAM_ITEM_TYPE_9, + /* 10 */ CAM_ITEM_TYPE_10, + /* 11 */ CAM_ITEM_TYPE_11, + /* 12 */ CAM_ITEM_TYPE_12, + /* 81 */ CAM_ITEM_TYPE_81 = 81, + /* 90 */ CAM_ITEM_TYPE_90 = 90, + /* 91 */ CAM_ITEM_TYPE_91 +} CameraItemType; + typedef struct { /* 0x00 */ f32 unk_00; /* 0x04 */ f32 unk_04; diff --git a/soh/include/z64collision_check.h b/soh/include/z64collision_check.h index 4dad0acc7d..6a0b4bb930 100644 --- a/soh/include/z64collision_check.h +++ b/soh/include/z64collision_check.h @@ -47,6 +47,17 @@ typedef struct { /* 0x07 */ u8 shape; // JntSph, Cylinder, Tris, or Quad } ColliderInitToActor; // size = 0x08 +typedef enum HitSpecialEffect { + HIT_SPECIAL_EFFECT_NONE, + HIT_SPECIAL_EFFECT_FIRE, + HIT_SPECIAL_EFFECT_ICE, + HIT_SPECIAL_EFFECT_ELECTRIC, + HIT_SPECIAL_EFFECT_KNOCKBACK, + HIT_SPECIAL_EFFECT_7 = 7, // Same effect as `HIT_SPECIAL_EFFECT_NONE` + HIT_SPECIAL_EFFECT_8, // Same effect as `HIT_SPECIAL_EFFECT_NONE` + HIT_SPECIAL_EFFECT_9 // Same effect as `HIT_SPECIAL_EFFECT_NONE` +} HitSpecialEffect; + typedef struct { /* 0x00 */ u32 dmgFlags; // Toucher damage type flags. /* 0x04 */ u8 effect; // Damage Effect (Knockback, Fire, etc.) diff --git a/soh/include/z64player.h b/soh/include/z64player.h index 7e051e6eae..e369f88983 100644 --- a/soh/include/z64player.h +++ b/soh/include/z64player.h @@ -587,20 +587,20 @@ typedef enum PlayerStickDirection { /* 3 */ PLAYER_STICK_DIR_RIGHT } PlayerStickDirection; -typedef enum { +typedef enum PlayerKnockbackType { /* 0 */ PLAYER_KNOCKBACK_NONE, // No knockback /* 1 */ PLAYER_KNOCKBACK_SMALL, // A small hop, remains standing up /* 2 */ PLAYER_KNOCKBACK_LARGE, // Sent flying in the air and lands laying down on the floor - /* 3 */ PLAYER_KNOCKBACK_LARGE_SHOCK // Same as`PLAYER_KNOCKBACK_LARGE` with a shock effect + /* 3 */ PLAYER_KNOCKBACK_LARGE_ELECTRIFIED // Same as`PLAYER_KNOCKBACK_LARGE` with a shock effect } PlayerKnockbackType; -typedef enum { +typedef enum PlayerHitResponseType { /* 0 */ PLAYER_HIT_RESPONSE_NONE, /* 1 */ PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, /* 2 */ PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL, - /* 3 */ PLAYER_HIT_RESPONSE_ICE_TRAP, - /* 4 */ PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK -} PlayerDamageResponseType; + /* 3 */ PLAYER_HIT_RESPONSE_FROZEN, + /* 4 */ PLAYER_HIT_RESPONSE_ELECTRIFIED +} PlayerHitResponseType; typedef struct PlayerAgeProperties { /* 0x00 */ f32 ceilingCheckHeight; diff --git a/soh/include/z64save.h b/soh/include/z64save.h index baf192aade..ee35859013 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -13,6 +13,28 @@ #define STARTING_HEALTH (3 * FULL_HEART_HEALTH) #define MAX_HEALTH (20 * FULL_HEART_HEALTH) +// `_FORCE` means that this request will respond to `forceRisingButtonAlphas`. +// If set, the buttons will also raise alphas but will also account for disabled buttons + +typedef enum HudVisibilityMode { + /* 0 */ HUD_VISIBILITY_NO_CHANGE, + /* 1 */ HUD_VISIBILITY_NOTHING, + /* 2 */ HUD_VISIBILITY_NOTHING_ALT, // Identical to HUD_VISIBILITY_NOTHING + /* 3 */ HUD_VISIBILITY_HEARTS_FORCE, // See above + /* 4 */ HUD_VISIBILITY_A, + /* 5 */ HUD_VISIBILITY_A_HEARTS_MAGIC_FORCE, // See above + /* 6 */ HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE, // See above + /* 7 */ HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS, // Only raises button alphas if not disabled + /* 8 */ HUD_VISIBILITY_B, + /* 9 */ HUD_VISIBILITY_HEARTS_MAGIC, + /* 10 */ HUD_VISIBILITY_B_ALT, // Identical to HUD_VISIBILITY_B + /* 11 */ HUD_VISIBILITY_HEARTS, + /* 12 */ HUD_VISIBILITY_A_B_MINIMAP, + /* 13 */ HUD_VISIBILITY_HEARTS_MAGIC_FORCE, // See above + /* 50 */ HUD_VISIBILITY_ALL = 50, // Only raises button alphas if not disabled + /* 52 */ HUD_VISIBILITY_NOTHING_INSTANT = 52 +} HudVisibilityMode; + typedef enum { /* 0x0 */ MAGIC_STATE_IDLE, // Regular gameplay /* 0x1 */ MAGIC_STATE_CONSUME_SETUP, // Sets the speed at which magic border flashes @@ -316,10 +338,10 @@ typedef struct { /* 0x13E1 */ u8 natureAmbienceId; /* 0x13E2 */ u8 buttonStatus[9]; // SOH [Enhancements] Changed from 5 to 9 to support Dpad equips /* 0x13E7 */ u8 forceRisingButtonAlphas; // alpha related - /* 0x13E8 */ u16 unk_13E8; // alpha type? - /* 0x13EA */ u16 unk_13EA; // also alpha type? - /* 0x13EC */ u16 unk_13EC; // alpha type counter? - /* 0x13EE */ u16 unk_13EE; // previous alpha type? + /* 0x13E8 */ u16 nextHudVisibilityMode; // triggers the hud to change visibility mode to the requested value. Reset to HUD_VISIBILITY_NO_CHANGE when target is reached + /* 0x13EA */ u16 hudVisibilityMode; // current hud visibility mode + /* 0x13EC */ u16 hudVisibilityModeTimer; // number of frames in the transition to a new hud visibility mode. Used to step alpha + /* 0x13EE */ u16 prevHudVisibilityMode; // used to store and recover hud visibility mode for pause menu and text boxes /* 0x13F0 */ s16 magicState; // determines magic meter behavior on each frame /* 0x13F2 */ s16 prevMagicState; // used to resume the previous state after adding or filling magic /* 0x13F4 */ s16 magicCapacity; // maximum magic available diff --git a/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp b/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp index f6692ce29b..55e1674b6b 100644 --- a/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp +++ b/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp @@ -142,7 +142,7 @@ extern "C" void DisableFixedCamera_SetNormalCamera(PlayState* play) { play->mainCamera.setting = CAM_SET_NORMAL0; play->mainCamera.prevSetting = CAM_SET_NORMAL0; } - Camera_ChangeSetting(&play->mainCamera, CAM_SET_NORMAL0); + Camera_RequestSetting(&play->mainCamera, CAM_SET_NORMAL0); Camera_ChangeMode(&play->mainCamera, CAM_MODE_NORMAL); } @@ -224,7 +224,7 @@ extern "C" void DisableFixedCamera_CheckCameraState(PlayState* play) { if (play->mainCamera.camDataIdx >= 0) { sStoreLastCamType = play->mainCamera.camDataIdx; } - Camera_ChangeSetting(&play->mainCamera, CAM_SET_TURN_AROUND); + Camera_RequestSetting(&play->mainCamera, CAM_SET_TURN_AROUND); Camera_ChangeMode(&play->mainCamera, CAM_MODE_NORMAL); if (sStoreLastCamType >= 0) { play->mainCamera.camDataIdx = sStoreLastCamType; diff --git a/soh/soh/Enhancements/QoL/PauseWarp.cpp b/soh/soh/Enhancements/QoL/PauseWarp.cpp index 572ff67163..ff2abf8406 100644 --- a/soh/soh/Enhancements/QoL/PauseWarp.cpp +++ b/soh/soh/Enhancements/QoL/PauseWarp.cpp @@ -69,7 +69,7 @@ static void PauseWarp_Execute() { } static void ActivateWarp(PauseContext* pauseCtx, int song) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Interface_SetDoAction(gPlayState, DO_ACTION_NONE); pauseCtx->state = 0x12; WREG(2) = -6240; diff --git a/soh/soh/Enhancements/Warping.cpp b/soh/soh/Enhancements/Warping.cpp index ac1a861e93..7d75d17e53 100644 --- a/soh/soh/Enhancements/Warping.cpp +++ b/soh/soh/Enhancements/Warping.cpp @@ -67,7 +67,7 @@ void Warp(WarpPoint& warpPoint) { for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) { gSaveContext.buttonStatus[buttonIndex] = BTN_ENABLED; } - gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0; + gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = gSaveContext.hudVisibilityModeTimer = 0; gSaveContext.forceRisingButtonAlphas = 0; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP); gSaveContext.entranceIndex = warpPoint.entranceId; diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index 935c7927aa..5e94e469fe 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -238,7 +238,7 @@ void DrawPreviewButton(uint16_t sequenceId, std::string sfxKey, SeqType sequence if (sequenceType == SEQ_SFX || sequenceType == SEQ_VOICE) { Audio_PlaySoundGeneral(sequenceId, &pos, 4, &freqScale, &freqScale, &reverbAdd); } else if (sequenceType == SEQ_INSTRUMENT) { - Audio_OcaSetInstrument(sequenceId - INSTRUMENT_OFFSET); + AudioOcarina_SetInstrument(sequenceId - INSTRUMENT_OFFSET); Audio_OcaSetSongPlayback(9, 1); } else { // TODO: Cant do both here, so have to click preview button twice diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index e7a7ef2a74..42302d19ce 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -401,7 +401,7 @@ void DrawDynapoly(std::vector& dl, CollisionHeader* col, int32_t bgId) { } else if (SurfaceType_GetFloorType(&gPlayState->colCtx, poly, bgId) != 0 || SurfaceType_IsWallDamage(&gPlayState->colCtx, poly, bgId)) { color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorSpecialSurface.Value"), { 192, 255, 192, 255 }); - } else if (SurfaceType_GetSlope(&gPlayState->colCtx, poly, bgId) == 0x01) { + } else if (SurfaceType_GetFloorEffect(&gPlayState->colCtx, poly, bgId) == 0x01) { color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorSlope.Value"), { 255, 255, 128, 255 }); } else { color = CVarGetColor(CVAR_DEVELOPER_TOOLS("ColViewer.ColorNormal.Value"), { 255, 255, 255, 255 }); diff --git a/soh/soh/Enhancements/debugger/valueViewer.cpp b/soh/soh/Enhancements/debugger/valueViewer.cpp index 4e3f3cf940..af9d447cc1 100644 --- a/soh/soh/Enhancements/debugger/valueViewer.cpp +++ b/soh/soh/Enhancements/debugger/valueViewer.cpp @@ -58,7 +58,7 @@ std::array valueTable = {{ { "Frame Counter", "play->state.frames", "FRAM:", TYPE_S32, true, []() -> void* { return &gPlayState->state.frames; }}, { "Cutscene Pointer", "play->csCtx.segment", "CSP:", TYPE_PTR, true, []() -> void* { return &gPlayState->csCtx.segment; }}, { "Framerate Divisor", "R_UPDATE_RATE", "FRDV:", TYPE_S16, false, []() -> void* { return &R_UPDATE_RATE; }}, - { "Next HUD mode", "gSaveContext.nextHudMode", "HUD:", TYPE_S16, false, []() -> void* { return &gSaveContext.unk_13E8; }}, + { "Next HUD mode", "gSaveContext.nextHudMode", "HUD:", TYPE_S16, false, []() -> void* { return &gSaveContext.nextHudVisibilityMode; }}, { "Temp B Value", "gSaveContext.buttonStatus[0]", "TEMPB:", TYPE_U8, false, []() -> void* { return &gSaveContext.buttonStatus[0]; }}, { "Blue Warp Timer", "DoorWarp1->warpTimer", "WARPT:", TYPE_U16, true, []() -> void* { DoorWarp1 *actor = (DoorWarp1 *)Actor_Find(&gPlayState->actorCtx, ACTOR_DOOR_WARP1 ,ACTORCAT_ITEMACTION); if(actor) { return &actor->warpTimer; } else { return nullptr; }}}, /* TODO: Find these (from GZ) diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp index 7f8b2bf17a..c93fe0e88a 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp @@ -327,7 +327,7 @@ void GameInteractor::RawAction::GiveOrTakeShield(int32_t shield) { } void GameInteractor::RawAction::ForceInterfaceUpdate() { - gSaveContext.unk_13E8 = 50; + gSaveContext.nextHudVisibilityMode = 50; Interface_Update(gPlayState); } diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 1a38871a9e..8ef4948ff4 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -2350,7 +2350,7 @@ typedef enum { // #### `result` // ```c - // SurfaceType_GetSlope(&play->colCtx, poly, bgId) == 2 + // SurfaceType_GetFloorEffect(&play->colCtx, poly, bgId) == 2 // ``` // #### `args` // - `*int16_t` - original next entrance index (`play->setupExitList[exitIndex - 1]`) diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index eee791fda8..3225bd0ff6 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -1382,8 +1382,8 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l // This is typically called when you close the text box after getting an item, in case a previous // function hid the interface. - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(0x32); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(0x32); // EnItem00_SetupAction(item00, func_8001E5C8); // *should = false; } else if (item00->actor.params == ITEM00_SOH_GIVE_ITEM_ENTRY_GI) { diff --git a/soh/soh/Network/Anchor/DummyPlayer.cpp b/soh/soh/Network/Anchor/DummyPlayer.cpp index eafe734980..fae13d5849 100644 --- a/soh/soh/Network/Anchor/DummyPlayer.cpp +++ b/soh/soh/Network/Anchor/DummyPlayer.cpp @@ -24,14 +24,14 @@ static DamageTable DummyPlayerDamageTable = { /* Master sword */ DMG_ENTRY(2, DUMMY_PLAYER_HIT_RESPONSE_NORMAL), /* Giant's Knife */ DMG_ENTRY(4, DUMMY_PLAYER_HIT_RESPONSE_NORMAL), /* Fire arrow */ DMG_ENTRY(2, DUMMY_PLAYER_HIT_RESPONSE_FIRE), - /* Ice arrow */ DMG_ENTRY(4, PLAYER_HIT_RESPONSE_ICE_TRAP), - /* Light arrow */ DMG_ENTRY(2, PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK), + /* Ice arrow */ DMG_ENTRY(4, PLAYER_HIT_RESPONSE_FROZEN), + /* Light arrow */ DMG_ENTRY(2, PLAYER_HIT_RESPONSE_ELECTRIFIED), /* Unk arrow 1 */ DMG_ENTRY(2, PLAYER_HIT_RESPONSE_NONE), /* Unk arrow 2 */ DMG_ENTRY(2, PLAYER_HIT_RESPONSE_NONE), /* Unk arrow 3 */ DMG_ENTRY(2, PLAYER_HIT_RESPONSE_NONE), /* Fire magic */ DMG_ENTRY(0, DUMMY_PLAYER_HIT_RESPONSE_FIRE), - /* Ice magic */ DMG_ENTRY(3, PLAYER_HIT_RESPONSE_ICE_TRAP), - /* Light magic */ DMG_ENTRY(0, PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK), + /* Ice magic */ DMG_ENTRY(3, PLAYER_HIT_RESPONSE_FROZEN), + /* Light magic */ DMG_ENTRY(0, PLAYER_HIT_RESPONSE_ELECTRIFIED), /* Shield */ DMG_ENTRY(0, PLAYER_HIT_RESPONSE_NONE), /* Mirror Ray */ DMG_ENTRY(0, PLAYER_HIT_RESPONSE_NONE), /* Kokiri spin */ DMG_ENTRY(1, DUMMY_PLAYER_HIT_RESPONSE_NORMAL), diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index ac6cb0d367..a9950908f1 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1694,7 +1694,7 @@ void func_800ED848(u8 inputEnabled) { sOcarinaInpEnabled = inputEnabled; } -void Audio_OcaSetInstrument(u8 arg0) { +void AudioOcarina_SetInstrument(u8 arg0) { if (D_80130F10 == arg0) { return; } @@ -2191,14 +2191,14 @@ void func_800EE824(void) { D_80131C80++; } else { D_80131C80 = 3; - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); } D_80131C88 = 1200; } break; case 1: Audio_SetSoundBanksMute(0); - Audio_OcaSetInstrument(D_80131C84); + AudioOcarina_SetInstrument(D_80131C84); Audio_OcaSetSongPlayback(OCARINA_SONG_SCARECROW_LONG + 1, 1); D_80131C84++; D_80131C80++; @@ -4223,12 +4223,12 @@ void Audio_StepFreqLerp(FreqLerp* lerp) { } } -void func_800F47BC(void) { +void Audio_SetBgmVolumeOffDuringFanfare(void) { Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 1, 0, 10); Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 1, 0, 10); } -void func_800F47FC(void) { +void Audio_SetBgmVolumeOnDuringFanfare(void) { Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 1, 0x7F, 3); Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 1, 0x7F, 3); } @@ -5122,7 +5122,7 @@ void func_800F6C34(void) { sAudioExtraFilter = 0; sAudioBaseFilter2 = 0; sAudioExtraFilter2 = 0; - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); sRiverFreqScaleLerp.remainingFrames = 0; sWaterfallFreqScaleLerp.remainingFrames = 0; sRiverFreqScaleLerp.value = 1.0f; diff --git a/soh/src/code/db_camera.c b/soh/src/code/db_camera.c index 591190136d..3647211604 100644 --- a/soh/src/code/db_camera.c +++ b/soh/src/code/db_camera.c @@ -2065,15 +2065,15 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { sDbCamAnim.unk_04 = 0; } else if (CHECK_BTN_ALL(sPlayState->state.input[2].press.button, BTN_CLEFT)) { sDbCamAnim.unk_0A = 0; - Interface_ChangeAlpha(2); - ShrinkWindow_SetVal(0); + Interface_ChangeHudVisibilityMode(2); + Letterbox_SetSizeTarget(0); D_8016110C = 0; return 2; } if (func_800B91B0(cam, dbCamera) == 0) { - Interface_ChangeAlpha(2); - ShrinkWindow_SetVal(0); + Interface_ChangeHudVisibilityMode(2); + Letterbox_SetSizeTarget(0); Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } @@ -2230,8 +2230,8 @@ s32 DbCamera_UpdateDemoControl(DbCamera* dbCamera, Camera* cam) { sDbCamAnim.unk_04 = 0.0f; sDbCamAnim.unk_0A = 1; sDbCamAnim.unk_0C = 0; - Interface_ChangeAlpha(50); - ShrinkWindow_SetVal(0x20); + Interface_ChangeHudVisibilityMode(50); + Letterbox_SetSizeTarget(0x20); D_8016110C = 0; Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); diff --git a/soh/src/code/shrink_window.c b/soh/src/code/shrink_window.c index ee4d2e9671..0753891747 100644 --- a/soh/src/code/shrink_window.c +++ b/soh/src/code/shrink_window.c @@ -5,7 +5,7 @@ s32 D_8012CED0 = 0; s32 sShrinkWindowVal = 0; s32 sShrinkWindowCurrentVal = 0; -void ShrinkWindow_SetVal(s32 value) { +void Letterbox_SetSizeTarget(s32 value) { if (CVarGetInteger(CVAR_ENHANCEMENT("DisableBlackBars"), 0)) { sShrinkWindowVal = 0; return; diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 12f1038f75..067b1bee88 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1456,8 +1456,8 @@ void Actor_SwapHookshotAttachment(PlayState* play, Actor* actorA, Actor* actorB) } void Actor_RequestHorseCameraSetting(PlayState* play, Player* player) { - if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_4) && func_800C0CB8(play)) { - Camera_ChangeSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE); + if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_4) && Play_CamIsNotFixed(play)) { + Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_HORSE); } } diff --git a/soh/src/code/z_bgcheck.c b/soh/src/code/z_bgcheck.c index 4c65371b04..7339ef9d63 100644 --- a/soh/src/code/z_bgcheck.c +++ b/soh/src/code/z_bgcheck.c @@ -4087,7 +4087,7 @@ u16 SurfaceType_GetSfx(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) /** * SurfaceType get terrain slope surface */ -u32 SurfaceType_GetSlope(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { +u32 SurfaceType_GetFloorEffect(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { return SurfaceType_GetData(colCtx, poly, bgId, 1) >> 4 & 3; } diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index c103ef5559..91283daf14 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -775,7 +775,7 @@ void Camera_UpdateInterface(s16 flags) { if (flags & SHRINKWIN_CURVAL) { ShrinkWindow_SetCurrentVal(sCameraShrinkWindowVal); } else { - ShrinkWindow_SetVal(sCameraShrinkWindowVal); + Letterbox_SetSizeTarget(sCameraShrinkWindowVal); } } @@ -786,7 +786,7 @@ void Camera_UpdateInterface(s16 flags) { } if (interfaceAlpha != sCameraInterfaceAlpha) { sCameraInterfaceAlpha = interfaceAlpha; - Interface_ChangeAlpha(sCameraInterfaceAlpha); + Interface_ChangeHudVisibilityMode(sCameraInterfaceAlpha); } } } @@ -7416,7 +7416,7 @@ s32 Camera_DbgChangeMode(Camera* camera) { } if (changeDir != 0) { sDbgModeIdx = (sDbgModeIdx + changeDir) % 6; - if (Camera_ChangeSetting(camera, D_8011DAFC[sDbgModeIdx]) > 0) { + if (Camera_RequestSetting(camera, D_8011DAFC[sDbgModeIdx]) > 0) { osSyncPrintf("camera: force change SET to %s!\n", sCameraSettingNames[D_8011DAFC[sDbgModeIdx]]); } } @@ -8023,7 +8023,7 @@ s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags) { return setting; } -s32 Camera_ChangeSetting(Camera* camera, s16 setting) { +s32 Camera_RequestSetting(Camera* camera, s16 setting) { return Camera_ChangeSettingFlags(camera, setting, 0); } @@ -8225,14 +8225,14 @@ s32 Camera_ChangeDoorCam(Camera* camera, Actor* doorActor, s16 camDataIdx, f32 a } if (camDataIdx == -1) { - Camera_ChangeSetting(camera, CAM_SET_DOORC); + Camera_RequestSetting(camera, CAM_SET_DOORC); osSyncPrintf(".... change default door camera (set %d)\n", CAM_SET_DOORC); } else { s32 setting = Camera_GetCamDataSetting(camera, camDataIdx); camera->unk_14A |= 0x40; - if (Camera_ChangeSetting(camera, setting) >= 0) { + if (Camera_RequestSetting(camera, setting) >= 0) { camera->camDataIdx = camDataIdx; camera->unk_14A |= 4; } diff --git a/soh/src/code/z_common_data.c b/soh/src/code/z_common_data.c index 31a25841dd..50133dabb9 100644 --- a/soh/src/code/z_common_data.c +++ b/soh/src/code/z_common_data.c @@ -15,5 +15,5 @@ void SaveContext_Init(void) { gSaveContext.skyboxTime = 0; gSaveContext.dogIsLost = true; gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT; - gSaveContext.unk_13EE = 50; + gSaveContext.prevHudVisibilityMode = 50; } diff --git a/soh/src/code/z_construct.c b/soh/src/code/z_construct.c index 23a63ece11..3eb5ec428b 100644 --- a/soh/src/code/z_construct.c +++ b/soh/src/code/z_construct.c @@ -13,7 +13,7 @@ void func_801109B0(PlayState* play) { u8 timerId; gSaveContext.sunsSongState = SUNSSONG_INACTIVE; - gSaveContext.unk_13E8 = gSaveContext.unk_13EA = 0; + gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = 0; View_Init(&interfaceCtx->view, play->state.gfxCtx); diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index c5c0d9a48c..ead99c6361 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -195,8 +195,8 @@ u32 func_8006472C(PlayState* play, CutsceneContext* csCtx, f32 target) { } void func_80064760(PlayState* play, CutsceneContext* csCtx) { - Interface_ChangeAlpha(1); - ShrinkWindow_SetVal(0x20); + Interface_ChangeHudVisibilityMode(1); + Letterbox_SetSizeTarget(0x20); if (func_8006472C(play, csCtx, 1.0f)) { Audio_SetCutsceneFlag(1); @@ -206,8 +206,8 @@ void func_80064760(PlayState* play, CutsceneContext* csCtx) { void func_800647C0(PlayState* play, CutsceneContext* csCtx) { func_80068C3C(play, csCtx); - Interface_ChangeAlpha(1); - ShrinkWindow_SetVal(0x20); + Interface_ChangeHudVisibilityMode(1); + Letterbox_SetSizeTarget(0x20); if (func_8006472C(play, csCtx, 1.0f)) { Audio_SetCutsceneFlag(1); @@ -399,10 +399,10 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { } break; case 28: - play->unk_11DE9 = 1; + play->haltAllActors = 1; break; case 29: - play->unk_11DE9 = 0; + play->haltAllActors = 0; break; case 30: Flags_SetEnv(play, 3); @@ -1698,7 +1698,7 @@ void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdText } if (csCtx->frames == originalCsFrames) { - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); D_8011E1C0 = 0; D_8011E1C4 = 0; } @@ -2165,8 +2165,8 @@ void func_80068ECC(PlayState* play, CutsceneContext* csCtx) { } if (gSaveContext.cutsceneTrigger == 0) { - Interface_ChangeAlpha(1); - ShrinkWindow_SetVal(0x20); + Interface_ChangeHudVisibilityMode(1); + Letterbox_SetSizeTarget(0x20); ShrinkWindow_SetCurrentVal(0x20); csCtx->state++; } diff --git a/soh/src/code/z_game_over.c b/soh/src/code/z_game_over.c index 96004dbde6..1bc7009676 100644 --- a/soh/src/code/z_game_over.c +++ b/soh/src/code/z_game_over.c @@ -77,8 +77,8 @@ void GameOver_Update(PlayState* play) { for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) { gSaveContext.buttonStatus[buttonIndex] = BTN_ENABLED; } - gSaveContext.forceRisingButtonAlphas = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = - gSaveContext.unk_13EC = 0; + gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = + gSaveContext.hudVisibilityModeTimer = 0; Environment_InitGameOverLights(play); gGameOverTimer = 20; @@ -109,7 +109,7 @@ void GameOver_Update(PlayState* play) { gameOverCtx->state++; gGameOverTimer = 0; Environment_InitGameOverLights(play); - ShrinkWindow_SetVal(0x20); + Letterbox_SetSizeTarget(0x20); return; case GAMEOVER_REVIVE_RUMBLE: diff --git a/soh/src/code/z_kaleido_setup.c b/soh/src/code/z_kaleido_setup.c index 8d92d7c329..9beda9e5ae 100644 --- a/soh/src/code/z_kaleido_setup.c +++ b/soh/src/code/z_kaleido_setup.c @@ -25,7 +25,7 @@ void KaleidoSetup_Update(PlayState* play) { } } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { - gSaveContext.unk_13EE = gSaveContext.unk_13EA; + gSaveContext.prevHudVisibilityMode = gSaveContext.hudVisibilityMode; if (CHECK_BTN_ALL(input->cur.button, BTN_L)) CVarSetInteger(CVAR_GENERAL("PauseMenuAnimatedLinkTriforce"), 1); @@ -60,7 +60,7 @@ void KaleidoSetup_Update(PlayState* play) { R_UPDATE_RATE = 2; if (ShrinkWindow_GetVal()) { - ShrinkWindow_SetVal(0); + Letterbox_SetSizeTarget(0); } func_800F64E0(1); diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index 704857e894..9518213f2d 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -2165,7 +2165,7 @@ void Environment_FadeInGameOverLights(PlayState* play) { sGameOverLightsIntensity += 2; } - if (func_800C0CB8(play)) { + if (Play_CamIsNotFixed(play)) { for (i = 0; i < 3; i++) { if (play->envCtx.adjAmbientColor[i] > -255) { play->envCtx.adjAmbientColor[i] -= 12; @@ -2212,7 +2212,7 @@ void Environment_FadeOutGameOverLights(PlayState* play) { sGameOverLightsIntensity, sGameOverLightsIntensity, sGameOverLightsIntensity, 255); } - if (func_800C0CB8(play)) { + if (Play_CamIsNotFixed(play)) { for (i = 0; i < 3; i++) { Math_SmoothStepToS(&play->envCtx.adjAmbientColor[i], 0, 5, 12, 1); Math_SmoothStepToS(&play->envCtx.adjLight1Color[i], 0, 5, 12, 1); @@ -2440,7 +2440,7 @@ void Environment_AdjustLights(PlayState* play, f32 arg1, f32 arg2, f32 arg3, f32 f32 temp; s32 i; - if (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_5 && func_800C0CB8(play)) { + if (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_5 && Play_CamIsNotFixed(play)) { arg1 = CLAMP_MIN(arg1, 0.0f); arg1 = CLAMP_MAX(arg1, 1.0f); diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 8dac99c738..b049f7c2a3 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -142,13 +142,13 @@ void Message_UpdateOcarinaGame(PlayState* play) { play->msgCtx.msgMode++; if (play->msgCtx.msgMode == MSGMODE_MEMORY_GAME_PLAYER_PLAYING) { - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); msgCtx->ocarinaStaff = Audio_OcaGetPlayingStaff(); msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos = 0; func_800ECC04((1 << OCARINA_SONG_MEMORY_GAME) + 0x8000); msgCtx->textDrawPos = msgCtx->decodedTextLen; } else if (msgCtx->msgMode == MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_PLAYING) { - Audio_OcaSetInstrument(6); + AudioOcarina_SetInstrument(6); msgCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff(); msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos = 0; Audio_OcaSetSongPlayback(OCARINA_SONG_MEMORY_GAME + 1, 1); @@ -891,8 +891,8 @@ void Message_HandleOcarina(PlayState* play) { } else if (msgCtx->ocarinaAction == OCARINA_ACTION_SCARECROW_LONG_PLAYBACK) { // "Recording Playback / Recording Playback / Recording Playback / Recording Playback -> " osSyncPrintf("録音再生 録音再生 録音再生 録音再生 -> "); - Audio_OcaSetInstrument(1); - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); + AudioOcarina_SetInstrument(1); msgCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff(); sOcarinaNoteBufPos = sOcarinaNoteBufLen = 0; msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos; @@ -907,8 +907,8 @@ void Message_HandleOcarina(PlayState* play) { } else if (msgCtx->ocarinaAction == OCARINA_ACTION_SCARECROW_PLAYBACK) { // "8 Note Playback / 8 Note Playback / 8 Note Playback -> " osSyncPrintf("8音再生 8音再生 8音再生 -> "); - Audio_OcaSetInstrument(1); - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); + AudioOcarina_SetInstrument(1); msgCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff(); sOcarinaNoteBufPos = sOcarinaNoteBufLen = 0; msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos; @@ -2694,10 +2694,10 @@ void Message_OpenText(PlayState* play, u16 textId) { sDisplayNextMessageAsEnglish = false; if (msgCtx->msgMode == MSGMODE_NONE) { - gSaveContext.unk_13EE = gSaveContext.unk_13EA; + gSaveContext.prevHudVisibilityMode = gSaveContext.hudVisibilityMode; } if (YREG(15) == 0x10) { - Interface_ChangeAlpha(5); + Interface_ChangeHudVisibilityMode(5); } sMessageHasSetSfx = D_8014B2F4 = sTextboxSkipped = sTextIsCredits = 0; @@ -2744,7 +2744,7 @@ void Message_OpenText(PlayState* play, u16 textId) { textId == 0x2061 || // Learning Epona's Song textId == 0x5035 || // Guru-Guru in Windmill textId == 0x40AC) { // Ocarina Frog Minigame - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); } msgCtx->textId = textId; @@ -2984,9 +2984,9 @@ void Message_StartOcarina(PlayState* play, u16 ocarinaActionId) { msgCtx->textboxColorAlphaCurrent = msgCtx->textboxColorAlphaTarget; if (noStop == false) { Interface_LoadActionLabelB(play, DO_ACTION_STOP); - noStop = gSaveContext.unk_13EA; - Interface_ChangeAlpha(0xA); - gSaveContext.unk_13EA = noStop; + noStop = gSaveContext.hudVisibilityMode; + Interface_ChangeHudVisibilityMode(0xA); + gSaveContext.hudVisibilityMode = noStop; } // "Music Performance Start" osSyncPrintf("演奏開始\n"); @@ -2997,14 +2997,14 @@ void Message_StartOcarina(PlayState* play, u16 ocarinaActionId) { msgCtx->msgMode = MSGMODE_FROGS_START; msgCtx->textBoxType = TEXTBOX_TYPE_BLUE; } else if (ocarinaActionId == OCARINA_ACTION_MEMORY_GAME) { - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); Message_Decode(play); msgCtx->msgMode = MSGMODE_MEMORY_GAME_START; } else if (ocarinaActionId == OCARINA_ACTION_SCARECROW_LONG_PLAYBACK) { // "?????Recording Playback / Recording Playback / Recording Playback / Recording Playback -> " osSyncPrintf("?????録音再生 録音再生 録音再生 録音再生 -> "); - Audio_OcaSetInstrument(1); - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); + AudioOcarina_SetInstrument(1); msgCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff(); sOcarinaNoteBufPos = sOcarinaNoteBufLen = 0; msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos; @@ -3012,8 +3012,8 @@ void Message_StartOcarina(PlayState* play, u16 ocarinaActionId) { msgCtx->stateTimer = 3; msgCtx->msgMode = MSGMODE_SCARECROW_LONG_PLAYBACK; Audio_OcaSetSongPlayback(OCARINA_SONG_SCARECROW_LONG + 1, 1); - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(1); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(1); } for (k = 0, j = 0; j < 48; j++) { Font_LoadCharWide(&play->msgCtx.font, 0x8140, k); @@ -3362,7 +3362,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { case MSGMODE_OCARINA_STARTING: case MSGMODE_SONG_DEMONSTRATION_STARTING: case MSGMODE_SONG_PLAYBACK_STARTING: - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); msgCtx->ocarinaStaff = Audio_OcaGetPlayingStaff(); msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos = 0; play->msgCtx.ocarinaMode = OCARINA_MODE_01; @@ -3430,7 +3430,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->ocarinaAction == OCARINA_ACTION_CHECK_NOWARP) { if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SARIAS || msgCtx->ocarinaStaff->state == OCARINA_SONG_SCARECROW) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -3445,11 +3445,11 @@ void Message_DrawMain(PlayState* play, Gfx** p) { Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); } } else if (msgCtx->ocarinaAction == OCARINA_ACTION_CHECK_SCARECROW) { if (msgCtx->ocarinaStaff->state < OCARINA_SONG_SCARECROW) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -3465,7 +3465,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); } } else if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY) { // "Ocarina_Free Correct Example Performance" @@ -3482,21 +3482,21 @@ void Message_DrawMain(PlayState* play, Gfx** p) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); } else { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_OCARINA_STARTING; } } else if (msgCtx->ocarinaStaff->state == 0xFF) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->stateTimer = 10; msgCtx->msgMode = MSGMODE_OCARINA_FAIL; } else if (isB_Held) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); play->msgCtx.ocarinaMode = OCARINA_MODE_04; Message_CloseTextbox(play); } @@ -3541,7 +3541,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); if (msgCtx->msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) { // "Correct Example Performance" osSyncPrintf("正解模範演奏=%x\n", msgCtx->lastPlayedSong); @@ -3615,7 +3615,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { case MSGMODE_SONG_PLAYED: msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); osSyncPrintf(VT_FGCOL(GREEN)); osSyncPrintf("Na_StopOcarinaMode();\n"); osSyncPrintf("Na_StopOcarinaMode();\n"); @@ -3645,12 +3645,12 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } else { Message_DrawText(play, &gfx); } - Audio_OcaSetInstrument(1); - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); + AudioOcarina_SetInstrument(1); Audio_OcaSetSongPlayback(msgCtx->lastPlayedSong + 1, 1); } else { - Audio_OcaSetInstrument(1); - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); + AudioOcarina_SetInstrument(1); } if (msgCtx->lastPlayedSong != OCARINA_SONG_SCARECROW) { Audio_PlayFanfare(sOcarinaSongFanfares[msgCtx->lastPlayedSong]); @@ -3672,15 +3672,15 @@ void Message_DrawMain(PlayState* play, Gfx** p) { // "ocarina_no=%d Song Chosen=%d" osSyncPrintf("ocarina_no=%d 選曲=%d\n", msgCtx->ocarinaAction, 0x16); if (msgCtx->ocarinaAction < OCARINA_ACTION_TEACH_SARIA) { - Audio_OcaSetInstrument(4); + AudioOcarina_SetInstrument(4); } else if (msgCtx->ocarinaAction == OCARINA_ACTION_TEACH_EPONA) { - Audio_OcaSetInstrument(2); + AudioOcarina_SetInstrument(2); } else if (msgCtx->ocarinaAction == OCARINA_ACTION_TEACH_LULLABY) { - Audio_OcaSetInstrument(3); + AudioOcarina_SetInstrument(3); } else if (msgCtx->ocarinaAction == OCARINA_ACTION_TEACH_STORMS) { - Audio_OcaSetInstrument(5); + AudioOcarina_SetInstrument(5); } else { - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); } // "Example Performance" osSyncPrintf("模範演奏=%x\n", msgCtx->ocarinaAction - OCARINA_ACTION_TEACH_MINUET); @@ -3726,7 +3726,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } break; case MSGMODE_SONG_PLAYED_ACT_BEGIN: - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Message_ResetOcarinaNoteState(); msgCtx->msgMode = MSGMODE_SONG_PLAYED_ACT; msgCtx->stateTimer = 2; @@ -3871,7 +3871,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { // "Scarecrow Recording Initialization" osSyncPrintf("案山子録音 初期化\n"); Audio_OcaSetRecordingState(1); - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); msgCtx->ocarinaStaff = Audio_OcaGetRecordingStaff(); msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos = 0; sOcarinaNoteBufLen = 0; @@ -3957,7 +3957,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->stateTimer == 0) { if (msgCtx->ocarinaStaff->state == 0) { osSyncPrintf("bbbbbbbbbbb\n"); - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); play->msgCtx.ocarinaMode = OCARINA_MODE_0F; Message_CloseTextbox(play); } @@ -3967,7 +3967,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { break; case MSGMODE_SCARECROW_RECORDING_START: Audio_OcaSetRecordingState(2); - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); msgCtx->msgMode = MSGMODE_SCARECROW_RECORDING_ONGOING; if (gSaveContext.language == LANGUAGE_JPN && !sDisplayNextMessageAsEnglish) { Message_DrawTextJPN(play, &gfx); @@ -4016,13 +4016,13 @@ void Message_DrawMain(PlayState* play, Gfx** p) { break; case MSGMODE_SCARECROW_RECORDING_FAILED: osSyncPrintf("cccccccccccc\n"); - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Message_StartTextbox(play, 0x40AD, NULL); // Bonooru doesn't remember your song play->msgCtx.ocarinaMode = OCARINA_MODE_04; break; case MSGMODE_MEMORY_GAME_START: - Audio_OcaSetInstrument(1); - Audio_OcaSetInstrument(6); + AudioOcarina_SetInstrument(1); + AudioOcarina_SetInstrument(6); Audio_OcaMemoryGameStart(gSaveContext.ocarinaGameRoundNum); msgCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff(); msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos = 0; @@ -4078,7 +4078,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->ocarinaStaff->state == 0xFF) { // "Musical round failed!!!!!!!!!" osSyncPrintf("輪唱失敗!!!!!!!!!\n"); - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->stateTimer = 10; @@ -4132,7 +4132,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } break; case MSGMODE_FROGS_START: - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); msgCtx->ocarinaStaff = Audio_OcaGetPlayingStaff(); msgCtx->ocarinaStaff->pos = sOcarinaNoteBufPos = 0; play->msgCtx.ocarinaMode = OCARINA_MODE_01; @@ -4534,7 +4534,7 @@ void Message_Update(PlayState* play) { case MSGMODE_TEXT_NEXT_MSG: Message_Decode(play); if (sTextFade) { - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); } if (D_80153D74 != 0) { msgCtx->textDrawPos = msgCtx->decodedTextLen; @@ -4620,7 +4620,7 @@ void Message_Update(PlayState* play) { if (msgCtx->textId == 0x301F || msgCtx->textId == 0xA || msgCtx->textId == 0xC || msgCtx->textId == 0xCF || msgCtx->textId == 0x21C || msgCtx->textId == 9 || msgCtx->textId == 0x4078 || msgCtx->textId == 0x2015 || msgCtx->textId == 0x3040) { - gSaveContext.unk_13EE = 0x32; + gSaveContext.prevHudVisibilityMode = 0x32; } if (play->csCtx.state == 0) { osSyncPrintf(VT_FGCOL(GREEN)); @@ -4631,11 +4631,12 @@ void Message_Update(PlayState* play) { (msgCtx->textId != 0x3055 && gSaveContext.cutsceneIndex < 0xFFF0)) { osSyncPrintf("=== day_time=%x ", ((void)0, gSaveContext.cutsceneIndex)); if (play->activeCamera == CAM_ID_MAIN) { - if (gSaveContext.unk_13EE == 0 || gSaveContext.unk_13EE == 1 || gSaveContext.unk_13EE == 2) { - gSaveContext.unk_13EE = 0x32; + if (gSaveContext.prevHudVisibilityMode == 0 || gSaveContext.prevHudVisibilityMode == 1 || + gSaveContext.prevHudVisibilityMode == 2) { + gSaveContext.prevHudVisibilityMode = 0x32; } - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(gSaveContext.unk_13EE); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(gSaveContext.prevHudVisibilityMode); } } } diff --git a/soh/src/code/z_onepointdemo.c b/soh/src/code/z_onepointdemo.c index 8aad2f0e74..870337fd19 100644 --- a/soh/src/code/z_onepointdemo.c +++ b/soh/src/code/z_onepointdemo.c @@ -962,7 +962,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 camIdx, s16 csId, Actor* actor } break; case 9806: csCam->timer = -99; - if (func_800C0CB8(play)) { + if (Play_CamIsNotFixed(play)) { func_800C0808(play, camIdx, player, CAM_SET_TURN_AROUND); csCam->data2 = 0xC; } else { @@ -971,7 +971,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 camIdx, s16 csId, Actor* actor } break; case 9908: - if (func_800C0CB8(play)) { + if (Play_CamIsNotFixed(play)) { D_801231B4[0].eyeTargetInit.z = D_801231B4[1].eyeTargetInit.z = !LINK_IS_ADULT ? 100.0f : 120.0f; if (player->stateFlags1 & PLAYER_STATE1_IN_WATER) { @@ -1187,7 +1187,7 @@ s16 OnePointCutscene_Init(PlayState* play, s16 csId, s16 timer, Actor* actor, s1 OnePointCutscene_SetAsChild(play, vChildCamIdx, csCamIdx); vCsStatus = CAM_STAT_WAIT; } else { - Interface_ChangeAlpha(2); + Interface_ChangeHudVisibilityMode(2); } OnePointCutscene_SetAsChild(play, csCamIdx, parentCamIdx); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 244c08bb20..a807a42b15 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -196,11 +196,12 @@ static const char* actionsTbl[] = { }; // original name: "alpha_change" -void Interface_ChangeAlpha(u16 alphaType) { - if (alphaType != gSaveContext.unk_13EA) { - osSyncPrintf("ALPHAーTYPE=%d LAST_TIME_TYPE=%d\n", alphaType, gSaveContext.unk_13EE); - gSaveContext.unk_13EA = gSaveContext.unk_13E8 = alphaType; - gSaveContext.unk_13EC = 1; +void Interface_ChangeHudVisibilityMode(u16 hudVisibilityMode) { + if (hudVisibilityMode != gSaveContext.hudVisibilityMode) { + osSyncPrintf("ALPHAーTYPE=%d LAST_TIME_TYPE=%d\n", hudVisibilityMode, + gSaveContext.prevHudVisibilityMode); + gSaveContext.hudVisibilityMode = gSaveContext.nextHudVisibilityMode = hudVisibilityMode; + gSaveContext.hudVisibilityModeTimer = 1; } } @@ -347,13 +348,13 @@ void func_80082850(PlayState* play, s16 maxAlpha) { InterfaceContext* interfaceCtx = &play->interfaceCtx; s16 alpha = 255 - maxAlpha; - switch (gSaveContext.unk_13E8) { + switch (gSaveContext.nextHudVisibilityMode) { case 1: case 2: case 8: osSyncPrintf("a_alpha=%d, c_alpha=%d → ", interfaceCtx->aAlpha, interfaceCtx->cLeftAlpha); - if (gSaveContext.unk_13E8 == 8) { + if (gSaveContext.nextHudVisibilityMode == 8) { if (interfaceCtx->bAlpha != 255) { interfaceCtx->bAlpha = alpha; } @@ -852,28 +853,28 @@ void func_80083108(PlayState* play) { BTN_DISABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_DISABLED; - Interface_ChangeAlpha(6); + Interface_ChangeHudVisibilityMode(6); } if (play->transitionMode != TRANS_MODE_OFF) { - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); } else if (gSaveContext.minigameState == 1) { - Interface_ChangeAlpha(8); + Interface_ChangeHudVisibilityMode(8); } else if (play->shootingGalleryStatus > 1) { - Interface_ChangeAlpha(8); + Interface_ChangeHudVisibilityMode(8); } else if ((play->sceneNum == SCENE_BOMBCHU_BOWLING_ALLEY) && Flags_GetSwitch(play, 0x38)) { - Interface_ChangeAlpha(8); + Interface_ChangeHudVisibilityMode(8); } else if (player->stateFlags1 & PLAYER_STATE1_ON_HORSE) { - Interface_ChangeAlpha(12); + Interface_ChangeHudVisibilityMode(12); } } else { if (player->stateFlags1 & PLAYER_STATE1_ON_HORSE) { - Interface_ChangeAlpha(12); + Interface_ChangeHudVisibilityMode(12); } } // Don't hide the HUD in the Chamber of Sages when in Boss Rush. } else if (play->sceneNum == SCENE_CHAMBER_OF_THE_SAGES && !IS_BOSS_RUSH) { - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); } else if (play->sceneNum == SCENE_FISHING_POND) { gSaveContext.forceRisingButtonAlphas = 2; if (play->interfaceCtx.unk_260 != 0) { @@ -881,17 +882,17 @@ void func_80083108(PlayState* play) { gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0]; GameInteractor_Should(VB_TEMP_B_STASH_SWORDLESS, true, play); gSaveContext.equips.buttonItems[0] = ITEM_FISHING_POLE; - gSaveContext.unk_13EA = 0; + gSaveContext.hudVisibilityMode = 0; Interface_LoadItemIcon1(play, 0); - Interface_ChangeAlpha(12); + Interface_ChangeHudVisibilityMode(12); } - if (gSaveContext.unk_13EA != 12) { - Interface_ChangeAlpha(12); + if (gSaveContext.hudVisibilityMode != 12) { + Interface_ChangeHudVisibilityMode(12); } } else if (gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE) { gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; - gSaveContext.unk_13EA = 0; + gSaveContext.hudVisibilityMode = 0; GameInteractor_Should(VB_TEMP_B_RESTORE_SWORDLESS, true); @@ -903,17 +904,17 @@ void func_80083108(PlayState* play) { gSaveContext.buttonStatus[3] = BTN_DISABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_DISABLED; - Interface_ChangeAlpha(50); + Interface_ChangeHudVisibilityMode(50); } else { if (gSaveContext.buttonStatus[0] == BTN_ENABLED) { - gSaveContext.unk_13EA = 0; + gSaveContext.hudVisibilityMode = 0; } gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_DISABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_DISABLED; - Interface_ChangeAlpha(50); + Interface_ChangeHudVisibilityMode(50); } } else if (msgCtx->msgMode == MSGMODE_NONE) { if (GameInteractor_PacifistModeActive()) { @@ -961,10 +962,10 @@ void func_80083108(PlayState* play) { } if (sp28) { - gSaveContext.unk_13EA = 0; + gSaveContext.hudVisibilityMode = 0; } - Interface_ChangeAlpha(50); + Interface_ChangeHudVisibilityMode(50); } else if ((player->stateFlags1 & PLAYER_STATE1_CLIMBING_LADDER) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING)) { if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { @@ -976,8 +977,8 @@ void func_80083108(PlayState* play) { gSaveContext.buttonStatus[6] = BTN_DISABLED; gSaveContext.buttonStatus[7] = BTN_DISABLED; gSaveContext.buttonStatus[8] = BTN_DISABLED; - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(50); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(50); } } else if ((gSaveContext.eventInf[0] & 0xF) == 1) { if (player->stateFlags1 & PLAYER_STATE1_ON_HORSE) { @@ -1032,10 +1033,10 @@ void func_80083108(PlayState* play) { } if (sp28) { - gSaveContext.unk_13EA = 0; + gSaveContext.hudVisibilityMode = 0; } - Interface_ChangeAlpha(50); + Interface_ChangeHudVisibilityMode(50); } else { if (interfaceCtx->restrictions.bButton == 0) { if ((gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT) || @@ -1305,9 +1306,9 @@ void func_80083108(PlayState* play) { } if (sp28) { - gSaveContext.unk_13EA = 0; + gSaveContext.hudVisibilityMode = 0; if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) { - Interface_ChangeAlpha(50); + Interface_ChangeHudVisibilityMode(50); osSyncPrintf("???????? alpha_change( 50 ); ?????\n"); } else { osSyncPrintf("game_play->fade_direction || game_play->fbdemo_wipe_modem"); @@ -1751,7 +1752,7 @@ void func_80084BF4(PlayState* play, u16 flag) { gSaveContext.buttonStatus[3] = BTN_ENABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_ENABLED; - Interface_ChangeAlpha(7); + Interface_ChangeHudVisibilityMode(7); } else { gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_ENABLED; @@ -4198,7 +4199,8 @@ void Interface_DrawItemButtons(PlayState* play) { // C-Up Button Texture, Color & Label (Navi Text) gDPPipeSync(OVERLAY_DISP++); - if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) { + if ((gSaveContext.hudVisibilityMode == 1) || (gSaveContext.hudVisibilityMode == 2) || + (gSaveContext.hudVisibilityMode == 5)) { temp = 0; } else if ((player->stateFlags1 & PLAYER_STATE1_CLIMBING_LADDER) || (Player_GetEnvironmentalHazard(play) == 4) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING)) { @@ -6520,7 +6522,7 @@ void Interface_Update(PlayState* play) { } } - switch (gSaveContext.unk_13E8) { + switch (gSaveContext.nextHudVisibilityMode) { case 1: case 2: case 3: @@ -6534,20 +6536,20 @@ void Interface_Update(PlayState* play) { case 11: case 12: case 13: - alpha = 255 - (gSaveContext.unk_13EC << 5); + alpha = 255 - (gSaveContext.hudVisibilityModeTimer << 5); if (alpha < 0) { alpha = 0; } func_80082850(play, alpha); - gSaveContext.unk_13EC++; + gSaveContext.hudVisibilityModeTimer++; if (alpha == 0) { - gSaveContext.unk_13E8 = 0; + gSaveContext.nextHudVisibilityMode = 0; } break; case 50: - alpha = 255 - (gSaveContext.unk_13EC << 5); + alpha = 255 - (gSaveContext.hudVisibilityModeTimer << 5); if (alpha < 0) { alpha = 0; } @@ -6602,16 +6604,16 @@ void Interface_Update(PlayState* play) { break; } - gSaveContext.unk_13EC++; + gSaveContext.hudVisibilityModeTimer++; if (alpha1 == 0xFF) { - gSaveContext.unk_13E8 = 0; + gSaveContext.nextHudVisibilityMode = 0; } break; case 52: - gSaveContext.unk_13E8 = 1; + gSaveContext.nextHudVisibilityMode = 1; func_80082850(play, 0); - gSaveContext.unk_13E8 = 0; + gSaveContext.nextHudVisibilityMode = 0; default: break; } @@ -6862,12 +6864,12 @@ void Interface_Update(PlayState* play) { gSaveContext.nextDayTime = 0; play->transitionType = TRANS_TYPE_FADE_BLACK_FAST; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK; - play->unk_11DE9 = 1; + play->haltAllActors = 1; } else { gSaveContext.nextDayTime = 0x8001; play->transitionType = TRANS_TYPE_FADE_WHITE_FAST; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE; - play->unk_11DE9 = 1; + play->haltAllActors = 1; } if (play->sceneNum == SCENE_HAUNTED_WASTELAND) { diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index e9e9965da7..db5c8cb0ea 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -526,7 +526,7 @@ void Play_Init(GameState* thisx) { play->transitionTrigger = TRANS_TRIGGER_END; play->unk_11E16 = 0xFF; play->bgCoverAlpha = 0; - play->unk_11DE9 = false; + play->haltAllActors = false; if (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN) { if (gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) { @@ -793,7 +793,7 @@ void Play_Update(PlayState* play) { case TRANS_MODE_SETUP: if (play->transitionTrigger != TRANS_TRIGGER_END) { s16 sceneLayer = 0; - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); if (gSaveContext.cutsceneIndex >= 0xFFF0) { sceneLayer = SCENE_LAYER_CUTSCENE_FIRST + (gSaveContext.cutsceneIndex & 0xF); @@ -1191,7 +1191,7 @@ void Play_Update(PlayState* play) { PLAY_LOG(3637); - if (!play->unk_11DE9) { + if (!play->haltAllActors) { Actor_UpdateAll(play, &play->actorCtx); } @@ -2017,11 +2017,11 @@ s32 func_800C0808(PlayState* play, s16 camId, Player* player, s16 setting) { camera = play->cameraPtrs[camIdx]; Camera_InitPlayerSettings(camera, player); - return Camera_ChangeSetting(camera, setting); + return Camera_RequestSetting(camera, setting); } s32 Play_CameraChangeSetting(PlayState* play, s16 camId, s16 setting) { - return Camera_ChangeSetting(Play_GetCamera(play, camId), setting); + return Camera_RequestSetting(Play_GetCamera(play, camId), setting); } void func_800C08AC(PlayState* play, s16 camId, s16 arg2) { @@ -2141,7 +2141,7 @@ void Play_TriggerRespawn(PlayState* play) { Play_LoadToLastEntrance(play); } -s32 func_800C0CB8(PlayState* play) { +s32 Play_CamIsNotFixed(PlayState* play) { return (play->roomCtx.curRoom.meshHeader->base.type != 1) && (YREG(15) != 0x20) && (YREG(15) != 0x30) && (YREG(15) != 0x40) && (play->sceneNum != SCENE_CASTLE_COURTYARD_GUARDS_DAY); } diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index b6d84d9546..f4c50666a5 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -710,7 +710,7 @@ void Player_ReleaseLockOn(Player* this) { * TODO: Learn more about this and give a name to PLAYER_STATE1_19 */ void Player_ClearZTargeting(Player* this) { - if ((this->actor.bgCheckFlags & 1) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & (PLAYER_STATE1_CLIMBING_LADDER | PLAYER_STATE1_ON_HORSE | PLAYER_STATE1_IN_WATER)) || (!(this->stateFlags1 & (PLAYER_STATE1_JUMPING | PLAYER_STATE1_FREEFALL)) && ((this->actor.world.pos.y - this->actor.floorHeight) < 100.0f))) { @@ -930,7 +930,7 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) { envHazard = PLAYER_ENV_HAZARD_HOTROOM - 1; } else if ((this->underwaterTimer > 80) && ((this->currentBoots == PLAYER_BOOTS_IRON) || (this->underwaterTimer >= 300))) { // Deep underwater - envHazard = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & 1)) + envHazard = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) ? (PLAYER_ENV_HAZARD_UNDERWATER_FLOOR - 1) : (PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1); } else if (this->stateFlags1 & PLAYER_STATE1_IN_WATER) { // Swimming diff --git a/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 5656ef7fdd..939e8bfaba 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -354,19 +354,19 @@ void BgBdanObjects_ElevatorOscillate(BgBdanObjects* this, PlayState* play) { if (this->switchFlag == 0) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { this->cameraSetting = play->cameraPtrs[CAM_ID_MAIN]->setting; - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_NORMAL2); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_NORMAL2); func_8005AD1C(play->cameraPtrs[CAM_ID_MAIN], 4); this->switchFlag = 10; } } else { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_NORMAL2); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_NORMAL2); if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->switchFlag != 0) { this->switchFlag--; } } if (this->switchFlag == 0) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], this->cameraSetting); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], this->cameraSetting); func_8005ACFC(play->cameraPtrs[CAM_ID_MAIN], 4); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index e7e4a286db..236e782af2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -404,7 +404,7 @@ void BgDyYoseizo_GreetPlayer_NoReward(BgDyYoseizo* this, PlayState* play) { if ((this->dialogState == Message_GetState(&play->msgCtx)) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - Interface_ChangeAlpha(5); + Interface_ChangeHudVisibilityMode(5); this->actionFunc = BgDyYoseizo_SetupHealPlayer_NoReward; } @@ -724,7 +724,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) { case FAIRY_UPGRADE_MAGIC: gSaveContext.isMagicAcquired = true; gSaveContext.magicFillTarget = MAGIC_NORMAL_METER; - Interface_ChangeAlpha(9); + Interface_ChangeHudVisibilityMode(9); break; case FAIRY_UPGRADE_DOUBLE_MAGIC: if (!gSaveContext.isMagicAcquired) { @@ -733,11 +733,11 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) { gSaveContext.isDoubleMagicAcquired = true; gSaveContext.magicFillTarget = MAGIC_DOUBLE_METER; gSaveContext.magicLevel = 0; - Interface_ChangeAlpha(9); + Interface_ChangeHudVisibilityMode(9); break; case FAIRY_UPGRADE_HALF_DAMAGE: gSaveContext.isDoubleDefenseAcquired = true; - Interface_ChangeAlpha(9); + Interface_ChangeHudVisibilityMode(9); break; } @@ -771,7 +771,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) { this->itemSpawned = true; gSaveContext.healthAccumulator = MAX_HEALTH; - Interface_ChangeAlpha(9); + Interface_ChangeHudVisibilityMode(9); gSaveContext.itemGetInf[1] |= sItemGetFlags[actionIndex]; Item_Give(play, sItemIds[actionIndex]); } diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c index 55fd8af5ca..80004a26d4 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c @@ -130,10 +130,10 @@ void BgHidanFslift_Update(Actor* thisx, PlayState* play) { if (this->cameraSetting == 0) { this->cameraSetting = 3; } - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); } else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->cameraSetting != 0) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); } this->cameraSetting = 0; } diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index 1fd4eac319..304bbd8813 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -268,10 +268,10 @@ void func_8088B79C(BgHidanRock* this, PlayState* play) { if (this->unk_169 == 0) { this->unk_169 = 3; } - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); } else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->unk_169 != 0) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); } this->unk_169 = 0; } @@ -321,10 +321,10 @@ void func_8088B990(BgHidanRock* this, PlayState* play) { if (this->unk_169 == 0) { this->unk_169 = 3; } - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); } else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->unk_169 != 0) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); } this->unk_169 = 0; } diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c index 0b5b2ff303..a535dfec17 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c @@ -113,10 +113,10 @@ void BgHidanSyoku_Update(Actor* thisx, PlayState* play) { if (this->unk_168 == 0) { this->unk_168 = 3; } - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); } else if (!DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->unk_168 != 0) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); } this->unk_168 = 0; } diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index b9dd1b8486..f00311f5d9 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -190,9 +190,9 @@ void BgJya1flift_Update(Actor* thisx, PlayState* play2) { tempIsRiding = DynaPolyActor_IsPlayerOnTop(&this->dyna) ? true : false; if ((this->actionFunc == BgJya1flift_Move) || (this->actionFunc == BgJya1flift_DelayMove)) { if (tempIsRiding) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FIRE_PLATFORM); } else if (!tempIsRiding && this->isLinkRiding) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); } } this->isLinkRiding = tempIsRiding; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index fc5b07e4e7..be597a869e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -147,10 +147,10 @@ void BgJyaLift_Update(Actor* thisx, PlayState* play2) { } if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ABOVE) && ((this->unk_16B & DYNA_INTERACT_PLAYER_ABOVE) == 0)) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DIRECTED_YAW); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DIRECTED_YAW); } else if (((this->dyna.interactFlags) & 4) == 0 && ((this->unk_16B & 4)) && (play->cameraPtrs[CAM_ID_MAIN]->setting == CAM_SET_DIRECTED_YAW)) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); } this->unk_16B = this->dyna.interactFlags; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 281e26f19a..4124c2b3d0 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -183,7 +183,7 @@ void func_808A3C8C(BgMoriHineri* this, PlayState* play) { f0 = 1100.0f - (player->actor.world.pos.z - this->dyna.actor.world.pos.z); this->dyna.actor.shape.rot.z = CLAMP(f0, 0.0f, 1000.0f) * 16.384f; - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON1); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON1); if (this->dyna.actor.params != 0) { this->dyna.actor.shape.rot.z = -this->dyna.actor.shape.rot.z; } diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index c8716967b4..bd303ca8df 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -209,11 +209,11 @@ void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play) { osSyncPrintf("camera changed (mori rakka tenjyo) ... \n"); sCamSetting = play->cameraPtrs[CAM_ID_MAIN]->setting; Camera_SetCameraData(play->cameraPtrs[CAM_ID_MAIN], 1, &this->dyna.actor, NULL, 0, 0, 0); - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FOREST_BIRDS_EYE); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_FOREST_BIRDS_EYE); } } else if (sCamSetting != CAM_SET_NONE) { osSyncPrintf("camera changed (previous) ... \n"); - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON1); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON1); sCamSetting = 0; } } diff --git a/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c index 8299fe68d3..9dffb763af 100644 --- a/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c +++ b/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c @@ -63,9 +63,9 @@ void BgSstFloor_Update(BgSstFloor* thisx, PlayState* play) { colHeader->vtxList = SEGMENTED_TO_VIRTUAL(colHeader->vtxList); if (DynaPolyActor_IsPlayerAbove(&this->dyna) && (this->dyna.actor.yDistToPlayer < 1000.0f)) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BOSS_BONGO); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BOSS_BONGO); } else { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); } if (DynaPolyActor_IsPlayerOnTop(&this->dyna) && (player->fallDistance > 1000.0f)) { diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 5f274777e7..a0ee1c5a7b 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -934,7 +934,7 @@ void BossDodongo_Roll(BossDodongo* this, PlayState* play) { Math_SmoothStepToF(&this->actor.world.pos.z, sp5C->z, 1.0f, this->unk_1E4, 0.0f); this->unk_1C4 += 2000; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_228 = 7700.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_K_ROLL - SFX_FLAG); diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 3322e452fa..cb6190d60c 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -797,7 +797,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { if (this->csTimer == 20) { Player_SetCsActionWithHaltedActors(play, &this->actor, 0x17); - Interface_ChangeAlpha(11); // show hearts only + Interface_ChangeHudVisibilityMode(11); // show hearts only } if (this->csTimer == 25) { @@ -805,7 +805,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { } if (this->csTimer == 100) { - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); } if (this->csTimer == 120) { @@ -4142,7 +4142,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { spBA = 4; } - if ((spBA != 0) || (this->actor.bgCheckFlags & 1)) { + if ((spBA != 0) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { f32 sp58; f32 sp54; f32 phi_f20; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 22e1034084..4b14410db8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -1076,7 +1076,7 @@ void func_808FFCFC(BossGanon2* this, PlayState* play) { this->unk_311 = false; func_80900580(this, play); Audio_StopSfxById(NA_SE_EN_MGANON_UNARI); - } else if ((this->actor.bgCheckFlags & 8) && func_808FFA24(this, play)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && func_808FFA24(this, play)) { this->unk_311 = false; func_80900580(this, play); Audio_StopSfxById(NA_SE_EN_MGANON_UNARI); @@ -2057,7 +2057,7 @@ void BossGanon2_Update(Actor* thisx, PlayState* play) { this->actor.shape.rot = this->actor.world.rot; if (this->unk_335 != 0) { Actor_UpdateBgCheckInfo(play, &this->actor, 60.0f, 60.0f, 100.0f, 5); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.velocity.y < -5.0f) { Actor_RequestQuakeAndRumble(&this->actor, play, 5, 20); Sfx_PlaySfxCentered(NA_SE_IT_BOMB_EXPLOSION); diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 76612bfe4a..eb02d76325 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -889,7 +889,7 @@ void BossGoma_Encounter(BossGoma* this, PlayState* play) { Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor), 2, 0x7D0); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actionState = 130; this->actor.velocity.y = 0.0f; Animation_Change(&this->skelanime, &gGohmaInitialLandingAnim, 1.0f, 0.0f, @@ -1441,7 +1441,7 @@ void BossGoma_FallJump(BossGoma* this, PlayState* play) { Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor), 2, 0x7D0); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { BossGoma_SetupFloorLand(this); this->actor.velocity.y = 0.0f; BossGoma_PlayEffectsAndSfx(this, play, 0, 8); @@ -1458,7 +1458,7 @@ void BossGoma_FallStruckDown(BossGoma* this, PlayState* play) { Math_ApproachS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor), 3, 0x7D0); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { BossGoma_SetupFloorLandStruckDown(this); this->actor.velocity.y = 0.0f; BossGoma_PlayEffectsAndSfx(this, play, 0, 8); @@ -1651,11 +1651,11 @@ void BossGoma_FloorMain(BossGoma* this, PlayState* play) { } } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.velocity.y = 0.0f; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { BossGoma_SetupWallClimb(this); } @@ -1702,7 +1702,7 @@ void BossGoma_CeilingMoveToCenter(BossGoma* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.x, -0x8000, 3, 0x3E8); // avoid walking into a wall? - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { angle = this->actor.shape.rot.y + 0x8000; if (angle < this->actor.wallYaw) { diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index a8fc5d18a9..f6abd973b8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -817,8 +817,8 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { tent_shake: case MO_TENT_SHAKE: if (this->timers[0] == 138) { - ShrinkWindow_SetVal(0); - Interface_ChangeAlpha(0xB); + Letterbox_SetSizeTarget(0); + Interface_ChangeHudVisibilityMode(0xB); } if ((this->timers[0] % 8) == 0) { play->damagePlayer(play, -1); diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 5bc88a5f69..a71826e1a0 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -453,7 +453,7 @@ void BossSst_HeadIntro(BossSst* this, PlayState* play) { } Math_Vec3f_Copy(&sCameraAt, &player->actor.world.pos); - if (player->actor.bgCheckFlags & 2) { + if (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (!this->ready) { sFloor->dyna.actor.params = BONGOFLOOR_HIT; this->ready = true; @@ -1652,7 +1652,7 @@ void BossSst_HandPunch(BossSst* this, PlayState* play) { this->actor.world.pos.x += this->actor.speedXZ * Math_SinS(this->actor.shape.rot.y); this->actor.world.pos.z += this->actor.speedXZ * Math_CosS(this->actor.shape.rot.y); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { BossSst_HandSetupRetreat(this); } else if (this->colliderJntSph.base.atFlags & AT_HIT) { Player_PlaySfx(&GET_PLAYER(play)->actor, NA_SE_PL_BODY_HIT); diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 6c1635fed3..e425a2c116 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -1368,7 +1368,7 @@ void BossTw_HitByBeam(BossTw* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, 4); this->actor.world.pos.y += 50.0f; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = 0.0f; } @@ -5333,7 +5333,7 @@ void BossTw_TwinrovaStun(BossTw* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, &gTwinrovaStunLoopAnim, 0.0f); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.velocity.y = 0.0f; } diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index f992cf8316..aed3db8d64 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1491,7 +1491,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) { this->unk_1AC += 0xC31; this->unk_1A0 = (Math_CosS(this->unk_1AC) * 0.1f) + 1.0f; this->unk_1A4 = (Math_SinS(this->unk_1AC) * 0.05f) + 1.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.bgCheckFlags &= ~8; this->actor.world.rot.y = (s16)Rand_CenteredFloat(30 * (0x10000 / 360)) + this->actor.wallYaw; } diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index cab48b7a98..99b9e790b5 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -724,7 +724,7 @@ void func_8098652C(DemoIm* this, PlayState* play) { } void func_80986570(DemoIm* this, PlayState* play) { - if (Animation_OnFrame(&this->skelAnime, 7.0f) && (this->actor.bgCheckFlags & 1)) { + if (Animation_OnFrame(&this->skelAnime, 7.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { u32 sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); diff --git a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 043a3aae23..5913c92fb9 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -336,7 +336,7 @@ void DemoKankyo_SetupType(DemoKankyo* this, PlayState* play) { play->csCtx.segment = gAdultWarpInCS; } } - if (func_800C0CB8(play) != 0) { + if (Play_CamIsNotFixed(play) != 0) { gSaveContext.cutsceneTrigger = 1; } DemoKankyo_SetupAction(this, DemoKankyo_DoNothing); diff --git a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 8e00a84155..3ed3de942a 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -350,7 +350,7 @@ void EnAnubice_Die(EnAnubice* this, PlayState* play) { Actor_SetColorFilter(&this->actor, 0x4000, 128, 0, 8); EffectSsEnFire_SpawnVec3f(play, &this->actor, &fireEffectPos, 100, 0, 0, -1); - if ((this->animLastFrame <= curFrame) && (this->actor.bgCheckFlags & 1)) { + if ((this->animLastFrame <= curFrame) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Math_ApproachF(&this->actor.shape.yOffset, -4230.0f, 0.5f, 300.0f); if (this->actor.shape.yOffset < -2000.0f) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xC0); diff --git a/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index c652f4d91d..906ca033ae 100644 --- a/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -214,7 +214,7 @@ void func_809B5670(EnAttackNiw* this, PlayState* play) { Actor_SetFocus(&this->actor, this->unk_2E4); Actor_GetScreenPos(play, &this->actor, &sp4E, &sp4C); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_2D4 = this->actor.yawTowardsPlayer; this->unk_2D0 = this->actor.world.rot.x - 3000.0f; this->unk_2DC = 0.0f; @@ -229,7 +229,7 @@ void func_809B5670(EnAttackNiw* this, PlayState* play) { } else if (((this->actor.projectedPos.z > 0.0f) && (fabsf(sp34.x - this->actor.world.pos.x) < 50.0f) && (fabsf(sp34.y - this->actor.world.pos.y) < 50.0f) && (fabsf(sp34.z - this->actor.world.pos.z) < 50.0f)) || - (this->actor.bgCheckFlags & 1)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->unk_2D4 = this->actor.yawTowardsPlayer; this->unk_2D0 = this->actor.world.rot.x - 2000.0f; @@ -255,7 +255,7 @@ void func_809B59B0(EnAttackNiw* this, PlayState* play) { return; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->unk_25A == 0) { this->unk_25A = 3; this->actor.velocity.y = 3.5f; @@ -277,13 +277,13 @@ void func_809B59B0(EnAttackNiw* this, PlayState* play) { Math_ApproachF(&this->unk_2DC, 10000.0f, 1.0f, 1000.0f); Math_ApproachF(&this->actor.speedXZ, this->unk_2E0, 0.9f, 1.0f); if ((this->actor.gravity == -2.0f) && (this->unk_262 == 0) && - ((this->actor.bgCheckFlags & 8) || (this->unk_25C == 0))) { + ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->unk_25C == 0))) { this->unk_2E0 = 0.0f; this->actor.gravity = 0.0f; this->unk_2DC = 0.0f; this->unk_2D0 = this->actor.world.rot.x - 5000.0f; this->actionFunc = func_809B5C18; - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_809B5268(this, play, 5); } else { func_809B5268(this, play, 2); diff --git a/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 86890a397a..9851bd8675 100644 --- a/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -207,7 +207,7 @@ void EnBa_SetupFallAsBlob(EnBa* this) { * Action function of the pink fleshy blobs that spawn and fall to the floor when a tentacle dies */ void EnBa_FallAsBlob(EnBa* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.scale.y -= 0.001f; this->actor.scale.x += 0.0005f; this->actor.scale.z += 0.0005f; diff --git a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c index b20331005c..b6720d86ac 100644 --- a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -516,7 +516,7 @@ void EnBb_SetupDamage(EnBb* this) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_DAMAGE); if (this->actor.params > ENBB_GREEN) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if ((this->actor.bgCheckFlags & 8) == 0) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) == 0) { this->actor.speedXZ = -7.0f; } this->actor.shape.yOffset = 1500.0f; @@ -635,7 +635,7 @@ void EnBb_Blue(EnBb* this, PlayState* play) { } thisYawToWall = this->actor.wallYaw - this->actor.world.rot.y; moveYawToWall = this->actor.wallYaw - this->vMoveAngleY; - if ((this->targetActor == NULL) && (this->actor.bgCheckFlags & 8) && + if ((this->targetActor == NULL) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(thisYawToWall) > 0x4000 || ABS(moveYawToWall) > 0x4000)) { this->vMoveAngleY = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0xBB8, 0); @@ -693,7 +693,7 @@ void EnBb_Down(EnBb* this, PlayState* play) { s16 yawDiff = this->actor.world.rot.y - this->actor.wallYaw; SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (ABS(yawDiff) > 0x4000) { this->actor.world.rot.y = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; } @@ -811,7 +811,7 @@ void EnBb_Red(EnBb* this, PlayState* play) { this->bobPhase += Rand_ZeroOne(); Math_SmoothStepToF(&this->flameScaleY, 80.0f, 1.0f, 10.0f, 0.0f); Math_SmoothStepToF(&this->flameScaleX, 100.0f, 1.0f, 10.0f, 0.0f); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { yawDiff = this->actor.world.rot.y - this->actor.wallYaw; if (ABS(yawDiff) > 0x4000) { this->actor.world.rot.y = @@ -819,7 +819,7 @@ void EnBb_Red(EnBb* this, PlayState* play) { } this->actor.bgCheckFlags &= ~8; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { floorType = SurfaceType_GetFloorType(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((floorType == 2) || (floorType == 3) || (floorType == 9)) { this->moveMode = BBMOVE_HIDDEN; @@ -1107,13 +1107,13 @@ void EnBb_SetupStunned(EnBb* this) { void EnBb_Stunned(EnBb* this, PlayState* play) { s16 yawDiff = this->actor.world.rot.y - this->actor.wallYaw; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (ABS(yawDiff) > 0x4000) { this->actor.world.rot.y = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; } this->actor.bgCheckFlags &= ~8; } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); if (this->actor.velocity.y < -14.0f) { this->actor.velocity.y *= -0.4f; diff --git a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 724db22b68..02c08d6b93 100644 --- a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -647,7 +647,7 @@ void func_809BE26C(EnBigokuta* this, PlayState* play) { } if (this->unk_198 == 0 && Math_StepToF(&this->actor.scale.y, 0.0f, 0.001f)) { Flags_SetClear(play, this->actor.room); - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0); func_8005ACFC(play->cameraPtrs[CAM_ID_MAIN], 4); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_OCTAROCK_BUBLE); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); @@ -785,7 +785,7 @@ void EnBigokuta_Update(Actor* thisx, PlayState* play2) { this->actionFunc(this, play); func_809BD2E4(this); func_809BE568(this); - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BIG_OCTO); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BIG_OCTO); func_8005AD1C(play->cameraPtrs[CAM_ID_MAIN], 4); if (this->cylinder[0].base.atFlags & AT_ON) { diff --git a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c index ecee3fc155..ad0018756c 100644 --- a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -323,7 +323,7 @@ void EnBili_UpdateFloating(EnBili* this) { this->actor.world.pos.y = this->actor.home.pos.y + (sinf(this->timer * (M_PI / 16)) * 3.0f); // Turn around if touching wall - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y = this->actor.wallYaw; } } @@ -525,7 +525,7 @@ void EnBili_Stunned(EnBili* this, PlayState* play) { this->timer--; } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } @@ -543,7 +543,7 @@ void EnBili_Frozen(EnBili* this, PlayState* play) { this->actor.gravity = -1.0f; } - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { this->actor.colorFilterTimer = 0; EnBili_SetupDie(this); } else { diff --git a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 35bababe25..288d09b3dc 100644 --- a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -156,7 +156,7 @@ void EnBom_Move(EnBom* this, PlayState* play) { } // rebound bomb off the wall it hits - if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { if (ABS((s16)(this->actor.wallYaw - this->actor.world.rot.y)) > 0x4000) { this->actor.world.rot.y = ((this->actor.wallYaw - this->actor.world.rot.y) + this->actor.wallYaw) - 0x8000; } @@ -166,11 +166,11 @@ void EnBom_Move(EnBom* this, PlayState* play) { this->actor.bgCheckFlags &= ~8; } - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f); } else { Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); - if ((this->actor.bgCheckFlags & 2) && (this->actor.velocity.y < -3.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -3.0f)) { Actor_PlaySfx_SurfaceBomb(play, &this->actor); this->actor.velocity.y *= -0.3f; this->actor.bgCheckFlags &= ~2; diff --git a/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index f43761cf14..68e58ee0f6 100644 --- a/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -234,11 +234,11 @@ void EnBombf_Move(EnBombf* this, PlayState* play) { this->flowerBombScale = 1.0f; - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.025f, 0.0f); } else { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f, 0.0f); - if ((this->actor.bgCheckFlags & 2) && (this->actor.velocity.y < -6.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (this->actor.velocity.y < -6.0f)) { Actor_PlaySfx_SurfaceBomb(play, &this->actor); this->actor.velocity.y *= -0.5f; } else if (this->timer >= 4) { diff --git a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c index cd9d0c2497..abed17d28c 100644 --- a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -284,7 +284,7 @@ void func_809CEA24(EnBw* this, PlayState* play) { } this->unk_222 = (Rand_ZeroOne() * 200.0f) + 200.0f; } - } else if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { + } else if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { if (this->unk_236 != this->actor.wallYaw) { sp64 = 1; this->unk_236 = this->actor.wallYaw; @@ -367,7 +367,8 @@ void func_809CEA24(EnBw* this, PlayState* play) { } break; case 1: - if (((sp64 == 0) && !(this->actor.bgCheckFlags & 8)) || Actor_IsFacingPlayer(&this->actor, 0x1C70)) { + if (((sp64 == 0) && !(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) || + Actor_IsFacingPlayer(&this->actor, 0x1C70)) { if (Actor_IsFacingPlayer(&this->actor, 0x1C70)) { this->unk_238 = -this->unk_238; } @@ -495,7 +496,7 @@ void func_809CFC4C(EnBw* this, PlayState* play) { this->unk_221 = 4; this->unk_258 += this->unk_25C; Math_SmoothStepToF(&this->unk_260, 0.075f, 1.0f, 0.005f, 0.0f); - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 30.0f, 11, 4.0f, 0, 0, false); Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } @@ -681,7 +682,7 @@ void func_809D0424(EnBw* this, PlayState* play) { } void func_809D0584(EnBw* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 0x10) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.bgCheckFlags & 0x10) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->unk_230 = 0; this->actor.scale.y -= 0.009f; Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 30.0f, 11, 4.0f, 0, 0, false); @@ -729,7 +730,8 @@ void func_809D0584(EnBw* this, PlayState* play) { this->unk_248 = 0.0f; } } - if ((play->actorCtx.unk_02 != 0) && (this->actor.xzDistToPlayer <= 400.0f) && (this->actor.bgCheckFlags & 1)) { + if ((play->actorCtx.unk_02 != 0) && (this->actor.xzDistToPlayer <= 400.0f) && + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->unk_220 == 5) { this->unk_23C = 0; func_809CFF10(this); diff --git a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 1d2e0d156e..18b4d03923 100644 --- a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -241,7 +241,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { skelanimeUpdated = Animation_OnFrame(&this->skelAnime, 0.0f); this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 3.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->aimRotY = this->actor.wallYaw; } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { this->aimRotY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); @@ -276,7 +276,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { this->aimRotX = CLAMP(this->aimRotX, -0x1000, 0x1000); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_ScaledStepToS(&this->actor.shape.rot.x, -0x100, 0x400); } @@ -341,7 +341,7 @@ void EnCrow_Damaged(EnCrow* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200); this->actor.shape.rot.z += 0x1780; } - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { EffectSsDeadDb_Spawn(play, &this->actor.world.pos, &sZeroVecAccel, &sZeroVecAccel, this->actor.scale.x * 10000.0f, 0, 255, 255, 255, 255, 255, 0, 0, 1, 9, 1); EnCrow_SetupDie(this); @@ -378,7 +378,7 @@ void EnCrow_Die(EnCrow* this, PlayState* play) { void EnCrow_TurnAway(EnCrow* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->aimRotY = this->actor.wallYaw; } else { this->aimRotY = this->actor.yawTowardsPlayer + 0x8000; diff --git a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index b84103a4a0..2addcba443 100644 --- a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -961,7 +961,8 @@ void EnDekubaba_PrunedSomersault(EnDekubaba* this, PlayState* play) { EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, this->size * 12.0f, this->size * 5.0f, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); - if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) { + if ((this->actor.scale.x > 0.005f) && + ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) { this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.0f; this->actor.speedXZ = 0.0f; this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); @@ -969,7 +970,7 @@ void EnDekubaba_PrunedSomersault(EnDekubaba* this, PlayState* play) { this->size * 5.0f, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); this->timer = 1; } diff --git a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 0c7584c006..912bf069e7 100644 --- a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -367,7 +367,7 @@ void EnDekunuts_Run(EnDekunuts* this, PlayState* play) { if (Math_SmoothStepToS(&this->actor.world.rot.y, this->runDirection, 1, 0xE38, 0xB6) == 0) { if (this->actor.bgCheckFlags & 0x20) { this->runDirection = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->runDirection = this->actor.wallYaw; } else if (this->runAwayCount == 0) { diffRotInit = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); diff --git a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 7e4d9273d2..a006243b0c 100644 --- a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -406,7 +406,7 @@ void EnDh_Burrow(EnDh* this, PlayState* play) { void EnDh_SetupDamage(EnDh* this) { Animation_MorphToPlayOnce(&this->skelAnime, &object_dh_Anim_003D6C, -6.0f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = -1.0f; } Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_DAMAGE); diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index e37c58cc56..707ff5d2e2 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -102,7 +102,7 @@ void EnDntJiji_Destroy(Actor* thisx, PlayState* play) { } void EnDntJiji_SetFlower(EnDntJiji* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->flowerPos = this->actor.world.pos; this->actionFunc = EnDntJiji_SetupWait; } @@ -184,7 +184,7 @@ void EnDntJiji_Walk(EnDntJiji* this, PlayState* play) { this->sfxTimer = 5; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); } - if ((this->actor.bgCheckFlags & 8) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.velocity.y = 9.0f; this->actor.speedXZ = 3.0f; } @@ -351,7 +351,7 @@ void EnDntJiji_Return(EnDntJiji* this, PlayState* play) { dz = this->flowerPos.z - this->actor.world.pos.z; Math_SmoothStepToS(&this->actor.shape.rot.y, Math_FAtan2F(dx, dz) * (0x8000 / M_PI), 1, 0xBB8, 0); this->actor.world.rot.y = this->actor.shape.rot.y; - if ((this->actor.bgCheckFlags & 8) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.velocity.y = 9.0f; this->actor.speedXZ = 3.0f; } diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index 21ad428362..d7ddc64ae9 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -194,7 +194,7 @@ void EnDntNomal_WaitForObject(EnDntNomal* this, PlayState* play) { } void EnDntNomal_SetFlower(EnDntNomal* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->flowerPos = this->actor.world.pos; if (this->type == ENDNTNOMAL_TARGET) { this->actionFunc = EnDntNomal_SetupTargetWait; @@ -551,7 +551,7 @@ void EnDntNomal_StageCelebrate(EnDntNomal* this, PlayState* play) { } else if ((this->timer5 & 3) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); } - if ((this->actor.bgCheckFlags & 8) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.velocity.y = 7.5f; } } diff --git a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index 4601816c0e..7b2e98e94b 100644 --- a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -149,7 +149,7 @@ s32 EnDodojr_UpdateBounces(EnDodojr* this, PlayState* play) { return 0; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); this->dustPos = this->actor.world.pos; EnDodojr_SpawnLargeDust(this, play, 10); @@ -456,7 +456,7 @@ void EnDodojr_CrawlTowardsTarget(EnDodojr* this, PlayState* play) { this->actionFunc = EnDodojr_JumpAttackBounce; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_DOWN); EnDodojr_SetupDespawn(this); this->actionFunc = EnDodojr_Despawn; diff --git a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index df30c191b1..e7352899fa 100644 --- a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -775,7 +775,7 @@ void EnDodongo_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); } } diff --git a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 7b227584c4..48ddc1eb23 100644 --- a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -433,7 +433,7 @@ void EnEiyer_Glide(EnEiyer* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, 1.5f, 0.03f); } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->targetYaw = this->actor.wallYaw; } @@ -481,7 +481,7 @@ void EnEiyer_DiveAttack(EnEiyer* this, PlayState* play) { SkelAnime_Update(&this->skelanime); this->actor.speedXZ *= 1.1f; - if (this->actor.bgCheckFlags & 8 || this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & 8 || this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnEiyer_SetupLand(this); } @@ -498,11 +498,11 @@ void EnEiyer_Land(EnEiyer* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, 7.0f, 1.0f); if (this->timer == -1) { - if (this->actor.bgCheckFlags & 8 || this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & 8 || this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->timer = 10; SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_SINK); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 1, 700); } } @@ -529,7 +529,7 @@ void EnEiyer_Hurt(EnEiyer* this, PlayState* play) { Math_ApproachF(&this->basePos.y, this->actor.floorHeight + 80.0f + 5.0f, 0.5f, this->actor.speedXZ); this->actor.world.pos.y = this->basePos.y - 5.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->targetYaw = this->actor.wallYaw; } else { this->targetYaw = this->actor.yawTowardsPlayer + 0x8000; @@ -592,7 +592,7 @@ void EnEiyer_Stunned(EnEiyer* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_EIER_FLUTTER); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } diff --git a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c index ee25570523..2b50c179da 100644 --- a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -509,7 +509,7 @@ void EnFd_SpinAndGrow(EnFd* this, PlayState* play) { } void EnFd_JumpToGround(EnFd* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 1) && !(this->actor.velocity.y > 0.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->actor.velocity.y > 0.0f)) { this->actor.velocity.y = 0.0f; this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; diff --git a/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index bca2c05e76..29a7bdbe1c 100644 --- a/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -303,7 +303,7 @@ void EnFhgFire_LightningShock(EnFhgFire* this, PlayState* play) { } Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, 1); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Actor_Kill(&this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/soh/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index de3992a99c..5567887c98 100644 --- a/soh/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/soh/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -193,7 +193,7 @@ void EnFireRock_Fall(EnFireRock* this, PlayState* play) { } break; } - if ((this->actor.bgCheckFlags & 1) && (this->timer == 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->timer == 0)) { switch (this->type) { case FIRE_ROCK_SPAWNED_FALLING1: case FIRE_ROCK_SPAWNED_FALLING2: diff --git a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index cda0fb18ad..59fbb17a77 100644 --- a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -404,7 +404,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) { this->targetPitch = 0x2154; } } else { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->targetPitch = 0x954; } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { this->targetPitch = 0x2154; @@ -412,7 +412,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) { } Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } if ((this->timer == 0) && (this->actor.xzDistToPlayer < 200.0f) && (Player_GetMask(play) != PLAYER_MASK_SKULL) && @@ -437,7 +437,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) { if (this->timer != 0) { this->timer--; } - if ((this->actor.bgCheckFlags & 1) || (this->timer == 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->timer == 0)) { EnFirefly_SetupDie(this); } } @@ -465,7 +465,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) { this->timer--; } Math_StepToF(&this->actor.speedXZ, 4.0f, 0.5f); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } else if (Actor_IsFacingPlayer(&this->actor, 0x2800)) { @@ -484,7 +484,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) { if (this->actor.xzDistToPlayer > 80.0f) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xC00, 0x300); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->targetPitch = 0x954; } if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { @@ -527,14 +527,14 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) { return; } Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->targetPitch = 0x954; } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { this->targetPitch = 0x2154; } else { this->targetPitch = 0x954; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } else { Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), @@ -561,7 +561,7 @@ void EnFirefly_Stunned(EnFirefly* this, PlayState* play) { } void EnFirefly_FrozenFall(EnFirefly* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { this->actor.colorFilterTimer = 0; EnFirefly_SetupDie(this); } else { diff --git a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 7ee6432b29..c685ab711d 100644 --- a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -381,7 +381,7 @@ void EnFish_Dropped_Fall(EnFish* this, PlayState* play) { this->actor.shape.rot.z = this->actor.world.rot.z; SkelAnime_Update(&this->skelAnime); - if (this->actor.bgCheckFlags & 1) { // On floor + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // On floor this->timer = 400; EnFish_Dropped_SetupFlopOnGround(this); } else if (this->actor.bgCheckFlags & 0x20) { // In water @@ -470,7 +470,7 @@ void EnFish_Dropped_FlopOnGround(EnFish* this, PlayState* play) { } } else if (this->actor.bgCheckFlags & 0x20) { // In water EnFish_Dropped_SetupSwimAway(this); - } else if (this->actor.bgCheckFlags & 1) { // On floor + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // On floor EnFish_Dropped_SetupFlopOnGround(this); } } @@ -493,7 +493,7 @@ void EnFish_Dropped_SwimAway(EnFish* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speedXZ, 2.8f, 0.1f, 0.4f, 0.0f); // If touching wall or not in water, turn back and slow down for one frame. - if ((this->actor.bgCheckFlags & 8) || !(this->actor.bgCheckFlags & 0x20)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !(this->actor.bgCheckFlags & 0x20)) { this->actor.home.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); this->actor.speedXZ *= 0.5f; } @@ -505,7 +505,7 @@ void EnFish_Dropped_SwimAway(EnFish* this, PlayState* play) { this->actor.shape.rot = this->actor.world.rot; // Raise if on a floor. - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 4.0f, 2.0f); } else { Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 10.0f, 2.0f); diff --git a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 32ccea05af..d14544f0a6 100644 --- a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -492,7 +492,7 @@ void EnFloormas_BigWalk(EnFloormas* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 320.0f) && (Actor_IsFacingPlayer(&this->actor, 0x4000))) { EnFloormas_SetupRun(this); - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { // set target rotation to the colliding wall's rotation this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); @@ -521,7 +521,7 @@ void EnFloormas_Run(EnFloormas* this, PlayState* play) { Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); if ((this->actor.xzDistToPlayer < 280.0f) && Actor_IsFacingPlayer(&this->actor, 0x2000) && - !(this->actor.bgCheckFlags & 8)) { + !(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { EnFloormas_SetupHover(this, play); } else if (this->actor.xzDistToPlayer > 400.0f) { EnFloormas_SetupBigWalk(this); @@ -612,7 +612,7 @@ void EnFloormas_Charge(EnFloormas* this, PlayState* play) { EnFloormas_Slide(this, play); } - if ((this->actor.bgCheckFlags & 8) || (this->actionTimer == 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actionTimer == 0)) { EnFloormas_SetupLand(this); } } @@ -621,7 +621,7 @@ void EnFloormas_Land(EnFloormas* this, PlayState* play) { s32 isOnGround; isOnGround = this->actor.bgCheckFlags & 1; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->actor.params != MERGE_MASTER) { EnFloormas_MakeVulnerable(this); } @@ -634,7 +634,7 @@ void EnFloormas_Land(EnFloormas* this, PlayState* play) { } } } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.speedXZ = 0.0f; } @@ -668,7 +668,7 @@ void EnFloormas_Land(EnFloormas* this, PlayState* play) { } void EnFloormas_Split(EnFloormas* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (SkelAnime_Update(&this->skelAnime)) { this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED; this->smActionTimer = 50; @@ -677,7 +677,7 @@ void EnFloormas_Split(EnFloormas* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); } } @@ -692,7 +692,7 @@ void EnFloormas_SmWalk(EnFloormas* this, PlayState* play) { if (this->smActionTimer == 0) { EnFloormas_SetupSmDecideAction(this); - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); } else if (this->actor.xzDistToPlayer < 120.0f) { @@ -754,7 +754,7 @@ void EnFloormas_JumpAtLink(EnFloormas* this, PlayState* play) { } else if (Animation_OnFrame(&this->skelAnime, 20.0f)) { this->actor.speedXZ = 5.0f; this->actor.velocity.y = 7.0f; - } else if (this->actor.bgCheckFlags & 2) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actionTimer = 0x32; this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); @@ -839,7 +839,7 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, PlayState* play) { } else if (this->actor.child->params == MERGE_MASTER) { primFloormas = this->actor.child; } else { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.params = 0x10; EnFloormas_SetupLand(this); } @@ -855,7 +855,7 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, PlayState* play) { (fabsf(this->actor.world.pos.z - primFloormas->world.pos.z) < 10.0f)) { EnFloormas_SetupSmWait(this); this->collider.base.ocFlags1 |= OC1_ON; - } else if (this->actor.bgCheckFlags & 2) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); EnFloormas_SetupLand(this); diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 3673864abc..b561b2305a 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -877,7 +877,7 @@ void EnFr_OcarinaMistake(EnFr* this, PlayState* play) { Message_CloseTextbox(play); this->reward = GI_NONE; Sfx_PlaySfxCentered(NA_SE_SY_OCARINA_ERROR); - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); sEnFrPointers.flags = 12; EnFr_DeactivateButterfly(); this->actionFunc = EnFr_Deactivate; @@ -947,7 +947,7 @@ void EnFr_SetupReward(EnFr* this, PlayState* play, u8 unkCondition) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); play->msgCtx.msgMode = MSGMODE_PAUSED; this->actionFunc = EnFr_PrintTextBox; } diff --git a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 314b861343..2abf22647e 100644 --- a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -214,7 +214,7 @@ void EnFu_TeachSong(EnFu* this, PlayState* play) { // if dialog state is 2, start song demonstration if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { this->behaviorFlags &= ~FU_WAIT; - Audio_OcaSetInstrument(4); // seems to be related to setting instrument type + AudioOcarina_SetInstrument(4); // seems to be related to setting instrument type func_8010BD58(play, OCARINA_ACTION_TEACH_STORMS); this->actionFunc = EnFu_WaitForPlayback; } diff --git a/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c index 6a293a65f3..50689f2fb0 100644 --- a/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -85,7 +85,7 @@ static AnimationInfo sAnimationInfo[] = { s32 EnFw_DoBounce(EnFw* this, s32 totalBounces, f32 yVelocity) { s16 temp_v1; - if (!(this->actor.bgCheckFlags & 1) || (this->actor.velocity.y > 0.0f)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.velocity.y > 0.0f)) { // not on the ground or moving upwards. return false; } @@ -273,7 +273,7 @@ void EnFw_Run(EnFw* this, PlayState* play) { return; } } else { - if (!(this->actor.bgCheckFlags & 1) || this->actor.velocity.y > 0.0f) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || this->actor.velocity.y > 0.0f) { Actor_SetColorFilter(&this->actor, 0x4000, 0xC8, 0, this->damageTimer); return; } diff --git a/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c index a555deea45..bbb7f7d96e 100644 --- a/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -326,7 +326,7 @@ void EnFz_SpawnIceSmokeActiveState(EnFz* this) { void EnFz_ApplyDamage(EnFz* this, PlayState* play) { Vec3f vec; - if (this->isMoving && ((this->actor.bgCheckFlags & 8) || + if (this->isMoving && ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (Actor_TestFloorInDirection(&this->actor, play, 60.0f, this->actor.world.rot.y) == 0))) { this->actor.bgCheckFlags &= ~8; this->isMoving = false; diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 9339fb51ee..efeba71335 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -372,7 +372,7 @@ void EnGeldB_Wait(EnGeldB* this, PlayState* play) { func_800F5ACC(NA_BGM_MINI_BOSS); } } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); this->skelAnime.playSpeed = 1.0f; this->actor.world.pos.y = this->actor.floorHeight; @@ -676,9 +676,9 @@ void EnGeldB_Circle(EnGeldB* this, PlayState* play) { this->actor.speedXZ = 8.0f; } } - if ((this->actor.bgCheckFlags & 8) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.speedXZ >= 0.0f) { phi_v1 = this->actor.shape.rot.y + 0x3E80; } else { @@ -775,9 +775,9 @@ void EnGeldB_SpinDodge(EnGeldB* this, PlayState* play) { s32 nextKeyFrame; this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x3A98; - if ((this->actor.bgCheckFlags & 8) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.speedXZ >= 0.0f) { phi_v1 = this->actor.shape.rot.y + 0x3E80; } else { @@ -1007,7 +1007,7 @@ void EnGeldB_RollBack(EnGeldB* this, PlayState* play) { } void EnGeldB_SetupStunned(EnGeldB* this) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = 0.0f; } if ((this->damageEffect != GELDB_DMG_FREEZE) || (this->action == GELDB_SPIN_ATTACK)) { @@ -1022,16 +1022,16 @@ void EnGeldB_SetupStunned(EnGeldB* this) { } void EnGeldB_Stunned(EnGeldB* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.05f; } this->invisible = false; } - if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.colChkInfo.health == 0) { EnGeldB_SetupDefeated(this); } else { @@ -1042,7 +1042,7 @@ void EnGeldB_Stunned(EnGeldB* this, PlayState* play) { void EnGeldB_SetupDamaged(EnGeldB* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gGerudoRedDamageAnim, -4.0f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->invisible = false; this->actor.speedXZ = -4.0f; } else { @@ -1058,10 +1058,10 @@ void EnGeldB_SetupDamaged(EnGeldB* this) { void EnGeldB_Damaged(EnGeldB* this, PlayState* play) { s16 angleToWall; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.05f; } @@ -1069,9 +1069,10 @@ void EnGeldB_Damaged(EnGeldB* this, PlayState* play) { } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x1194, 0); if (!EnGeldB_DodgeRanged(play, this) && !EnGeldB_ReactToPlayer(play, this, 0) && - SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) { + SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { angleToWall = this->actor.wallYaw - this->actor.shape.rot.y; - if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToPlayer < 90.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(angleToWall) < 0x2EE0) && + (this->actor.xzDistToPlayer < 90.0f)) { EnGeldB_SetupJump(this); } else if (!EnGeldB_DodgeRanged(play, this)) { if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsTargeted(play, &this->actor) && @@ -1224,9 +1225,9 @@ void EnGeldB_Sidestep(EnGeldB* this, PlayState* play) { this->actor.speedXZ -= 0.125f; } - if ((this->actor.bgCheckFlags & 8) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.speedXZ >= 0.0f) { phi_v1 = this->actor.shape.rot.y + 0x3E80; } else { @@ -1317,7 +1318,7 @@ void EnGeldB_Sidestep(EnGeldB* this, PlayState* play) { void EnGeldB_SetupDefeated(EnGeldB* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gGerudoRedDefeatAnim, -4.0f); this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->invisible = false; this->actor.speedXZ = -6.0f; } else { @@ -1331,10 +1332,10 @@ void EnGeldB_SetupDefeated(EnGeldB* this) { } void EnGeldB_Defeated(EnGeldB* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); this->invisible = false; } diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c index df54669d13..fbe4b41af5 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -433,13 +433,13 @@ s32 EnGo_IsCameraModified(EnGo* this, PlayState* play) { xyzDistSq = (this->actor.scale.x / 0.01f) * SQ(100.0f); if ((this->actor.params & 0xF0) == 0x90) { - Camera_ChangeSetting(mainCam, CAM_SET_DIRECTED_YAW); + Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW); xyzDistSq *= 4.8f; } if (fabsf(this->actor.xyzDistToPlayerSq) > xyzDistSq) { if (mainCam->setting == CAM_SET_DIRECTED_YAW) { - Camera_ChangeSetting(mainCam, CAM_SET_NORMAL0); + Camera_RequestSetting(mainCam, CAM_SET_NORMAL0); } return 0; } else { @@ -546,7 +546,7 @@ s32 EnGo_SpawnDust(EnGo* this, u8 initialTimer, f32 scale, f32 scaleStep, s32 nu } s32 EnGo_IsRollingOnGround(EnGo* this, s16 unkArg1, f32 unkArg2) { - if ((this->actor.bgCheckFlags & 1) == 0 || this->actor.velocity.y > 0.0f) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) == 0 || this->actor.velocity.y > 0.0f) { return false; } else if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { return true; diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 16073d8385..eca68ac50d 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -991,7 +991,7 @@ s32 EnGo2_IsWakingUp(EnGo2* this) { } s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) { - if ((this->actor.bgCheckFlags & 1) == 0 || this->actor.velocity.y > 0.0f) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) == 0 || this->actor.velocity.y > 0.0f) { return false; } @@ -1167,10 +1167,10 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { if (EnGo2_IsWakingUp(this)) { - Camera_ChangeSetting(camera, CAM_SET_DIRECTED_YAW); + Camera_RequestSetting(camera, CAM_SET_DIRECTED_YAW); func_8005AD1C(camera, 4); } else if (!EnGo2_IsWakingUp(this) && (camera->setting == CAM_SET_DIRECTED_YAW)) { - Camera_ChangeSetting(camera, CAM_SET_DUNGEON1); + Camera_RequestSetting(camera, CAM_SET_DUNGEON1); func_8005ACFC(camera, 4); } } diff --git a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c index fa95087bf7..60c8e6d7a5 100644 --- a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -220,7 +220,7 @@ void EnGoma_EggFallToGround(EnGoma* this, PlayState* play) { switch (this->hatchState) { case 0: - if (this->actor.bgCheckFlags & 1) { // floor + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { // floor if (this->actor.params < 6) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_EGG1); } else { @@ -266,7 +266,7 @@ void EnGoma_EggFallToGround(EnGoma* this, PlayState* play) { break; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_ApproachZeroF(&this->actor.speedXZ, 0.2f, 0.05f); } this->eggPitch += (this->actor.speedXZ * 0.1f); @@ -348,7 +348,7 @@ void EnGoma_SetupHurt(EnGoma* this, PlayState* play) { void EnGoma_Hurt(EnGoma* this, PlayState* play) { SkelAnime_Update(&this->skelanime); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f); } @@ -380,7 +380,7 @@ void EnGoma_SetupDie(EnGoma* this) { void EnGoma_Die(EnGoma* this, PlayState* play) { SkelAnime_Update(&this->skelanime); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f); } @@ -485,7 +485,7 @@ void EnGoma_SetupLand(EnGoma* this) { void EnGoma_Land(EnGoma* this, PlayState* play) { SkelAnime_Update(&this->skelanime); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f); } if (this->actionTimer == 0) { @@ -511,7 +511,7 @@ void EnGoma_Jump(EnGoma* this, PlayState* play) { SkelAnime_Update(&this->skelanime); Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.5f, 5.0f); - if (this->actor.velocity.y <= 0.0f && (this->actor.bgCheckFlags & 1)) { + if (this->actor.velocity.y <= 0.0f && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { EnGoma_SetupLand(this); if (this->actor.params < 6) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_BJR_LAND2); @@ -548,7 +548,7 @@ void EnGoma_ChasePlayer(EnGoma* this, PlayState* play) { Math_ApproachS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 2000); Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 2, 3000); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.velocity.y = 0.0f; } if (this->actor.xzDistToPlayer <= 150.0f) { @@ -577,7 +577,7 @@ void EnGoma_Stunned(EnGoma* this, PlayState* play) { SkelAnime_Update(&this->skelanime); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.velocity.y = 0.0f; Math_ApproachZeroF(&this->actor.speedXZ, 0.5f, 2.0f); } @@ -885,7 +885,7 @@ void EnGoma_BossLimb(EnGoma* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, 4); this->actor.world.pos.y += 5.0f; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.velocity.y = 0.0f; } else if (this->actionTimer < 250) { this->actor.shape.rot.y += 2000; diff --git a/soh/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/soh/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 64537135e9..c93b010b41 100644 --- a/soh/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/soh/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -642,7 +642,7 @@ void EnGoroiwa_SetupMoveAndFallToGround(EnGoroiwa* this) { void EnGoroiwa_MoveAndFallToGround(EnGoroiwa* this, PlayState* play) { EnGoroiwa_MoveAndFall(this, play); - if ((this->actor.bgCheckFlags & 1) && this->actor.velocity.y < 0.0f) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && this->actor.velocity.y < 0.0f) { if ((this->stateFlags & ENGOROIWA_PLAYER_IN_THE_WAY) && (this->actor.home.rot.z & 1) == 1) { EnGoroiwa_ReverseDirection(this); EnGoroiwa_FaceNextWaypoint(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 49ee741d0f..75cc277402 100644 --- a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -359,7 +359,7 @@ void EnHintnuts_Run(EnHintnuts* this, PlayState* play) { if (Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_196, 1, 0xE38, 0xB6) == 0) { if (this->actor.bgCheckFlags & 0x20) { this->unk_196 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->unk_196 = this->actor.wallYaw; } else if (this->animFlagAndTimer == 0) { diffRotInit = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); @@ -411,7 +411,7 @@ void EnHintnuts_Leave(EnHintnuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 6.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { temp_a1 = this->actor.wallYaw; } else { temp_a1 = this->actor.yawTowardsPlayer - Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - 0x8000; diff --git a/soh/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/soh/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index a5fba5429c..a9a32ead94 100644 --- a/soh/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/soh/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -431,7 +431,7 @@ void EnHonotrap_FlameChase(EnHonotrap* this, PlayState* play) { this->actor.speedXZ *= 0.1f; this->actor.velocity.y *= 0.1f; EnHonotrap_SetupFlameVanish(this); - } else if ((this->actor.bgCheckFlags & 8) || (this->timer <= 0)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->timer <= 0)) { EnHonotrap_SetupFlameVanish(this); } else { EnHonotrap_FlameCollisionCheck(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 024a12a50a..ac329cf836 100644 --- a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -1755,7 +1755,7 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) { // Focus the camera on Epona Camera_SetParam(play->cameraPtrs[0], 8, this); - Camera_ChangeSetting(play->cameraPtrs[0], 0x38); + Camera_RequestSetting(play->cameraPtrs[0], 0x38); Camera_SetCameraData(play->cameraPtrs[0], 4, NULL, NULL, 0x51, 0, 0); } } @@ -1829,7 +1829,7 @@ void EnHorse_Idle(EnHorse* this, PlayState* play) { this->followTimer = 0; EnHorse_SetFollowAnimation(this, play); Camera_SetParam(play->cameraPtrs[0], 8, this); - Camera_ChangeSetting(play->cameraPtrs[0], 0x38); + Camera_RequestSetting(play->cameraPtrs[0], 0x38); Camera_SetCameraData(play->cameraPtrs[0], 4, NULL, NULL, 0x51, 0, 0); } } else { diff --git a/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index e7d1a017be..e4cf98c53f 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -398,7 +398,7 @@ void EnHorseNormal_Wander(EnHorseNormal* this, PlayState* play) { this->actor.speedXZ = 8.0f; phi_t0 = 6; } - if (Rand_ZeroOne() < 0.1f || (this->unk_21E == 0 && ((this->actor.bgCheckFlags & 8) || + if (Rand_ZeroOne() < 0.1f || (this->unk_21E == 0 && ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->bodyCollider.base.ocFlags1 & OC1_HIT) || (this->headCollider.base.ocFlags1 & OC1_HIT)))) { this->unk_21E += (Rand_ZeroOne() * 30.0f) - 15.0f; diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 7382af6976..77e25d2d50 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -385,7 +385,7 @@ void func_80A74BA4(EnIk* this, PlayState* play) { sp2E = 9; } temp_a1 = this->actor.wallYaw - this->actor.shape.rot.y; - if ((this->actor.bgCheckFlags & 8) && (ABS(temp_a1) >= 0x4000)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(temp_a1) >= 0x4000)) { temp_a1 = (this->actor.yawTowardsPlayer > 0) ? this->actor.wallYaw - 0x4000 : this->actor.wallYaw + 0x4000; Math_SmoothStepToS(&this->actor.world.rot.y, temp_a1, 1, phi_a3, 0); } else { diff --git a/soh/src/overlays/actors/ovl_En_In/z_en_in.c b/soh/src/overlays/actors/ovl_En_In/z_en_in.c index 5b8eb2d08c..7986b042ce 100644 --- a/soh/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/soh/src/overlays/actors/ovl_En_In/z_en_in.c @@ -436,7 +436,7 @@ void func_80A79BAC(EnIn* this, PlayState* play, s32 index, u32 transitionType) { play->transitionType = transitionType; play->transitionTrigger = TRANS_TRIGGER_START; Player_SetCsActionWithHaltedActors(play, &this->actor, 8); - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); if (index == 0) { AREG(6) = 0; } @@ -473,8 +473,8 @@ void func_80A79C78(EnIn* this, PlayState* play) { } player->actor.freezeTimer = 10; this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; - ShrinkWindow_SetVal(0x20); - Interface_ChangeAlpha(2); + Letterbox_SetSizeTarget(0x20); + Interface_ChangeHudVisibilityMode(2); } static s32 D_80A7B998 = 0; @@ -795,8 +795,8 @@ void func_80A7AA40(EnIn* this, PlayState* play) { this->interactInfo.talkState = NPC_TALK_STATE_TALKING; this->unk_1FC = 0; play->csCtx.frames = 0; - ShrinkWindow_SetVal(0x20); - Interface_ChangeAlpha(2); + Letterbox_SetSizeTarget(0x20); + Interface_ChangeHudVisibilityMode(2); this->actionFunc = func_80A7ABD4; } @@ -861,7 +861,7 @@ void func_80A7AE84(EnIn* this, PlayState* play) { Play_ChangeCameraStatus(play, this->activeCamId, CAM_STAT_ACTIVE); Play_ClearCamera(play, this->camId); Player_SetCsActionWithHaltedActors(play, &this->actor, 7); - Interface_ChangeAlpha(0x32); + Interface_ChangeHudVisibilityMode(0x32); this->actionFunc = func_80A7AEF0; } diff --git a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 49836eb61b..d0dfb26494 100644 --- a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -265,7 +265,8 @@ void EnInsect_SlowDown(EnInsect* this, PlayState* play) { } if (((this->insectFlags & 4) && this->lifeTimer <= 0) || - ((sp2E == 2 || sp2E == 3) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) { + ((sp2E == 2 || sp2E == 3) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + D_80A7DEB8 >= 4)) { EnInsect_SetupDig(this); } else if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) { EnInsect_SetupWalkOnWater(this); @@ -308,7 +309,8 @@ void EnInsect_Crawl(EnInsect* this, PlayState* play) { } if (((this->insectFlags & 4) && this->lifeTimer <= 0) || - ((sp34 == 2 || sp34 == 3) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4)) { + ((sp34 == 2 || sp34 == 3) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + D_80A7DEB8 >= 4)) { EnInsect_SetupDig(this); } else if ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 0x40)) { EnInsect_SetupWalkOnWater(this); @@ -640,7 +642,7 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { Actor_SetScale(&this->actor, CLAMP_MAX(thisTemp->actor.scale.x + 0.0008f, 0.01f)); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->actor.speedXZ, this->unk_324, 0.1f, 0.5f, 0.0f); Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_328, 2000); sp50 = Math_ScaledStepToS(&this->actor.world.rot.x, 0, 2000); @@ -668,7 +670,7 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { } SkelAnime_Update(&this->skelAnime); - if (!(this->insectFlags & 0x40) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & 1)) { + if (!(this->insectFlags & 0x40) && (this->insectFlags & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_LAND); this->insectFlags |= 0x40; } @@ -693,7 +695,7 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { if (sp40 < 9.0f) { EnInsect_SetupDig(this); } else if (this->actionTimer <= 0 || this->lifeTimer <= 0 || - ((this->insectFlags & 1) && (this->actor.bgCheckFlags & 1) && D_80A7DEB8 >= 4 && + ((this->insectFlags & 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && D_80A7DEB8 >= 4 && (sp3A == 2 || sp3A == 3))) { EnInsect_SetupDig(this); } else { @@ -742,7 +744,7 @@ void EnInsect_Update(Actor* thisx, PlayState* play) { Actor_MoveXZGravity(&this->actor); if (this->insectFlags & 0x100) { if (this->insectFlags & 1) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnInsect_UpdateCrawlSfx(this); } } else { diff --git a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index b7d0da6bad..90ef185ed9 100644 --- a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -149,11 +149,11 @@ void EnIshi_SpawnFragmentsSmall(EnIshi* this, PlayState* play) { pos.y = this->actor.world.pos.y + (Rand_ZeroOne() * 5.0f) + 5.0f; pos.z = this->actor.world.pos.z + (Rand_ZeroOne() - 0.5f) * 8.0f; Math_Vec3f_Copy(&velocity, &this->actor.velocity); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { velocity.x *= 0.8f; velocity.y *= -0.8f; velocity.z *= 0.8f; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { velocity.x *= -0.8f; velocity.y *= 0.8f; velocity.z *= -0.8f; @@ -221,11 +221,11 @@ void EnIshi_SpawnDustSmall(EnIshi* this, PlayState* play) { Vec3f pos; Math_Vec3f_Copy(&pos, &this->actor.world.pos); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { pos.x += 2.0f * this->actor.velocity.x; pos.y -= 2.0f * this->actor.velocity.y; pos.z += 2.0f * this->actor.velocity.z; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { pos.x -= 2.0f * this->actor.velocity.x; pos.y += 2.0f * this->actor.velocity.y; pos.z -= 2.0f * this->actor.velocity.z; @@ -237,11 +237,11 @@ void EnIshi_SpawnDustLarge(EnIshi* this, PlayState* play) { Vec3f pos; Math_Vec3f_Copy(&pos, &this->actor.world.pos); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { pos.x += 2.0f * this->actor.velocity.x; pos.y -= 2.0f * this->actor.velocity.y; pos.z += 2.0f * this->actor.velocity.z; - } else if (this->actor.bgCheckFlags & 8) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { pos.x -= 2.0f * this->actor.velocity.x; pos.y += 2.0f * this->actor.velocity.y; pos.z -= 2.0f * this->actor.velocity.z; diff --git a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c index 153495d11e..1e95fdb386 100644 --- a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -190,7 +190,7 @@ void EnJs_Update(Actor* thisx, PlayState* play) { Actor_MoveXZGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 4); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1) { Math_ApproachF(&this->actor.shape.yOffset, sREG(80) + -2000.0f, 1.0f, (sREG(81) / 10.0f) + 50.0f); } diff --git a/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 53417d3c8b..233fefa09d 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -141,7 +141,7 @@ void func_80A8F320(EnKakasi* this, PlayState* play, s16 arg) { if (this->unk_19A != 0) { this->actor.gravity = -1.0f; - if (this->unk_19A == 8 && (this->actor.bgCheckFlags & 1)) { + if (this->unk_19A == 8 && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.velocity.y = 3.0f; Audio_PlayActorSound2(&this->actor, NA_SE_IT_KAKASHI_JUMP); } diff --git a/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index cf96205abe..ed565258ec 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -144,7 +144,7 @@ void func_80A90EBC(EnKakasi3* this, PlayState* play, s32 arg) { if (this->unk_19A != 0) { this->actor.gravity = -1.0f; - if (this->unk_19A == 8 && (this->actor.bgCheckFlags & 1)) { + if (this->unk_19A == 8 && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.velocity.y = 3.0f; Audio_PlayActorSound2(&this->actor, NA_SE_IT_KAKASHI_JUMP); } diff --git a/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index baeef5e783..600fa5fdd0 100644 --- a/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -446,7 +446,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { this->actor.yDistToWater = tempYDistToWater; osSyncPrintf(VT_RST); - onGround = (this->actor.bgCheckFlags & 1); + onGround = (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND); if (this->spinXFlag) { this->spinRot.x += this->spinVel.x; this->spinVel.x -= 0x800; @@ -483,7 +483,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { if (this->spinVel.z < -0xC00) { this->spinVel.z = -0xC00; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.speedXZ *= -0.5f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_WOODPLATE_BOUND); } @@ -595,13 +595,13 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { this->spinVel.y = this->actor.speedXZ * -1000.0f; } } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = 0.0f; } Actor_MoveXZGravity(&this->actor); if (this->actor.speedXZ != 0.0f) { Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 50.0f, 5); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.speedXZ *= -0.5f; if (this->spinVel.y > 0) { this->spinVel.y = -0x7D0; diff --git a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 0b1e6de23e..0990674317 100644 --- a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -330,14 +330,15 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); - if (this->actor.scale.x > 0.005f && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) { + if (this->actor.scale.x > 0.005f && + ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) { this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.0f; this->actor.speedXZ = 0.0f; this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); this->actor.params = 1; } diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index ef4ee4f8e3..68ce9076a2 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -391,7 +391,7 @@ void EnMa1_IdleTeachSong(EnMa1* this, PlayState* play) { void EnMa1_StartTeachSong(EnMa1* this, PlayState* play) { GET_PLAYER(play)->stateFlags2 |= PLAYER_STATE2_NEAR_OCARINA_ACTOR; if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { - Audio_OcaSetInstrument(2); + AudioOcarina_SetInstrument(2); func_8010BD58(play, OCARINA_ACTION_TEACH_EPONA); this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnMa1_TeachSong; diff --git a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c index cec1d97698..34c44cccfb 100644 --- a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -745,7 +745,7 @@ void EnMb_SpearPatrolEndCharge(EnMb* this, PlayState* play) { Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f, 0.0f); if (this->actor.speedXZ > 1.0f) { diff --git a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c index e194e8e745..6507bceb82 100644 --- a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -379,7 +379,7 @@ void func_80AB6100(EnNiw* this, PlayState* play, s32 arg2) { if (this->timer4 == 0) { this->timer4 = 3; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.velocity.y = 3.5f; } } @@ -394,7 +394,7 @@ void func_80AB6100(EnNiw* this, PlayState* play, s32 arg2) { factor = -D_80AB860C[arg2]; } if (arg2 == 1) { - if (this->timer6 == 0 || this->actor.bgCheckFlags & 8) { + if (this->timer6 == 0 || this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->timer6 = 150; if (this->timer8 == 0) { this->timer8 = 70; @@ -552,7 +552,7 @@ void func_80AB6570(EnNiw* this, PlayState* play) { this->unk_2B8.z = this->unk_2AC.z + posZ; } else { this->timer4 = 4; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 3.5f; } @@ -650,7 +650,7 @@ void func_80AB6BF8(EnNiw* this, PlayState* play) { void func_80AB6D08(EnNiw* this, PlayState* play) { if (this->path == 0) { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { return; } if (this->actor.params == 0xE) { @@ -671,7 +671,7 @@ void func_80AB6D08(EnNiw* this, PlayState* play) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 4.0f; } else { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->sfxTimer1 = 0; this->actor.velocity.y = 4.0f; this->unk_2A6 = 1; @@ -730,21 +730,21 @@ void func_80AB6F04(EnNiw* this, PlayState* play) { pos.y += this->actor.yDistToWater; EffectSsGRipple_Spawn(play, &pos, 100, 500, 30); } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.velocity.y = 10.0f; this->actor.speedXZ = 1.0f; } } else { this->actor.gravity = -2.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.velocity.y = 10.0f; this->actor.speedXZ = 1.0f; this->actor.gravity = 0.0f; } else { this->actor.speedXZ = 4.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.gravity = -2.0f; this->timer6 = 100; this->timer4 = 0; @@ -856,7 +856,7 @@ void func_80AB7328(EnNiw* this, PlayState* play) { } void func_80AB7420(EnNiw* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_2A4 = (s16)Rand_ZeroFloat(3.99f) + 5; this->actionFunc = EnNiw_ResetAction; } diff --git a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index ed2cfe90da..581487b25e 100644 --- a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -118,8 +118,9 @@ void func_80ABBBA8(EnNutsball* this, PlayState* play) { this->actor.home.rot.z += 0x2AA8; - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & AT_HIT) || - (this->collider.base.acFlags & AC_HIT) || (this->collider.base.ocFlags1 & OC1_HIT)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) || + (this->collider.base.ocFlags1 & OC1_HIT)) { // Checking if the player is using a shield that reflects projectiles // And if so, reflects the projectile on impact if ((player->currentShield == PLAYER_SHIELD_DEKU) || diff --git a/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 248b644ac0..edc387e5fd 100644 --- a/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -255,7 +255,7 @@ void EnNy_TurnToStone(EnNy* this, PlayState* play) { phi_f0 -= 2.0f; if (phi_f0 <= 0.25f) { phi_f0 = 0.25f; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (!(this->unk_1F0 < this->actor.yDistToWater)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } diff --git a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 8f0c7302c1..638ca98814 100644 --- a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -490,9 +490,9 @@ void EnOkuta_ProjectileFly(EnOkuta* this, PlayState* play) { this->actor.speedXZ -= 0.1f; this->actor.speedXZ = CLAMP_MIN(this->actor.speedXZ, 1.0f); } - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & AT_HIT) || - this->collider.base.acFlags & AC_HIT || this->collider.base.ocFlags1 & OC1_HIT || - this->actor.floorHeight == BGCHECK_Y_MIN) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (this->collider.base.atFlags & AT_HIT) || this->collider.base.acFlags & AC_HIT || + this->collider.base.ocFlags1 & OC1_HIT || this->actor.floorHeight == BGCHECK_Y_MIN) { if ((player->currentShield == PLAYER_SHIELD_DEKU || (player->currentShield == PLAYER_SHIELD_HYLIAN && LINK_IS_ADULT)) && this->collider.base.atFlags & AT_HIT && this->collider.base.atFlags & AT_TYPE_ENEMY && @@ -657,12 +657,12 @@ void EnOkuta_Update(Actor* thisx, PlayState* play2) { Actor_MoveXZGravity(&this->actor); Math_Vec3f_Copy(&sp38, &this->actor.world.pos); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 15.0f, 30.0f, 5); - if ((this->actor.bgCheckFlags & 8) && + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && SurfaceType_IsIgnoredByProjectiles(&play->colCtx, this->actor.wallPoly, this->actor.wallBgId)) { sp34 = true; this->actor.bgCheckFlags &= ~8; } - if ((this->actor.bgCheckFlags & 1) && + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && SurfaceType_IsIgnoredByProjectiles(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId)) { sp34 = true; this->actor.bgCheckFlags &= ~1; diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 5b978a7d7a..9138c5c1c2 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -682,7 +682,7 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) { play->msgCtx.stateTimer = 4; player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW; Play_SetViewpoint(play, 1); - Interface_ChangeAlpha(50); + Interface_ChangeHudVisibilityMode(50); this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; @@ -1402,7 +1402,7 @@ void EnOssan_GiveItemWithFanfare(PlayState* play, EnOssan* this) { play->msgCtx.stateTimer = 4; player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW; Play_SetViewpoint(play, 1); - Interface_ChangeAlpha(50); + Interface_ChangeHudVisibilityMode(50); this->drawCursor = 0; EnOssan_UpdateCameraDirection(this, play, 0.0f); this->stateFlag = OSSAN_STATE_GIVE_ITEM_FANFARE; diff --git a/soh/src/overlays/actors/ovl_En_Part/z_en_part.c b/soh/src/overlays/actors/ovl_En_Part/z_en_part.c index 8dd761c489..c47a46a21c 100644 --- a/soh/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/soh/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -109,7 +109,7 @@ void func_80ACE13C(EnPart* this, PlayState* play) { if ((this->actor.params == 12) || (this->actor.params == 13)) { Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 15.0f, 0.0f, 0x1D); - if ((this->actor.bgCheckFlags & 1) || (this->actor.world.pos.y <= this->actor.floorHeight)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.world.pos.y <= this->actor.floorHeight)) { this->action = 4; this->actor.speedXZ = 0.0f; this->actor.gravity = 0.0f; diff --git a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index d48b611ea5..21b054e3a1 100644 --- a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -570,7 +570,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, PlayState* play) { this->colQuad.base.acFlags = this->colQuad.base.acFlags & ~AC_BOUNCED; EnPeehat_SetStateAttackRecoil(this); } else if ((this->colQuad.base.atFlags & AT_HIT) || (this->colCylinder.base.acFlags & AC_HIT) || - (this->actor.bgCheckFlags & 1)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Player* player = GET_PLAYER(play); this->colQuad.base.atFlags &= ~AT_HIT; if (!(this->colCylinder.base.acFlags & AC_HIT) && &player->actor == this->colQuad.base.at) { @@ -580,7 +580,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, PlayState* play) { this->actor.world.rot.y -= 0x2000; } this->unk_2D4 = 40; - } else if (this->colCylinder.base.acFlags & AC_HIT || this->actor.bgCheckFlags & 1) { + } else if (this->colCylinder.base.acFlags & AC_HIT || this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Vec3f zeroVec = { 0, 0, 0 }; s32 i; for (i = 4; i >= 0; i--) { @@ -592,7 +592,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, PlayState* play) { } } if (&player->actor != this->colQuad.base.at || this->colCylinder.base.acFlags & AC_HIT) { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_PIHAT_SM_DEAD, 1, 1, 40); } Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x20); diff --git a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index f02e556883..aa7c66526b 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -613,7 +613,7 @@ void EnPoField_SoulIdle(EnPoField* this, PlayState* play) { if (this->actionTimer != 0) { this->actionTimer--; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO_FIELD, 10, gPoeFieldLanternDL); func_80AD42B0(this); diff --git a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 0eba814c58..7e72ebcbeb 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -627,7 +627,7 @@ void func_80ADA530(EnPoSisters* this, PlayState* play) { } else if (this->unk_19A == 0 && Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f) != 0) { func_80AD9368(this); } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x71C); } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { @@ -739,7 +739,7 @@ void func_80ADAC70(EnPoSisters* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) { this->unk_19A--; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_199 |= 2; func_80AD9718(this); diff --git a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c index bf87fdfecb..4ee08bc2cd 100644 --- a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -724,7 +724,7 @@ void EnPoh_Death(EnPoh* this, PlayState* play) { if (this->unk_198 != 0) { this->unk_198--; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { objId = (this->infoIdx == EN_POH_INFO_COMPOSER) ? OBJECT_PO_COMPOSER : OBJECT_POH; EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, objId, 10, this->info->lanternDisplayList); diff --git a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 0d282086e1..0f60bea487 100644 --- a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -618,7 +618,7 @@ void EnRd_Crouch(EnRd* this, PlayState* play) { void EnRd_SetupDamaged(EnRd* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDamageAnim, -6.0f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = -2.0f; } diff --git a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 6fd24c6765..f52636693b 100644 --- a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -262,7 +262,7 @@ void EnReeba_Move(EnReeba* this, PlayState* play) { this->actor.speedXZ = 0.0f; this->actionfunc = EnReeba_SetupSink; } else if ((this->moveTimer == 0) || (this->actor.xzDistToPlayer < 30.0f) || - (this->actor.xzDistToPlayer > 400.0f) || (this->actor.bgCheckFlags & 8)) { + (this->actor.xzDistToPlayer > 400.0f) || (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { this->actionfunc = EnReeba_SetupSink; } else if (this->sfxTimer == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE); @@ -290,7 +290,7 @@ void EnReeba_MoveBig(EnReeba* this, PlayState* play) { surfaceType = SurfaceType_GetFloorType(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); if (((surfaceType != 4) && (surfaceType != 7)) || (this->actor.xzDistToPlayer > 400.0f) || - (this->actor.bgCheckFlags & 8)) { + (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { this->actionfunc = EnReeba_SetupSink; } else { if ((this->actor.xzDistToPlayer < 70.0f) && (this->bigLeeverTimer == 0)) { diff --git a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index c6acffc53d..c8592994e6 100644 --- a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -921,7 +921,7 @@ void func_80AEC9C4(EnRu1* this) { } void func_80AECA18(EnRu1* this) { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->action = 13; this->walkingFrame = 0.0f; this->actor.velocity.y = 0.0f; @@ -1343,7 +1343,7 @@ void func_80AEDB30(EnRu1* this, PlayState* play) { s32 temp_a0; s32 phi_v1; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { velocityY = &this->actor.velocity.y; dynaPolyActor = DynaPoly_GetActor(&play->colCtx, this->actor.floorBgId); if (*velocityY <= 0.0f) { @@ -1392,7 +1392,7 @@ void func_80AEDB30(EnRu1* this, PlayState* play) { func_80AED4FC(this); } } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { speedXZ = &this->actor.speedXZ; if (*speedXZ != 0.0f) { rotY = this->actor.world.rot.y; @@ -1526,7 +1526,7 @@ void func_80AEE2F8(EnRu1* this, PlayState* play) { DynaPolyActor* dynaPolyActor; s32 floorBgId; - if ((this->actor.bgCheckFlags & 1) && (this->actor.floorBgId != BGCHECK_SCENE)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.floorBgId != BGCHECK_SCENE)) { floorBgId = this->actor.floorBgId; dynaPolyActor = DynaPoly_GetActor(&play->colCtx, floorBgId); if ((dynaPolyActor != NULL) && (dynaPolyActor->actor.id == ACTOR_BG_BDAN_SWITCH)) { @@ -1545,7 +1545,7 @@ s32 func_80AEE394(EnRu1* this, PlayState* play) { DynaPolyActor* dynaPolyActor; s32 floorBgId; - if ((this->actor.bgCheckFlags & 1) && this->actor.floorBgId != BGCHECK_SCENE) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && this->actor.floorBgId != BGCHECK_SCENE) { colCtx = &play->colCtx; floorBgId = this->actor.floorBgId; // necessary match, can't move this out of this block unfortunately dynaPolyActor = DynaPoly_GetActor(colCtx, floorBgId); @@ -1575,7 +1575,7 @@ void func_80AEE488(EnRu1* this, PlayState* play) { this->roomNum3 = curRoomNum; this->action = 31; func_80AED520(this, play); - } else if ((!func_80AEE394(this, play)) && (!(this->actor.bgCheckFlags & 1))) { + } else if ((!func_80AEE394(this, play)) && (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND))) { this->actor.minVelocityY = -((kREG(24) * 0.01f) + 6.8f); this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f); this->action = 28; @@ -1584,7 +1584,8 @@ void func_80AEE488(EnRu1* this, PlayState* play) { void func_80AEE568(EnRu1* this, PlayState* play) { if (!func_80AEE394(this, play)) { - if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ == 0.0f) && (this->actor.minVelocityY == 0.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.speedXZ == 0.0f) && + (this->actor.minVelocityY == 0.0f)) { func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); this->action = 27; @@ -1688,7 +1689,7 @@ void func_80AEE7C4(EnRu1* this, PlayState* play) { } s32 func_80AEEAC8(EnRu1* this, PlayState* play) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); this->action = 27; diff --git a/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 04a3ff4ae6..b191e18afd 100644 --- a/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -275,7 +275,7 @@ void EnSb_TurnAround(EnSb* this, PlayState* play) { void EnSb_Lunge(EnSb* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); - if ((this->actor.velocity.y <= -0.1f) || ((this->actor.bgCheckFlags & 2))) { + if ((this->actor.velocity.y <= -0.1f) || ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH))) { if (!(this->actor.yDistToWater > 0.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } @@ -308,7 +308,7 @@ void EnSb_Bounce(EnSb* this, PlayState* play) { } EnSb_SpawnBubbles(play, this); EnSb_SetupLunge(this); - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.bgCheckFlags &= ~2; this->actor.speedXZ = 0.0f; this->timer = 1; @@ -321,12 +321,12 @@ void EnSb_Bounce(EnSb* this, PlayState* play) { void EnSb_Cooldown(EnSb* this, PlayState* play) { if (this->timer != 0) { this->timer--; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.bgCheckFlags &= ~1; this->actor.speedXZ = 0.0f; } } else { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.bgCheckFlags &= ~1; this->actionFunc = EnSb_WaitClosed; this->actor.speedXZ = 0.0f; diff --git a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c index e8dcebae7f..a467c93bc3 100644 --- a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -344,7 +344,7 @@ void func_80AFD508(EnSkb* this, PlayState* play) { } void EnSkb_SetupStunned(EnSkb* this) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = 0.0f; } Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -354,15 +354,15 @@ void EnSkb_SetupStunned(EnSkb* this) { } void func_80AFD59C(EnSkb* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.05f; } } - if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.colChkInfo.health == 0) { func_80AFD7B4(this, play); } else { @@ -373,7 +373,7 @@ void func_80AFD59C(EnSkb* this, PlayState* play) { void func_80AFD644(EnSkb* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gStalchildDamagedAnim, -4.0f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = -4.0f; } this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -391,17 +391,17 @@ void func_80AFD6CC(EnSkb* this, PlayState* play) { if ((*new_var) != 0) { this->breakFlags = (*new_var) | 2; } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.05f; } } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x1194, 0); - if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) { + if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_80AFCD60(this); } } @@ -411,7 +411,7 @@ void func_80AFD7B4(EnSkb* this, PlayState* play) { Animation_MorphToPlayOnce(&this->skelAnime, &gStalchildDyingAnim, -4.0f); this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = -6.0f; } this->actionState = 1; diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 27503e2d91..85367dbfe9 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -680,7 +680,7 @@ void EnSkj_Fade(EnSkj* this, PlayState* play) { } if (this->actor.velocity.y <= 0.0f) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.bgCheckFlags &= ~2; func_80AFF2A0(this); } @@ -1106,7 +1106,7 @@ void EnSkj_JumpFromStump(EnSkj* this) { void EnSkj_WaitForLanding(EnSkj* this, PlayState* play) { if (this->actor.velocity.y <= 0.0f) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.bgCheckFlags &= ~2; this->actor.speedXZ = 0.0f; EnSkj_SetupWaitForLandAnimFinish(this); @@ -1503,7 +1503,7 @@ void EnSkj_WaitForPlayback(EnSkj* this, PlayState* play) { SKULL_KID_OCARINA_PLAY_NOTES; } this->songFailTimer = 160; - Audio_OcaSetInstrument(6); // related instrument sound (flute?) + AudioOcarina_SetInstrument(6); // related instrument sound (flute?) Audio_OcaSetSongPlayback(OCARINA_SONG_MEMORY_GAME + 1, 1); play->msgCtx.msgMode = MSGMODE_MEMORY_GAME_LEFT_SKULLKID_PLAYING; play->msgCtx.stateTimer = 2; diff --git a/soh/src/overlays/actors/ovl_En_St/z_en_st.c b/soh/src/overlays/actors/ovl_En_St/z_en_st.c index aac063cd19..c1dc1115b0 100644 --- a/soh/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/soh/src/overlays/actors/ovl_En_St/z_en_st.c @@ -660,7 +660,7 @@ s32 EnSt_IsDoneBouncing(EnSt* this, PlayState* play) { return false; } - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { // the Skulltula is not on the ground. return false; } diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 9e04627a08..3eacc734dc 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -651,7 +651,7 @@ void func_80B0DB00(EnSw* this, PlayState* play) { this->actor.shape.rot.z += 0x1000; Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 0.0f, 5); - if ((this->actor.bgCheckFlags & 1) && (!(0.0f <= this->actor.velocity.y))) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (!(0.0f <= this->actor.velocity.y))) { if (this->actor.floorHeight <= BGCHECK_Y_MIN || this->actor.floorHeight >= 32000.0f) { Actor_Kill(&this->actor); return; diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 69c1c2f2e5..8a5220b305 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -233,7 +233,7 @@ void EnSyatekiNiw_Default(EnSyatekiNiw* this, PlayState* play) { f32 tmpf1; s16 sp4A; - if ((this->archeryState != 0) && (this->minigameType == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->archeryState != 0) && (this->minigameType == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->archeryState = 0; this->actionFunc = EnSyatekiNiw_SetupArchery; return; @@ -303,7 +303,7 @@ void EnSyatekiNiw_Default(EnSyatekiNiw* this, PlayState* play) { } } else { this->hopTimer = 4; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.velocity.y = 2.5f; if ((Rand_ZeroFloat(10.0f) < 1.0f) && (this->minigameType == 0)) { this->hopTimer = 0xC; @@ -407,7 +407,7 @@ void EnSyatekiNiw_Archery(EnSyatekiNiw* this, PlayState* play) { this->actor.speedXZ = 0.0f; } - if ((this->actor.bgCheckFlags & 1) && (this->actor.world.pos.z > 110.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.world.pos.z > 110.0f)) { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; this->leftWingRotZTarget = 0.0f; @@ -537,7 +537,7 @@ void EnSyatekiNiw_Remove(EnSyatekiNiw* this, PlayState* play) { this->rotYFlip++; this->rotYFlip &= 1; this->hopTimer = (s16)Rand_CenteredFloat(4.0f) + 5; - if ((Rand_ZeroFloat(5.0f) < 1.0f) && (this->actor.bgCheckFlags & 1)) { + if ((Rand_ZeroFloat(5.0f) < 1.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.velocity.y = 4.0f; } } diff --git a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c index 16641e2e4c..c0ee75d75d 100644 --- a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -822,10 +822,10 @@ void func_80860F84(EnTest* this, PlayState* play) { } } - if ((this->actor.bgCheckFlags & 8) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || ((this->actor.params == STALFOS_TYPE_CEILING) && !Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.world.rot.y))) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.speedXZ >= 0.0f) { newYaw = this->actor.shape.rot.y + 0x3FFF; } else { @@ -1228,8 +1228,9 @@ void func_808621D4(EnTest* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { this->actor.speedXZ = 0.0f; - if ((this->actor.bgCheckFlags & 8) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) && - (this->actor.xzDistToPlayer < 80.0f))) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && + ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) && + (this->actor.xzDistToPlayer < 80.0f))) { EnTest_SetupJumpUp(this); } else if (!EnTest_ReactToProjectile(play, this)) { EnTest_ChooseAction(this, play); @@ -1239,8 +1240,9 @@ void func_808621D4(EnTest* this, PlayState* play) { } if (player->meleeWeaponState != 0) { - if ((this->actor.bgCheckFlags & 8) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) && - (this->actor.xzDistToPlayer < 80.0f))) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && + ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) && + (this->actor.xzDistToPlayer < 80.0f))) { EnTest_SetupJumpUp(this); } else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) && (player->meleeWeaponAnimation != 0x11)) { @@ -1278,8 +1280,9 @@ void func_80862418(EnTest* this, PlayState* play) { } if (player->meleeWeaponState != 0) { - if ((this->actor.bgCheckFlags & 8) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) && - (this->actor.xzDistToPlayer < 80.0f))) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && + ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) && + (this->actor.xzDistToPlayer < 80.0f))) { EnTest_SetupJumpUp(this); } else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) && (player->meleeWeaponAnimation != 0x11)) { @@ -1324,7 +1327,7 @@ void EnTest_Stunned(EnTest* this, PlayState* play) { if (this->actor.colChkInfo.health == 0) { func_80862FA8(this, play); } else if (player->meleeWeaponState != 0) { - if ((this->actor.bgCheckFlags & 8) && + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) && (this->actor.xzDistToPlayer < 80.0f))) { EnTest_SetupJumpUp(this); @@ -1393,10 +1396,10 @@ void func_808628C8(EnTest* this, PlayState* play) { } } - if ((this->actor.bgCheckFlags & 8) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || ((this->actor.params == STALFOS_TYPE_CEILING) && !Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y + 0x3FFF))) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.speedXZ >= 0.0f) { newYaw = (this->actor.shape.rot.y + 0x3FFF); } else { @@ -1724,7 +1727,7 @@ void EnTest_Update(Actor* thisx, PlayState* play) { if (this->actor.floorHeight <= this->actor.home.pos.y) { this->actor.floorHeight = this->actor.home.pos.y; } - } else if (this->actor.bgCheckFlags & 2) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { floorProperty = func_80041EA4(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((floorProperty == 5) || (floorProperty == 0xC) || @@ -2001,7 +2004,7 @@ s32 EnTest_ReactToProjectile(PlayState* play, EnTest* this) { if (projectileActor != NULL) { yawToProjectile = Actor_WorldYawTowardActor(&this->actor, projectileActor) - (u16)this->actor.shape.rot.y; - if ((u8)(this->actor.bgCheckFlags & 8)) { + if ((u8)(this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { wallYawDiff = ((u16)this->actor.wallYaw - (u16)this->actor.shape.rot.y); touchingWall = true; } else { diff --git a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c index a7574e1791..2c51ae5a0d 100644 --- a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -361,7 +361,7 @@ void EnTite_Attack(EnTite* this, PlayState* play) { case TEKTITE_MID_LUNGE: // Generate sparkles at feet upon landing, set jumping animation and hurtbox and check if hit player if (this->actor.velocity.y >= 5.0f) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_800355B8(play, &this->frontLeftFootPos); func_800355B8(play, &this->frontRightFootPos); func_800355B8(play, &this->backRightFootPos); @@ -397,7 +397,7 @@ void EnTite_Attack(EnTite* this, PlayState* play) { break; } // Create ripples on water surface where tektite feet landed - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (!(this->actor.bgCheckFlags & 0x20)) { func_80033480(play, &this->frontLeftFootPos, 1.0f, 2, 80, 15, 1); func_80033480(play, &this->frontRightFootPos, 1.0f, 2, 80, 15, 1); @@ -415,10 +415,10 @@ void EnTite_Attack(EnTite* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_LAND_WATER2); } this->actor.bgCheckFlags &= ~0x40; - } else if (this->actor.bgCheckFlags & 2) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } - } else if (this->actor.bgCheckFlags & 2) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } @@ -525,7 +525,8 @@ void EnTite_MoveTowardPlayer(EnTite* this, PlayState* play) { } } - if ((this->actor.bgCheckFlags & 2) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x40))) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || + ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x40))) { if (this->vQueuedJumps != 0) { this->vQueuedJumps--; } else { @@ -596,7 +597,7 @@ void EnTite_MoveTowardPlayer(EnTite* this, PlayState* play) { this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT; Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 1000, 0); if (this->actor.velocity.y >= 6.0f) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_800355B8(play, &this->frontLeftFootPos); func_800355B8(play, &this->frontRightFootPos); func_800355B8(play, &this->backRightFootPos); @@ -652,13 +653,14 @@ void EnTite_Recoil(EnTite* this, PlayState* play) { // If player is far away, idle. Otherwise attack or move angleToPlayer = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y); - if ((this->actor.speedXZ == 0.0f) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && - (this->actor.bgCheckFlags & 0x20)))) { + if ((this->actor.speedXZ == 0.0f) && + ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { this->actor.world.rot.y = this->actor.shape.rot.y; this->collider.base.atFlags &= ~AT_HIT; if ((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f) && (ABS(this->actor.shape.rot.x) < 4000) && (ABS(this->actor.shape.rot.z) < 4000) && - ((this->actor.bgCheckFlags & 1) || + ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { EnTite_SetupIdle(this); } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.yDistToPlayer <= 80.0f) && @@ -721,7 +723,7 @@ void EnTite_Stunned(EnTite* this, PlayState* play) { // Decide on next action based on health, flip state and player distance angleToPlayer = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (((this->actor.colorFilterTimer == 0) && (this->actor.speedXZ == 0.0f)) && - ((this->actor.bgCheckFlags & 1) || + ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.colChkInfo.health == 0) { @@ -730,7 +732,7 @@ void EnTite_Stunned(EnTite* this, PlayState* play) { EnTite_SetupFlipUpright(this); } else if (((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f) && (ABS(this->actor.shape.rot.x) < 4000) && (ABS(this->actor.shape.rot.z) < 4000)) && - ((this->actor.bgCheckFlags & 1) || + ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { EnTite_SetupIdle(this); } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.yDistToPlayer <= 80.0f) && @@ -803,7 +805,7 @@ void EnTite_FlipOnBack(EnTite* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 3) { // Upon landing, spawn dust and make noise - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 20.0f, 11, 4.0f, 0, 0, false); Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } @@ -832,7 +834,7 @@ void EnTite_FlipUpright(EnTite* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.z, 0, 1, 0xFA0, 0); SkelAnime_Update(&this->skelAnime); //! @bug flying tektite: the following condition is never met and tektite stays stuck in this action forever - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { func_80033480(play, &this->frontLeftFootPos, 1.0f, 2, 80, 15, 1); func_80033480(play, &this->frontRightFootPos, 1.0f, 2, 80, 15, 1); func_80033480(play, &this->backRightFootPos, 1.0f, 2, 80, 15, 1); diff --git a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index ceca597df8..62d4788364 100644 --- a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -500,7 +500,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } else if (sJumpslashFlag && (sAlpha == 255) && (this->actor.velocity.y > 0)) { input->cur.button |= BTN_B; - } else if (!sJumpslashFlag && (this->actor.bgCheckFlags & 1)) { + } else if (!sJumpslashFlag && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; sStickAngle = this->actor.yawTowardsPlayer; if (sAlpha != 255) { diff --git a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c index e1b795cea4..86d38c718f 100644 --- a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -676,7 +676,7 @@ void EnTp_Update(Actor* thisx, PlayState* play) { } // Turn away from wall - if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { + if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL)) { yawToWall = this->actor.wallYaw - this->actor.world.rot.y; if (ABS(yawToWall) > 0x4000) { diff --git a/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index c4aabb956b..96836bbc3d 100644 --- a/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -214,7 +214,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { } } - if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { EnTuboTrap_SpawnEffectsOnLand(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 2351aeed37..d6293096e8 100644 --- a/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -128,7 +128,7 @@ void EnVbBall_UpdateBones(EnVbBall* this, PlayState* play) { s16 i; Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, 4); - if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y <= 0.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y <= 0.0f)) { this->xRotVel = Rand_CenteredFloat((f32)0x4000); this->yRotVel = Rand_CenteredFloat((f32)0x4000); angle = Math_FAtan2F(this->actor.world.pos.x, this->actor.world.pos.z); @@ -188,7 +188,7 @@ void EnVbBall_Update(Actor* thisx, PlayState* play2) { this->actor.world.pos.y -= radius; Actor_UpdateBgCheckInfo(play, &this->actor, 50.0f, 50.0f, 100.0f, 4); this->actor.world.pos.y += radius; - if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y <= 0.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->actor.velocity.y <= 0.0f)) { if ((this->actor.params == 100) || (this->actor.params == 101)) { Actor_Kill(&this->actor); if (this->actor.params == 100) { diff --git a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 13d1d0e9e9..5dace5fbb8 100644 --- a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -594,7 +594,7 @@ void EnWallmas_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); - if ((this->actionFunc != EnWallmas_TakeDamage) && (this->actor.bgCheckFlags & 1) != 0 && + if ((this->actionFunc != EnWallmas_TakeDamage) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) != 0 && (this->actor.freezeTimer == 0)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } diff --git a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index f14bee8e57..5705702a2e 100644 --- a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -252,7 +252,7 @@ void EnWeiyer_FreeSwim(EnWeiyer* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, 1.3f, 0.03f); } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->targetYaw = this->actor.wallYaw; this->timer = 30; } @@ -284,7 +284,7 @@ void EnWeiyer_FreeSwim(EnWeiyer* this, PlayState* play) { } else { Player* player = GET_PLAYER(play); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->targetSwimHeight = this->actor.home.pos.y - Rand_ZeroOne() * ((this->actor.home.pos.y - this->actor.floorHeight) / 2.0f); } else if (sp34 && (Rand_ZeroOne() < 0.1f)) { @@ -320,7 +320,7 @@ void EnWeiyer_TurnAround(EnWeiyer* this, PlayState* play) { } EnWeiyer_SetupInactive(this); - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnWeiyer_SetupStuckOnFloor(this); } } @@ -419,7 +419,7 @@ void EnWeiyer_Inactive(EnWeiyer* this, PlayState* play) { this->timer--; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->targetYaw = this->actor.wallYaw; } @@ -447,7 +447,7 @@ void EnWeiyer_Hurt(EnWeiyer* this, PlayState* play) { this->timer--; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->targetYaw = this->actor.wallYaw; } else { this->targetYaw = this->actor.yawTowardsPlayer + 0x8000; @@ -502,7 +502,7 @@ void EnWeiyer_Stunned(EnWeiyer* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_EIER_FLUTTER); } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } } @@ -550,7 +550,7 @@ void EnWeiyer_OutOfWater(EnWeiyer* this, PlayState* play) { Math_ScaledStepToS(&this->actor.shape.rot.x, phi_a1, 0x400); } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { EnWeiyer_SetupTurnAround(this); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.shape.rot.x > 0)) { EffectSsGSplash_Spawn(play, &this->actor.world.pos, NULL, NULL, 1, 400); diff --git a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 48f17149e8..1e43258817 100644 --- a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -312,7 +312,8 @@ s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) { if (func_800354B4(play, &this->actor, 100.0f, 0x5DC0, 0x2AA8, this->actor.shape.rot.y)) { this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if ((this->actor.bgCheckFlags & 8) && (ABS(wallYawDiff) < 0x2EE0) && (this->actor.xzDistToPlayer < 120.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(wallYawDiff) < 0x2EE0) && + (this->actor.xzDistToPlayer < 120.0f)) { EnWf_SetupSomersaultAndAttack(this); return true; } else if (player->meleeWeaponAnimation == 0x11) { @@ -332,7 +333,8 @@ s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) { if (explosive != NULL) { this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (((this->actor.bgCheckFlags & 8) && (wallYawDiff < 0x2EE0)) || (explosive->id == ACTOR_EN_BOM_CHU)) { + if (((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (wallYawDiff < 0x2EE0)) || + (explosive->id == ACTOR_EN_BOM_CHU)) { if ((explosive->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(&this->actor, explosive) < 80.0f) && (s16)((this->actor.shape.rot.y - explosive->world.rot.y) + 0x8000) < 0x3E80) { EnWf_SetupSomersaultAndAttack(this); @@ -650,9 +652,9 @@ void EnWf_RunAroundPlayer(EnWf* this, PlayState* play) { angle1 = player->actor.shape.rot.y + this->runAngle + 0x8000; // Actor_TestFloorInDirection is useless here (see comment below) - if ((this->actor.bgCheckFlags & 8) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y)) { - angle2 = (this->actor.bgCheckFlags & 8) + angle2 = (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) ? (this->actor.wallYaw - this->actor.yawTowardsPlayer) - this->runAngle : 0; @@ -871,7 +873,7 @@ void EnWf_BackflipAway(EnWf* this, PlayState* play) { } void EnWf_SetupStunned(EnWf* this) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.speedXZ = 0.0f; } @@ -882,11 +884,11 @@ void EnWf_SetupStunned(EnWf* this) { } void EnWf_Stunned(EnWf* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.05f; } @@ -894,7 +896,7 @@ void EnWf_Stunned(EnWf* this, PlayState* play) { this->unk_300 = false; } - if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.colChkInfo.health == 0) { EnWf_SetupDie(this); } else { @@ -906,7 +908,7 @@ void EnWf_Stunned(EnWf* this, PlayState* play) { void EnWf_SetupDamaged(EnWf* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosDamagedAnim, -4.0f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_300 = false; this->actor.speedXZ = -4.0f; } else { @@ -923,11 +925,11 @@ void EnWf_SetupDamaged(EnWf* this) { void EnWf_Damaged(EnWf* this, PlayState* play) { s16 angleToWall; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.05f; } @@ -938,11 +940,12 @@ void EnWf_Damaged(EnWf* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 4500, 0); if (!EnWf_ChangeAction(play, this, false) && SkelAnime_Update(&this->skelAnime)) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { angleToWall = this->actor.wallYaw - this->actor.shape.rot.y; angleToWall = ABS(angleToWall); - if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 12000) && (this->actor.xzDistToPlayer < 120.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(angleToWall) < 12000) && + (this->actor.xzDistToPlayer < 120.0f)) { EnWf_SetupSomersaultAndAttack(this); } else if (!EnWf_DodgeRanged(play, this)) { if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(play, &this->actor) && @@ -1103,10 +1106,11 @@ void EnWf_Sidestep(EnWf* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->runAngle, 1, 3000, 1); // Actor_TestFloorInDirection is useless here (see comment below) - if ((this->actor.bgCheckFlags & 8) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y)) { - s16 angle = - (this->actor.bgCheckFlags & 8) ? (this->actor.wallYaw - this->actor.yawTowardsPlayer) - this->runAngle : 0; + s16 angle = (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) + ? (this->actor.wallYaw - this->actor.yawTowardsPlayer) - this->runAngle + : 0; // This is probably meant to reverse direction if the edge of a floor is encountered, but does nothing // unless bgCheckFlags & 8 anyway, since angle = 0 otherwise @@ -1188,7 +1192,7 @@ void EnWf_SetupDie(EnWf* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gWolfosRearingUpFallingOverAnim, -4.0f); this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_300 = false; this->actor.speedXZ = -6.0f; } else { @@ -1204,11 +1208,11 @@ void EnWf_SetupDie(EnWf* this) { } void EnWf_Die(EnWf* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); this->unk_300 = false; } diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c index de71d4f9f0..ad3c000f3c 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -416,7 +416,7 @@ void EnXc_SetWalkingSFX(EnXc* this, PlayState* play) { s32 pad2; if (Animation_OnFrame(&this->skelAnime, 11.0f) || Animation_OnFrame(&this->skelAnime, 23.0f)) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); Sfx_PlaySfxAtPos(&this->actor.projectedPos, sfxId); @@ -430,7 +430,7 @@ void EnXc_SetNutThrowSFX(EnXc* this, PlayState* play) { s32 pad2; if (Animation_OnFrame(&this->skelAnime, 7.0f)) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); Sfx_PlaySfxAtPos(&this->actor.projectedPos, sfxId); diff --git a/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index 552cbf4934..587f4f764d 100644 --- a/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -121,7 +121,7 @@ void EnYukabyun_Update(Actor* thisx, PlayState* play) { if (((this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) || ((this->collider.base.ocFlags1 & OC1_HIT) && !(this->collider.base.oc->id == ACTOR_EN_YUKABYUN))) || - ((this->actionfunc == func_80B43B6C) && (this->actor.bgCheckFlags & 8))) { + ((this->actionfunc == func_80B43B6C) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL))) { this->collider.base.atFlags &= ~AT_HIT; this->collider.base.acFlags &= ~AC_HIT; this->collider.base.ocFlags1 &= ~OC1_HIT; diff --git a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 99d9fba48a..bb01a56b5d 100644 --- a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -240,7 +240,7 @@ s32 EnZf_PrimaryFloorCheck(EnZf* this, PlayState* play, f32 dist) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 0x1C); this->actor.world.pos = curPos; - ret = !(this->actor.bgCheckFlags & 1); + ret = !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND); this->actor.bgCheckFlags = curBgCheckFlags; return ret; } @@ -271,7 +271,7 @@ s16 EnZf_SecondaryFloorCheck(EnZf* this, PlayState* play, f32 dist) { Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, 0x1C); this->actor.world.pos = curPos; - ret = !(this->actor.bgCheckFlags & 1); + ret = !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND); this->actor.bgCheckFlags = curBgCheckFlags; return ret; } @@ -589,7 +589,8 @@ s32 EnZf_ChooseAction(PlayState* play, EnZf* this) { if (func_800354B4(play, &this->actor, 100.0f, 0x5DC0, 0x2AA8, this->actor.shape.rot.y)) { this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToPlayer < 80.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(angleToWall) < 0x2EE0) && + (this->actor.xzDistToPlayer < 80.0f)) { EnZf_SetupJumpUp(this); return true; } else if ((this->actor.xzDistToPlayer < 90.0f) && ((play->gameplayFrames % 2) != 0)) { @@ -605,7 +606,8 @@ s32 EnZf_ChooseAction(PlayState* play, EnZf* this) { if (explosive != NULL) { this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (((this->actor.bgCheckFlags & 8) && (angleToWall < 0x2EE0)) || (explosive->id == ACTOR_EN_BOM_CHU)) { + if (((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (angleToWall < 0x2EE0)) || + (explosive->id == ACTOR_EN_BOM_CHU)) { if ((explosive->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(&this->actor, explosive) < 80.0f) && ((s16)((this->actor.shape.rot.y - explosive->world.rot.y) + 0x8000) < 0x3E80)) { EnZf_SetupJumpUp(this); @@ -804,12 +806,12 @@ void EnZf_ApproachPlayer(EnZf* this, PlayState* play) { temp_v1 = ABS(temp_v1); if ((this->unk_3F8 && (this->actor.speedXZ > 0.0f)) || - ((this->actor.bgCheckFlags & 8) && (temp_v1 >= 0x5C19))) { + ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (temp_v1 >= 0x5C19))) { if ((Actor_WorldDistXZToPoint(&this->actor, &sPlatformPositions[this->nextPlatform]) < sp44) && !EnZf_PrimaryFloorCheck(this, play, 191.9956f)) { EnZf_SetupJumpForward(this); - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.velocity.y = 20.0f; } @@ -1076,10 +1078,10 @@ void func_80B463E4(EnZf* this, PlayState* play) { if (this->unk_3F8) { this->actor.speedXZ = -this->actor.speedXZ; } - } else if ((this->actor.bgCheckFlags & 8) || + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y + 0x3FFF)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.speedXZ >= 0.0f) { phi_v0_3 = this->actor.shape.rot.y + 0x3FFF; } else { @@ -1285,7 +1287,8 @@ void EnZf_JumpBack(EnZf* this, PlayState* play) { } void EnZf_SetupStunned(EnZf* this) { - if ((this->actor.bgCheckFlags & 1) && ((this->actor.velocity.y == 0.0f) || (this->actor.velocity.y == -4.0f))) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + ((this->actor.velocity.y == 0.0f) || (this->actor.velocity.y == -4.0f))) { this->actor.speedXZ = 0.0f; this->hopAnimIndex = 0; } else { @@ -1306,18 +1309,18 @@ void EnZf_SetupStunned(EnZf* this) { void EnZf_Stunned(EnZf* this, PlayState* play) { s16 angleToWall; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.05f; } this->hopAnimIndex = 0; } - if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.colChkInfo.health == 0) { EnZf_SetupDie(this); } else if ((this->actor.params != ENZF_TYPE_DINOLFOS) || !EnZf_ChooseAction(play, this)) { @@ -1327,7 +1330,7 @@ void EnZf_Stunned(EnZf* this, PlayState* play) { angleToWall = this->actor.wallYaw - this->actor.shape.rot.y; angleToWall = ABS(angleToWall); - if ((this->actor.params == ENZF_TYPE_DINOLFOS) && (this->actor.bgCheckFlags & 8) && + if ((this->actor.params == ENZF_TYPE_DINOLFOS) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToPlayer < 90.0f)) { this->actor.world.rot.y = this->actor.shape.rot.y; EnZf_SetupJumpUp(this); @@ -1505,7 +1508,7 @@ void EnZf_HopAway(EnZf* this, PlayState* play) { case 1: case 1 | 2: this->actor.velocity.y = 12.0f; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->actor.velocity.y += 8.0f; } @@ -1538,7 +1541,8 @@ void EnZf_HopAway(EnZf* this, PlayState* play) { break; case 1: - if ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 1)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) || + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_ONGND); this->actor.velocity.y = 0.0f; this->actor.world.pos.y = this->actor.floorHeight; @@ -1611,7 +1615,8 @@ void EnZf_SetupDamaged(EnZf* this) { Animation_Change(&this->skelAnime, &gZfKnockedBackAnim, 1.5f, 0.0f, Animation_GetLastFrame(&gZfKnockedBackAnim), ANIMMODE_ONCE, -4.0f); - if ((this->actor.bgCheckFlags & 1) && ((this->actor.velocity.y == 0.0f) || (this->actor.velocity.y == -4.0f))) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + ((this->actor.velocity.y == 0.0f) || (this->actor.velocity.y == -4.0f))) { this->actor.speedXZ = -4.0f; this->hopAnimIndex = 0; } else { @@ -1634,11 +1639,11 @@ void EnZf_SetupDamaged(EnZf* this) { void EnZf_Damaged(EnZf* this, PlayState* play) { s16 wallYawDiff; - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.05f; } @@ -1648,7 +1653,7 @@ void EnZf_Damaged(EnZf* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 4500, 0); if (((this->actor.params != ENZF_TYPE_DINOLFOS) || !EnZf_ChooseAction(play, this)) && - SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) { + SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (D_80B4A1B4 != -1) { if (this->damageEffect == ENZF_DMGEFF_PROJECTILE) { @@ -1669,7 +1674,7 @@ void EnZf_Damaged(EnZf* this, PlayState* play) { wallYawDiff = this->actor.wallYaw - this->actor.shape.rot.y; wallYawDiff = ABS(wallYawDiff); - if ((this->actor.params == ENZF_TYPE_DINOLFOS) && (this->actor.bgCheckFlags & 8) && + if ((this->actor.params == ENZF_TYPE_DINOLFOS) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (ABS(wallYawDiff) < 12000) && (this->actor.xzDistToPlayer < 90.0f)) { EnZf_SetupJumpUp(this); } else if (!EnZf_DodgeRangedEngaging(play, this)) { @@ -1775,9 +1780,9 @@ void EnZf_CircleAroundPlayer(EnZf* this, PlayState* play) { if (this->unk_3F8) { this->actor.speedXZ = -this->actor.speedXZ; } - } else if ((this->actor.bgCheckFlags & 8) || + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || !Actor_TestFloorInDirection(&this->actor, play, this->actor.speedXZ, this->actor.shape.rot.y + 0x3FFF)) { - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (this->actor.speedXZ >= 0.0f) { phi_v0_4 = this->actor.shape.rot.y + 0x3FFF; } else { @@ -1896,7 +1901,8 @@ void EnZf_SetupDie(EnZf* this) { Animation_Change(&this->skelAnime, &gZfDyingAnim, 1.5f, 0.0f, Animation_GetLastFrame(&gZfDyingAnim), ANIMMODE_ONCE, -4.0f); - if ((this->actor.bgCheckFlags & 1) && ((this->actor.velocity.y == 0.0f) || (this->actor.velocity.y == -4.0f))) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + ((this->actor.velocity.y == 0.0f) || (this->actor.velocity.y == -4.0f))) { this->actor.speedXZ = 0.0f; this->hopAnimIndex = 0; } else { @@ -1931,11 +1937,11 @@ void EnZf_SetupDie(EnZf* this) { void EnZf_Die(EnZf* this, PlayState* play) { - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { this->actor.speedXZ = 0.0f; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.15f, 0.0f); this->hopAnimIndex = 0; } @@ -2050,7 +2056,7 @@ void EnZf_Update(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 25.0f, 30.0f, 60.0f, 0x1D); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { this->hopAnimIndex = 1; } @@ -2079,7 +2085,7 @@ void EnZf_Update(Actor* thisx, PlayState* play) { Math_SmoothStepToS(&this->headRot, 0, 1, 2000, 0); if (this->action <= ENZF_ACTION_HOP_AND_TAUNT) { - if ((this->unk_3F4 == 1) && (this->actor.bgCheckFlags & 1)) { + if ((this->unk_3F4 == 1) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->actor.colChkInfo.health > 0) { EnZf_SetupDrawSword(this, play); } diff --git a/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index b6089cd690..c1a357c5d0 100644 --- a/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -184,8 +184,8 @@ void func_80B4B010(EnZl1* this, PlayState* play) { play->envCtx.fillScreen = true; Play_CameraSetAtEye(play, this->subCamId, &vec1, &vec2); Play_CameraSetFov(play, this->subCamId, 30.0f); - ShrinkWindow_SetVal(0x20); - Interface_ChangeAlpha(2); + Letterbox_SetSizeTarget(0x20); + Interface_ChangeHudVisibilityMode(2); player->actor.world.pos = playerPos; player->actor.speedXZ = 0.0f; this->unk_1E2 = 0; @@ -559,7 +559,7 @@ void func_80B4BF2C(EnZl1* this, PlayState* play) { case 6: if (Actor_TextboxIsClosing(&this->actor, play)) { Player_SetCsActionWithHaltedActors(play, &this->actor, 7); - Interface_ChangeAlpha(50); + Interface_ChangeHudVisibilityMode(50); this->actor.flags &= ~ACTOR_FLAG_TALK; this->unk_1E2 = 4; } diff --git a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 1c8a531fab..8f41e02f2d 100644 --- a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -1438,7 +1438,7 @@ void func_80B51D24(EnZl2* this, PlayState* play) { SkelAnime* skelAnime = &this->skelAnime; if (Animation_OnFrame(skelAnime, 6.0f) || Animation_OnFrame(skelAnime, 0.0f)) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { sfxId = SFX_FLAG; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); Sfx_PlaySfxAtPos(&this->actor.projectedPos, sfxId); diff --git a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 15d9bcf58f..6db4fa1a55 100644 --- a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -1555,7 +1555,8 @@ void func_80B56E38(EnZl3* this, PlayState* play) { s32 sfxId; SkelAnime* sp20 = &this->skelAnime; - if ((Animation_OnFrame(sp20, 6.0f) || Animation_OnFrame(sp20, 0.0f)) && (this->actor.bgCheckFlags & 1)) { + if ((Animation_OnFrame(sp20, 6.0f) || Animation_OnFrame(sp20, 0.0f)) && + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { sfxId = 0x800; sfxId += SurfaceType_GetSfx(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId); Sfx_PlaySfxAtPos(&this->actor.projectedPos, sfxId); @@ -2202,7 +2203,7 @@ s32 func_80B58938(EnZl3* this, PlayState* play) { } s32 func_80B5899C(EnZl3* this, PlayState* play) { - if ((this->actor.bgCheckFlags & 1)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Player* player = GET_PLAYER(play); s8 invincibilityTimer = player->invincibilityTimer; diff --git a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 4b03e154fc..c2d53e8129 100644 --- a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -184,7 +184,7 @@ static AnimationInfo sAnimationInfo[] = { void EnZl4_SetCsCameraAngle(PlayState* play, s16 index) { Camera* activeCam = GET_ACTIVE_CAM(play); - Camera_ChangeSetting(activeCam, CAM_SET_FREE0); + Camera_RequestSetting(activeCam, CAM_SET_FREE0); activeCam->at = sCsCameraAngle[index].at; activeCam->eye = activeCam->eyeNext = sCsCameraAngle[index].eye; activeCam->roll = sCsCameraAngle[index].roll; @@ -195,7 +195,7 @@ void EnZl4_SetCsCameraMove(PlayState* play, s16 index) { Camera* activeCam = GET_ACTIVE_CAM(play); Player* player = GET_PLAYER(play); - Camera_ChangeSetting(activeCam, CAM_SET_CS_0); + Camera_RequestSetting(activeCam, CAM_SET_CS_0); Camera_ResetAnim(activeCam); Camera_SetCSParams(activeCam, sCsCameraMove[index].atPoints, sCsCameraMove[index].eyePoints, player, sCsCameraMove[index].relativeToPlayer); @@ -335,8 +335,8 @@ s32 EnZl4_SetupFromLegendCs(EnZl4* this, PlayState* play) { player->linearVelocity = playerx->speedXZ = 0.0f; EnZl4_SetCsCameraMove(play, 5); - ShrinkWindow_SetVal(0x20); - Interface_ChangeAlpha(2); + Letterbox_SetSizeTarget(0x20); + Interface_ChangeHudVisibilityMode(2); this->talkTimer2 = 0; return true; } @@ -1106,7 +1106,7 @@ s32 EnZl4_CsMakePlan(EnZl4* this, PlayState* play) { if (!((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play))) { break; } else { - Camera_ChangeSetting(GET_ACTIVE_CAM(play), 1); + Camera_RequestSetting(GET_ACTIVE_CAM(play), 1); this->talkState = 7; play->talkWithPlayer(play, &this->actor); if (GameInteractor_Should(VB_GIVE_ITEM_ZELDAS_LETTER, true)) { @@ -1147,8 +1147,8 @@ void EnZl4_Cutscene(EnZl4* this, PlayState* play) { this->mouthExpression = ZL4_MOUTH_SURPRISED; Audio_PlayFanfare(NA_BGM_APPEAR); EnZl4_SetCsCameraAngle(play, 0); - Interface_ChangeAlpha(2); - ShrinkWindow_SetVal(0x20); + Interface_ChangeHudVisibilityMode(2); + Letterbox_SetSizeTarget(0x20); this->talkState = 0; this->csState++; break; @@ -1191,7 +1191,7 @@ void EnZl4_Cutscene(EnZl4* this, PlayState* play) { case ZL4_CS_PLAN: if (EnZl4_CsMakePlan(this, play)) { Player_SetCsActionWithHaltedActors(play, &this->actor, 7); - gSaveContext.unk_13EE = 0x32; + gSaveContext.prevHudVisibilityMode = 0x32; Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER); this->actionFunc = EnZl4_Idle; } diff --git a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 6e30b0095b..ecb7ce65fa 100644 --- a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -712,7 +712,7 @@ void EnZo_Dive(EnZo* this, PlayState* play) { return; } - if (this->actor.yDistToWater > 80.0f || this->actor.bgCheckFlags & 1) { + if (this->actor.yDistToWater > 80.0f || this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_ApproachF(&this->actor.velocity.y, -1.0f, 0.4f, 0.6f); Math_ApproachF(&this->alpha, 0.0f, 0.3f, 10.0f); } diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 40c7699fe7..32defd2c7e 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -2331,7 +2331,7 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { if (this->actor.bgCheckFlags & 0x10) { sLurePosDelta.y = -0.5f; } - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { if (sLurePosDelta.y > 0.0f) { sLurePosDelta.y = 0.0f; } @@ -4230,11 +4230,11 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { this->actor.velocity.y = velocityY; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->bumpTimer = 20; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->actor.world.pos.y > WATER_SURFACE_Y(play)) { this->unk_184 = Rand_ZeroFloat(3.0f) + 3.0f; this->actor.velocity.x = this->actor.world.pos.x * -0.003f; @@ -5406,13 +5406,13 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { sCameraAt.y = mainCam->at.y; sCameraAt.z = mainCam->at.z; sFishingPlayerCinematicState = 2; - Interface_ChangeAlpha(12); + Interface_ChangeHudVisibilityMode(12); sSubCamVelFactor = 0.0f; // fallthrough } case 2: - ShrinkWindow_SetVal(0x1B); + Letterbox_SetSizeTarget(0x1B); lureDist.x = sLurePos.x - player->actor.world.pos.x; lureDist.z = sLurePos.z - player->actor.world.pos.z; diff --git a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 7edfb5a0f9..bb29d5170b 100644 --- a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -167,7 +167,7 @@ void ItemEtcetera_SpawnSparkles(ItemEtcetera* this, PlayState* play) { void ItemEtcetera_MoveFireArrowDown(ItemEtcetera* this, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 0.0f, 5); Actor_MoveXZGravity(&this->actor); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { ItemEtcetera_SpawnSparkles(this, play); } this->actor.shape.rot.y += 0x400; diff --git a/soh/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/soh/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index 4242cc0dea..4fbe8a3ebe 100644 --- a/soh/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/soh/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -107,7 +107,7 @@ void func_80B86AC8(ItemShield* this, PlayState* play) { } Actor_OfferGetItem(&this->actor, play, GI_SHIELD_DEKU, 30.0f, 50.0f); Actor_UpdateBgCheckInfo(play, &this->actor, 10.0f, 10.0f, 0.0f, 5); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->timer--; if (this->timer < 60) { if (this->timer & 1) { @@ -169,7 +169,7 @@ void func_80B86CA8(ItemShield* this, PlayState* play) { this->unk_1A8[i].z = Rand_CenteredFloat(15.0f); } } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->unk_198 -= this->actor.shape.rot.x >> 1; this->unk_198 -= this->unk_198 >> 2; this->actor.shape.rot.x += this->unk_198; diff --git a/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 393cf2f6db..fa6fe0289f 100644 --- a/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -758,9 +758,9 @@ void ObjBean_WaitForPlayer(ObjBean* this, PlayState* play) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { // Player is standing on ObjBean_SetupFly(this); if (play->sceneNum == SCENE_LOST_WOODS) { // Lost woods - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_LOST_WOODS); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_LOST_WOODS); } else { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_GENERIC); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_GENERIC); } } ObjBean_UpdatePosition(this); @@ -786,7 +786,7 @@ void ObjBean_Fly(ObjBean* this, PlayState* play) { camera = play->cameraPtrs[CAM_ID_MAIN]; if ((camera->setting == CAM_SET_BEAN_LOST_WOODS) || (camera->setting == CAM_SET_BEAN_GENERIC)) { - Camera_ChangeSetting(camera, CAM_SET_NORMAL0); + Camera_RequestSetting(camera, CAM_SET_NORMAL0); } } else if (DynaPolyActor_IsPlayerOnTop(&this->dyna) != 0) { // Player is on top @@ -794,15 +794,15 @@ void ObjBean_Fly(ObjBean* this, PlayState* play) { Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_PL_PLANT_MOVE - SFX_FLAG); if (play->sceneNum == SCENE_LOST_WOODS) { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_LOST_WOODS); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_LOST_WOODS); } else { - Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_GENERIC); + Camera_RequestSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_BEAN_GENERIC); } } else if (this->stateFlags & BEAN_STATE_PLAYER_ON_TOP) { camera = play->cameraPtrs[CAM_ID_MAIN]; if ((camera->setting == CAM_SET_BEAN_LOST_WOODS) || (camera->setting == CAM_SET_BEAN_GENERIC)) { - Camera_ChangeSetting(camera, CAM_SET_NORMAL0); + Camera_RequestSetting(camera, CAM_SET_NORMAL0); } } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 3825ff7554..aeb1fac438 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -323,7 +323,7 @@ void Player_Action_8084EED8(Player* this, PlayState* play); void Player_Action_8084EFC0(Player* this, PlayState* play); void Player_Action_ExchangeItem(Player* this, PlayState* play); void Player_Action_SlideOnSlope(Player* this, PlayState* play); -void Player_Action_8084F608(Player* this, PlayState* play); +void Player_Action_WaitForCutscene(Player* this, PlayState* play); void Player_Action_8084F698(Player* this, PlayState* play); void Player_Action_8084F710(Player* this, PlayState* play); void Player_Action_8084F88C(Player* this, PlayState* play); @@ -2904,7 +2904,7 @@ s32 func_80834D2C(Player* this, PlayState* play) { if (this->stateFlags1 & PLAYER_STATE1_ON_HORSE) { Player_AnimPlayLoop(play, this, &gPlayerAnim_link_uma_anim_walk); - } else if ((this->actor.bgCheckFlags & 1) && !Player_UpdateHostileLockOn(this)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !Player_UpdateHostileLockOn(this)) { Player_AnimPlayLoop(play, this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_wait, this->modelAnimType)); } @@ -3055,7 +3055,7 @@ s32 func_808351D4(Player* this, PlayState* play) { if (!func_808350A4(play, this)) { Player_PlaySfx(this, D_808543DC[ABS(this->unk_860) - 1]); } - } else if (this->actor.bgCheckFlags & 1) { + } else if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_808350A4(play, this); } } @@ -3113,7 +3113,7 @@ s32 func_808353D8(Player* this, PlayState* play) { } s32 func_80835588(Player* this, PlayState* play) { - if (!(this->actor.bgCheckFlags & 1) || LinkAnimation_Update(play, &this->upperSkelAnime)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || LinkAnimation_Update(play, &this->upperSkelAnime)) { Player_SetUpperActionFunc(this, func_8083501C); } @@ -3123,7 +3123,7 @@ s32 func_80835588(Player* this, PlayState* play) { void Player_SetParallel(Player* this) { this->stateFlags1 |= PLAYER_STATE1_PARALLEL; - if (!(this->skelAnime.movementFlags & 0x80) && (this->actor.bgCheckFlags & 0x200) && + if (!(this->skelAnime.movementFlags & 0x80) && (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (sShapeYawToTouchedWall < 0x2000)) { // snap to the wall this->yaw = this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; @@ -3304,7 +3304,7 @@ s32 Player_SetupAction(PlayState* play, Player* this, PlayerActionFunc actionFun } if (Player_Action_8084E3C4 == this->actionFunc) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); this->stateFlags2 &= ~(PLAYER_STATE2_ATTEMPT_PLAY_FOR_ACTOR | PLAYER_STATE2_PLAY_FOR_ACTOR); } else if (Player_Action_808507F4 == this->actionFunc) { func_80832340(play, this); @@ -3379,19 +3379,19 @@ void Player_SetupActionPreserveItemAction(PlayState* play, Player* this, PlayerA } } -void func_80835E44(PlayState* play, s16 camSetting) { - if (!func_800C0CB8(play)) { +void Player_RequestCameraSetting(PlayState* play, s16 camSetting) { + if (!Play_CamIsNotFixed(play)) { if (camSetting == CAM_SET_SCENE_TRANSITION) { - Interface_ChangeAlpha(2); + Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING_ALT); } } else { - Camera_ChangeSetting(Play_GetCamera(play, 0), camSetting); + Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), camSetting); } } -void func_80835EA4(PlayState* play, s32 arg1) { - func_80835E44(play, CAM_SET_TURN_AROUND); - Camera_SetCameraData(Play_GetCamera(play, 0), 4, NULL, NULL, arg1, 0, 0); +void Player_SetTurnAroundCamera(PlayState* play, s32 camItemType) { + Player_RequestCameraSetting(play, CAM_SET_TURN_AROUND); + Camera_SetCameraData(Play_GetCamera(play, CAM_ID_MAIN), CAM_DATA_SET_2, NULL, NULL, camItemType, 0, 0); } void Player_DestroyHookshot(Player* this) { @@ -3419,7 +3419,7 @@ void Player_UseItem(PlayState* play, Player* this, s32 item) { ((this->itemAction < 0) && ((Player_ActionToMeleeWeapon(itemAction) != 0) || (itemAction == PLAYER_IA_NONE)))) { if ((itemAction == PLAYER_IA_NONE) || !(this->stateFlags1 & PLAYER_STATE1_IN_WATER) || - ((this->actor.bgCheckFlags & 1) && + ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && ((itemAction == PLAYER_IA_HOOKSHOT) || (itemAction == PLAYER_IA_LONGSHOT)))) { if ((play->bombchuBowlingStatus == 0) && @@ -3529,7 +3529,7 @@ void func_80836448(PlayState* play, Player* this, LinkAnimationHeader* anim) { Player_PlayVoiceSfx(this, NA_SE_VO_LI_DOWN); if (this->actor.category == ACTORCAT_PLAYER) { - func_800F47BC(); + Audio_SetBgmVolumeOffDuringFanfare(); if (Inventory_ConsumeFairy(play)) { play->gameOverCtx.state = GAMEOVER_REVIVE_START; @@ -3543,7 +3543,7 @@ void func_80836448(PlayState* play, Player* this, LinkAnimationHeader* anim) { } OnePointCutscene_Init(play, 9806, cond ? 120 : 60, &this->actor, CAM_ID_MAIN); - ShrinkWindow_SetVal(0x20); + Letterbox_SetSizeTarget(32); } } @@ -4536,7 +4536,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 damageResponseType, f32 sp if (!func_80837B18(play, this, 0 - this->actor.colChkInfo.damage)) { this->stateFlags2 &= ~PLAYER_STATE2_GRABBED_BY_ENEMY; - if (!(this->actor.bgCheckFlags & 1) && !(this->stateFlags1 & PLAYER_STATE1_IN_WATER)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->stateFlags1 & PLAYER_STATE1_IN_WATER)) { func_80837B9C(this, play); } return; @@ -4544,7 +4544,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 damageResponseType, f32 sp Player_SetIntangibility(this, invincibilityTimer); - if (damageResponseType == PLAYER_HIT_RESPONSE_ICE_TRAP) { + if (damageResponseType == PLAYER_HIT_RESPONSE_FROZEN) { Player_SetupAction(play, this, Player_Action_8084FB10, 0); anim = &gPlayerAnim_link_normal_ice_down; @@ -4554,7 +4554,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 damageResponseType, f32 sp Player_PlaySfx(this, NA_SE_PL_FREEZE_S); Player_PlayVoiceSfx(this, NA_SE_VO_LI_FREEZE); - } else if (damageResponseType == PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK) { + } else if (damageResponseType == PLAYER_HIT_RESPONSE_ELECTRIFIED) { Player_SetupAction(play, this, Player_Action_8084FBF4, 0); Player_RequestRumble(this, 255, 80, 150, 0); @@ -4576,7 +4576,8 @@ void func_80837C0C(PlayState* play, Player* this, s32 damageResponseType, f32 sp Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); } else if ((damageResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE) || - (damageResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL) || !(this->actor.bgCheckFlags & 1) || + (damageResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL) || + !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & (PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE | PLAYER_STATE1_CLIMBING_LADDER))) { Player_SetupAction(play, this, Player_Action_8084377C, 0); @@ -4614,7 +4615,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 damageResponseType, f32 sp } this->hoverBootsTimer = 0; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; } else { if ((this->linearVelocity > 4.0f) && !Player_CheckHostileLockOn(this)) { this->unk_890 = 20; @@ -4726,7 +4727,7 @@ s32 func_808382DC(Player* this, PlayState* play) { } else { sp68 = ((Player_GetHeight(this) - 8.0f) < (this->unk_6C4 * this->actor.scale.y)); - if (sp68 || (this->actor.bgCheckFlags & 0x100) || (sFloorType == 9) || + if (sp68 || (this->actor.bgCheckFlags & BGCHECKFLAG_CRUSHED) || (sFloorType == 9) || (this->stateFlags2 & PLAYER_STATE2_FORCED_VOID_OUT)) { Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); @@ -4759,7 +4760,7 @@ s32 func_808382DC(Player* this, PlayState* play) { } Player_PlayVoiceSfx(this, NA_SE_VO_LI_TAKEN_AWAY); - play->unk_11DE9 = 1; + play->haltAllActors = true; Sfx_PlaySfxCentered(NA_SE_OC_ABYSS); } else if ((this->knockbackType != PLAYER_KNOCKBACK_NONE) && ((this->knockbackType >= PLAYER_KNOCKBACK_LARGE) || (this->invincibilityTimer == 0))) { @@ -4771,7 +4772,7 @@ s32 func_808382DC(Player* this, PlayState* play) { func_80838280(this); - if (this->knockbackType == PLAYER_KNOCKBACK_LARGE_SHOCK) { + if (this->knockbackType == PLAYER_KNOCKBACK_LARGE_ELECTRIFIED) { this->bodyShockTimer = 40; } @@ -4827,7 +4828,7 @@ s32 func_808382DC(Player* this, PlayState* play) { } } - if (sp64 && (this->shieldQuad.info.acHitInfo->toucher.effect == 1)) { + if (sp64 && (this->shieldQuad.info.acHitInfo->toucher.effect == HIT_SPECIAL_EFFECT_FIRE)) { func_8083819C(this, play); } @@ -4850,11 +4851,11 @@ s32 func_808382DC(Player* this, PlayState* play) { if (this->stateFlags1 & PLAYER_STATE1_IN_WATER) { sp4C = PLAYER_HIT_RESPONSE_NONE; - } else if (this->actor.colChkInfo.acHitEffect == 2) { - sp4C = PLAYER_HIT_RESPONSE_ICE_TRAP; - } else if (this->actor.colChkInfo.acHitEffect == 3) { - sp4C = PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK; - } else if (this->actor.colChkInfo.acHitEffect == 4) { + } else if (this->actor.colChkInfo.acHitEffect == HIT_SPECIAL_EFFECT_ICE) { + sp4C = PLAYER_HIT_RESPONSE_FROZEN; + } else if (this->actor.colChkInfo.acHitEffect == HIT_SPECIAL_EFFECT_ELECTRIC) { + sp4C = PLAYER_HIT_RESPONSE_ELECTRIFIED; + } else if (this->actor.colChkInfo.acHitEffect == HIT_SPECIAL_EFFECT_KNOCKBACK) { sp4C = PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE; } else { func_80838280(this); @@ -4898,7 +4899,7 @@ void func_80838940(Player* this, LinkAnimationHeader* anim, f32 arg2, PlayState* this->actor.velocity.y = arg2 * sWaterSpeedFactor; this->hoverBootsTimer = 0; - this->actor.bgCheckFlags &= ~1; + this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; Player_PlayJumpingSfx(this); Player_PlayVoiceSfx(this, sfxId); @@ -4925,14 +4926,16 @@ s32 Player_ActionHandler_12(Player* this, PlayState* play) { if (func_808332B8(this)) { if (this->actor.yDistToWater < 50.0f) { - if ((this->ledgeClimbType < 2) || (this->yDistToLedge > this->ageProperties->unk_10)) { + if ((this->ledgeClimbType < PLAYER_LEDGE_CLIMB_2) || + (this->yDistToLedge > this->ageProperties->unk_10)) { return 0; } - } else if ((this->currentBoots != PLAYER_BOOTS_IRON) || (this->ledgeClimbType > 2)) { + } else if ((this->currentBoots != PLAYER_BOOTS_IRON) || (this->ledgeClimbType > PLAYER_LEDGE_CLIMB_2)) { return 0; } - } else if (!(this->actor.bgCheckFlags & 1) || ((this->ageProperties->unk_14 <= this->yDistToLedge) && - (this->stateFlags1 & PLAYER_STATE1_IN_WATER))) { + } else if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + ((this->ageProperties->unk_14 <= this->yDistToLedge) && + (this->stateFlags1 & PLAYER_STATE1_IN_WATER))) { return 0; } @@ -4994,7 +4997,8 @@ s32 Player_ActionHandler_12(Player* this, PlayState* play) { return 1; } - } else if ((this->actor.bgCheckFlags & 1) && (this->ledgeClimbType == 1) && (this->ledgeClimbDelayTimer >= 3)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->ledgeClimbType == 1) && + (this->ledgeClimbDelayTimer >= 3)) { temp = (this->yDistToLedge * 0.08f) + 5.5f; func_808389E8(this, &gPlayerAnim_link_normal_jump, temp, play); this->linearVelocity = 2.5f; @@ -5028,7 +5032,7 @@ void func_80838F5C(PlayState* play, Player* this) { this->stateFlags1 |= PLAYER_STATE1_IN_CUTSCENE | PLAYER_STATE1_FLOOR_DISABLED; - Camera_ChangeSetting(Play_GetCamera(play, 0), CAM_SET_FREE0); + Camera_RequestSetting(Play_GetCamera(play, CAM_ID_MAIN), CAM_SET_FREE0); } s32 func_80838FB8(PlayState* play, Player* this) { @@ -5107,7 +5111,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol exitIndex = 0; if (!(this->stateFlags1 & PLAYER_STATE1_DEAD) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && - (this->csAction == 0) && !(this->stateFlags1 & PLAYER_STATE1_LOADING) && + (this->csAction == PLAYER_CSACTION_NONE) && !(this->stateFlags1 & PLAYER_STATE1_LOADING) && (((poly != NULL) && (exitIndex = SurfaceType_GetSceneExitIndex(&play->colCtx, poly, bgId), exitIndex != 0)) || (func_8083816C(sFloorType) && (this->floorProperty == 12)))) { @@ -5115,7 +5119,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol sp34 = this->unk_A84 - (s32)this->actor.world.pos.y; if (!(this->stateFlags1 & (PLAYER_STATE1_ON_HORSE | PLAYER_STATE1_IN_WATER | PLAYER_STATE1_IN_CUTSCENE)) && - !(this->actor.bgCheckFlags & 1) && (sp34 < 100) && (sYDistToFloor > 100.0f)) { + !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (sp34 < 100) && (sYDistToFloor > 100.0f)) { return 0; } @@ -5153,7 +5157,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol Scene_SetTransitionForNextEntrance(play); } else { if (GameInteractor_Should(VB_SET_VOIDOUT_FROM_SURFACE, - SurfaceType_GetSlope(&play->colCtx, poly, bgId) == 2, + SurfaceType_GetFloorEffect(&play->colCtx, poly, bgId) == 2, play->setupExitList[exitIndex - 1])) { gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = play->nextEntranceIndex; if (GameInteractor_Should(VB_TRIGGER_VOIDOUT, true, this)) { @@ -5170,7 +5174,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol if (!(this->stateFlags1 & (PLAYER_STATE1_ON_HORSE | PLAYER_STATE1_IN_CUTSCENE)) && !(this->stateFlags2 & PLAYER_STATE2_CRAWLING) && !func_808332B8(this) && (temp = SurfaceType_GetFloorType(&play->colCtx, poly, bgId), (temp != 10)) && - ((sp34 < 100) || (this->actor.bgCheckFlags & 1))) { + ((sp34 < 100) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND))) { if (temp == 11) { Sfx_PlaySfxCentered2(NA_SE_OC_SECRET_HOLE_OUT); @@ -5199,14 +5203,14 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol func_80838E70(play, this, 400.0f, yaw); } } else { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Player_ZeroSpeedXZ(this); } } this->stateFlags1 |= PLAYER_STATE1_LOADING | PLAYER_STATE1_IN_CUTSCENE; - func_80835E44(play, 0x2F); + Player_RequestCameraSetting(play, CAM_SET_SCENE_TRANSITION); return 1; } else { @@ -5218,7 +5222,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol ((play->sceneNum != SCENE_SHADOW_TEMPLE) && (this->fallDistance > 200.0f)))) || ((play->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR) && (this->fallDistance > 320.0f))) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (this->floorProperty == 5) { Play_TriggerRespawn(play); } else if (GameInteractor_Should(VB_TRIGGER_VOIDOUT, true, this)) { @@ -5370,7 +5374,7 @@ s32 Player_ActionHandler_1(Player* this, PlayState* play) { if (doorShutter->dyna.actor.category == ACTORCAT_DOOR) { this->cv.slidingDoorBgCamIndex = - play->transiActorCtx.list[(u16)doorShutter->dyna.actor.params >> 10] + play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(&doorShutter->dyna.actor)] .sides[(doorDirection > 0) ? 0 : 1] .effects; @@ -5423,7 +5427,7 @@ s32 Player_ActionHandler_1(Player* this, PlayState* play) { doorDirection = -doorDirection; } - door->playerIsOpening = 1; + door->playerIsOpening = true; if (this->doorType != PLAYER_DOORTYPE_FAKE) { this->stateFlags1 |= PLAYER_STATE1_IN_CUTSCENE; @@ -5443,8 +5447,8 @@ s32 Player_ActionHandler_1(Player* this, PlayState* play) { gSaveContext.entranceSound = NA_SE_OC_DOOR_OPEN; } } else { - Camera_ChangeDoorCam(Play_GetCamera(play, 0), doorActor, - play->transiActorCtx.list[(u16)doorActor->params >> 10] + Camera_ChangeDoorCam(Play_GetCamera(play, CAM_ID_MAIN), doorActor, + play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(doorActor)] .sides[(doorDirection > 0) ? 0 : 1] .effects, 0, 38.0f * sInvWaterSpeedFactor, 26.0f * sInvWaterSpeedFactor, @@ -5454,8 +5458,9 @@ s32 Player_ActionHandler_1(Player* this, PlayState* play) { } if ((this->doorType != PLAYER_DOORTYPE_FAKE) && (doorActor->category == ACTORCAT_DOOR)) { - frontRoom = - play->transiActorCtx.list[(u16)doorActor->params >> 10].sides[(doorDirection > 0) ? 0 : 1].room; + frontRoom = play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(doorActor)] + .sides[(doorDirection > 0) ? 0 : 1] + .room; if ((frontRoom >= 0) && (frontRoom != play->roomCtx.curRoom.num)) { Room_RequestNewRoom(play, &play->roomCtx, frontRoom); @@ -5547,7 +5552,7 @@ void func_8083A0F4(PlayState* play, Player* this) { if (interactActorId == ACTOR_BG_TOKI_SWD) { this->interactRangeActor->parent = &this->actor; - Player_SetupAction(play, this, Player_Action_8084F608, 0); + Player_SetupAction(play, this, Player_Action_WaitForCutscene, 0); this->stateFlags1 |= PLAYER_STATE1_IN_CUTSCENE; if (!CVarGetInteger(CVAR_ENHANCEMENT("PersistentMasks"), 0) || !CVarGetInteger(CVAR_ENHANCEMENT("AdultMasks"), 0)) { @@ -5560,7 +5565,7 @@ void func_8083A0F4(PlayState* play, Player* this) { Player_SetupAction(play, this, Player_Action_80846120, 0); this->stateFlags1 |= PLAYER_STATE1_IN_CUTSCENE; anim = &gPlayerAnim_link_normal_heavy_carry; - } else if ((interactActorId == ACTOR_EN_ISHI) && ((interactRangeActor->params & 0xF) == 1)) { + } else if ((interactActorId == ACTOR_EN_ISHI) && (PARAMS_GET_U(interactRangeActor->params, 0, 4) == 1)) { Player_SetupAction(play, this, Player_Action_80846260, 0); anim = &gPlayerAnim_link_silver_carry; } else if (GameInteractor_Should(VB_PREVENT_STRENGTH, ((interactActorId == ACTOR_EN_BOMBF) || @@ -5766,7 +5771,7 @@ void func_8083AA10(Player* this, PlayState* play) { this->fallDistance = this->fallStartHeight - (s32)this->actor.world.pos.y; if (!(this->stateFlags1 & (PLAYER_STATE1_IN_WATER | PLAYER_STATE1_IN_CUTSCENE)) && - !(this->actor.bgCheckFlags & 1)) { + !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (!func_80838FB8(play, this)) { if (sPrevFloorProperty == 8) { this->actor.world.pos.x = this->actor.prevPos.x; @@ -5799,9 +5804,10 @@ void func_8083AA10(Player* this, PlayState* play) { this->floorSfxOffset = this->prevFloorSfxOffset; - if ((this->actor.bgCheckFlags & 4) && !(this->stateFlags1 & PLAYER_STATE1_IN_WATER) && - (sPrevFloorProperty != 6) && (sPrevFloorProperty != 9) && (sYDistToFloor > 20.0f) && - (this->meleeWeaponState == 0) && (ABS(sp5C) < 0x2000) && (this->linearVelocity > 3.0f)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_LEAVE) && + !(this->stateFlags1 & PLAYER_STATE1_IN_WATER) && (sPrevFloorProperty != 6) && + (sPrevFloorProperty != 9) && (sYDistToFloor > 20.0f) && (this->meleeWeaponState == 0) && + (ABS(sp5C) < 0x2000) && (this->linearVelocity > 3.0f)) { if ((sPrevFloorProperty == 11) && !(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR)) { @@ -5929,7 +5935,7 @@ void func_8083AF44(PlayState* play, Player* this, s32 magicSpell) { if (magicSpell == 5) { this->subCamId = OnePointCutscene_Init(play, 1100, -101, NULL, CAM_ID_MAIN); } else { - func_80835EA4(play, 10); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_10); } } @@ -5984,8 +5990,8 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) { GetItemEntry giEntry; Actor* talkActor; - if ((this->unk_6AD != 0) && - (func_808332B8(this) || (this->actor.bgCheckFlags & 1) || (this->stateFlags1 & PLAYER_STATE1_ON_HORSE))) { + if ((this->unk_6AD != 0) && (func_808332B8(this) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (this->stateFlags1 & PLAYER_STATE1_ON_HORSE))) { if (!Player_StartCsAction(play, this)) { if (this->unk_6AD == 4) { @@ -5997,7 +6003,7 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) { Player_SetupAction(play, this, Player_Action_8085063C, 1); this->stateFlags1 |= PLAYER_STATE1_IN_ITEM_CS | PLAYER_STATE1_IN_CUTSCENE; Player_AnimPlayOnce(play, this, Player_GetIdleAnim(this)); - func_80835EA4(play, 4); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_4); } func_80832224(this); @@ -6057,11 +6063,11 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) { } else if (sp2C == EXCH_ITEM_LETTER_RUTO) { this->av1.actionVar1 = 1; this->actor.textId = 0x4005; - func_80835EA4(play, 1); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_1); } else { this->av1.actionVar1 = 2; this->actor.textId = 0xCF; - func_80835EA4(play, 4); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_4); } this->actor.flags |= ACTOR_FLAG_TALK; @@ -6084,21 +6090,21 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) { if (sp2C == 0xC) { Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EED8, 0); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_bug_out); - func_80835EA4(play, 3); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_3); } else if ((sp2C > 0) && (sp2C < 4)) { Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EFC0, 0); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_fish_out); - func_80835EA4(play, (sp2C == 1) ? 1 : 5); + Player_SetTurnAroundCamera(play, (sp2C == 1) ? CAM_ITEM_TYPE_1 : CAM_ITEM_TYPE_5); } else { Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EAC0, 0); Player_AnimChangeOnceMorphAdjusted(play, this, &gPlayerAnim_link_bottle_drink_demo_start); - func_80835EA4(play, 2); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_2); } } else { Player_SetupActionPreserveItemAction(play, this, Player_Action_8084E3C4, 0); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_normal_okarina_start); this->stateFlags2 |= PLAYER_STATE2_OCARINA_PLAYING; - func_80835EA4(play, (this->unk_6A8 != NULL) ? 0x5B : 0x5A); + Player_SetTurnAroundCamera(play, (this->unk_6A8 != NULL) ? CAM_ITEM_TYPE_91 : CAM_ITEM_TYPE_90); if (this->unk_6A8 != NULL) { this->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR; Camera_SetParam(Play_GetCamera(play, 0), 8, this->unk_6A8); @@ -6168,7 +6174,7 @@ s32 Player_ActionHandler_Talk(Player* this, PlayState* play) { ((this->heldActor != NULL) && (forceTalkToNavi || (talkOfferActor == this->heldActor) || (cUpTalkActor == this->heldActor) || ((talkOfferActor != NULL) && (talkOfferActor->flags & ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED))))) { - if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & PLAYER_STATE1_ON_HORSE) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & PLAYER_STATE1_ON_HORSE) || (func_808332B8(this) && !(this->stateFlags2 & PLAYER_STATE2_UNDERWATER))) { if (talkOfferActor != NULL) { @@ -6228,7 +6234,7 @@ s32 Player_ActionHandler_Talk(Player* this, PlayState* play) { s32 func_8083B8F4(Player* this, PlayState* play) { if (!(this->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_ON_HORSE)) && Camera_CheckValidMode(Play_GetCamera(play, 0), 6)) { - if ((this->actor.bgCheckFlags & 1) || + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (func_808332B8(this) && (this->actor.yDistToWater < this->ageProperties->unk_2C))) { this->unk_6AD = 1; return 1; @@ -6334,7 +6340,7 @@ s32 Player_ActionHandler_10(Player* this, PlayState* play) { if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && (sFloorType != 7) && - (SurfaceType_GetSlope(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) != 1)) { + (SurfaceType_GetFloorEffect(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) != 1)) { controlStickDirection = this->controlStickDirections[this->controlStickDataIndex]; if (controlStickDirection <= PLAYER_STICK_DIR_FORWARD) { @@ -6543,8 +6549,8 @@ s32 Player_ActionHandler_8(Player* this, PlayState* play) { } s32 func_8083C61C(PlayState* play, Player* this) { - if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && (this->actor.bgCheckFlags & 1) && - (AMMO(ITEM_NUT) != 0)) { + if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (AMMO(ITEM_NUT) != 0)) { Player_SetupAction(play, this, Player_Action_8084E604, 0); Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_light_bom); this->unk_6AD = 0; @@ -6589,7 +6595,7 @@ s32 func_8083C6B8(PlayState* play, Player* this) { if (CVarGetInteger(CVAR_ENHANCEMENT("HoverFishing"), 0) ? 0 - : !(this->actor.bgCheckFlags & 1) || (this->actor.world.pos.z > 1300.0f) || + : !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.world.pos.z > 1300.0f) || BgCheck_SphVsFirstPoly(&play->colCtx, &rodCheckPos, 20.0f)) { Sfx_PlaySfxCentered(NA_SE_SY_ERROR); return 0; @@ -6873,7 +6879,7 @@ void func_8083D330(PlayState* play, Player* this) { } void func_8083D36C(PlayState* play, Player* this) { - if ((this->currentBoots != PLAYER_BOOTS_IRON) || !(this->actor.bgCheckFlags & 1)) { + if ((this->currentBoots != PLAYER_BOOTS_IRON) || !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_80832564(play, this); if ((this->currentBoots != PLAYER_BOOTS_IRON) && (this->stateFlags2 & PLAYER_STATE2_UNDERWATER)) { @@ -6886,8 +6892,9 @@ void func_8083D36C(PlayState* play, Player* this) { } else { Player_SetupAction(play, this, Player_Action_8084D610, 1); Player_AnimChangeOnceMorph(play, this, - (this->actor.bgCheckFlags & 1) ? &gPlayerAnim_link_swimer_wait2swim_wait - : &gPlayerAnim_link_swimer_land2swim_wait); + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) + ? &gPlayerAnim_link_swimer_wait2swim_wait + : &gPlayerAnim_link_swimer_land2swim_wait); } } @@ -6923,7 +6930,7 @@ void func_8083D53C(PlayState* play, Player* this) { if ((Player_Action_80845668 != this->actionFunc) && (Player_Action_8084BDFC != this->actionFunc)) { if (this->ageProperties->unk_2C < this->actor.yDistToWater) { if (!(this->stateFlags1 & PLAYER_STATE1_IN_WATER) || - (!((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & 1)) && + (!((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) && (Player_Action_8084E30C != this->actionFunc) && (Player_Action_8084E368 != this->actionFunc) && (Player_Action_8084D610 != this->actionFunc) && (Player_Action_8084D84C != this->actionFunc) && (Player_Action_8084DAB4 != this->actionFunc) && (Player_Action_8084DC48 != this->actionFunc) && @@ -7022,7 +7029,7 @@ void func_8083D6EC(PlayState* play, Player* this) { s32 numBubbles = 0; s32 i; - if ((this->actor.velocity.y > -1.0f) || (this->actor.bgCheckFlags & 1)) { + if ((this->actor.velocity.y > -1.0f) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (Rand_ZeroOne() < 0.2f) { numBubbles = 1; } @@ -7210,7 +7217,7 @@ s32 Player_HandleSlopes(PlayState* play, Player* this, CollisionPoly* floorPoly) s16 velYawToDownwardSlope; if (!Player_InBlockingCsMode(play, this) && (Player_Action_SlideOnSlope != this->actionFunc) && - (SurfaceType_GetSlope(&play->colCtx, floorPoly, this->actor.floorBgId) == 1)) { + (SurfaceType_GetFloorEffect(&play->colCtx, floorPoly, this->actor.floorBgId) == 1)) { // Get direction of movement relative to the downward direction of the slope playerVelYaw = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); Player_GetSlopeDirection(floorPoly, &slopeNormal, &downwardSlopeYaw); @@ -7342,7 +7349,7 @@ s32 Player_ActionHandler_2(Player* this, PlayState* play) { if (!(this->stateFlags2 & PLAYER_STATE2_UNDERWATER) || (this->currentBoots == PLAYER_BOOTS_IRON)) { Player_SetupWaitForPutAway(play, this, func_8083A434); Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_demo_get_itemB); - func_80835EA4(play, 9); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_9); } this->stateFlags1 |= @@ -7397,7 +7404,7 @@ s32 Player_ActionHandler_2(Player* this, PlayState* play) { Player_AnimPlayOnceAdjusted(play, this, this->ageProperties->unk_98); Player_StartAnimMovement(play, this, 0x28F); chest->unk_1F4 = 1; - Camera_ChangeSetting(Play_GetCamera(play, 0), CAM_SET_SLOW_CHEST_CS); + Camera_RequestSetting(Play_GetCamera(play, 0), CAM_SET_SLOW_CHEST_CS); } else { Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_box_kick); chest->unk_1F4 = -1; @@ -7555,7 +7562,7 @@ s32 func_8083EC18(Player* this, PlayState* play, u32 wallFlags) { if ((sp8C != 0) || (wallFlags & 2)) { if ((this->av1.actionVar1 = sp8C) != 0) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { anim = &gPlayerAnim_link_normal_Fclimb_startA; } else { anim = &gPlayerAnim_link_normal_Fclimb_hold2upL; @@ -7734,7 +7741,7 @@ s32 func_8083F524(PlayState* play, Player* this) { s32 Player_TryLeavingCrawlspace(Player* this, PlayState* play) { s16 yawToWall; - if ((this->linearVelocity != 0.0f) && (this->actor.bgCheckFlags & 8) && (sTouchedWallFlags & 0x30)) { + if ((this->linearVelocity != 0.0f) && (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) && (sTouchedWallFlags & 0x30)) { // The exit wallYaws will always point inward on the crawlline // Interacting with the exit wall in front will have a yaw diff of 0x8000 @@ -7789,8 +7796,8 @@ void func_8083F72C(Player* this, LinkAnimationHeader* anim, PlayState* play) { s32 Player_ActionHandler_5(Player* this, PlayState* play) { DynaPolyActor* wallPolyActor; - if (!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->actor.bgCheckFlags & 0x200) && - (sShapeYawToTouchedWall < 0x3000)) { + if (!(this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && + (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (sShapeYawToTouchedWall < 0x3000)) { if (((this->linearVelocity > 0.0f) && func_8083EC18(this, play, sTouchedWallFlags)) || Player_TryEnteringCrawlspace(this, play, sTouchedWallFlags)) { @@ -7799,7 +7806,8 @@ s32 Player_ActionHandler_5(Player* this, PlayState* play) { if (!func_808332B8(this) && ((this->linearVelocity == 0.0f) || !(this->stateFlags2 & PLAYER_STATE2_DO_ACTION_CLIMB)) && - (sTouchedWallFlags & 0x40) && (this->actor.bgCheckFlags & 1) && (this->yDistToLedge >= 39.0f)) { + (sTouchedWallFlags & 0x40) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (this->yDistToLedge >= 39.0f)) { this->stateFlags2 |= PLAYER_STATE2_DO_ACTION_GRAB; @@ -7840,7 +7848,7 @@ s32 Player_ActionHandler_5(Player* this, PlayState* play) { } s32 func_8083F9D0(PlayState* play, Player* this) { - if ((this->actor.bgCheckFlags & 0x200) && + if ((this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && ((this->stateFlags2 & PLAYER_STATE2_MOVING_DYNAPOLY) || CHECK_BTN_ALL(sControlInput->cur.button, BTN_A))) { DynaPolyActor* wallPolyActor = NULL; @@ -7882,7 +7890,8 @@ void func_8083FB7C(Player* this, PlayState* play) { } s32 func_8083FBC0(Player* this, PlayState* play) { - if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (this->actor.bgCheckFlags & 0x200) && + if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && + (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && ((sTouchedWallFlags & 8) || (sTouchedWallFlags & 2) || func_80041E4C(&play->colCtx, this->actor.wallPoly, this->actor.wallBgId))) { return false; @@ -8060,7 +8069,8 @@ void func_8084029C(Player* this, f32 arg1) { arg1 = 7.25f; } - if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & 1) && (this->hoverBootsTimer != 0)) { + if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (this->hoverBootsTimer != 0)) { Actor_PlaySfx_Flagged2(&this->actor, NA_SE_PL_HOBBERBOOTS_LV - SFX_FLAG); } else if (func_8084021C(this->unk_868, arg1, 29.0f, 10.0f) || func_8084021C(this->unk_868, arg1, 29.0f, 24.0f)) { Player_PlaySteppingSfx(this, this->linearVelocity); @@ -9203,8 +9213,7 @@ s32 func_80842DF4(PlayState* play, Player* this) { if (this->actor.colChkInfo.atHitEffect == 1) { this->actor.colChkInfo.damage = 8; - func_80837C0C(play, this, PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK, 0.0f, 0.0f, this->actor.shape.rot.y, - 20); + func_80837C0C(play, this, PLAYER_HIT_RESPONSE_ELECTRIFIED, 0.0f, 0.0f, this->actor.shape.rot.y, 20); return 1; } } @@ -9373,7 +9382,7 @@ void Player_Action_8084377C(Player* this, PlayState* play) { } } - if (LinkAnimation_Update(play, &this->skelAnime) && (this->actor.bgCheckFlags & 1)) { + if (LinkAnimation_Update(play, &this->skelAnime) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->av2.actionVar2 != 0) { this->av2.actionVar2--; if (this->av2.actionVar2 == 0) { @@ -9395,7 +9404,7 @@ void Player_Action_8084377C(Player* this, PlayState* play) { } } - if (this->actor.bgCheckFlags & 2) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { Player_PlayFloorSfx(this, NA_SE_PL_BOUND); } } @@ -9427,7 +9436,7 @@ static AnimSfxEntry D_808545DC[] = { }; void Player_Action_80843A38(Player* this, PlayState* play) { - s32 sp24; + s32 interruptResult; this->stateFlags2 |= PLAYER_STATE2_DISABLE_ROTATION_Z_TARGET; func_808382BC(this); @@ -9435,8 +9444,8 @@ void Player_Action_80843A38(Player* this, PlayState* play) { if (this->stateFlags1 & PLAYER_STATE1_IN_CUTSCENE) { LinkAnimation_Update(play, &this->skelAnime); } else { - sp24 = Player_TryActionInterrupt(play, this, &this->skelAnime, 16.0f); - if ((sp24 != 0) && (LinkAnimation_Update(play, &this->skelAnime) || (sp24 > 0))) { + interruptResult = Player_TryActionInterrupt(play, this, &this->skelAnime, 16.0f); + if ((interruptResult != 0) && (LinkAnimation_Update(play, &this->skelAnime) || (interruptResult > 0))) { func_80839F90(this, play); } } @@ -9471,7 +9480,7 @@ void func_80843AE8(PlayState* play, Player* this) { } this->unk_A87 = 20; Player_SetInvulnerability(this, -20); - func_800F47FC(); + Audio_SetBgmVolumeOnDuringFanfare(); } } else if (this->av1.actionVar1 != 0) { this->av2.actionVar2 = 60; @@ -9534,23 +9543,23 @@ static FallImpactInfo D_80854600[] = { }; s32 func_80843E64(PlayState* play, Player* this) { - s32 sp34; + s32 fallDistance; if (!GameInteractor_Should(VB_RECIEVE_FALL_DAMAGE, true, this)) { return 0; } if ((sFloorType == 6) || (sFloorType == 9)) { - sp34 = 0; + fallDistance = 0; } else { - sp34 = this->fallDistance; + fallDistance = this->fallDistance; } Math_StepToF(&this->linearVelocity, 0.0f, 1.0f); this->stateFlags1 &= ~(PLAYER_STATE1_JUMPING | PLAYER_STATE1_FREEFALL); - if (sp34 >= 400) { + if (fallDistance >= 400) { s32 impactIndex; FallImpactInfo* impactInfo; @@ -9577,14 +9586,14 @@ s32 func_80843E64(PlayState* play, Player* this) { return impactIndex + 1; } - if (sp34 > 200) { - sp34 *= 2; + if (fallDistance > 200) { + fallDistance *= 2; - if (sp34 > 255) { - sp34 = 255; + if (fallDistance > 255) { + fallDistance = 255; } - Player_RequestRumble(this, (u8)sp34, (u8)(sp34 * 0.1f), (u8)sp34, 0); + Player_RequestRumble(this, (u8)fallDistance, (u8)(fallDistance * 0.1f), (u8)fallDistance, 0); if (sFloorType == 6) { Player_PlayVoiceSfx(this, NA_SE_VO_LI_CLIMB_END); @@ -9621,7 +9630,7 @@ void Player_Action_8084411C(Player* this, PlayState* play) { Player_GetMovementSpeedAndYaw(this, &sp4C, &sp4A, SPEED_MODE_LINEAR, play); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) { Actor* heldActor = this->heldActor; @@ -9647,7 +9656,8 @@ void Player_Action_8084411C(Player* this, PlayState* play) { !func_8083BBA0(this, play)) { if (this->actor.velocity.y < 0.0f) { if (this->av2.actionVar2 >= 0) { - if ((this->actor.bgCheckFlags & 8) || (this->av2.actionVar2 == 0) || (this->fallDistance > 0)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) || (this->av2.actionVar2 == 0) || + (this->fallDistance > 0)) { if ((sYDistToFloor > 800.0f) || (this->stateFlags1 & PLAYER_STATE1_HOOKSHOT_FALLING)) { func_80843E14(this, NA_SE_VO_LI_FALL_S); this->stateFlags1 &= ~PLAYER_STATE1_HOOKSHOT_FALLING; @@ -9663,7 +9673,8 @@ void Player_Action_8084411C(Player* this, PlayState* play) { func_80843E14(this, NA_SE_VO_LI_FALL_L); } - if (!GameInteractor_GetDisableLedgeGrabsActive() && (this->actor.bgCheckFlags & 0x200) && + if (!GameInteractor_GetDisableLedgeGrabsActive() && + (this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && !(this->stateFlags2 & PLAYER_STATE2_HOPPING) && !(this->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_IN_WATER)) && (this->linearVelocity > 0.0f)) { @@ -9766,7 +9777,9 @@ void Player_Action_Roll(Player* this, PlayState* play) { // Must have a speed of 7 or above to be able to bonk into something if (this->linearVelocity >= 7.0f) { bool randomBonk = GameInteractor_GetRandomBonksActive() && (Rand_ZeroOne() <= .05); - if (randomBonk || ((this->actor.bgCheckFlags & 0x200) && (sWorldYawToTouchedWall < 0x2000)) || + if (randomBonk || + ((this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && + (sWorldYawToTouchedWall < 0x2000)) || ((this->cylinder.base.ocFlags1 & OC1_HIT) && (ocCollidedActor = this->cylinder.base.oc, ((ocCollidedActor->id == ACTOR_EN_WOOD02) && @@ -9844,7 +9857,7 @@ void Player_Action_80844A44(Player* this, PlayState* play) { Math_StepToF(&this->linearVelocity, 0.0f, 0.05f); - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.colChkInfo.damage = 0x10; func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, 4.0f, 5.0f, this->actor.shape.rot.y, 20); } @@ -9862,7 +9875,7 @@ void Player_Action_80844AF4(Player* this, PlayState* play) { if (!func_80842DF4(play, this)) { func_8084285C(this, 6.0f, 7.0f, 99.0f); - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); func_8083DFE0(this, &speedTarget, &this->yaw); return; @@ -11013,7 +11026,7 @@ void Player_UpdateInterface(PlayState* play, Player* this) { doAction = DO_ACTION_ENTER; } else if ((this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) && (this->getItemId == GI_NONE) && (heldActor != NULL)) { - if ((this->actor.bgCheckFlags & 1) || (heldActor->id == ACTOR_EN_NIW)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (heldActor->id == ACTOR_EN_NIW)) { if (func_8083EAF0(this, heldActor) == 0) { doAction = DO_ACTION_DROP; } else { @@ -11105,11 +11118,11 @@ s32 Player_UpdateHoverBoots(Player* this) { (this->currentBoots == PLAYER_BOOTS_HOVER) && ((this->actor.yDistToWater >= 0.0f) || (func_80838144(sFloorType) >= 0) || func_8083816C(sFloorType)); - if (canHoverOnGround && (this->actor.bgCheckFlags & 1) && (this->hoverBootsTimer != 0)) { + if (canHoverOnGround && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (this->hoverBootsTimer != 0)) { this->actor.bgCheckFlags &= ~1; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (!canHoverOnGround) { this->hoverBootsTimer = 19; } @@ -11235,7 +11248,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { sIsFloorConveyor = SurfaceType_IsConveyor(&play->colCtx, floorPoly, this->actor.floorBgId); if (((sIsFloorConveyor == 0) && (this->actor.yDistToWater > 20.0f) && (this->currentBoots != PLAYER_BOOTS_IRON)) || - ((sIsFloorConveyor != 0) && (this->actor.bgCheckFlags & 1))) { + ((sIsFloorConveyor != 0) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND))) { sConveyorYaw = SurfaceType_GetConveyorDirection(&play->colCtx, floorPoly, this->actor.floorBgId) << 10; } else { sConveyorSpeed = 0; @@ -11247,7 +11260,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { this->actor.bgCheckFlags &= ~0x200; - if (this->actor.bgCheckFlags & 8) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { CollisionPoly* wallPoly; s32 wallBgId; s16 yawDiff; @@ -11283,7 +11296,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { vSpeedScale = sWorldYawToTouchedWall * 0.00008f; - if (!(this->actor.bgCheckFlags & 1) || vSpeedScale >= 1.0f) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || vSpeedScale >= 1.0f) { this->unk_880 = R_RUN_SPEED_LIMIT / 100.0f; } else { vSpeedLimit = (R_RUN_SPEED_LIMIT / 100.0f * vSpeedScale); @@ -11294,7 +11307,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { } } - if ((this->actor.bgCheckFlags & 0x200) && (sShapeYawToTouchedWall < 0x3000)) { + if ((this->actor.bgCheckFlags & BGCHECKFLAG_PLAYER_WALL_INTERACT) && (sShapeYawToTouchedWall < 0x3000)) { CollisionPoly* wallPoly = this->actor.wallPoly; if (GameInteractor_Should(VB_SURFACE_ANGLE_IS_CLIMBABLE, ABS(wallPoly->normal.y) < 600)) { @@ -11371,7 +11384,7 @@ void Player_ProcessSceneCollision(PlayState* play, Player* this) { this->ledgeClimbDelayTimer = 0; } - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { if (GameInteractor_Should(VB_SET_STATIC_FLOOR_TYPE, true, this)) { sFloorType = SurfaceType_GetFloorType(&play->colCtx, floorPoly, this->actor.floorBgId); } @@ -11813,7 +11826,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { } if (this->stateFlags2 & PLAYER_STATE2_PAUSE_MOST_UPDATING) { - if (!(this->actor.bgCheckFlags & 1)) { + if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Player_ZeroSpeedXZ(this); Actor_MoveXZGravity(&this->actor); } @@ -11833,7 +11846,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { } } else { if (this->stateFlags1 & PLAYER_STATE1_IN_WATER) { - if ((this->prevBoots == PLAYER_BOOTS_IRON) || (this->actor.bgCheckFlags & 1)) { + if ((this->prevBoots == PLAYER_BOOTS_IRON) || (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { func_8083D36C(play, this); this->stateFlags2 &= ~PLAYER_STATE2_UNDERWATER; } @@ -11874,7 +11887,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { } if (!(this->skelAnime.movementFlags & 0x80)) { - if (((this->actor.bgCheckFlags & 1) && (sFloorType == 5) && (this->currentBoots != PLAYER_BOOTS_IRON)) || + if (((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (sFloorType == 5) && + (this->currentBoots != PLAYER_BOOTS_IRON)) || ((this->currentBoots == PLAYER_BOOTS_HOVER || GameInteractor_GetSlipperyFloorActive()) && !(this->stateFlags1 & (PLAYER_STATE1_IN_WATER | PLAYER_STATE1_IN_CUTSCENE)))) { f32 sp70 = this->linearVelocity; @@ -11983,7 +11997,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { (PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LEDGE | PLAYER_STATE1_CLIMBING_LADDER)) { func_80832440(play, this); func_80837B9C(this, play); - } else if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & PLAYER_STATE1_IN_WATER)) { + } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || + (this->stateFlags1 & PLAYER_STATE1_IN_WATER)) { func_80836448(play, this, func_808332B8(this) ? &gPlayerAnim_link_swimer_swim_down : (this->bodyShockTimer != 0) ? &gPlayerAnim_link_normal_electric_shock_end @@ -12359,7 +12374,7 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, Matrix_Pop(); } - if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & 1) && + if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && !(this->stateFlags1 & PLAYER_STATE1_ON_HORSE) && (this->hoverBootsTimer != 0)) { s32 sp5C; s32 hoverBootsTimer = this->hoverBootsTimer; @@ -13715,7 +13730,7 @@ void Player_Action_8084D3E4(Player* this, PlayState* play) { gSaveContext.horseData.angle = rideActor->actor.shape.rot.y; } } else { - Camera_ChangeSetting(Play_GetCamera(play, 0), CAM_SET_NORMAL0); + Camera_RequestSetting(Play_GetCamera(play, 0), CAM_SET_NORMAL0); if (this->mountSide < 0) { D_808549C4[0].data = ANIMSFX_DATA(ANIMSFX_TYPE_LANDING, 40); @@ -13763,7 +13778,7 @@ void Player_Action_8084D610(Player* this, PlayState* play) { sp34 = 0.0f; sp32 = this->actor.shape.rot.y; - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { func_8083A098(this, GET_PLAYER_ANIM(PLAYER_ANIMGROUP_short_landing, this->modelAnimType), play); Player_PlayLandingSfx(this); } @@ -13931,7 +13946,8 @@ void Player_Action_8084DC48(Player* this, PlayState* play) { this->unk_6C2 = 16000; if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) && !Player_ActionHandler_2(this, play) && - !(this->actor.bgCheckFlags & 1) && (this->actor.yDistToWater < D_80854784[CUR_UPG_VALUE(UPG_SCALE)])) { + !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && + (this->actor.yDistToWater < D_80854784[CUR_UPG_VALUE(UPG_SCALE)])) { func_8084DBC4(play, this, -2.0f); } else { this->av1.actionVar1++; @@ -14123,7 +14139,7 @@ void Player_Action_8084E1EC(Player* this, PlayState* play) { if ((this->stateFlags1 & PLAYER_STATE1_GETTING_ITEM) && LinkAnimation_OnFrame(&this->skelAnime, 10.0f)) { func_808332F4(this, play); func_80832340(play, this); - func_80835EA4(play, 8); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_8); } else if (LinkAnimation_OnFrame(&this->skelAnime, 5.0f)) { Player_PlayVoiceSfx(this, NA_SE_VO_LI_BREATH_DRINK); } @@ -14266,6 +14282,7 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) { } } else { Player_FinishAnimMovement(this); + if ((this->getItemId == GI_ICE_TRAP && !IS_RANDO) || (IS_RANDO && (this->getItemId == RG_ICE_TRAP || this->getItemEntry.getItemId == RG_ICE_TRAP))) { this->stateFlags1 &= ~(PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_CARRYING_ACTOR); @@ -14281,7 +14298,7 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) { func_8083C0E8(this, play); } else { this->actor.colChkInfo.damage = 0; - func_80837C0C(play, this, PLAYER_HIT_RESPONSE_ICE_TRAP, 0.0f, 0.0f, 0, 20); + func_80837C0C(play, this, PLAYER_HIT_RESPONSE_FROZEN, 0.0f, 0.0f, 0, 20); } return; } @@ -14293,7 +14310,7 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) { } this->av2.actionVar2 = 2; - func_80835EA4(play, 9); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_9); } } else { if (this->av2.actionVar2 == 0) { @@ -14491,7 +14508,7 @@ void Player_Action_SwingBottle(Player* this, PlayState* play) { Player_UpdateBottleHeld(play, this, catchInfo->itemId, ABS(catchInfo->itemAction)); if (!CVarGetInteger(CVAR_ENHANCEMENT("FastBottles"), 0)) { Player_AnimPlayOnceAdjusted(play, this, swingEntry->catchAnimation); - func_80835EA4(play, 4); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_4); } } } @@ -14674,7 +14691,7 @@ void Player_Action_SlideOnSlope(Player* this, PlayState* play) { xzSpeedIncrStep = SQ(xzSpeedTarget) * 0.015f; xzSpeedDecrStep = slopeNormal.y * 0.01f; - if (SurfaceType_GetSlope(&play->colCtx, floorPoly, this->actor.floorBgId) != 1) { + if (SurfaceType_GetFloorEffect(&play->colCtx, floorPoly, this->actor.floorBgId) != 1) { xzSpeedTarget = 0; xzSpeedDecrStep = slopeNormal.y * 10.0f; } @@ -14700,7 +14717,7 @@ void Player_Action_SlideOnSlope(Player* this, PlayState* play) { } } -void Player_Action_8084F608(Player* this, PlayState* play) { +void Player_Action_WaitForCutscene(Player* this, PlayState* play) { if ((DECR(this->av2.actionVar2) == 0) && Player_StartCsAction(play, this)) { func_80852280(play, this, NULL); Player_SetupAction(play, this, Player_Action_CsAction, 0); @@ -14709,7 +14726,7 @@ void Player_Action_8084F608(Player* this, PlayState* play) { } void Player_Action_8084F698(Player* this, PlayState* play) { - Player_SetupAction(play, this, Player_Action_8084F608, 0); + Player_SetupAction(play, this, Player_Action_WaitForCutscene, 0); this->av2.actionVar2 = 40; Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_KANKYO, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0x10); } @@ -14723,7 +14740,7 @@ void Player_Action_8084F710(Player* this, PlayState* play) { } else if (sYDistToFloor < 150.0f) { if (LinkAnimation_Update(play, &this->skelAnime)) { if (this->av2.actionVar2 == 0) { - if (this->actor.bgCheckFlags & 1) { + if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->skelAnime.endFrame = this->skelAnime.animLength - 1.0f; Player_PlayLandingSfx(this); this->av2.actionVar2 = 1; @@ -15956,7 +15973,8 @@ void func_80851BE8(PlayState* play, Player* this, CsCmdActorCue* cue) { } void func_80851CA4(PlayState* play, Player* this, CsCmdActorCue* cue) { - if (LinkAnimation_Update(play, &this->skelAnime) && (this->av2.actionVar2 == 0) && (this->actor.bgCheckFlags & 1)) { + if (LinkAnimation_Update(play, &this->skelAnime) && (this->av2.actionVar2 == 0) && + (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { Player_AnimPlayOnce(play, this, &gPlayerAnim_link_normal_back_downB); this->av2.actionVar2 = 1; } @@ -16569,6 +16587,6 @@ void Player_StartTalking(PlayState* play, Actor* actor) { if ((this->naviActor == this->talkActor) && ((this->talkActor->textId & 0xFF00) != 0x200)) { this->naviActor->flags |= ACTOR_FLAG_TALK; - func_80835EA4(play, 0xB); + Player_SetTurnAroundCamera(play, CAM_ITEM_TYPE_11); } } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 63a69358fd..c335dd6054 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -2542,7 +2542,7 @@ void FileChoose_LoadGame(GameState* thisx) { gSaveContext.eventInf[1] = 0; gSaveContext.eventInf[2] = 0; gSaveContext.eventInf[3] = 0; - gSaveContext.unk_13EE = 0x32; + gSaveContext.prevHudVisibilityMode = 0x32; gSaveContext.nayrusLoveTimer = 0; gSaveContext.healthAccumulator = 0; gSaveContext.magicState = MAGIC_STATE_IDLE; @@ -2560,8 +2560,8 @@ void FileChoose_LoadGame(GameState* thisx) { gSaveContext.buttonStatus[buttonIndex] = BTN_ENABLED; } - gSaveContext.forceRisingButtonAlphas = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = - gSaveContext.magicCapacity = 0; + gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = + gSaveContext.hudVisibilityModeTimer = gSaveContext.magicCapacity = 0; gSaveContext.magicFillTarget = gSaveContext.magic; gSaveContext.magic = 0; @@ -3062,7 +3062,7 @@ void FileChoose_InitContext(GameState* thisx) { this->bossRushOffset = 0; this->randomizerIndex = 0; - ShrinkWindow_SetVal(0); + Letterbox_SetSizeTarget(0); gSaveContext.skyboxTime = 0; gSaveContext.dayTime = 0; diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index 2be2df5f4f..8f85b5c027 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -38,7 +38,8 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) { for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) { gSaveContext.buttonStatus[buttonIndex] = BTN_ENABLED; } - gSaveContext.forceRisingButtonAlphas = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0; + gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = + gSaveContext.hudVisibilityModeTimer = 0; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP); gSaveContext.entranceIndex = entranceIndex; @@ -98,7 +99,8 @@ void Select_Grotto_LoadGame(SelectContext* this, s32 grottoIndex) { for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) { gSaveContext.buttonStatus[buttonIndex] = BTN_ENABLED; } - gSaveContext.forceRisingButtonAlphas = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0; + gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = + gSaveContext.hudVisibilityModeTimer = 0; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP); // Entrance index and grotto content data to load the correct grotto and actors gSaveContext.entranceIndex = this->betterGrottos[grottoIndex].entranceIndex; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index ade62acc3e..86b8c59b46 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -205,7 +205,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { } D_8082A11C = 0; - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); func_800ECC04((1 << pauseCtx->ocarinaSongIdx) + 0x8000); pauseCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff(); pauseCtx->ocarinaStaff->pos = 0; @@ -216,13 +216,13 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { VREG(24) = -46; VREG(25) = -41; pauseCtx->unk_1E4 = 8; - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); } } } else if (pauseCtx->unk_1E4 == 5) { if ((pauseCtx->stickRelX != 0) || (pauseCtx->stickRelY != 0)) { pauseCtx->unk_1E4 = 0; - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); } } else if (pauseCtx->unk_1E4 == 8) { if (CHECK_BTN_ALL(input->press.button, BTN_A) && (sp216 >= QUEST_SONG_MINUET) && @@ -292,8 +292,8 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { VREG(24) = -46; VREG(25) = -41; sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; - Audio_OcaSetInstrument(1); - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); + AudioOcarina_SetInstrument(1); pauseCtx->ocarinaSongIdx = gOcarinaSongItemMap[sp216 - QUEST_SONG_MINUET]; Audio_OcaSetSongPlayback(pauseCtx->ocarinaSongIdx + 1, 1); pauseCtx->unk_1E4 = 2; @@ -721,7 +721,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { } D_8082A11C = 0; - Audio_OcaSetInstrument(1); + AudioOcarina_SetInstrument(1); func_800ECC04((1 << pauseCtx->ocarinaSongIdx) + 0x8000); pauseCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff(); pauseCtx->ocarinaStaff->pos = 0; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 4d48d3bc70..a526f9267a 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -1285,8 +1285,8 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { osSyncPrintf("kscope->kscp_pos+pt = %d\n", pauseCtx->pageIndex + pt); - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(50); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(50); KaleidoScope_ResetItemCycling(); } @@ -4274,8 +4274,8 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[4] = BTN_ENABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_DISABLED; - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(50); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(50); pauseCtx->unk_1EC = 0; pauseCtx->state = 7; } else if (IS_RANDO && CHECK_BTN_ALL(input->press.button, BTN_CUP) && @@ -4294,7 +4294,7 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->ocarinaStaff = Audio_OcaGetDisplayingStaff(); if (pauseCtx->ocarinaStaff->state == 0) { pauseCtx->unk_1E4 = 4; - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); } break; @@ -4309,7 +4309,7 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->ocarinaStaff = Audio_OcaGetPlayingStaff(); if (CHECK_BTN_ALL(input->press.button, BTN_START)) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Interface_SetDoAction(play, DO_ACTION_NONE); pauseCtx->state = 0x12; WREG(2) = -6240; @@ -4317,7 +4317,7 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->unk_1E4 = 0; break; } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); pauseCtx->unk_1E4 = 0; pauseCtx->mode = 0; pauseCtx->promptChoice = 0; @@ -4328,8 +4328,8 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[4] = BTN_ENABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_DISABLED; - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(50); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(50); pauseCtx->unk_1EC = 0; pauseCtx->state = 7; } else if (pauseCtx->ocarinaStaff->state == pauseCtx->ocarinaSongIdx) { @@ -4352,7 +4352,7 @@ void KaleidoScope_Update(PlayState* play) { if (D_8082B25C == 0) { pauseCtx->unk_1E4 = D_8082B258; if (pauseCtx->unk_1E4 == 0) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); } } break; @@ -4362,14 +4362,14 @@ void KaleidoScope_Update(PlayState* play) { case 8: if (CHECK_BTN_ALL(input->press.button, BTN_START)) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); Interface_SetDoAction(play, DO_ACTION_NONE); pauseCtx->state = 0x12; WREG(2) = -6240; func_800F64E0(0); pauseCtx->unk_1E4 = 0; } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { - Audio_OcaSetInstrument(0); + AudioOcarina_SetInstrument(0); pauseCtx->unk_1E4 = 0; pauseCtx->mode = 0; pauseCtx->promptChoice = 0; @@ -4380,8 +4380,8 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[4] = BTN_ENABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_DISABLED; - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(50); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(50); pauseCtx->unk_1EC = 0; pauseCtx->state = 7; } @@ -4416,8 +4416,8 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[3] = BTN_ENABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_ENABLED; - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(50); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(50); pauseCtx->unk_1EC = 2; WREG(2) = -6240; YREG(8) = pauseCtx->unk_204; @@ -4442,8 +4442,8 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[3] = BTN_ENABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_ENABLED; - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(50); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(50); } break; @@ -4455,8 +4455,8 @@ void KaleidoScope_Update(PlayState* play) { gSaveContext.buttonStatus[3] = BTN_ENABLED; gSaveContext.buttonStatus[5] = gSaveContext.buttonStatus[6] = gSaveContext.buttonStatus[7] = gSaveContext.buttonStatus[8] = BTN_ENABLED; - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(50); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(50); pauseCtx->unk_1EC = 5; WREG(2) = -6240; YREG(8) = pauseCtx->unk_204; @@ -4509,7 +4509,7 @@ void KaleidoScope_Update(PlayState* play) { WREG(16) = -175; WREG(17) = 155; pauseCtx->unk_204 = -434.0f; - Interface_ChangeAlpha(1); + Interface_ChangeHudVisibilityMode(1); #if 1 pauseCtx->iconItemSegment = (void*)(((uintptr_t)play->objectCtx.spaceStart + 0x30) & ~0x3F); @@ -4871,9 +4871,9 @@ void KaleidoScope_Update(PlayState* play) { interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; osSyncPrintf(VT_FGCOL(YELLOW)); - osSyncPrintf("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.unk_13EE); - gSaveContext.unk_13EA = 0; - Interface_ChangeAlpha(gSaveContext.unk_13EE); + osSyncPrintf("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.prevHudVisibilityMode); + gSaveContext.hudVisibilityMode = 0; + Interface_ChangeHudVisibilityMode(gSaveContext.prevHudVisibilityMode); player->talkActor = NULL; Player_SetEquipmentData(play, player); osSyncPrintf(VT_RST);