Removed logic that's no longer needed.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user