From c10842cce039b222b0e3adff850c9ef56234d698 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 13 Sep 2019 17:45:44 +0200 Subject: [PATCH] CLI option -musicfocus --- sound.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound.cpp b/sound.cpp index d1cf88e5..546e0cc3 100644 --- a/sound.cpp +++ b/sound.cpp @@ -79,12 +79,14 @@ eLand cid = laNone; hookset *hooks_music; +bool music_out_of_focus = false; + EX void handlemusic() { DEBBI(DF_GRAPH, ("handle music")); if(audio && musicvolume) { eLand id = getCurrentLandForMusic(); if(callhandlers(false, hooks_music, id)) return; - if(outoffocus) id = eLand(0); + if(outoffocus && !music_out_of_focus) id = eLand(0); if(musfname[id] == "LAST") id = cid; if(!loaded[id] && !memory_issues()) { loaded[id] = true; @@ -268,6 +270,7 @@ int read_sound_args() { else if(argis("-se")) { PHASE(1); shift(); wheresounds = args(); } #endif else if(argis("-svol")) { PHASEFROM(2); shift(); effvolume = argi(); } + else if(argis("-musicfocus")) { music_out_of_focus = true; } else return 1; return 0; }