1 | #ifndef GAME_CLIENT_COMPONENTS_MAPSOUNDS_H |
---|---|
2 | #define GAME_CLIENT_COMPONENTS_MAPSOUNDS_H |
3 | |
4 | #include <vector> |
5 | |
6 | #include <engine/sound.h> |
7 | |
8 | #include <game/client/component.h> |
9 | #include <game/mapitems.h> |
10 | |
11 | struct CSoundSource; |
12 | |
13 | class CMapSounds : public CComponent |
14 | { |
15 | int m_aSounds[MAX_MAPSOUNDS]; |
16 | int m_Count; |
17 | |
18 | struct CSourceQueueEntry |
19 | { |
20 | int m_Sound; |
21 | bool m_HighDetail; |
22 | ISound::CVoiceHandle m_Voice; |
23 | CSoundSource *m_pSource; |
24 | |
25 | bool operator==(const CSourceQueueEntry &Other) const { return (m_Sound == Other.m_Sound) && (m_Voice == Other.m_Voice) && (m_pSource == Other.m_pSource); } |
26 | }; |
27 | |
28 | std::vector<CSourceQueueEntry> m_vSourceQueue; |
29 | |
30 | void Clear(); |
31 | |
32 | public: |
33 | CMapSounds(); |
34 | virtual int Sizeof() const override { return sizeof(*this); } |
35 | |
36 | virtual void OnMapLoad() override; |
37 | virtual void OnRender() override; |
38 | virtual void OnStateChange(int NewState, int OldState) override; |
39 | }; |
40 | |
41 | #endif // GAME_CLIENT_COMPONENTS_MAPSOUNDS_H |
42 |