From d18159616e7d34220be85812d5f500fb53450edc Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 13 Jun 2014 16:22:27 +0200 Subject: [PATCH] SSE2: Fix hopefully the last few alignment issues --HG-- branch : sse2 --- code/nel/include/nel/sound/audio_mixer_user.h | 2 +- code/nel/include/nel/sound/background_sound_manager.h | 10 +++++----- code/nel/include/nel/sound/u_audio_mixer.h | 8 +++++++- code/nel/src/sound/audio_mixer_user.cpp | 10 +++++----- code/ryzom/client/src/sound_manager.cpp | 4 ++-- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/code/nel/include/nel/sound/audio_mixer_user.h b/code/nel/include/nel/sound/audio_mixer_user.h index d8949c3d3..d152cd31b 100644 --- a/code/nel/include/nel/sound/audio_mixer_user.h +++ b/code/nel/include/nel/sound/audio_mixer_user.h @@ -471,7 +471,7 @@ protected: /// Returns nb available tracks (or NULL) void getFreeTracks( uint nb, CTrack **tracks ); /// Fill a vector of position and mute flag for all playing sound source. - virtual void getPlayingSoundsPos(bool virtualPos, std::vector > &pos); + virtual void getPlayingSoundsPos(bool virtualPos, std::vector &pos); typedef CHashMap TUserVarControlsContainer; /// Container for all user controler and currently controled playing source diff --git a/code/nel/include/nel/sound/background_sound_manager.h b/code/nel/include/nel/sound/background_sound_manager.h index 326ece0f3..06f15f80f 100644 --- a/code/nel/include/nel/sound/background_sound_manager.h +++ b/code/nel/include/nel/sound/background_sound_manager.h @@ -258,17 +258,17 @@ private: struct TSoundStatus { /// The data of the sound. - TSoundData &SoundData; + TSoundData &SoundData; /// The position of the source. - NLMISC::CVector Position; + NLMISC::CVectorPacked Position; /** The relative gain of the source. This is used for patatoid competition.when * a smaller patatoid mute bigger one. */ - float Gain; + float Gain; /// The distance beween listener and source. - float Distance; + float Distance; /// flag if inside a sound zone - bool Inside; + bool Inside; /// Constructor. TSoundStatus(TSoundData &sd, const NLMISC::CVector &position, float gain, float distance, bool inside) : SoundData(sd), Position(position), Gain(gain), Distance(distance), Inside(inside) diff --git a/code/nel/include/nel/sound/u_audio_mixer.h b/code/nel/include/nel/sound/u_audio_mixer.h index 0d845f9c3..0b1bcc42a 100644 --- a/code/nel/include/nel/sound/u_audio_mixer.h +++ b/code/nel/include/nel/sound/u_audio_mixer.h @@ -336,7 +336,13 @@ public: virtual uint getMutedPlayingSourcesCount() const = 0; /// Return a string showing the playing sources virtual std::string getSourcesStats() const = 0; - virtual void getPlayingSoundsPos(bool virtualPos, std::vector > &pos) =0; + struct CPlayingSoundPos + { + CPlayingSoundPos(bool first_, const NLMISC::CVector &second_) : first(first_), second(second_) { } + bool first; + NLMISC::CVector second; + }; + virtual void getPlayingSoundsPos(bool virtualPos, std::vector &pos) =0; /** Write profiling information about the mixer to the output stream. * \param out The output stream to which to write the information */ diff --git a/code/nel/src/sound/audio_mixer_user.cpp b/code/nel/src/sound/audio_mixer_user.cpp index 4807581f0..1c9c46cdc 100644 --- a/code/nel/src/sound/audio_mixer_user.cpp +++ b/code/nel/src/sound/audio_mixer_user.cpp @@ -1475,7 +1475,7 @@ void CAudioMixerUser::freeTrack(CTrack *track) // ****************************************************************** -void CAudioMixerUser::getPlayingSoundsPos(bool virtualPos, std::vector > &pos) +void CAudioMixerUser::getPlayingSoundsPos(bool virtualPos, std::vector &pos) { int nbplay = 0; int nbmute = 0; @@ -1493,9 +1493,9 @@ void CAudioMixerUser::getPlayingSoundsPos(bool virtualPos, std::vectorisPlaying()) { if (virtualPos) - pos.push_back(make_pair(source->getTrack() == 0, source->getVirtualPos())); + pos.push_back(CPlayingSoundPos(source->getTrack() == 0, source->getVirtualPos())); else - pos.push_back(make_pair(source->getTrack() == 0, + pos.push_back(CPlayingSoundPos(source->getTrack() == 0, source->getSourceRelativeMode() ? source->getPos() + _ListenPosition : source->getPos())); @@ -1517,9 +1517,9 @@ void CAudioMixerUser::getPlayingSoundsPos(bool virtualPos, std::vectorisPlaying()) { if (virtualPos) - pos.push_back(make_pair(source->getTrack() == 0, source->getVirtualPos())); + pos.push_back(CPlayingSoundPos(source->getTrack() == 0, source->getVirtualPos())); else - pos.push_back(make_pair(source->getTrack() == 0, + pos.push_back(CPlayingSoundPos(source->getTrack() == 0, source->getSourceRelativeMode() ? source->getPos() + _ListenPosition : source->getPos())); diff --git a/code/ryzom/client/src/sound_manager.cpp b/code/ryzom/client/src/sound_manager.cpp index 7c5589432..eddd4ed4c 100644 --- a/code/ryzom/client/src/sound_manager.cpp +++ b/code/ryzom/client/src/sound_manager.cpp @@ -363,10 +363,10 @@ void CSoundManager::drawSounds(float camHeight) } // draw the sound source position { - std::vector > soundPos; + std::vector soundPos; _AudioMixer->getPlayingSoundsPos(true, soundPos); - std::vector >::iterator first(soundPos.begin()), last(soundPos.end()); + std::vector::iterator first(soundPos.begin()), last(soundPos.end()); for (; first != last; ++first) { NL3D::CDRU::drawLine(first->second + CVector(0.5f,0.5f,0), first->second + CVector(-0.5f,-0.5f,0), CRGBA(255,0,255,255), *idriver);