SoundInstance range and input.Release (#761)

This commit is contained in:
Turánszki János
2023-10-08 14:27:19 +02:00
committed by GitHub
parent 06a02d0407
commit 3b1441f7f0
18 changed files with 385 additions and 47 deletions
+26
View File
@@ -1787,5 +1787,31 @@ namespace wi::scene
_flags &= ~PLAYING;
wi::audio::Stop(&soundinstance);
}
void SoundComponent::SetLooped(bool value)
{
soundinstance.SetLooped(value);
if (value)
{
_flags |= LOOPED;
wi::audio::CreateSoundInstance(&soundResource.GetSound(), &soundinstance);
}
else
{
_flags &= ~LOOPED;
wi::audio::ExitLoop(&soundinstance);
}
}
void SoundComponent::SetDisable3D(bool value)
{
if (value)
{
_flags |= DISABLE_3D;
}
else
{
_flags &= ~DISABLE_3D;
}
wi::audio::CreateSoundInstance(&soundResource.GetSound(), &soundinstance);
}
}