mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 00:37:58 +03:00
Refactor and fix sound code
This commit is contained in:
parent
feae212cef
commit
d470cdcf01
11 changed files with 240 additions and 238 deletions
|
@ -172,12 +172,14 @@ void GameFlow::SetGameFarView(byte val)
|
|||
void GameFlow::SetAudioTracks(sol::as_table_t<std::vector<GameScriptAudioTrack>>&& src)
|
||||
{
|
||||
std::vector<GameScriptAudioTrack> tracks = std::move(src);
|
||||
SoundTracks.clear();
|
||||
|
||||
for (auto t : tracks) {
|
||||
AudioTrack track;
|
||||
SoundTrackInfo track;
|
||||
track.Name = t.trackName;
|
||||
track.Mask = 0;
|
||||
track.looped = t.looped;
|
||||
SoundTracks.insert_or_assign(track.Name, track);
|
||||
track.Mode = t.looped ? SOUNDTRACK_PLAYTYPE::BGM : SOUNDTRACK_PLAYTYPE::OneShot;
|
||||
SoundTracks.push_back(track);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue