Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.2 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef MODELSOUNDSCACHE_H
  7. #define MODELSOUNDSCACHE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "UtlCachedFileData.h"
  12. #include "SoundEmitterSystem/isoundemittersystembase.h"
  13. #define MODELSOUNDSCACHE_VERSION 5
  14. class CStudioHdr;
  15. class CModelSoundsCacheListLess
  16. {
  17. public:
  18. bool Less( const int &lhs, const int &rhs, void *pCtx )
  19. {
  20. return lhs < rhs;
  21. }
  22. };
  23. #pragma pack(1)
  24. class CModelSoundsCache : public IBaseCacheInfo
  25. {
  26. public:
  27. CUtlSortVector< int, CModelSoundsCacheListLess > sounds;
  28. CModelSoundsCache();
  29. CModelSoundsCache( const CModelSoundsCache& src );
  30. void PrecacheSoundList();
  31. virtual void Save( CUtlBuffer& buf );
  32. virtual void Restore( CUtlBuffer& buf );
  33. virtual void Rebuild( char const *filename );
  34. static void FindOrAddScriptSound( CUtlSortVector< int, CModelSoundsCacheListLess >& sounds, char const *soundname );
  35. static void BuildAnimationEventSoundList( CStudioHdr *hdr, CUtlSortVector< int, CModelSoundsCacheListLess >& sounds );
  36. private:
  37. char const *GetSoundName( int index );
  38. };
  39. #pragma pack()
  40. #endif // MODELSOUNDSCACHE_H