WIP pull request fixes

This commit is contained in:
stiffly
2016-03-12 14:26:09 +01:00
parent 28d576bfc0
commit 9942747d41
4 changed files with 15 additions and 51 deletions
+1 -1
View File
@@ -592,7 +592,7 @@ void Server::parseOnInputCommand(Packet& packet)
e.Player = EntityWrapper(m_World, m_ConnectedPlayers.at(player).EntityID);
e.Value = packet.ReadPrimitive<float>();
m_EventBroker->Publish(e);
if (e.Command == "PrimaryFire" || e.Command == "Reload") {
if (e.Command == "PrimaryFire" || e.Command == "Reload" || e.Command == "Jump") {
m_InputCommandsToBroadcast.push_back(e);
}
//LOG_INFO("Server::parseOnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
+14 -6
View File
@@ -297,7 +297,7 @@ bool SoundManager::OnPlayAnnouncerVoice(const Events::PlayAnonuncerVoice& e)
auto listenerComponents = m_World->GetComponents("Listener");
for (auto it = listenerComponents->begin(); it != listenerComponents->end(); it++) {
if ((*it).EntityID != m_LocalPlayer.ID) {
break;
continue;
}
auto emitterChild = m_World->CreateEntity((*it).EntityID);
auto emitter = m_World->AttachComponent(emitterChild, "SoundEmitter");
@@ -394,7 +394,7 @@ bool SoundManager::OnPlayQueueOnEntity(const Events::PlayQueueOnEntity &e)
bool SoundManager::OnChangeBGM(const Events::ChangeBGM &e)
{
if (m_CurrentBGM != nullptr) {
stopSound(m_CurrentBGM);
stopSound(m_CurrentBGM);
}
m_CurrentBGM = createSource(e.FilePath);
m_CurrentBGM->Type = SoundType::BGM;
@@ -419,10 +419,18 @@ void SoundManager::setSoundProperties(Source* source, ComponentWrapper* soundCom
{
float gain;
switch (source->Type) {
case SoundType::SFX: gain = m_SFXVolumeChannel; break;
case SoundType::BGM: gain = m_BGMVolumeChannel; break;
case SoundType::Announcer: gain = m_AnnouncerVolumeChannel; break;
default: gain = 1.f; break;
case SoundType::SFX:
gain = m_SFXVolumeChannel;
break;
case SoundType::BGM:
gain = m_BGMVolumeChannel;
break;
case SoundType::Announcer:
gain = m_AnnouncerVolumeChannel;
break;
default:
gain = 1.f;
break;
}
alSourcef(source->ALsource, AL_GAIN, (float)(double)(*soundComponent)["Gain"] * gain);
alSourcef(source->ALsource, AL_PITCH, (float)(double)(*soundComponent)["Pitch"]);
@@ -1,23 +0,0 @@
#include "../Game/Systems/BackgroundMusicSystem.h"
BackgroundMusicSystem::BackgroundMusicSystem(SystemParams params)
: System(params)
, PureSystem("SoundEmitter")
{
}
BackgroundMusicSystem::~BackgroundMusicSystem()
{
}
void BackgroundMusicSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cEmitter, double dt)
{
}
void BackgroundMusicSystem::mainMenuLoop()
{
}