//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// ! Load a streaming sound @param sSound filename of the sound @return nil or sound ID in case of success */
| 490 | @return nil or sound ID in case of success |
| 491 | */ |
| 492 | int 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 | ///////////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected