tracking down volume related assert
This commit is contained in:
@@ -398,7 +398,7 @@ float PrefsManager::GetSoundVolume()
|
||||
if ( m_fSoundVolume==-1 )
|
||||
return DEFAULT_SOUND_VOLUME;
|
||||
else
|
||||
return m_fSoundVolume;
|
||||
return clamp(m_fSoundVolume,0.0f,1.0f);
|
||||
}
|
||||
|
||||
CString PrefsManager::GetInputDrivers() {
|
||||
|
||||
@@ -331,6 +331,8 @@ void RageSoundManager::PlayOnce( CString sPath )
|
||||
|
||||
void RageSoundManager::SetMixVolume( float fMixVol )
|
||||
{
|
||||
ASSERT_M( fMixVol >= 0 && fVolume <= 1, ssprintf("%f",fMixVol) );
|
||||
|
||||
g_SoundManMutex.Lock(); /* lock for access to m_fMixVolume */
|
||||
m_fMixVolume = fMixVol;
|
||||
g_SoundManMutex.Unlock(); /* finished with m_fMixVolume */
|
||||
|
||||
@@ -305,8 +305,7 @@ void DSoundBuf::SetSampleRate( int hz )
|
||||
|
||||
void DSoundBuf::SetVolume( float fVolume )
|
||||
{
|
||||
ASSERT( fVolume >= 0 );
|
||||
ASSERT( fVolume <= 1 );
|
||||
ASSERT_M( fVolume >= 0 && fVolume <= 1, ssprintf("%f",fVolume) );
|
||||
|
||||
if( fVolume == 0 )
|
||||
fVolume = 0.001f; // fix log10f(0) == -INF
|
||||
|
||||
Reference in New Issue
Block a user