This commit is contained in:
Adam
2014-03-13 20:52:54 +01:00
parent d5ed8fc4f3
commit 6d3c564295
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ void GameWorld::Initialize()
bounds->VolumeVector = glm::vec3(4.f, 0.7f, 1); bounds->VolumeVector = glm::vec3(4.f, 0.7f, 1);
soundEmitter = AddComponent<Components::SoundEmitter>(m_Player, "SoundEmitter"); soundEmitter = AddComponent<Components::SoundEmitter>(m_Player, "SoundEmitter");
soundEmitter->Loop = true; soundEmitter->Loop = true;
soundEmitter->MaxDistance = FLT_MAX; //soundEmitter->MaxDistance = FLT_MAX;
soundEmitter->ReferenceDistance = 10; soundEmitter->ReferenceDistance = 10;
soundEmitter->Gain = 1; soundEmitter->Gain = 1;
soundEmitter->Pitch = 1; soundEmitter->Pitch = 1;
+3 -3
View File
@@ -89,14 +89,14 @@ void Systems::SoundSystem::PlaySound(std::shared_ptr<Components::SoundEmitter> e
void Systems::SoundSystem::PlaySound(std::shared_ptr<Components::SoundEmitter> emitter) void Systems::SoundSystem::PlaySound(std::shared_ptr<Components::SoundEmitter> emitter)
{ {
ALuint buffer = LoadFile(emitter->Path); ALuint buffer = LoadFile(emitter->Path);
ALuint source = m_Source[emitter.get()]; ALuint source = m_Sources[emitter.get()];
alSourcei(source, AL_BUFFER, buffer); alSourcei(source, AL_BUFFER, buffer);
alSourcePlay(m_Source[emitter.get()]); alSourcePlay(m_Sources[emitter.get()]);
} }
void Systems::SoundSystem::StopSound(std::shared_ptr<Components::SoundEmitter> emitter) void Systems::SoundSystem::StopSound(std::shared_ptr<Components::SoundEmitter> emitter)
{ {
alSourceStop(m_Source[emitter.get()]); alSourceStop(m_Sources[emitter.get()]);
} }
void Systems::SoundSystem::OnComponentCreated(std::string type, std::shared_ptr<Component> component) void Systems::SoundSystem::OnComponentCreated(std::string type, std::shared_ptr<Component> component)