mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-10-19 15:42:28 +00:00
music reset modes
This commit is contained in:
@@ -27,6 +27,12 @@ EX int effvolume = 60;
|
||||
EX bool music_available;
|
||||
EX int musiclength[MUSIC_MAX];
|
||||
|
||||
#if HDR
|
||||
enum class music_reset_t { always, subland, never };
|
||||
#endif
|
||||
|
||||
EX music_reset_t music_reset;
|
||||
|
||||
EX eLand getCurrentLandForMusic() {
|
||||
eLand id = ((anims::center_music()) && centerover) ? centerover->land : cwt.at->land;
|
||||
if(isHaunted(id)) id = laHaunted;
|
||||
@@ -129,6 +135,11 @@ EX void handlemusic() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(id != cid && musfname[id] == musfname[cid]) {
|
||||
if(music_reset == music_reset_t::never) id = cid;
|
||||
if(music_reset == music_reset_t::subland && get_superland(id) == get_superland(cid))
|
||||
id = cid;
|
||||
}
|
||||
if(cid != id && !musfadeval) {
|
||||
musicpos[cid] = SDL_GetTicks() - musstart;
|
||||
musfadeval = musicpos[id] ? 500 : 2000;
|
||||
|
||||
Reference in New Issue
Block a user