-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathefxlib.h
75 lines (56 loc) · 1.96 KB
/
efxlib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*****************************************************************************
The Dark Mod GPL Source Code
This file is part of the The Dark Mod Source Code, originally based
on the Doom 3 GPL Source Code as published in 2011.
The Dark Mod Source Code is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version. For details, see LICENSE.TXT.
Project: The Dark Mod (http://www.thedarkmod.com/)
******************************************************************************/
#ifndef __EFXLIBH
#define __EFXLIBH
#include "../idlib/containers/List.h"
#include "../idlib/Str.h"
#include "../idlib/Lexer.h"
#include "../idlib/Heap.h"
#include "../framework/Common.h"
#include "sound.h"
#define EFX_VERBOSE 0
#if EFX_VERBOSE
#define EFXprintf(...) do { common->Printf(__VA_ARGS__); } while (false)
#else
#define EFXprintf(...) do { } while (false)
#endif
struct idSoundEffect {
idSoundEffect();
~idSoundEffect();
bool alloc();
idStr name;
ALuint effect;
};
class idEFXFile {
public:
idEFXFile();
~idEFXFile();
bool FindEffect(idStr &name, ALuint *effect);
bool LoadFile(const char *filename);
void Clear(void);
//reloading with listSounds command
bool Reload();
bool IsAfterReload();
bool AddOrUpdatePreset(idStr areaName, idStr efxPreset, ALuint* effect);
private:
bool ReadEffectLegacy(idLexer &lexer, idSoundEffect *effect);
bool AddPreset(idStr token, idSoundEffect *effect, ALenum err);
bool GetEffect(idStr& name, idSoundEffect * soundEffect);
bool ReadEffectOpenAL(idLexer &lexer, idSoundEffect *effect);
//filename initially passed to LoadFile (or empty if LoadFile never called)
//(used in Reload method)
idStr efxFilename;
int version;
//this flag is raised after reload: idSoundWorldLocal::MixLoop checks for it
bool isAfterReload;
idList<idSoundEffect *> effects;
};
#endif // __EFXLIBH