mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-25 16:46:17 +00:00
Changed: Exceptions catched by reference
This commit is contained in:
parent
fa82b66d79
commit
03e10fb45b
1 changed files with 19 additions and 16 deletions
|
@ -890,22 +890,25 @@ void CSourceAL::setStreamingBuffersMax(uint buffers)
|
|||
unqueueBuffers();
|
||||
removeBuffers();
|
||||
|
||||
for(uint i = 0; i < _BuffersMax; ++i)
|
||||
{
|
||||
try {
|
||||
// create a new buffer
|
||||
CBufferAL *buffer = static_cast<CBufferAL*>(_SoundDriver->createBuffer());
|
||||
// use StorageSoftware because buffers will be reused
|
||||
// deleting and recreating them is a waste of time
|
||||
buffer->setStorageMode(IBuffer::StorageSoftware);
|
||||
_Buffers[buffer->bufferName()] = buffer;
|
||||
} catch(ESoundDriverGenBuf &e) {
|
||||
nlwarning("Cannot create %d buffers. openal fails after %d buffers", buffers, i);
|
||||
_BuffersMax = i;
|
||||
_BuffersName.resize(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(uint i = 0; i < _BuffersMax; ++i)
|
||||
{
|
||||
try
|
||||
{
|
||||
// create a new buffer
|
||||
CBufferAL *buffer = static_cast<CBufferAL*>(_SoundDriver->createBuffer());
|
||||
// use StorageSoftware because buffers will be reused
|
||||
// deleting and recreating them is a waste of time
|
||||
buffer->setStorageMode(IBuffer::StorageSoftware);
|
||||
_Buffers[buffer->bufferName()] = buffer;
|
||||
}
|
||||
catch(const ESoundDriverGenBuf &e)
|
||||
{
|
||||
nlwarning("Cannot create %d buffers. openal fails after %d buffers", buffers, i);
|
||||
_BuffersMax = i;
|
||||
_BuffersName.resize(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Set the default size for streaming buffers
|
||||
|
|
Loading…
Reference in a new issue