Added Listener component
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user