1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 21:45:35 +00:00

Merge pull request #2941 from elsid/lookup_stop_sound

Lookup sound when need to stop
This commit is contained in:
Bret Curtis 2020-07-01 17:30:23 +02:00 committed by GitHub
commit 3d7f8a573a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 18 deletions

View file

@ -163,9 +163,6 @@ namespace MWBase
virtual void stopSound(const MWWorld::CellStore *cell) = 0;
///< Stop all sounds for the given cell.
virtual void stopSound(const std::string& soundId) = 0;
///< Stop a non-3d looping sound
virtual void fadeOutSound3D(const MWWorld::ConstPtr &reference, const std::string& soundId, float duration) = 0;
///< Fade out given sound (that is already playing) of given object
///< @param reference Reference to object, whose sound is faded out

View file

@ -767,23 +767,12 @@ namespace MWSound
}
}
void SoundManager::stopSound(const std::string& soundId)
{
if(!mOutput->isInitialized())
return;
Sound_Buffer *sfx = loadSound(Misc::StringUtils::lowerCase(soundId));
if (!sfx) return;
stopSound(sfx, MWWorld::ConstPtr());
}
void SoundManager::stopSound3D(const MWWorld::ConstPtr &ptr, const std::string& soundId)
{
if(!mOutput->isInitialized())
return;
Sound_Buffer *sfx = loadSound(Misc::StringUtils::lowerCase(soundId));
Sound_Buffer *sfx = lookupSound(Misc::StringUtils::lowerCase(soundId));
if (!sfx) return;
stopSound(sfx, ptr);

View file

@ -237,9 +237,6 @@ namespace MWSound
virtual void stopSound(const MWWorld::CellStore *cell);
///< Stop all sounds for the given cell.
virtual void stopSound(const std::string& soundId);
///< Stop a non-3d looping sound
virtual void fadeOutSound3D(const MWWorld::ConstPtr &reference, const std::string& soundId, float duration);
///< Fade out given sound (that is already playing) of given object
///< @param reference Reference to object, whose sound is faded out