Removed logic that's no longer needed.

This commit is contained in:
stiffly
2016-02-29 16:26:09 +01:00
parent 67dffafe5a
commit 4fd578c764
5 changed files with 3 additions and 41 deletions
+1 -1
Submodule assets updated: cea183a06a...d72b3b4b47
-1
View File
@@ -88,7 +88,6 @@ private:
void stopSound(Source* source);
Source* createSource(std::string filePath);
std::unordered_map<EntityID, Source*> m_Sources;
void mainMenuLoop();
void matchBGMLoop();
Source* m_CurrentBGM;
Source* m_CurrentBGMCombo;
-5
View File
@@ -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;
+1 -15
View File
@@ -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);
+1 -19
View File
@@ -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;
}