Some optimalizations to AudioChange

dev-ui
krzys-h 2013-04-13 15:07:08 +02:00
parent ebffda717b
commit e3b92fb9d8
1 changed files with 5 additions and 5 deletions

View File

@ -3476,10 +3476,9 @@ bool CRobotMain::EventFrame(const Event &event)
{ {
m_checkEndTime = m_time; m_checkEndTime = m_time;
CheckEndMission(true); CheckEndMission(true);
UpdateAudio(true);
} }
UpdateAudio(true);
if (m_winDelay > 0.0f && !m_editLock) if (m_winDelay > 0.0f && !m_editLock)
{ {
m_winDelay -= event.rTime; m_winDelay -= event.rTime;
@ -3667,7 +3666,7 @@ void CRobotMain::Convert()
} }
} }
if (Cmd(line, "EndMissionTake")) if (Cmd(line, "EndMissionTake") || Cmd(line, "AudioChange"))
{ {
char* p = strstr(line, "pos="); char* p = strstr(line, "pos=");
if (p != 0) if (p != 0)
@ -6595,6 +6594,8 @@ void CRobotMain::UpdateAudio(bool frame)
for (int t = 0; t < m_audioChangeTotal; t++) for (int t = 0; t < m_audioChangeTotal; t++)
{ {
if(m_audioChange[t].changed) continue;
Math::Vector bPos = m_audioChange[t].pos; Math::Vector bPos = m_audioChange[t].pos;
bPos.y = 0.0f; bPos.y = 0.0f;
@ -6635,8 +6636,7 @@ void CRobotMain::UpdateAudio(bool frame)
} }
if (nb >= m_audioChange[t].min && if (nb >= m_audioChange[t].min &&
nb <= m_audioChange[t].max && nb <= m_audioChange[t].max)
!m_audioChange[t].changed)
{ {
CLogger::GetInstancePointer()->Debug("Changing music...\n"); CLogger::GetInstancePointer()->Debug("Changing music...\n");
m_sound->StopMusic(); m_sound->StopMusic();