mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Make openal works on linux
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2805 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -21,17 +21,18 @@
|
||||
#include "SoundStream.h"
|
||||
#include "Thread.h"
|
||||
|
||||
//#include <list>
|
||||
//using namespace std;
|
||||
|
||||
#ifdef HAVE_OPENAL && HAVE_OPENAL
|
||||
#include "../../../../Externals/OpenAL/include/al.h"
|
||||
#include "../../../../Externals/OpenAL/include/alc.h"
|
||||
|
||||
// public use
|
||||
#define SFX_MAX_SOURCE 1
|
||||
#endif
|
||||
|
||||
|
||||
class OpenALStream: public SoundStream
|
||||
{
|
||||
#ifdef HAVE_OPENAL && HAVE_OPENAL
|
||||
public:
|
||||
OpenALStream(CMixer *mixer, void *hWnd = NULL): SoundStream(mixer) {};
|
||||
virtual ~OpenALStream() {};
|
||||
@ -49,6 +50,12 @@ private:
|
||||
Common::Thread *thread;
|
||||
Common::CriticalSection soundCriticalSection;
|
||||
Common::Event soundSyncEvent;
|
||||
#else
|
||||
OpenALStream(CMixer *mixer, void *hWnd = NULL): SoundStream(mixer) {}
|
||||
#endif // HAVE_OPENAL
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // OPENALSTREAM
|
||||
|
@ -4,6 +4,7 @@ Import('env')
|
||||
|
||||
files = [
|
||||
'AOSoundStream.cpp',
|
||||
'aldlist.cpp',
|
||||
'AudioCommonConfig.cpp',
|
||||
'OpenALStream.cpp',
|
||||
'WaveFile.cpp',
|
||||
|
@ -22,6 +22,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "aldlist.h"
|
||||
#include "../../../../Externals/OpenAL/include/al.h"
|
||||
#include "../../../../Externals/OpenAL/include/alc.h"
|
||||
@ -51,7 +52,7 @@ ALDeviceList::ALDeviceList()
|
||||
defaultDeviceName = (char *)alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
index = 0;
|
||||
// go through device list (each device terminated with a single NULL, list terminated with double NULL)
|
||||
while (*devices != NULL) {
|
||||
while (devices != NULL) {
|
||||
if (strcmp(defaultDeviceName, devices) == 0) {
|
||||
defaultDeviceIndex = index;
|
||||
}
|
||||
@ -191,7 +192,7 @@ bool ALDeviceList::IsExtensionSupported(s32 index, char *szExtName)
|
||||
|
||||
if (index < GetNumDevices()) {
|
||||
for (u32 i = 0; i < vDeviceInfo[index].pvstrExtensions->size(); i++) {
|
||||
if (!_stricmp(vDeviceInfo[index].pvstrExtensions->at(i).c_str(), szExtName)) {
|
||||
if (!strcasecmp(vDeviceInfo[index].pvstrExtensions->at(i).c_str(), szExtName)) {
|
||||
bReturn = true;
|
||||
break;
|
||||
}
|
||||
@ -214,7 +215,7 @@ s32 ALDeviceList::GetDefaultDevice()
|
||||
*/
|
||||
void ALDeviceList::FilterDevicesMinVer(s32 major, s32 minor)
|
||||
{
|
||||
s32 dMajor, dMinor;
|
||||
s32 dMajor = 0, dMinor = 0;
|
||||
for (u32 i = 0; i < vDeviceInfo.size(); i++) {
|
||||
GetDeviceVersion(i, &dMajor, &dMinor);
|
||||
if ((dMajor < major) || ((dMajor == major) && (dMinor < minor))) {
|
||||
@ -228,7 +229,7 @@ void ALDeviceList::FilterDevicesMinVer(s32 major, s32 minor)
|
||||
*/
|
||||
void ALDeviceList::FilterDevicesMaxVer(s32 major, s32 minor)
|
||||
{
|
||||
s32 dMajor, dMinor;
|
||||
s32 dMajor = 0, dMinor = 0;
|
||||
for (u32 i = 0; i < vDeviceInfo.size(); i++) {
|
||||
GetDeviceVersion(i, &dMajor, &dMinor);
|
||||
if ((dMajor > major) || ((dMajor == major) && (dMinor > minor))) {
|
||||
@ -247,7 +248,7 @@ void ALDeviceList::FilterDevicesExtension(char *szExtName)
|
||||
for (u32 i = 0; i < vDeviceInfo.size(); i++) {
|
||||
bFound = false;
|
||||
for (u32 j = 0; j < vDeviceInfo[i].pvstrExtensions->size(); j++) {
|
||||
if (!_stricmp(vDeviceInfo[i].pvstrExtensions->at(j).c_str(), szExtName)) {
|
||||
if (!strcasecmp(vDeviceInfo[i].pvstrExtensions->at(j).c_str(), szExtName)) {
|
||||
bFound = true;
|
||||
break;
|
||||
}
|
||||
@ -330,4 +331,4 @@ u32 ALDeviceList::GetMaxNumSources()
|
||||
}
|
||||
|
||||
return iSourceCount;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user