diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp index d520dd91..99c0357a 100644 --- a/src/sound/oalsound/alsound.cpp +++ b/src/sound/oalsound/alsound.cpp @@ -316,15 +316,15 @@ bool CALSound::SearchFreeBuffer(SoundType sound, int &channel, bool &alreadyLoad int CALSound::Play(SoundType sound, float amplitude, float frequency, bool loop) { - return Play(sound, Math::Vector{}, true, amplitude, frequency, loop); + return Play(sound, glm::vec3{0, 0, 0}, true, amplitude, frequency, loop); } -int CALSound::Play(SoundType sound, const Math::Vector &pos, float amplitude, float frequency, bool loop) +int CALSound::Play(SoundType sound, const glm::vec3 &pos, float amplitude, float frequency, bool loop) { return Play(sound, pos, false, amplitude, frequency, loop); } -int CALSound::Play(SoundType sound, const Math::Vector &pos, bool relativeToListener, float amplitude, float frequency, bool loop) +int CALSound::Play(SoundType sound, const glm::vec3 &pos, bool relativeToListener, float amplitude, float frequency, bool loop) { if (!m_enabled) { @@ -408,7 +408,7 @@ bool CALSound::AddEnvelope(int channel, float amplitude, float frequency, float return true; } -bool CALSound::Position(int channel, const Math::Vector &pos) +bool CALSound::Position(int channel, const glm::vec3 &pos) { if (!CheckChannel(channel)) { @@ -570,11 +570,11 @@ void CALSound::FrameMove(float rTime) } } -void CALSound::SetListener(const Math::Vector &eye, const Math::Vector &lookat) +void CALSound::SetListener(const glm::vec3 &eye, const glm::vec3 &lookat) { m_eye = eye; m_lookat = lookat; - Math::Vector forward = glm::normalize(lookat - eye); + glm::vec3 forward = glm::normalize(lookat - eye); float orientation[] = {forward.x, forward.y, forward.z, 0.f, -1.0f, 0.0f}; alListener3f(AL_POSITION, eye.x, eye.y, eye.z); diff --git a/src/sound/oalsound/alsound.h b/src/sound/oalsound/alsound.h index 8d6911f1..5acb4575 100644 --- a/src/sound/oalsound/alsound.h +++ b/src/sound/oalsound/alsound.h @@ -96,14 +96,14 @@ public: void SetMusicVolume(int volume) override; int GetMusicVolume() override; - void SetListener(const Math::Vector &eye, const Math::Vector &lookat) override; + void SetListener(const glm::vec3 &eye, const glm::vec3 &lookat) override; void FrameMove(float rTime) override; int Play(SoundType sound, float amplitude=1.0f, float frequency=1.0f, bool loop = false) override; - int Play(SoundType sound, const Math::Vector &pos, float amplitude=1.0f, float frequency=1.0f, bool loop = false) override; + int Play(SoundType sound, const glm::vec3 &pos, float amplitude=1.0f, float frequency=1.0f, bool loop = false) override; bool FlushEnvelope(int channel) override; bool AddEnvelope(int channel, float amplitude, float frequency, float time, SoundNext oper) override; - bool Position(int channel, const Math::Vector &pos) override; + bool Position(int channel, const glm::vec3 &pos) override; bool Frequency(int channel, float frequency) override; bool Stop(int channel) override; bool StopAll() override; @@ -117,7 +117,7 @@ public: private: void CleanUp(); - int Play(SoundType sound, const Math::Vector &pos, bool relativeToListener, float amplitude, float frequency, bool loop); + int Play(SoundType sound, const glm::vec3 &pos, bool relativeToListener, float amplitude, float frequency, bool loop); int GetPriority(SoundType); bool SearchFreeBuffer(SoundType sound, int &channel, bool &alreadyLoaded); bool CheckChannel(int &channel); @@ -134,7 +134,7 @@ private: std::unique_ptr m_currentMusic; std::list m_oldMusic; OldMusic m_previousMusic; - Math::Vector m_eye; - Math::Vector m_lookat; + glm::vec3 m_eye; + glm::vec3 m_lookat; CWorkerThread m_thread; }; diff --git a/src/sound/oalsound/channel.cpp b/src/sound/oalsound/channel.cpp index cd9504b6..9015ecc6 100644 --- a/src/sound/oalsound/channel.cpp +++ b/src/sound/oalsound/channel.cpp @@ -94,7 +94,7 @@ bool CChannel::Pause() return true; } -bool CChannel::SetPosition(const Math::Vector &pos, bool relativeToListener) +bool CChannel::SetPosition(const glm::vec3 &pos, bool relativeToListener) { if (!m_ready || m_buffer == nullptr) { diff --git a/src/sound/oalsound/channel.h b/src/sound/oalsound/channel.h index f8c9a8a9..77f125f1 100644 --- a/src/sound/oalsound/channel.h +++ b/src/sound/oalsound/channel.h @@ -59,7 +59,7 @@ public: bool Pause(); bool Stop(); - bool SetPosition(const Math::Vector &pos, bool relativeToListener = false); + bool SetPosition(const glm::vec3 &pos, bool relativeToListener = false); bool SetFrequency(float freq); float GetFrequency(); @@ -120,6 +120,6 @@ private: bool m_ready; bool m_loop; bool m_mute; - Math::Vector m_position; + glm::vec3 m_position; }; diff --git a/src/sound/sound.cpp b/src/sound/sound.cpp index a6a8f8c6..8a3595fe 100644 --- a/src/sound/sound.cpp +++ b/src/sound/sound.cpp @@ -98,7 +98,7 @@ int CSoundInterface::GetMusicVolume() return 0; } -void CSoundInterface::SetListener(const Math::Vector &eye, const Math::Vector &lookat) +void CSoundInterface::SetListener(const glm::vec3 &eye, const glm::vec3 &lookat) { } @@ -111,7 +111,7 @@ int CSoundInterface::Play(SoundType sound, float amplitude, float frequency, boo return 0; } -int CSoundInterface::Play(SoundType sound, const Math::Vector &pos, float amplitude, float frequency, bool loop) +int CSoundInterface::Play(SoundType sound, const glm::vec3 &pos, float amplitude, float frequency, bool loop) { return 0; } @@ -126,7 +126,7 @@ bool CSoundInterface::AddEnvelope(int channel, float amplitude, float frequency, return true; } -bool CSoundInterface::Position(int channel, const Math::Vector &pos) +bool CSoundInterface::Position(int channel, const glm::vec3 &pos) { return true; } diff --git a/src/sound/sound.h b/src/sound/sound.h index df9d50e5..5c7fb1d1 100644 --- a/src/sound/sound.h +++ b/src/sound/sound.h @@ -129,7 +129,7 @@ public: * \param eye - position of listener * \param lookat - direction listener is looking at */ - virtual void SetListener(const Math::Vector &eye, const Math::Vector &lookat); + virtual void SetListener(const glm::vec3 &eye, const glm::vec3 &lookat); /** Update data each frame * \param rTime - time since last update @@ -153,7 +153,7 @@ public: * \param loop - loop sound * \return identifier of channel that sound will be played on */ - virtual int Play(SoundType sound, const Math::Vector &pos, float amplitude=1.0f, float frequency=1.0f, bool loop = false); + virtual int Play(SoundType sound, const glm::vec3 &pos, float amplitude=1.0f, float frequency=1.0f, bool loop = false); /** Remove all operations that would be made on sound in channel. * \param channel - channel to work on @@ -176,7 +176,7 @@ public: * \param pos - new positino of a sound * \return return true on success */ - virtual bool Position(int channel, const Math::Vector &pos); + virtual bool Position(int channel, const glm::vec3 &pos); /** Set sound frequency * \param channel - channel to work on