SoundEmitter: Make SE source count configurable

Default is still 6.
This commit is contained in:
Jonas Kulla 2014-08-25 05:28:46 +02:00
parent 5ee62ba0fd
commit b1ebc655f9
8 changed files with 48 additions and 22 deletions

View file

@ -27,10 +27,10 @@
#include "boost-hash.h"
#include <string>
#define SE_SOURCES 6
#include <vector>
struct SoundBuffer;
struct Config;
struct SoundEmitter
{
@ -42,13 +42,14 @@ struct SoundEmitter
/* Byte count sum of all cached / playing buffers */
uint32_t bufferBytes;
AL::Source::ID alSrcs[SE_SOURCES];
SoundBuffer *atchBufs[SE_SOURCES];
const size_t srcCount;
std::vector<AL::Source::ID> alSrcs;
std::vector<SoundBuffer*> atchBufs;
/* Indices of sources, sorted by priority (lowest first) */
size_t srcPrio[SE_SOURCES];
std::vector<size_t> srcPrio;
SoundEmitter();
SoundEmitter(const Config &conf);
~SoundEmitter();
void play(const std::string &filename,