From 8516b837ff8376e7a5a7737fced5133c3a93ab16 Mon Sep 17 00:00:00 2001 From: Kevin Poitra Date: Wed, 28 May 2014 15:04:35 -0500 Subject: [PATCH] Revert "Started implementing sound time tracking so we can have NPCs' mouths move as they talk." This reverts commit b897080156825c577ce0fe5e476cc54fe35c6e8f. --- apps/openmw/mwbase/soundmanager.hpp | 3 --- apps/openmw/mwsound/soundmanagerimp.cpp | 34 +++---------------------- apps/openmw/mwsound/soundmanagerimp.hpp | 7 ----- 3 files changed, 3 insertions(+), 41 deletions(-) diff --git a/apps/openmw/mwbase/soundmanager.hpp b/apps/openmw/mwbase/soundmanager.hpp index 68ec2cae8..15739730b 100644 --- a/apps/openmw/mwbase/soundmanager.hpp +++ b/apps/openmw/mwbase/soundmanager.hpp @@ -100,9 +100,6 @@ namespace MWBase virtual void stopSay(const MWWorld::Ptr &reference=MWWorld::Ptr()) = 0; ///< Stop an actor speaking - - virtual float getSoundPlayingTime(const MWWorld::Ptr &reference=MWWorld::Ptr()) = 0; - ///< Get the amount of time this sound has been playing. virtual SoundPtr playTrack(const MWSound::DecoderPtr& decoder, PlayType type) = 0; ///< Play a 2D audio track, using a custom decoder diff --git a/apps/openmw/mwsound/soundmanagerimp.cpp b/apps/openmw/mwsound/soundmanagerimp.cpp index e778f6e34..4a3093b10 100644 --- a/apps/openmw/mwsound/soundmanagerimp.cpp +++ b/apps/openmw/mwsound/soundmanagerimp.cpp @@ -244,7 +244,6 @@ namespace MWSound MWBase::SoundPtr sound = mOutput->playSound3D(filePath, objpos, 1.0f, basevol, 1.0f, 20.0f, 1500.0f, Play_Normal|Play_TypeVoice, 0); mActiveSounds[sound] = std::make_pair(ptr, std::string("_say_sound")); - mSoundPlayTime[sound] = std::make_pair(ptr, 0); } catch(std::exception &e) { @@ -262,9 +261,7 @@ namespace MWSound std::string filePath = "Sound/"+filename; MWBase::SoundPtr sound = mOutput->playSound(filePath, 1.0f, basevol, 1.0f, Play_Normal|Play_TypeVoice, 0); - MWWorld::Ptr ptr = MWWorld::Ptr(); - mActiveSounds[sound] = std::make_pair(ptr, std::string("_say_sound")); - mSoundPlayTime[sound] = std::make_pair(ptr, 0); + mActiveSounds[sound] = std::make_pair(MWWorld::Ptr(), std::string("_say_sound")); } catch(std::exception &e) { @@ -291,18 +288,6 @@ namespace MWSound ++snditer; } } - - float SoundManager::getSoundPlayingTime(const MWWorld::Ptr &ptr) - { - typedef SoundPlayingTimeMap::iterator iter_type; - for(iter_type iterator = mSoundPlayTime.begin(); iterator != mSoundPlayTime.end(); iterator++) - { - if (iterator->second.first == ptr) - return iterator->second.second; - } - - return 0; - } MWBase::SoundPtr SoundManager::playTrack(const DecoderPtr& decoder, PlayType type) @@ -617,12 +602,8 @@ namespace MWSound while(snditer != mActiveSounds.end()) { if(!snditer->first->isPlaying()) - { - mActiveSounds.erase(snditer); - mSoundPlayTime.erase(snditer->first); - snditer++; - } - else + mActiveSounds.erase(snditer++); + else { const MWWorld::Ptr &ptr = snditer->second.first; if(!ptr.isEmpty()) @@ -645,15 +626,6 @@ namespace MWSound ++snditer; } } - - // Update the total playing time for all sounds. - // This is primarily used for detecting amplitude for NPC mouth animation. - - typedef SoundPlayingTimeMap::iterator it_type; - for(it_type iterator = mSoundPlayTime.begin(); iterator != mSoundPlayTime.end(); iterator++) - { - iterator->second.second += duration; - } } void SoundManager::update(float duration) diff --git a/apps/openmw/mwsound/soundmanagerimp.hpp b/apps/openmw/mwsound/soundmanagerimp.hpp index 3f6490d85..ab9dcf734 100644 --- a/apps/openmw/mwsound/soundmanagerimp.hpp +++ b/apps/openmw/mwsound/soundmanagerimp.hpp @@ -43,10 +43,6 @@ namespace MWSound typedef std::pair PtrIDPair; typedef std::map SoundMap; SoundMap mActiveSounds; - - typedef std::pair PtrFloatPair; - typedef std::map SoundPlayingTimeMap; - SoundPlayingTimeMap mSoundPlayTime; MWBase::SoundPtr mUnderwaterSound; @@ -108,9 +104,6 @@ namespace MWSound virtual void stopSay(const MWWorld::Ptr &reference=MWWorld::Ptr()); ///< Stop an actor speaking - - virtual float getSoundPlayingTime(const MWWorld::Ptr &reference=MWWorld::Ptr()); - ///< Get the amount of time this sound has been playing. virtual MWBase::SoundPtr playTrack(const DecoderPtr& decoder, PlayType type); ///< Play a 2D audio track, using a custom decoder