-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
music: fix the main music playing at the wrong volume with certain sound options #1544
music: fix the main music playing at the wrong volume with certain sound options #1544
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
Thanks. I think that a more fitting place for both this volume fix and the title level music check would be in diff --git a/src/game/level.c b/src/game/level.c
index 42c50c0f..c60f2143 100644
--- a/src/game/level.c
+++ b/src/game/level.c
@@ -1149,11 +1149,14 @@ bool Level_Initialise(int32_t level_num)
Overlay_BarSetHealthTimer(100);
Music_Stop();
+ Music_SetVolume(g_Config.music_volume);
Sound_ResetEffects();
Viewport_SetFOV(Viewport_GetUserFOV());
- if (g_GameFlow.levels[level_num].music) {
+ const bool disable_music = level_num == g_GameFlow.title_level_num
+ && !g_Config.enable_music_in_menu;
+ if (g_GameFlow.levels[level_num].music && !disable_music) {
Music_PlayLooped(g_GameFlow.levels[level_num].music);
}
diff --git a/src/game/music.c b/src/game/music.c
index c24810a5..382bf82f 100644
--- a/src/game/music.c
+++ b/src/game/music.c
@@ -131,11 +131,6 @@ bool Music_PlayLooped(MUSIC_TRACK_ID track)
return false;
}
- if (g_CurrentLevel == g_GameFlow.title_level_num
- && !g_Config.enable_music_in_menu) {
- return false;
- }
-
M_StopActiveStream();
char *file_path = M_GetTrackFileName(track); |
2fb6f0b
to
9c47069
Compare
Ok done. Amended the issue commit and added a second commit which moves the |
9c47069
to
60f033a
Compare
Fixed quiet or mute main menu music if a level was exited while underwater and the quiet, full but no ambient, quiet but no ambient, or none underwater music behavior option was set. Resolves LostArtefacts#1540.
60f033a
to
13b9d40
Compare
Fixed quiet or mute main menu music if a level was exited while underwater and the quiet, full but no ambient, quiet but no ambient, or none underwater music behavior option was set.
Resolves #1540.
Checklist
Description
Fixed the main menu music being quiet or mute if a level was exited while underwater and the quiet, full but no ambient, quiet but no ambient, or none underwater music behavior option was set (regression from 4.4). I tried to apply the fix to the volume in a logical place which is where the other config option to mute main menu music is.
M_EnsureEnvironment
couldn't be called becauseGame_DrawScene
isn't called when in the title menu inventory soCamera_Apply
is never called. Might need to be hotfixed though it's not a game breaking issue, and it should be a rare bug.