tracking down volume related assert

This commit is contained in:
Chris Danford
2005-10-07 05:29:33 +00:00
parent 052a0166df
commit e80dcafbdd
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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() {
+2
View File
@@ -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 */
+1 -2
View File
@@ -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