WIP pull request fixes
This commit is contained in:
@@ -1,21 +0,0 @@
|
|||||||
#ifndef Systems_BackgroundMusicSystem_h__
|
|
||||||
#define Systems_BackgroundMusicSystem_h__
|
|
||||||
|
|
||||||
#include "../Engine/Core/System.h"
|
|
||||||
#include "../Engine/Core/EventBroker.h"
|
|
||||||
|
|
||||||
// Handles transitions between BGM's depending on the current state of the game.
|
|
||||||
class BackgroundMusicSystem : public PureSystem
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BackgroundMusicSystem(SystemParams params);
|
|
||||||
~BackgroundMusicSystem();
|
|
||||||
void UpdateComponent(EntityWrapper& entity, ComponentWrapper& cEmitter, double dt) override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void mainMenuLoop();
|
|
||||||
|
|
||||||
const std::string menu = "Audio/crosscounter.wav";
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // ifndef
|
|
||||||
@@ -592,7 +592,7 @@ void Server::parseOnInputCommand(Packet& packet)
|
|||||||
e.Player = EntityWrapper(m_World, m_ConnectedPlayers.at(player).EntityID);
|
e.Player = EntityWrapper(m_World, m_ConnectedPlayers.at(player).EntityID);
|
||||||
e.Value = packet.ReadPrimitive<float>();
|
e.Value = packet.ReadPrimitive<float>();
|
||||||
m_EventBroker->Publish(e);
|
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);
|
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);
|
//LOG_INFO("Server::parseOnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ bool SoundManager::OnPlayAnnouncerVoice(const Events::PlayAnonuncerVoice& e)
|
|||||||
auto listenerComponents = m_World->GetComponents("Listener");
|
auto listenerComponents = m_World->GetComponents("Listener");
|
||||||
for (auto it = listenerComponents->begin(); it != listenerComponents->end(); it++) {
|
for (auto it = listenerComponents->begin(); it != listenerComponents->end(); it++) {
|
||||||
if ((*it).EntityID != m_LocalPlayer.ID) {
|
if ((*it).EntityID != m_LocalPlayer.ID) {
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
auto emitterChild = m_World->CreateEntity((*it).EntityID);
|
auto emitterChild = m_World->CreateEntity((*it).EntityID);
|
||||||
auto emitter = m_World->AttachComponent(emitterChild, "SoundEmitter");
|
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)
|
bool SoundManager::OnChangeBGM(const Events::ChangeBGM &e)
|
||||||
{
|
{
|
||||||
if (m_CurrentBGM != nullptr) {
|
if (m_CurrentBGM != nullptr) {
|
||||||
stopSound(m_CurrentBGM);
|
stopSound(m_CurrentBGM);
|
||||||
}
|
}
|
||||||
m_CurrentBGM = createSource(e.FilePath);
|
m_CurrentBGM = createSource(e.FilePath);
|
||||||
m_CurrentBGM->Type = SoundType::BGM;
|
m_CurrentBGM->Type = SoundType::BGM;
|
||||||
@@ -419,10 +419,18 @@ void SoundManager::setSoundProperties(Source* source, ComponentWrapper* soundCom
|
|||||||
{
|
{
|
||||||
float gain;
|
float gain;
|
||||||
switch (source->Type) {
|
switch (source->Type) {
|
||||||
case SoundType::SFX: gain = m_SFXVolumeChannel; break;
|
case SoundType::SFX:
|
||||||
case SoundType::BGM: gain = m_BGMVolumeChannel; break;
|
gain = m_SFXVolumeChannel;
|
||||||
case SoundType::Announcer: gain = m_AnnouncerVolumeChannel; break;
|
break;
|
||||||
default: gain = 1.f; 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_GAIN, (float)(double)(*soundComponent)["Gain"] * gain);
|
||||||
alSourcef(source->ALsource, AL_PITCH, (float)(double)(*soundComponent)["Pitch"]);
|
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()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user