Merge branch 'develop' of https://github.com/antopilo/Nuake into develop

This commit is contained in:
antopilo
2024-11-06 20:40:58 -05:00
2 changed files with 18 additions and 13 deletions

6
.gitmodules vendored
View File

@@ -1,6 +1,3 @@
[submodule "Nuake/dependencies/glfw"]
path = Nuake/dependencies/glfw
url = https://github.com/glfw/glfw.git
[submodule "Nuake/dependencies/assimp"]
path = Nuake/dependencies/assimp
url = https://github.com/assimp/assimp.git
@@ -31,3 +28,6 @@
[submodule "Nuake/dependencies/entt"]
path = Nuake/dependencies/entt
url = https://github.com/skypjack/entt.git
[submodule "Nuake/dependencies/glfw"]
path = Nuake/dependencies/glfw
url = https://github.com/antopilo/glfw.git

View File

@@ -151,30 +151,35 @@ namespace Nuake {
void AudioManager::AudioUpdate()
{
// Check if we have audio queued
if (m_Soloud->getGlobalVolume() != m_GlobalVolume)
{
m_Soloud->setGlobalVolume(m_GlobalVolume);
}
while (!m_AudioQueue.empty())
{
AudioRequest& audioRequest = m_AudioQueue.front();
Ref<SoLoud::AudioSource> audio = m_WavSamples[audioRequest.audioFile];
SoLoud::handle soloudHandle;
SoLoud::handle handle;
if (!audioRequest.spatialized)
{
soloudHandle = m_Soloud->play(*audio);
m_Soloud->setVolume(soloudHandle, audioRequest.volume);
m_Soloud->setPan(soloudHandle, audioRequest.pan);
handle = m_Soloud->play(*audio);
m_Soloud->setVolume(handle, audioRequest.volume);
m_Soloud->setPan(handle, audioRequest.pan);
}
else
{
const Vector3& position = audioRequest.position;
soloudHandle = m_Soloud->play3d(*audio, position.x, position.y, position.z);
m_Soloud->set3dSourceMinMaxDistance(soloudHandle, audioRequest.MinDistance, audioRequest.MaxDistance);
m_Soloud->set3dSourceAttenuation(soloudHandle, SoLoud::AudioSource::ATTENUATION_MODELS::EXPONENTIAL_DISTANCE, audioRequest.AttenuationFactor);
handle = m_Soloud->play3d(*audio, position.x, position.y, position.z);
m_Soloud->set3dSourceMinMaxDistance(handle, audioRequest.MinDistance, audioRequest.MaxDistance);
m_Soloud->set3dSourceAttenuation(handle, SoLoud::AudioSource::ATTENUATION_MODELS::EXPONENTIAL_DISTANCE, audioRequest.AttenuationFactor);
}
m_Soloud->setRelativePlaySpeed(soloudHandle, audioRequest.speed);
m_Soloud->setLooping(soloudHandle, audioRequest.Loop);
m_Soloud->setRelativePlaySpeed(handle, audioRequest.speed);
m_Soloud->setLooping(handle, audioRequest.Loop);
m_ActiveClips[audioRequest.audioFile] = soloudHandle;
m_ActiveClips[audioRequest.audioFile] = handle;
m_AudioQueue.pop();
}