efxlib.h 810 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. */
  3. #ifndef __EFXLIBH
  4. #define __EFXLIBH
  5. #include "../idlib/containers/List.h"
  6. #include "../idlib/Str.h"
  7. #include "../idlib/Lexer.h"
  8. #include "../idlib/Heap.h"
  9. #include "../framework/Common.h"
  10. #include "sound.h"
  11. #define EFX_VERBOSE 0
  12. #if EFX_VERBOSE
  13. #define EFXprintf(...) do { common->Printf(__VA_ARGS__); } while (false)
  14. #else
  15. #define EFXprintf(...) do { } while (false)
  16. #endif
  17. struct idSoundEffect {
  18. idSoundEffect();
  19. ~idSoundEffect();
  20. bool alloc();
  21. idStr name;
  22. ALuint effect;
  23. };
  24. class idEFXFile {
  25. public:
  26. idEFXFile();
  27. ~idEFXFile();
  28. bool FindEffect( idStr &name, ALuint *effect );
  29. bool LoadFile( const char *filename, bool OSPath = false );
  30. void Clear( void );
  31. private:
  32. bool ReadEffect( idLexer &lexer, idSoundEffect *effect );
  33. idList<idSoundEffect *>effects;
  34. };
  35. #endif // __EFXLIBH