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

Method SetLoopMode

CrySoundSystem/Sound.cpp:629–657  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

627
628//////////////////////////////////////////////////////////////////////
629void CSound::SetLoopMode(bool bLoop)
630{
631 GUARD_HEAP;
632 //FRAME_PROFILER( "CSound:SetLoopMode",m_pSSys->GetSystem(),PROFILE_SOUND );
633
634 if (m_pSound->Loaded()) // && m_pSound->m_btType==SoundBuffer::btSAMPLE && m_pSound->m_data.m_sfx)
635 {
636 switch (m_pSound->GetType())
637 {
638 //case btSAMPLE: CS_Sample_SetMode(m_pSound->GetSample(), bLoop ? CS_LOOP_NORMAL : CS_LOOP_OFF); break;
639 case btSAMPLE: CS_Sample_SetMode(m_pSound->GetSample(), m_pSound->GetFModFlags(bLoop)); break;
640 //case btSTREAM: if (m_nChannel>=0) CS_SetLoopMode(m_nChannel, bLoop ? CS_LOOP_NORMAL : CS_LOOP_OFF); break; // [Lennert] this call screws up ! Always set loopmode before playing the stream-sound !
641 }
642 }
643 if (bLoop)
644 m_nFlags|=FLAG_SOUND_LOOP;
645 else
646 m_nFlags&=~FLAG_SOUND_LOOP;
647 if ((m_nFlags & FLAG_SOUND_STREAM) && (m_bLoop!=bLoop))
648 { // this is kinda unfortunate, but we have to reload the stream when we the change loop-mode because changing it runtime doesnt seem to work...
649 if (!m_pSound->NotLoaded())
650 {
651 m_pSound->AbortLoading();
652 m_pSound->DestroyData();
653 m_pSound->Load(bLoop, NULL);
654 }
655 }
656 m_bLoop=bLoop;
657}
658
659//////////////////////////////////////////////////////////////////////
660void CSound::SetPitching(float fPitching)

Callers 3

AddToSoundSystemMethod · 0.45
SetSoundLoopMethod · 0.45
LoadDialogMethod · 0.45

Calls 8

LoadedMethod · 0.80
GetSampleMethod · 0.80
GetFModFlagsMethod · 0.80
NotLoadedMethod · 0.80
DestroyDataMethod · 0.80
GetTypeMethod · 0.45
AbortLoadingMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected