Merge branch 'master' into LevelSystemAndSuch

This commit is contained in:
PlatinumSkink
2015-10-20 11:44:57 +02:00
11 changed files with 75 additions and 39 deletions
+11 -9
View File
@@ -229,6 +229,8 @@ public:
//ResourceManager::Update();
if (m_GameIsRunning) {
m_World->Update(dt);
} else {
m_EventBroker->Process<Systems::SoundSystem>();
}
m_EventBroker->Process<GUI::Frame>();
m_FrameStack->UpdateLayered(dt);
@@ -428,17 +430,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;
+4
View File
@@ -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()) {
+6
View File
@@ -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;
}
+1
View File
@@ -62,6 +62,7 @@ public:
if (m_Texture == nullptr) {
m_Texture = ResourceManager::Load<dd::Texture>("Textures/Core/ErrorTexture.png");
}
SizeToTexture();
}
-4
View File
@@ -1,7 +1,3 @@
//
// Created by Adam on 2015-09-25.
//
#ifndef EVENTS_EGAMESTART_H__
#define EVENTS_EGAMESTART_H__
+1
View File
@@ -14,6 +14,7 @@ class Sound : public Resource
friend class ResourceManager;
public:
~Sound();
ALuint Buffer() { return m_Buffer; };
std::string Path() { return m_Path; };
float Gain() { return m_Gain; };
+10 -4
View File
@@ -10,15 +10,17 @@
#include "Core/ResourceManager.h"
#include "Core/ConfigFile.h"
#include "Sound.h"
#include "Sound/EPlaySound.h"
#include "Sound/EStopSound.h"
#include "Sound/EMasterVolume.h"
#include "Sound/CCollisionSound.h"
#include "Physics/EContact.h"
#include "Game/CBall.h"
#include "Game/CBrick.h"
#include "Game/CPad.h"
#include "Sound/EPlaySound.h"
#include "Sound/EStopSound.h"
#include "Sound/EMasterVolume.h"
#include "Physics/ECreateParticleSequence.h"
#include "Physics/EContact.h"
#include "Game/EGameStart.h"
namespace dd
{
@@ -41,6 +43,7 @@ private:
std::map<ALuint, Sound*> m_BGMSourcesToBuffers;
std::map<ALuint, Sound*> m_SFXSourcesToBuffers;
ALCdevice* m_Device = nullptr;
ALCcontext* m_Context = nullptr;
//Events
dd::EventRelay<SoundSystem, dd::Events::PlaySound> m_EPlaySFX;
@@ -52,6 +55,9 @@ private:
bool OnStopSound(const dd::Events::StopSound &event);
dd::EventRelay<SoundSystem, dd::Events::MasterVolume> m_EMasterVolume;
bool OnMasterVolume(const dd::Events::MasterVolume &event);
dd::EventRelay<SoundSystem, dd::Events::GameStart> m_EGameStart;
bool OnGameStart(const dd::Events::GameStart &event);
ALuint CreateSource();
};