mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-10 06:44:29 +00:00
Fix windows builds
Can't instantiate a container (at least with MSVC) without knowing the exact size of the object being stored, forward-declares only work with pointers. I couldn't see a simple way to remove the forward declare, so pointers and memory management it is.
This commit is contained in:
parent
e49bce7b40
commit
b085c09f86
@ -104,9 +104,10 @@ namespace MWSound
|
|||||||
SoundBufferList::iterator sfxiter = mSoundBuffers.begin();
|
SoundBufferList::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);
|
||||||
sfxiter->mHandle = 0;
|
(*sfxiter)->mHandle = 0;
|
||||||
|
delete (*sfxiter);
|
||||||
}
|
}
|
||||||
mUnusedBuffers.clear();
|
mUnusedBuffers.clear();
|
||||||
}
|
}
|
||||||
@ -145,8 +146,8 @@ 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)
|
new Sound_Buffer("Sound/"+sound->mSound, volume, min, max)
|
||||||
);
|
);
|
||||||
mVFS->normalizeFilename(sfx->mResourceName);
|
mVFS->normalizeFilename(sfx->mResourceName);
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ namespace MWSound
|
|||||||
float mVoiceVolume;
|
float mVoiceVolume;
|
||||||
float mFootstepsVolume;
|
float mFootstepsVolume;
|
||||||
|
|
||||||
typedef std::deque<Sound_Buffer> SoundBufferList;
|
typedef 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…
x
Reference in New Issue
Block a user