mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
cleanup SOundManaer component
This was SVN commit r13475.
This commit is contained in:
parent
26dbac8d57
commit
da17e4329b
1 changed files with 14 additions and 24 deletions
|
|
@ -28,9 +28,8 @@
|
|||
class CCmpSoundManager : public ICmpSoundManager
|
||||
{
|
||||
public:
|
||||
static void ClassInit(CComponentManager& componentManager)
|
||||
static void ClassInit(CComponentManager& UNUSED(componentManager) )
|
||||
{
|
||||
componentManager.SubscribeToMessageType(MT_Update);
|
||||
}
|
||||
|
||||
DEFAULT_COMPONENT_ALLOCATOR(SoundManager)
|
||||
|
|
@ -59,36 +58,27 @@ public:
|
|||
Init(paramNode);
|
||||
}
|
||||
|
||||
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
|
||||
{
|
||||
switch (msg.GetType())
|
||||
{
|
||||
case MT_Update:
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void PlaySoundGroup(std::wstring name, entity_id_t source)
|
||||
{
|
||||
if ( g_SoundManager )
|
||||
{
|
||||
CmpPtr<ICmpRangeManager> cmpRangeManager(GetSimContext(), SYSTEM_ENTITY);
|
||||
ICmpRangeManager::ELosVisibility vis = cmpRangeManager->GetLosVisibility(source, GetSimContext().GetCurrentDisplayedPlayer());
|
||||
if ( ! g_SoundManager )
|
||||
return;
|
||||
|
||||
if (vis == ICmpRangeManager::VIS_VISIBLE)
|
||||
CmpPtr<ICmpRangeManager> cmpRangeManager(GetSimContext(), SYSTEM_ENTITY);
|
||||
ICmpRangeManager::ELosVisibility vis = cmpRangeManager->GetLosVisibility(source, GetSimContext().GetCurrentDisplayedPlayer());
|
||||
|
||||
if (vis == ICmpRangeManager::VIS_VISIBLE)
|
||||
{
|
||||
if (source != INVALID_ENTITY)
|
||||
{
|
||||
if (source != INVALID_ENTITY)
|
||||
CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), source);
|
||||
if (cmpPosition && cmpPosition->IsInWorld())
|
||||
{
|
||||
CmpPtr<ICmpPosition> cmpPosition(GetSimContext(), source);
|
||||
if (cmpPosition && cmpPosition->IsInWorld())
|
||||
{
|
||||
CVector3D sourcePos = CVector3D(cmpPosition->GetPosition());
|
||||
g_SoundManager->PlayAsGroup(name, sourcePos, source);
|
||||
}
|
||||
CVector3D sourcePos = CVector3D(cmpPosition->GetPosition());
|
||||
g_SoundManager->PlayAsGroup(name, sourcePos, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue