WIP
This commit is contained in:
+11
-9
@@ -391,6 +391,8 @@ public:
|
||||
|
||||
// I apologize about this.
|
||||
ScreenShakeUpdate(dt);
|
||||
} else {
|
||||
m_EventBroker->Process<Systems::SoundSystem>();
|
||||
}
|
||||
m_EventBroker->Process<GUI::Frame>();
|
||||
m_FrameStack->UpdateLayered(dt);
|
||||
@@ -610,17 +612,17 @@ private:
|
||||
m_GameIsRunning = true;
|
||||
//Todo: Move this
|
||||
{
|
||||
dd::Events::PlaySound e;
|
||||
e.FilePath = "Sounds/BGM/under-the-sea-instrumental.wav";
|
||||
e.IsAmbient = true;
|
||||
m_EventBroker->Publish(e);
|
||||
// dd::Events::PlaySound e;
|
||||
// e.FilePath = "Sounds/BGM/under-the-sea-instrumental.wav";
|
||||
// e.IsAmbient = true;
|
||||
// m_EventBroker->Publish(e);
|
||||
}
|
||||
{
|
||||
dd::Events::PlaySound e;
|
||||
e.FilePath = "Sounds/BGM/water-flowing.wav";
|
||||
e.Gain = 0.3f;
|
||||
e.IsAmbient = true;
|
||||
m_EventBroker->Publish(e);
|
||||
// dd::Events::PlaySound e;
|
||||
// e.FilePath = "Sounds/BGM/water-flowing.wav";
|
||||
// e.Gain = 0.3f;
|
||||
// e.IsAmbient = true;
|
||||
// m_EventBroker->Publish(e);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -75,6 +75,10 @@ protected:
|
||||
Events::ButtonEnter e;
|
||||
e.FrameName = m_Name;
|
||||
EventBroker->Publish(e);
|
||||
Events::PlaySound soundEvent;
|
||||
soundEvent.FilePath = "Sounds/GUI/hover.wav";
|
||||
EventBroker->Publish(soundEvent);
|
||||
|
||||
} else if (!isOver && m_MouseIsOver) { // Leave
|
||||
if (!m_IsDown) {
|
||||
if (!m_TextureReleased.empty()) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "GUI/EButtonRelease.h"
|
||||
#include "GUI/ESliderUpdate.h"
|
||||
#include "Core/EMouseMove.h"
|
||||
#include "Sound/EPlaySound.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
@@ -79,6 +80,11 @@ private:
|
||||
if (event.Button == m_SliderButton) {
|
||||
m_IsGrabbed = true;
|
||||
}
|
||||
else {
|
||||
Events::PlaySound e;
|
||||
e.FilePath = "Sounds/GUI/click.wav";
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
if (m_Texture == nullptr) {
|
||||
m_Texture = ResourceManager::Load<dd::Texture>("Textures/Core/ErrorTexture.png");
|
||||
}
|
||||
|
||||
SizeToTexture();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ dd::Systems::SoundSystem::~SoundSystem()
|
||||
for (auto &bgm : m_BGMSourcesToBuffers) {
|
||||
alSourceStop(bgm.first);
|
||||
alDeleteSources(1, &bgm.first);
|
||||
bgm.second->~Sound();
|
||||
//bgm.second->~Sound();
|
||||
}
|
||||
for (auto &sfx : m_SFXSourcesToBuffers) {
|
||||
alSourceStop(sfx.first);
|
||||
alDeleteSources(1, &sfx.first);
|
||||
sfx.second->~Sound();
|
||||
//sfx.second->~Sound();
|
||||
}
|
||||
m_BGMSourcesToBuffers.clear();
|
||||
m_SFXSourcesToBuffers.clear();
|
||||
@@ -40,22 +40,20 @@ void dd::Systems::SoundSystem::Initialize()
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStopSound, &SoundSystem::OnStopSound);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EMasterVolume, &SoundSystem::OnMasterVolume);
|
||||
|
||||
//Todo: Move this
|
||||
{
|
||||
dd::Events::PlaySound e;
|
||||
e.FilePath = "Sounds/BGM/under-the-sea-instrumental.wav";
|
||||
e.IsAmbient = true;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
{
|
||||
dd::Events::PlaySound e;
|
||||
e.FilePath = "Sounds/BGM/water-flowing.wav";
|
||||
e.Gain = 0.3f;
|
||||
e.IsAmbient = true;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
|
||||
|
||||
// //Todo: Move this
|
||||
// {
|
||||
// dd::Events::PlaySound e;
|
||||
// e.FilePath = "Sounds/BGM/under-the-sea-instrumental.wav";
|
||||
// e.IsAmbient = true;
|
||||
// EventBroker->Publish(e);
|
||||
// }
|
||||
// {
|
||||
// dd::Events::PlaySound e;
|
||||
// e.FilePath = "Sounds/BGM/water-flowing.wav";
|
||||
// e.Gain = 0.3f;
|
||||
// e.IsAmbient = true;
|
||||
// EventBroker->Publish(e);
|
||||
// }
|
||||
}
|
||||
|
||||
void dd::Systems::SoundSystem::Update(double dt)
|
||||
@@ -181,10 +179,10 @@ bool dd::Systems::SoundSystem::OnContact(const dd::Events::Contact &event)
|
||||
//Send play-sound event
|
||||
|
||||
{
|
||||
dd::Events::PlaySound e;
|
||||
e.FilePath = collisionSound->FilePath;
|
||||
e.IsAmbient = false;
|
||||
EventBroker->Publish(e);
|
||||
// dd::Events::PlaySound e;
|
||||
// e.FilePath = collisionSound->FilePath;
|
||||
// e.IsAmbient = false;
|
||||
// EventBroker->Publish(e);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user