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

Method SetSoundVolume

CrySystem/ScriptObjectSound.cpp:667–686  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// ! Change the volume of a sound @param nID ID of the sound @param iVolume volume between 0 and 100 */

Source from the content-addressed store, hash-verified

665 @param iVolume volume between 0 and 100
666*/
667int CScriptObjectSound::SetSoundVolume(IFunctionHandler *pH)
668{
669 CHECK_PARAMETERS(2);
670 int nCookie=0;
671 int iVolume=0;
672 ISound *pSound=NULL;
673 pH->GetParamUDVal(1,(INT_PTR &)pSound,nCookie);
674
675 pH->GetParam(2,iVolume);
676
677
678 if (pSound && (nCookie==USER_DATA_SOUND))
679 {
680 if (iVolume<0)
681 iVolume=0;
682 pSound->SetVolume(iVolume);
683 }
684
685 return pH->EndFunction();
686}
687/////////////////////////////////////////////////////////////////////////////////
688/////////////////////////////////////////////////////////////////////////////////
689/*! Change the looping status of a looped sound

Callers

nothing calls this directly

Calls 4

EndFunctionMethod · 0.80
GetParamUDValMethod · 0.45
GetParamMethod · 0.45
SetVolumeMethod · 0.45

Tested by

no test coverage detected