//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// ! Change the volume of a sound @param nID ID of the sound @param iVolume volume between 0 and 100 */
| 665 | @param iVolume volume between 0 and 100 |
| 666 | */ |
| 667 | int 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 |
nothing calls this directly
no test coverage detected