The win sound plays on win screen
This commit is contained in:
@@ -81,6 +81,7 @@ private:
|
|||||||
void setSoundProperties(Source* source, ComponentWrapper* soundComponent);
|
void setSoundProperties(Source* source, ComponentWrapper* soundComponent);
|
||||||
float getDurationSeconds(Source* source);
|
float getDurationSeconds(Source* source);
|
||||||
float getTimeOffsetSeconds(Source* source);
|
float getTimeOffsetSeconds(Source* source);
|
||||||
|
void setTimeOffsetSeconds(Source* source, float timeOffset);
|
||||||
|
|
||||||
// Specific logic
|
// Specific logic
|
||||||
void playSound(Source* source);
|
void playSound(Source* source);
|
||||||
|
|||||||
+6085
-6000
File diff suppressed because it is too large
Load Diff
@@ -417,8 +417,17 @@ bool SoundManager::OnSetCamera(const Events::SetCamera& e)
|
|||||||
alSourcei(m_CurrentBGMCombo->ALsource, AL_LOOPING, 1);
|
alSourcei(m_CurrentBGMCombo->ALsource, AL_LOOPING, 1);
|
||||||
setGain(m_CurrentBGMCombo, 0);
|
setGain(m_CurrentBGMCombo, 0);
|
||||||
playSound(m_CurrentBGMCombo);
|
playSound(m_CurrentBGMCombo);
|
||||||
} else if (e.CameraEntity.Name() == "WINCAMERAISH") {
|
} else if (m_World->HasComponent(e.CameraEntity.ID, "EndScreen")) {
|
||||||
// Play win sound!
|
float timeOffset = getTimeOffsetSeconds(m_CurrentBGM);
|
||||||
|
stopSound(m_CurrentBGM);
|
||||||
|
m_CurrentBGM = createSource("Audio/BGM/Layer3.wav");
|
||||||
|
m_CurrentBGM->Type = SoundType::BGM;
|
||||||
|
alSourcei(m_CurrentBGM->ALsource, AL_LOOPING, 1);
|
||||||
|
playSound(m_CurrentBGM);
|
||||||
|
setTimeOffsetSeconds(m_CurrentBGM, timeOffset);
|
||||||
|
//Events::ChangeBGM changeBGM;
|
||||||
|
//changeBGM.FilePath = "Audio/BGM/Layer3.wav";
|
||||||
|
//m_EventBroker->Publish(changeBGM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,6 +488,11 @@ float SoundManager::getTimeOffsetSeconds(Source* source)
|
|||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SoundManager::setTimeOffsetSeconds(Source * source, float timeOffset)
|
||||||
|
{
|
||||||
|
alSourcef(source->ALsource, AL_SEC_OFFSET, timeOffset);
|
||||||
|
}
|
||||||
|
|
||||||
void SoundManager::initOpenAL()
|
void SoundManager::initOpenAL()
|
||||||
{
|
{
|
||||||
// Initialize OpenAL
|
// Initialize OpenAL
|
||||||
|
|||||||
Reference in New Issue
Block a user