Added some extra information to OpenAL error messages

This commit is contained in:
Joonas Rikkonen
2018-07-20 16:10:49 +03:00
parent 0abdcb969d
commit f0a663bab0
4 changed files with 54 additions and 42 deletions
@@ -56,7 +56,7 @@ namespace Barotrauma.Sounds
AL.BufferData(sound.alBufferId, reader.Channels == 1 ? ALFormat.Mono16 : ALFormat.Stereo16, sound.castBuffer,
readSamples * sizeof(short), reader.SampleRate);
ALHelper.Check();
ALHelper.Check(oggFile);
}
//AL.Source(alSourceId, ALSourcei.Buffer, alBufferId);
@@ -100,12 +100,12 @@ namespace Barotrauma.Sounds
public void Dispose()
{
//var state = AL.GetSourceState(alSourceId);
//if (state == ALSourceState.Playing || state == ALSourceState.Paused)
// Stop();
System.Diagnostics.Debug.WriteLine(alBufferId);
//AL.DeleteSource(alSourceId);
AL.DeleteBuffer(alBufferId);
if (alBufferId > 0)
{
AL.DeleteBuffer(alBufferId);
alBufferId = 0;
}
//if (ALHelper.Efx.IsInitialized)
// ALHelper.Efx.DeleteFilter(alFilterId);