MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / SetMinMaxDistance

Method SetMinMaxDistance

CrySoundSystem/Sound.cpp:707–736  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

705
706//////////////////////////////////////////////////////////////////////
707void CSound::SetMinMaxDistance(float fMinDist, float fMaxDist)
708{
709 //FRAME_PROFILER( "CSound:SetMinMaxDistance",m_pSSys->GetSystem(),PROFILE_SOUND );
710
711 // increasing mindistnace makes it louder in 3d space
712
713 m_fMinDist=fMinDist;
714 m_fMaxDist=fMaxDist;
715
716 m_fMaxRadius2=fMaxDist*fMaxDist;
717 m_fMinRadius2=fMinDist*fMinDist;
718 float fPreloadRadius=fMaxDist+SOUND_PRELOAD_DISTANCE;
719 m_fPreloadRadius2=fPreloadRadius*fPreloadRadius;
720
721#ifdef _DEBUG
722 if(fMinDist<0.1f)
723 {
724 m_pSSys->m_pILog->LogToConsole("SOUND[%s] min out of range %f",GetName(),fMinDist);
725 }
726 if(fMaxDist>1000000000.0f)
727 {
728 m_pSSys->m_pILog->LogToConsole("SOUND[%s] max out of range %f",GetName(),fMaxDist);
729 }
730#endif
731 if (m_pSound->GetSample())
732 {
733 GUARD_HEAP;
734 CS_Sample_SetMinMaxDistance(m_pSound->GetSample(), fMinDist, CRYSOUND_MAXDIST);//fMaxDist);
735 }
736}
737
738//////////////////////////////////////////////////////////////////////
739void CSound::SetAttrib(int nVolume, float fRatio, int nPan, int nFreq, bool bSetRatio)

Callers 3

ApplySoundKeyMethod · 0.45
LoadDialogMethod · 0.45
PlaySoundMethod · 0.45

Calls 2

GetSampleMethod · 0.80
LogToConsoleMethod · 0.45

Tested by

no test coverage detected