forked from mirror/openmw-tes3mp
Different way to solve the type deduction issue
This commit is contained in:
parent
a69e751089
commit
6823298516
2 changed files with 6 additions and 4 deletions
|
@ -40,6 +40,7 @@ namespace MWSound
|
||||||
, mMusicVolume(1.0f)
|
, mMusicVolume(1.0f)
|
||||||
, mVoiceVolume(1.0f)
|
, mVoiceVolume(1.0f)
|
||||||
, mFootstepsVolume(1.0f)
|
, mFootstepsVolume(1.0f)
|
||||||
|
, mSoundBuffers(new SoundBufferList::element_type())
|
||||||
, mBufferCacheSize(0)
|
, mBufferCacheSize(0)
|
||||||
, mListenerUnderwater(false)
|
, mListenerUnderwater(false)
|
||||||
, mListenerPos(0,0,0)
|
, mListenerPos(0,0,0)
|
||||||
|
@ -101,8 +102,8 @@ namespace MWSound
|
||||||
clear();
|
clear();
|
||||||
if(mOutput->isInitialized())
|
if(mOutput->isInitialized())
|
||||||
{
|
{
|
||||||
SoundBufferList::iterator sfxiter = mSoundBuffers.begin();
|
SoundBufferList::element_type::iterator sfxiter = mSoundBuffers->begin();
|
||||||
for(;sfxiter != mSoundBuffers.end();++sfxiter)
|
for(;sfxiter != mSoundBuffers->end();++sfxiter)
|
||||||
{
|
{
|
||||||
if(sfxiter->mHandle)
|
if(sfxiter->mHandle)
|
||||||
mOutput->unloadSound(sfxiter->mHandle);
|
mOutput->unloadSound(sfxiter->mHandle);
|
||||||
|
@ -145,7 +146,7 @@ namespace MWSound
|
||||||
min = std::max(min, 1.0f);
|
min = std::max(min, 1.0f);
|
||||||
max = std::max(min, max);
|
max = std::max(min, max);
|
||||||
|
|
||||||
Sound_Buffer *sfx = &*mSoundBuffers.insert(mSoundBuffers.end(),
|
Sound_Buffer *sfx = &*mSoundBuffers->insert(mSoundBuffers->end(),
|
||||||
Sound_Buffer("Sound/"+sound->mSound, volume, min, max)
|
Sound_Buffer("Sound/"+sound->mSound, volume, min, max)
|
||||||
);
|
);
|
||||||
mVFS->normalizeFilename(sfx->mResourceName);
|
mVFS->normalizeFilename(sfx->mResourceName);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef GAME_SOUND_SOUNDMANAGER_H
|
#ifndef GAME_SOUND_SOUNDMANAGER_H
|
||||||
#define GAME_SOUND_SOUNDMANAGER_H
|
#define GAME_SOUND_SOUNDMANAGER_H
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
@ -56,7 +57,7 @@ namespace MWSound
|
||||||
float mVoiceVolume;
|
float mVoiceVolume;
|
||||||
float mFootstepsVolume;
|
float mFootstepsVolume;
|
||||||
|
|
||||||
typedef std::deque<Sound_Buffer> SoundBufferList;
|
typedef std::auto_ptr<std::deque<Sound_Buffer>> SoundBufferList;
|
||||||
// List of sound buffers, grown as needed. New enties are added to the
|
// List of sound buffers, grown as needed. New enties are added to the
|
||||||
// back, allowing existing Sound_Buffer references/pointers to remain
|
// back, allowing existing Sound_Buffer references/pointers to remain
|
||||||
// valid.
|
// valid.
|
||||||
|
|
Loading…
Reference in a new issue