From 4fd578c764262a4392e34138a3df710722cc57f1 Mon Sep 17 00:00:00 2001 From: stiffly Date: Mon, 29 Feb 2016 16:26:09 +0100 Subject: [PATCH] Removed logic that's no longer needed. --- assets | 2 +- include/Engine/Sound/SoundManager.h | 1 - include/Game/Systems/SoundSystem.h | 5 ----- src/Engine/Sound/SoundManager.cpp | 16 +--------------- src/Game/Systems/SoundSystem.cpp | 20 +------------------- 5 files changed, 3 insertions(+), 41 deletions(-) diff --git a/assets b/assets index cea183a0..d72b3b4b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit cea183a06a5dfbcb5ea9c0a3e76175c2e4b07bb2 +Subproject commit d72b3b4b47cb6a1de8d8ccc94ff9640b3d1e0d56 diff --git a/include/Engine/Sound/SoundManager.h b/include/Engine/Sound/SoundManager.h index fe5b4189..3452917c 100644 --- a/include/Engine/Sound/SoundManager.h +++ b/include/Engine/Sound/SoundManager.h @@ -88,7 +88,6 @@ private: void stopSound(Source* source); Source* createSource(std::string filePath); std::unordered_map m_Sources; - void mainMenuLoop(); void matchBGMLoop(); Source* m_CurrentBGM; Source* m_CurrentBGMCombo; diff --git a/include/Game/Systems/SoundSystem.h b/include/Game/Systems/SoundSystem.h index 37e78d32..3826b62a 100644 --- a/include/Game/Systems/SoundSystem.h +++ b/include/Game/Systems/SoundSystem.h @@ -35,11 +35,6 @@ private: std::string m_Announcer = ""; // Logic for playing a sound when a player jumps void playerJumps(); - - // Temporary solution for play test. - bool m_DrumsIsPlaying = false; - double m_DrumTimer = 0.0; - bool drumTimer(double dt); std::default_random_engine generator; diff --git a/src/Engine/Sound/SoundManager.cpp b/src/Engine/Sound/SoundManager.cpp index 940572c4..272cb89e 100644 --- a/src/Engine/Sound/SoundManager.cpp +++ b/src/Engine/Sound/SoundManager.cpp @@ -68,8 +68,6 @@ void SoundManager::Update(double dt) updateListener(dt); if (m_TempPleaseDeleteMeASAP) matchBGMLoop(); - if (false) - mainMenuLoop(); } void SoundManager::deleteInactiveEmitters() @@ -177,18 +175,6 @@ Source* SoundManager::createSource(std::string filePath) return source; } - -void SoundManager::mainMenuLoop() -{ - float time = getTimeOffsetSeconds(m_CurrentBGM); - //LOG_INFO("%f/%f", time, m_CurrentBGM->Duration); - // TODO: config? - if (m_CurrentBGM->Duration - time <= 5) { // 5 is hard coded value that Petter recommended - m_CurrentBGM = createSource("Audio/lalala.wav"); - playSound(m_CurrentBGM); - } -} - void SoundManager::matchBGMLoop() { if (m_CurrentBGMCombo == nullptr) @@ -377,7 +363,7 @@ bool SoundManager::OnPlayerSpawned(const Events::PlayerSpawned &e) if (m_TempPleaseDeleteMeASAP) { return true; } - m_CurrentBGMCombo = createSource("Audio/bgm/nearWin.wav"); + m_CurrentBGMCombo = createSource("Audio/bgm/layer2.wav"); m_CurrentBGMCombo->Type = SoundType::BGM; alSourcei(m_CurrentBGMCombo->ALsource, AL_LOOPING, 1); setGain(m_CurrentBGMCombo, 0); diff --git a/src/Game/Systems/SoundSystem.cpp b/src/Game/Systems/SoundSystem.cpp index 20336548..9020895d 100644 --- a/src/Game/Systems/SoundSystem.cpp +++ b/src/Game/Systems/SoundSystem.cpp @@ -25,11 +25,6 @@ void SoundSystem::Update(double dt) if (!IsClient) { return; } - - // Temp for play test. - if (m_DrumsIsPlaying) { - m_DrumsIsPlaying = !drumTimer(dt); - } } bool SoundSystem::OnPlayerSpawned(const Events::PlayerSpawned &e) @@ -42,7 +37,7 @@ bool SoundSystem::OnPlayerSpawned(const Events::PlayerSpawned &e) // TEMP: starts bgm { Events::PlayBackgroundMusic ev; - ev.FilePath = "Audio/bgm/ambient.wav"; + ev.FilePath = "Audio/bgm/layer1.wav"; m_EventBroker->Publish(ev); } } @@ -76,17 +71,6 @@ void SoundSystem::playerJumps() } } -bool SoundSystem::drumTimer(double dt) -{ - m_DrumTimer += dt; - if (m_DrumTimer > 15) { - m_DrumTimer = 0.0; - return true; - } else { - return false; - } -} - bool SoundSystem::OnCaptured(const Events::Captured & e) { int homeTeam = (int)m_World->GetComponent(e.CapturePointID, "Team")["Team"]; @@ -98,8 +82,6 @@ bool SoundSystem::OnCaptured(const Events::Captured & e) ev.FilePath = "Audio/announcer/" + m_Announcer + "/objective_failed.wav"; // have not been tested } m_EventBroker->Publish(ev); - // Temp for play test. - m_DrumsIsPlaying = false; return false; }