diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/soundscape_system.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/soundscape_system.h')
| -rw-r--r-- | game/server/soundscape_system.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/game/server/soundscape_system.h b/game/server/soundscape_system.h new file mode 100644 index 0000000..8cdc356 --- /dev/null +++ b/game/server/soundscape_system.h @@ -0,0 +1,65 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef SOUNDSCAPE_SYSTEM_H +#define SOUNDSCAPE_SYSTEM_H +#ifdef _WIN32 +#pragma once +#endif + + +#include "stringregistry.h" +#include "tier1/utlstring.h" +class CEnvSoundscape; + +struct clusterSoundscapeList_t +{ + unsigned short soundscapeCount; + unsigned short firstSoundscape; +}; + + + +class CSoundscapeSystem : public CAutoGameSystemPerFrame +{ +public: + CSoundscapeSystem( char const *name ) : CAutoGameSystemPerFrame( name ) + { + } + + // game system + virtual bool Init( void ); + virtual void Shutdown( void ); + virtual void FrameUpdatePostEntityThink( void ); + virtual void LevelInitPreEntity( void ); + virtual void LevelInitPostEntity(); + + virtual void AddSoundscapeFile( const char *filename ); + int GetSoundscapeIndex( const char *pName ); + bool IsValidIndex( int index ); + + void FlushSoundscapes( void ); + void AddSoundscapeEntity( CEnvSoundscape *pSoundscape ); + void RemoveSoundscapeEntity( CEnvSoundscape *pSoundscape ); + void PrintDebugInfo( void ); + + void AddSoundscapeSounds( KeyValues *pSoundscape, int soundscapeIndex ); + void PrecacheSounds( int soundscapeIndex ); + +private: + CStringRegistry m_soundscapes; + int m_soundscapeCount; + CUtlVector< CEnvSoundscape * > m_soundscapeEntities; + CUtlVector<clusterSoundscapeList_t> m_soundscapesInCluster; + CUtlVector<unsigned short> m_soundscapeIndexList; + int m_activeIndex; + CUtlVector< CUtlVector< CUtlString > > m_soundscapeSounds; +}; + +extern CSoundscapeSystem g_SoundscapeSystem; + + +#endif // SOUNDSCAPE_SYSTEM_H |