Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/components/CCmpSoundManager.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | public: | ||||
virtual void PlaySoundGroupAtPosition(const std::wstring& name, const CFixedVector3D& sourcePos) | virtual void PlaySoundGroupAtPosition(const std::wstring& name, const CFixedVector3D& sourcePos) | ||||
{ | { | ||||
if (!g_SoundManager) | if (!g_SoundManager) | ||||
return; | return; | ||||
g_SoundManager->PlayAsGroup(name, CVector3D(sourcePos), INVALID_ENTITY, false); | g_SoundManager->PlayAsGroup(name, CVector3D(sourcePos), INVALID_ENTITY, false); | ||||
} | } | ||||
virtual void PlaySoundGroupForPlayer(const VfsPath& groupPath, const player_id_t playerId) const | |||||
{ | |||||
if (!g_SoundManager) | |||||
return; | |||||
g_SoundManager->PlayAsGroup(groupPath, CVector3D(0.f, 0.f, 0.f), INVALID_ENTITY, GetSimContext().GetCurrentDisplayedPlayer() == playerId); | |||||
} | |||||
virtual void StopMusic() | virtual void StopMusic() | ||||
{ | { | ||||
if (!g_SoundManager) | if (!g_SoundManager) | ||||
return; | return; | ||||
g_SoundManager->Pause(true); | g_SoundManager->Pause(true); | ||||
} | } | ||||
}; | }; | ||||
REGISTER_COMPONENT_TYPE(SoundManager) | REGISTER_COMPONENT_TYPE(SoundManager) | ||||
Wildfire Games · Phabricator