diff options
| author | Roman971 <32455037+Roman971@users.noreply.github.com> | 2020-07-05 05:30:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-04 23:30:21 -0400 |
| commit | 61544b873d1ab559918ed022b97a6ffcb2d2c76a (patch) | |
| tree | a3ff53d9478eb193fc3a9573536eabde66c00d11 /src/code | |
| parent | a5aee3d691bc7abd99173841736193bf16e81edb (diff) | |
Various SFX fixes (#237)
* Various SFX fixes
* Fix sfx references in z_en_zl2.c
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 20 | ||||
| -rw-r--r-- | src/code/z_camera.c | 2 | ||||
| -rw-r--r-- | src/code/z_collision_check.c | 14 | ||||
| -rw-r--r-- | src/code/z_demo.c | 2 | ||||
| -rw-r--r-- | src/code/z_en_a_keep.c | 2 | ||||
| -rw-r--r-- | src/code/z_parameter.c | 5 | ||||
| -rw-r--r-- | src/code/z_play.c | 8 | ||||
| -rw-r--r-- | src/code/z_scene.c | 4 |
8 files changed, 29 insertions, 28 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 172f755ee..fabe0c5a9 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1697,16 +1697,16 @@ void func_8002F850(GlobalContext* globalCtx, Actor* actor) { if (actor->bgCheckFlags & 0x20) { if (actor->waterY < 20.0f) { - sfxId = NA_SE_PL_WALK_WATER0; + sfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG; } else { - sfxId = NA_SE_PL_WALK_WATER1; + sfxId = NA_SE_PL_WALK_WATER1 - SFX_FLAG; } } else { sfxId = func_80041F34(&globalCtx->colCtx, actor->floorPoly, actor->floorPolySource); } func_80078914(&actor->projectedPos, NA_SE_EV_BOMB_BOUND); - func_80078914(&actor->projectedPos, sfxId + 0x800); + func_80078914(&actor->projectedPos, sfxId + SFX_FLAG); } void func_8002F8F0(Actor* actor, u16 sfxId) { @@ -1732,15 +1732,15 @@ void func_8002F974(Actor* actor, u16 sfxId) { actor->sfx = sfxId; } -void func_8002F994(Actor* actor, s32 sfxId) { +void func_8002F994(Actor* actor, s32 arg1) { actor->flags |= 0x10000000; actor->flags &= ~0x00380000; - if (sfxId < NA_SE_PL_LAND_GRASS) { - actor->sfx = NA_SE_PL_WALK_DIRT; - } else if (sfxId < NA_SE_PL_DIVE_BUBBLE) { - actor->sfx = NA_SE_PL_WALK_CONCRETE; + if (arg1 < 40) { + actor->sfx = NA_SE_PL_WALK_DIRT - SFX_FLAG; + } else if (arg1 < 100) { + actor->sfx = NA_SE_PL_WALK_CONCRETE - SFX_FLAG; } else { - actor->sfx = NA_SE_PL_WALK_SAND; + actor->sfx = NA_SE_PL_WALK_SAND - SFX_FLAG; } } @@ -2263,7 +2263,7 @@ void func_80030ED8(Actor* actor) { } else if (actor->flags & 0x200000) { func_800788CC(actor->sfx); } else if (actor->flags & 0x10000000) { - func_800F4C58(&D_801333D4, 0x2021, (s8)(actor->sfx - 1)); + func_800F4C58(&D_801333D4, NA_SE_SY_TIMER - SFX_FLAG, (s8)(actor->sfx - 1)); } else { func_80078914(&actor->projectedPos, actor->sfx); } diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 510340516..4693fa171 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -3518,7 +3518,7 @@ s32 Camera_ChangeMode(Camera* camera, s16 mode, u8 arg2) { if (camera->status == 7) { switch (phi_v0) { case 1: - func_80078884(NA_SE_PL_WALK_GROUND); + func_80078884(NA_SE_PL_WALK_GROUND - SFX_FLAG); break; case 2: if (1 == camera->globalCtx->roomCtx.curRoom.unk_03) { diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index c8729cb32..fbe38abad 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1408,14 +1408,14 @@ s32 func_8005E4F8(Collider* left, ColliderBody* rightBody) { Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else if (rightBody->flags == 1) { - Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); - } else if (2 == rightBody->flags) { - Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &left->actor->projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); + } else if (rightBody->flags == 2) { + Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &left->actor->projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } else if (rightBody->flags == 3) { - Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND, &left->actor->projectedPos, 4, &D_801333E0, &D_801333E0, - &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_PL_WALK_GROUND - SFX_FLAG, &left->actor->projectedPos, 4, &D_801333E0, + &D_801333E0, &D_801333E8); } } } diff --git a/src/code/z_demo.c b/src/code/z_demo.c index df0f8c227..f0bc2a333 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -358,7 +358,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* if (sp3F != 0) { globalCtx->envCtx.unk_E6 = 1; } - func_800788CC(0x20C0); + func_800788CC(NA_SE_EV_SAND_STORM - SFX_FLAG); break; case 33: gSaveContext.unk_1422 = 1; diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 309b3d32e..ed2ab16b6 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -317,7 +317,7 @@ void func_8001D608(EnAObj* this, GlobalContext* globalCtx) { Math_SmoothScaleMaxMinF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); if (this->dyna.actor.speedXZ != 0.0f) { - Audio_PlayActorSound2(&this->dyna.actor, 0x200A); + Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } this->dyna.unk_154 = 0.0f; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 4caee3394..fb6e5a436 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2422,7 +2422,8 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { gSaveContext.magic += 4; if (gSaveContext.gameMode == 0 && gSaveContext.sceneSetupIndex < 4) { - Audio_PlaySoundGeneral(0x401F, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, + &D_801333E8); } // Translates to: "Storage MAGIC_NOW=%d (%d)" @@ -2550,7 +2551,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { break; case 10: gSaveContext.magic += 4; - Audio_PlaySoundGeneral(0x401F, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); if (gSaveContext.magic >= gSaveContext.unk_13F8) { gSaveContext.magic = gSaveContext.unk_13F8; gSaveContext.unk_13F0 = gSaveContext.unk_13F2; diff --git a/src/code/z_play.c b/src/code/z_play.c index 6082a593e..d91464eaa 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -404,8 +404,8 @@ void Gameplay_Init(GlobalContext* globalCtx) { Interface_SetSceneRestrictions(globalCtx); func_800758AC(globalCtx); - gSaveContext.seqIndex = globalCtx->soundCtx.musicSeq; - gSaveContext.nightSeqIndex = globalCtx->soundCtx.nighttimeSFX; + gSaveContext.seqIndex = globalCtx->soundCtx.seqIndex; + gSaveContext.nightSeqIndex = globalCtx->soundCtx.nightSeqIndex; func_8002DF18(globalCtx, PLAYER); func_800A390C(globalCtx, &globalCtx->animationCtx); gSaveContext.respawnFlag = 0; @@ -714,7 +714,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { break; case 13: - Audio_PlaySoundGeneral(0x20C0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); if (globalCtx->sceneLoadFlag == -0x14) { if (globalCtx->envCtx.unk_E7 < 0x6E) { gTrnsnUnkState = 0; @@ -747,7 +747,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { break; case 15: - Audio_PlaySoundGeneral(0x20C0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); if (globalCtx->sceneLoadFlag == -0x14) { if (globalCtx->envCtx.unk_E7 <= 0) { gTrnsnUnkState = 0; diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 74859ffe4..6fdb658cb 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -441,8 +441,8 @@ void func_80099134(GlobalContext* globalCtx, SceneCmd* cmd) { // Scene Command 0x15: Sound Settings void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd) { - globalCtx->soundCtx.musicSeq = cmd->soundSettings.musicSeq; - globalCtx->soundCtx.nighttimeSFX = cmd->soundSettings.nighttimeSFX; + globalCtx->soundCtx.seqIndex = cmd->soundSettings.seqIndex; + globalCtx->soundCtx.nightSeqIndex = cmd->soundSettings.nightSeqIndex; if (gSaveContext.seqIndex == 0xFF) { Audio_SetBGM(cmd->soundSettings.bgmId | 0xF0000000); |
