mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Increased robustness of audio module initialization (see issue #646.) Also changed Source:play to return a boolean indicating success.
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#ifdef LOVE_MACOSX_USE_FRAMEWORKS
|
||||
#include <OpenAL-Soft/alc.h>
|
||||
#include <OpenAL-Soft/al.h>
|
||||
#include <OpenAL-Soft/alext.h>
|
||||
#else
|
||||
#include <AL/alc.h>
|
||||
#include <AL/al.h>
|
||||
@@ -99,11 +100,15 @@ private:
|
||||
|
||||
bool findSource(Source *source, ALuint &out);
|
||||
bool removeSource(Source *source);
|
||||
// Number of OpenAL sources.
|
||||
static const int NUM_SOURCES = 64;
|
||||
|
||||
// Maximum possible number of OpenAL sources the pool attempts to generate.
|
||||
static const int MAX_SOURCES = 64;
|
||||
|
||||
// OpenAL sources
|
||||
ALuint sources[NUM_SOURCES];
|
||||
ALuint sources[MAX_SOURCES];
|
||||
|
||||
// Total number of created sources in the pool.
|
||||
int totalSources;
|
||||
|
||||
// A queue of available sources.
|
||||
std::queue<ALuint> available;
|
||||
|
||||
Reference in New Issue
Block a user