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

Method PlaySound

CrySystem/ScriptObjectSound.cpp:589–613  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// ! Load a streaming sound @param sSound filename of the sound @return nil or sound ID in case of success */ int CScriptObjectSound::LoadStreamSoundLocalized(IFunctionHandler *pH) { if (pH->GetParamCount()<1 || pH->GetParamCount()>2) { m_pSc

Source from the content-addressed store, hash-verified

587 @see CScriptObjectSound::SetSoundLoop
588*/
589int CScriptObjectSound::PlaySound(IFunctionHandler *pH)
590{
591 int nCookie=0;
592 float fVolumeScale=1.0f;
593 ISound *pSound=NULL;
594
595 if(pH->GetParamUDVal(1,(USER_DATA &)pSound,nCookie) && pSound && (nCookie==USER_DATA_SOUND)) //AMD Port
596 {
597 if (pH->GetParamCount()>1)
598 {
599 if(!pH->GetParam(2,fVolumeScale))
600 {
601 fVolumeScale=1.0f;
602 }
603 }
604
605 pSound->Play(fVolumeScale);
606 }
607 else
608 {
609 if(m_pSoundSystem)
610 m_pScriptSystem->RaiseError("PlaySound NULL SOUND!!");
611 }
612 return pH->EndFunction();
613}
614
615//////////////////////////////////////////////////////////////////////////
616int CScriptObjectSound::PlaySoundFadeUnderwater(IFunctionHandler *pH)

Callers

nothing calls this directly

Calls 6

RaiseErrorMethod · 0.80
EndFunctionMethod · 0.80
GetParamUDValMethod · 0.45
GetParamCountMethod · 0.45
GetParamMethod · 0.45
PlayMethod · 0.45

Tested by

no test coverage detected