ddnet/src/game/client/components/mapsounds.h

34 lines
644 B
C
Raw Normal View History

2014-10-10 17:10:57 +00:00
#pragma once
#include <base/tl/array.h>
2014-10-12 14:12:13 +00:00
#include <engine/sound.h>
2014-10-10 17:10:57 +00:00
#include <game/client/component.h>
class CMapSounds : public CComponent
{
int m_aSounds[64];
int m_Count;
2014-10-12 14:12:13 +00:00
struct CSourceQueueEntry
2014-10-11 11:38:08 +00:00
{
int m_Sound;
2014-10-18 13:21:13 +00:00
ISound::CVoiceHandle m_Voice;
2014-10-11 11:38:08 +00:00
CSoundSource *m_pSource;
2014-10-18 13:21:13 +00:00
bool operator ==(const CSourceQueueEntry &Other) const { return (m_Sound == Other.m_Sound) && (m_Voice == Other.m_Voice) && (m_pSource == Other.m_pSource); }
2014-10-11 11:38:08 +00:00
};
2014-10-12 14:12:13 +00:00
array<CSourceQueueEntry> m_lSourceQueue;
2014-10-18 13:21:13 +00:00
void Clear();
2014-10-10 17:10:57 +00:00
public:
CMapSounds();
virtual void OnMapLoad();
virtual void OnRender();
2014-10-18 13:21:13 +00:00
virtual void OnStateChange(int NewState, int OldState);
2014-10-10 17:10:57 +00:00
};