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