1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Allow ride music to loop seamlessly without reload

This commit is contained in:
Ted John
2022-06-08 00:28:57 +01:00
parent 704e68a9b4
commit dda5402644

View File

@@ -226,7 +226,8 @@ namespace OpenRCT2::RideAudio
auto source = audioContext->CreateStreamFromWAV(std::move(stream));
if (source != nullptr)
{
auto channel = Mixer_Play_Music(source, MIXER_LOOP_NONE, true);
auto shouldLoop = musicObj->GetTrackCount() == 1;
auto channel = Mixer_Play_Music(source, shouldLoop ? MIXER_LOOP_INFINITE : MIXER_LOOP_NONE, true);
if (channel != nullptr)
{
_musicChannels.emplace_back(instance, channel, source);