mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-04 09:09:54 +00:00
CLI option -musicfocus
This commit is contained in:
parent
2a950369ba
commit
c10842cce0
@ -79,12 +79,14 @@ eLand cid = laNone;
|
|||||||
|
|
||||||
hookset<bool(eLand&)> *hooks_music;
|
hookset<bool(eLand&)> *hooks_music;
|
||||||
|
|
||||||
|
bool music_out_of_focus = false;
|
||||||
|
|
||||||
EX void handlemusic() {
|
EX void handlemusic() {
|
||||||
DEBBI(DF_GRAPH, ("handle music"));
|
DEBBI(DF_GRAPH, ("handle music"));
|
||||||
if(audio && musicvolume) {
|
if(audio && musicvolume) {
|
||||||
eLand id = getCurrentLandForMusic();
|
eLand id = getCurrentLandForMusic();
|
||||||
if(callhandlers(false, hooks_music, id)) return;
|
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(musfname[id] == "LAST") id = cid;
|
||||||
if(!loaded[id] && !memory_issues()) {
|
if(!loaded[id] && !memory_issues()) {
|
||||||
loaded[id] = true;
|
loaded[id] = true;
|
||||||
@ -268,6 +270,7 @@ int read_sound_args() {
|
|||||||
else if(argis("-se")) { PHASE(1); shift(); wheresounds = args(); }
|
else if(argis("-se")) { PHASE(1); shift(); wheresounds = args(); }
|
||||||
#endif
|
#endif
|
||||||
else if(argis("-svol")) { PHASEFROM(2); shift(); effvolume = argi(); }
|
else if(argis("-svol")) { PHASEFROM(2); shift(); effvolume = argi(); }
|
||||||
|
else if(argis("-musicfocus")) { music_out_of_focus = true; }
|
||||||
else return 1;
|
else return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user