Skip to content

Commit

Permalink
fix timed switches audio on reload
Browse files Browse the repository at this point in the history
  • Loading branch information
walkawayy committed Aug 9, 2023
1 parent f0d661b commit 9485804
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 0 additions & 6 deletions src/game/game/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,13 @@ bool Game_Start(int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type)
// Item_GlobalReplace in the inventory initialization routines too early
Savegame_InitCurrentInfo();

// prevent audio clipping that occurs when level plays a music track,
// and later savegame routines override it while the stream is already
// playing in the background thread
Music_Pause();

if (!Level_Initialise(level_num)) {
return false;
}
if (!Savegame_Load(g_GameInfo.current_save_slot, &g_GameInfo)) {
LOG_ERROR("Failed to load save file!");
return false;
}
Music_Unpause();
break;

case GFL_RESTART:
Expand Down
1 change: 1 addition & 0 deletions src/game/level.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ bool Level_Initialise(int32_t level_num)
Overlay_Init();
Overlay_BarSetHealthTimer(100);

Music_Stop();
Sound_ResetEffects();

Viewport_AlterFOV(g_Config.fov_value * PHD_DEGREE);
Expand Down

0 comments on commit 9485804

Please sign in to comment.