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

Method LoadStreamSound

CrySystem/ScriptObjectSound.cpp:492–529  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// ! Load a streaming sound @param sSound filename of the sound @return nil or sound ID in case of success */

Source from the content-addressed store, hash-verified

490 @return nil or sound ID in case of success
491*/
492int CScriptObjectSound::LoadStreamSound(IFunctionHandler *pH)
493{
494 if (pH->GetParamCount()<1 || pH->GetParamCount()>2)
495 {
496 m_pScriptSystem->RaiseError("System.LoadStreamSound wrong number of arguments");
497 return pH->EndFunctionNull();
498 };
499
500/*
501 ICVar *pMusic=m_pSystem->GetIConsole()->GetCVar("g_MusicEnable");
502 if (pMusic && (pMusic->GetIVal()==0))
503 return (pH->EndFunctionNull());
504*/
505 const char *sSound;
506// int nID;
507 ISound *pSound;
508 pH->GetParam(1,sSound);
509
510 int nFlags=0;
511 if (pH->GetParamCount()>1)
512 pH->GetParam(2, nFlags);
513
514 if (m_pSoundSystem)
515 {
516 pSound=m_pSoundSystem->LoadSound(sSound,FLAG_SOUND_STREAM | nFlags);
517 if (pSound)
518 {
519 pSound->AddRef();
520 USER_DATA ud=m_pScriptSystem->CreateUserData((INT_PTR)pSound,USER_DATA_SOUND); //AMD Port
521 return pH->EndFunction(ud);
522 }
523 }else
524 {
525 m_pScriptSystem->RaiseError("Sound.LoadStreamSound error loading %s",sSound);
526 }
527 return pH->EndFunctionNull();
528
529}
530
531
532/////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 8

RaiseErrorMethod · 0.80
EndFunctionNullMethod · 0.80
CreateUserDataMethod · 0.80
EndFunctionMethod · 0.80
GetParamCountMethod · 0.45
GetParamMethod · 0.45
LoadSoundMethod · 0.45
AddRefMethod · 0.45

Tested by

no test coverage detected