diff --git a/SQCSim2021/audio.cpp b/SQCSim2021/audio.cpp index 97bed1c..161a73b 100644 --- a/SQCSim2021/audio.cpp +++ b/SQCSim2021/audio.cpp @@ -2,18 +2,18 @@ Audio::Audio() { m_engine = irrklang::createIrrKlangDevice(); - m_engine->setDopplerEffectParameters(10); - m_engine->setRolloffFactor(2); - m_engine->setDefault3DSoundMinDistance(.1); + m_engine->setDopplerEffectParameters(1); + m_engine->setRolloffFactor(1); + m_engine->setDefault3DSoundMinDistance(1); m_engine->setDefault3DSoundMaxDistance(1000); } Audio::Audio(const char * music, const char* menumusic) { m_engine = irrklang::createIrrKlangDevice(); m_engine->setDopplerEffectParameters(1); - m_engine->setRolloffFactor(2); - m_engine->setDefault3DSoundMinDistance(.1); - m_engine->setDefault3DSoundMaxDistance(1000); + m_engine->setRolloffFactor(1); + m_engine->setDefault3DSoundMinDistance(1); + m_engine->setDefault3DSoundMaxDistance(100); m_music = m_engine->play2D(music, true, true, true, irrklang::ESM_STREAMING); m_menumusic = m_engine->play2D(menumusic, true, true, true, irrklang::ESM_STREAMING); m_music->setVolume(.5); diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index f504c3e..106fac0 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -1410,18 +1410,19 @@ void Engine::Render(float elapsedTime) { m_chunkmod = nullptr; } m_bullets[x] = nullptr; - //if (m_whoosh[x]) - // m_whoosh[x]->drop(); - //m_whoosh[x] = nullptr; + if (m_whoosh[x]){ + m_whoosh[x]->drop(); + m_whoosh[x] = nullptr; + } break; } - // else if (!m_whoosh[x]) { - // m_whoosh[x] = m_audio.Create3DAudioObj(m_whoosh[x], AUDIO_PATH "noise.wav", m_bullets[x]->getPos(), m_bullets[x]->getVel(), true, (m_bullets[x]->getPos() - m_player.GetPosition()).Length()); - // } - // else { - // Vector3f pos = m_bullets[x]->getPos(), vel = m_bullets[x]->getVel(); - // m_audio.Render3DAudioObj(m_whoosh[x], pos, vel, 5 - (m_bullets[x]->getPos() - m_player.GetPosition()).Length()); - // } + else if (!m_whoosh[x]) { + m_whoosh[x] = m_audio.Create3DAudioObj(m_whoosh[x], AUDIO_PATH "noise.wav", m_bullets[x]->getPos(), m_bullets[x]->getVel(), true, (m_bullets[x]->getPos() - m_player.GetPosition()).Length()); + } + else { + Vector3f pos = m_bullets[x]->getPos(), vel = m_bullets[x]->getVel(); + m_audio.Render3DAudioObj(m_whoosh[x], pos, vel, m_sfxvolume); + } } } }