Added Listener component

This commit is contained in:
Stiffly
2014-05-19 22:13:52 +02:00
parent 73afc8dad4
commit d06702a7e0
5 changed files with 41 additions and 2 deletions
+15 -2
View File
@@ -6,12 +6,15 @@ void Systems::SoundSystem::Initialize()
{
FMOD_RESULT result;
result = FMOD::System_Create(&m_FmodSystem);
result = m_FmodSystem->init(32, FMOD_INIT_NORMAL, 0);
FMOD::Sound *sound;
FMOD::Channel *channel;
FMOD_VECTOR pos;
pos.x = 0.f;
pos.y = 0.f;
pos.z = 0.f;
m_FmodSystem->createSound("Sounds/WUB.mp3", FMOD_HARDWARE, 0, &sound);
m_FmodSystem->playSound(FMOD_CHANNEL_FREE, sound, false, 0);
}
@@ -19,6 +22,7 @@ void Systems::SoundSystem::Initialize()
void Systems::SoundSystem::RegisterComponents(ComponentFactory* cf)
{
cf->Register<Components::SoundEmitter>([]() { return new Components::SoundEmitter(); });
cf->Register<Components::Listener>([]() { return new Components::Listener(); });
}
void Systems::SoundSystem::RegisterResourceTypes(ResourceManager* rm)
@@ -30,3 +34,12 @@ void Systems::SoundSystem::Update(double dt)
{
m_FmodSystem->update();
}
void Systems::SoundSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
{
auto listener = m_World->GetComponent<Components::Listener>(entity);
if(listener)
{
}
}