Fixed: The default max distance for sources is now sqrt(numeric_limits<float>::max())

This commit is contained in:
kaetemi 2012-04-12 18:16:53 +02:00
parent 4973e05183
commit 1926c56f64
3 changed files with 3 additions and 3 deletions

View file

@ -397,7 +397,7 @@ public:
virtual void setSourceRelativeMode(bool mode = true) = 0; virtual void setSourceRelativeMode(bool mode = true) = 0;
/// Get the source relative mode /// Get the source relative mode
virtual bool getSourceRelativeMode() const = 0; virtual bool getSourceRelativeMode() const = 0;
/// Set the min and max distances (default: 1, MAX_FLOAT) (3D mode only) /// Set the min and max distances (default: 1, sqrt(MAX_FLOAT)) (3D mode only)
virtual void setMinMaxDistances(float mindist, float maxdist, bool deferred = true) = 0; virtual void setMinMaxDistances(float mindist, float maxdist, bool deferred = true) = 0;
/// Get the min and max distances /// Get the min and max distances
virtual void getMinMaxDistances(float& mindist, float& maxdist) const = 0; virtual void getMinMaxDistances(float& mindist, float& maxdist) const = 0;

View file

@ -34,7 +34,7 @@ _SoundDriver(NULL), _Buffer(NULL), _Source(AL_NONE),
_DirectFilter(AL_FILTER_NULL), _EffectFilter(AL_FILTER_NULL), _DirectFilter(AL_FILTER_NULL), _EffectFilter(AL_FILTER_NULL),
_IsPlaying(false), _IsPaused(false), _StartTime(0), _IsStreaming(false), _RelativeMode(false), _IsPlaying(false), _IsPaused(false), _StartTime(0), _IsStreaming(false), _RelativeMode(false),
_Pos(0.0f, 0.0f, 0.0f), _Gain(NLSOUND_DEFAULT_GAIN), _Alpha(1.0), _Pos(0.0f, 0.0f, 0.0f), _Gain(NLSOUND_DEFAULT_GAIN), _Alpha(1.0),
_MinDistance(1.0f), _MaxDistance(numeric_limits<float>::max()), _MinDistance(1.0f), _MaxDistance(sqrt(numeric_limits<float>::max())),
_Effect(NULL), _Direct(true), _Effect(NULL), _Direct(true),
_DirectGain(NLSOUND_DEFAULT_DIRECT_GAIN), _EffectGain(NLSOUND_DEFAULT_EFFECT_GAIN), _DirectGain(NLSOUND_DEFAULT_DIRECT_GAIN), _EffectGain(NLSOUND_DEFAULT_EFFECT_GAIN),
_DirectFilterType(ISource::FilterLowPass), _EffectFilterType(ISource::FilterLowPass), _DirectFilterType(ISource::FilterLowPass), _EffectFilterType(ISource::FilterLowPass),

View file

@ -42,7 +42,7 @@ _DirectFilterPassGain(NLSOUND_DEFAULT_FILTER_PASS_GAIN), _EffectFilterPassGain(N
_DirectFilterLowFrequency(NLSOUND_DEFAULT_FILTER_PASS_LF), _DirectFilterHighFrequency(NLSOUND_DEFAULT_FILTER_PASS_HF), _DirectFilterLowFrequency(NLSOUND_DEFAULT_FILTER_PASS_LF), _DirectFilterHighFrequency(NLSOUND_DEFAULT_FILTER_PASS_HF),
_EffectFilterLowFrequency(NLSOUND_DEFAULT_FILTER_PASS_LF), _EffectFilterHighFrequency(NLSOUND_DEFAULT_FILTER_PASS_HF), _EffectFilterLowFrequency(NLSOUND_DEFAULT_FILTER_PASS_LF), _EffectFilterHighFrequency(NLSOUND_DEFAULT_FILTER_PASS_HF),
_IsPlaying(false), _IsPaused(false), _IsLooping(false), _Pitch(1.0f), _IsPlaying(false), _IsPaused(false), _IsLooping(false), _Pitch(1.0f),
_Gain(1.0f), _MinDistance(1.0f), _MaxDistance(numeric_limits<float>::max()), _Gain(1.0f), _MinDistance(1.0f), _MaxDistance(sqrt(numeric_limits<float>::max())),
_AdpcmUtility(NULL), _Channels(0), _BitsPerSample(0), _BufferStreaming(false) _AdpcmUtility(NULL), _Channels(0), _BitsPerSample(0), _BufferStreaming(false)
{ {
// nlwarning(NLSOUND_XAUDIO2_PREFIX "Inititializing CSourceXAudio2"); // nlwarning(NLSOUND_XAUDIO2_PREFIX "Inititializing CSourceXAudio2");