2323#define SOUNDGENDER_MACRO_LENGTH 7 // Length of above including $
2424
2525class KeyValues ;
26- typedef short HSOUNDSCRIPTHANDLE ;
27- #define SOUNDEMITTER_INVALID_HANDLE (HSOUNDSCRIPTHANDLE )-1
26+ typedef unsigned int HSOUNDSCRIPTHASH ;
27+ #define SOUNDEMITTER_INVALID_HASH (HSOUNDSCRIPTHASH )-1
2828
2929
3030// -----------------------------------------------------------------------------
@@ -47,6 +47,12 @@ struct CSoundParameters
4747 count = 0 ;
4848
4949 delay_msec = 0 ;
50+
51+ m_nSoundEntryVersion = 1 ;
52+ m_hSoundScriptHash = SOUNDEMITTER_INVALID_HASH;
53+ m_pOperatorsKV = NULL ;
54+ m_nRandomSeed = -1 ;
55+
5056 }
5157
5258 int channel;
@@ -59,6 +65,11 @@ struct CSoundParameters
5965 int count;
6066 char soundname[ 128 ];
6167 int delay_msec;
68+ HSOUNDSCRIPTHASH m_hSoundScriptHash;
69+ int m_nSoundEntryVersion;
70+ KeyValues *m_pOperatorsKV;
71+ int m_nRandomSeed;
72+
6273};
6374
6475// A bit of a hack, but these are just utility function which are implemented in the SouneParametersInternal.cpp file which all users of this lib also compile
@@ -252,25 +263,21 @@ abstract_class ISoundEmitterSystemBase : public IAppSystem
252263 // .txt files that are read into the sound emitter system
253264 virtual unsigned int GetManifestFileTimeChecksum () = 0 ;
254265
255- // Called from both client and server (single player) or just one (server only in dedicated server and client only if connected to a remote server)
256- // Called by LevelInitPreEntity to override sound scripts for the mod with level specific overrides based on custom mapnames, etc.
257- virtual void AddSoundOverrides ( char const *scriptfile ) = 0 ;
266+ virtual bool GetParametersForSoundEx ( const char *soundname, HSOUNDSCRIPTHASH& handle, CSoundParameters& params, gender_t gender, bool isbeingemitted = false ) = 0 ;
267+ virtual soundlevel_t LookupSoundLevelByHandle ( char const *soundname, HSOUNDSCRIPTHASH& handle ) = 0 ;
268+ virtual KeyValues * GetOperatorKVByHandle ( HSOUNDSCRIPTHASH& handle ) = 0 ;
258269
259- // Called by either client or server in LevelShutdown to clear out custom overrides
260- virtual void ClearSoundOverrides () = 0 ;
261-
262- virtual bool GetParametersForSoundEx ( const char *soundname, HSOUNDSCRIPTHANDLE& handle, CSoundParameters& params, gender_t gender, bool isbeingemitted = false ) = 0 ;
263- virtual soundlevel_t LookupSoundLevelByHandle ( char const *soundname, HSOUNDSCRIPTHANDLE& handle ) = 0 ;
264-
265- virtual char const *GetSoundNameForHash ( unsigned int hash ) = 0 ; // Returns NULL if hash not found!!!
266- virtual unsigned int HashSoundName ( char const *pchSndName ) = 0 ;
267- virtual bool IsValidHash ( unsigned int hash ) = 0 ;
270+ virtual char const *GetSoundNameForHash ( HSOUNDSCRIPTHASH hash ) const = 0 ; // Returns NULL if hash not found!!!
271+ virtual int GetSoundIndexForHash ( HSOUNDSCRIPTHASH hash ) const = 0 ;
272+ virtual HSOUNDSCRIPTHASH HashSoundName ( char const *pchSndName ) const = 0 ;
273+ virtual bool IsValidHash ( HSOUNDSCRIPTHASH hash ) const = 0 ;
268274
269275 virtual void DescribeSound ( char const *soundname ) = 0 ;
270276 // Flush and reload
271277 virtual void Flush () = 0 ;
272278
273- virtual void AddSoundsFromFile ( const char *filename, bool bPreload, bool bIsOverride = false ) = 0 ;
279+ virtual void AddSoundsFromFile ( const char *filename, bool bPreload, bool bAutoCache, bool bIsOverride = false ) = 0 ;
280+
274281};
275282
276283#endif // ISOUNDEMITTERSYSTEMBASE_H
0 commit comments