Added: FormatNotSet value for TBufferFormat

This commit is contained in:
kaetemi 2012-04-10 00:06:05 +02:00
parent 517a36d9db
commit 34c38b68b4
2 changed files with 4 additions and 3 deletions

View file

@ -48,6 +48,8 @@ public:
/// Intel/DVI ADPCM format, only available for 1 channel at 16 bits per sample, encoded at 4 bits per sample. /// Intel/DVI ADPCM format, only available for 1 channel at 16 bits per sample, encoded at 4 bits per sample.
/// This is only implemented in the DSound and XAudio2 driver. /// This is only implemented in the DSound and XAudio2 driver.
FormatDviAdpcm = 11, FormatDviAdpcm = 11,
/// No format set. Used when a TBufferFormat value has not been set to any value yet.
FormatNotSet = (~0),
}; };
/// The storage mode of this buffer. Also controls the X-RAM extension of OpenAL. /// The storage mode of this buffer. Also controls the X-RAM extension of OpenAL.
enum TStorageMode enum TStorageMode

View file

@ -121,8 +121,7 @@ void CSourceXAudio2::commit3DChanges()
{ {
nlassert(_SourceVoice); nlassert(_SourceVoice);
// Only mono buffers get 3d sound, multi-channel buffers go directly to the speakers (calculate rolloff too!!). // Only mono buffers get 3d sound, multi-channel buffers go directly to the speakers without any distance rolloff.
// Todo: stereo buffers calculate distance ?
if (_Channels > 1) if (_Channels > 1)
{ {
// _SoundDriver->getDSPSettings()->DstChannelCount = 1; // _SoundDriver->getDSPSettings()->DstChannelCount = 1;
@ -535,7 +534,7 @@ bool CSourceXAudio2::preparePlay(IBuffer::TBufferFormat bufferFormat, uint8 chan
// destroy adpcm utility (if it exists) // destroy adpcm utility (if it exists)
delete _AdpcmUtility; _AdpcmUtility = NULL; delete _AdpcmUtility; _AdpcmUtility = NULL;
// reset current stuff // reset current stuff
_Format = (IBuffer::TBufferFormat)~0; _Format = IBuffer::FormatNotSet;
_Channels = 0; _Channels = 0;
_BitsPerSample = 0; _BitsPerSample = 0;
} }