mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Make detail flag work for sounds (fixes #103)
This commit is contained in:
parent
91bc16c037
commit
0071fbaf8d
|
@ -1,4 +1,3 @@
|
|||
|
||||
#include <engine/engine.h>
|
||||
#include <engine/sound.h>
|
||||
|
||||
|
@ -76,12 +75,13 @@ void CMapSounds::OnMapLoad()
|
|||
CSourceQueueEntry source;
|
||||
source.m_Sound = pSoundLayer->m_Sound;
|
||||
source.m_pSource = &pSources[i];
|
||||
source.m_HighDetail = pLayer->m_Flags&LAYERFLAG_DETAIL;
|
||||
|
||||
if(!source.m_pSource || source.m_Sound == -1)
|
||||
continue;
|
||||
|
||||
m_lSourceQueue.add(source);
|
||||
}
|
||||
m_lSourceQueue.add(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ void CMapSounds::OnRender()
|
|||
Client()->IntraGameTick());
|
||||
}
|
||||
float offset = s_Time-pSource->m_pSource->m_TimeDelay;
|
||||
if(offset >= 0.0f && g_Config.m_SndEnable)
|
||||
if(offset >= 0.0f && g_Config.m_SndEnable && (g_Config.m_GfxHighDetail || !pSource->m_HighDetail))
|
||||
{
|
||||
if(pSource->m_Voice.IsValid())
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@ class CMapSounds : public CComponent
|
|||
struct CSourceQueueEntry
|
||||
{
|
||||
int m_Sound;
|
||||
bool m_HighDetail;
|
||||
ISound::CVoiceHandle m_Voice;
|
||||
CSoundSource *m_pSource;
|
||||
|
||||
|
@ -31,4 +32,4 @@ public:
|
|||
virtual void OnMapLoad();
|
||||
virtual void OnRender();
|
||||
virtual void OnStateChange(int NewState, int OldState);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue