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

Method PlaySound

CryEntitySystem/Entity.cpp:877–904  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

875
876//////////////////////////////////////////////////////////////////////////
877void CEntity::PlaySound(ISound *pSound, float fSoundScale, Vec3d &Offset)
878{
879 m_bUpdateSounds = true;
880 if (m_lstAttachedSounds.size()<15)
881 {
882 bool bWasPlaying = pSound->IsPlaying();
883 pSound->SetPosition(GetSoundPos());
884 pSound->Play(fSoundScale);
885 // If this sound already playing don`t add it again for playback.
886 if (!bWasPlaying && pSound->IsPlaying())
887 {
888 m_lstAttachedSounds.push_back(SAttachedSound(pSound, Offset));
889 }
890 }
891 else
892 {
893 m_pISystem->GetILog()->Log("\001 warning trying to attach more than 15 sounds to %s",m_name.c_str());
894 int ddd=1;
895 for(SoundsList::iterator sItr = m_lstAttachedSounds.begin();sItr!=m_lstAttachedSounds.end(); ++sItr,++ddd)
896 {
897 ISound *pDbg = (*sItr).pSound;
898
899 m_pISystem->GetILog()->Log("\005 %d. %s",ddd,pDbg->GetName());
900 }
901 // let's clear it, to restore from an erroneous situation
902 m_lstAttachedSounds.clear();
903 }
904}
905
906//////////////////////////////////////////////////////////////////////////
907void CEntity::MoveTo(const Vec3d &pos, bool moveObjects, bool bUpdatePhysics)

Callers

nothing calls this directly

Calls 13

SAttachedSoundClass · 0.85
GetILogMethod · 0.80
sizeMethod · 0.45
IsPlayingMethod · 0.45
SetPositionMethod · 0.45
PlayMethod · 0.45
push_backMethod · 0.45
LogMethod · 0.45
c_strMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected