diff options
| author | nakeee <nakeee@gmail.com> | 2009-03-30 17:24:55 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2009-03-30 17:24:55 +0000 |
| commit | 58a78cb2b59aa7a2858467b0c29f75962ab1979c (patch) | |
| tree | d1e3fc1472cda8c2ba3d3c0cb7847cb777dd2e55 /Source/Core | |
| parent | 6b2b1a34ee079f1c3fb8d3ac0d1d41dfbe9a3866 (diff) | |
Make openal works on linux
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2805 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/AudioCommon/Src/OpenALStream.h | 15 | ||||
| -rw-r--r-- | Source/Core/AudioCommon/Src/SConscript | 1 | ||||
| -rw-r--r-- | Source/Core/AudioCommon/Src/aldlist.cpp | 13 |
3 files changed, 19 insertions, 10 deletions
diff --git a/Source/Core/AudioCommon/Src/OpenALStream.h b/Source/Core/AudioCommon/Src/OpenALStream.h index 9398474d58..a02e597399 100644 --- a/Source/Core/AudioCommon/Src/OpenALStream.h +++ b/Source/Core/AudioCommon/Src/OpenALStream.h @@ -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
diff --git a/Source/Core/AudioCommon/Src/SConscript b/Source/Core/AudioCommon/Src/SConscript index 2f64311a41..4d493c8a26 100644 --- a/Source/Core/AudioCommon/Src/SConscript +++ b/Source/Core/AudioCommon/Src/SConscript @@ -4,6 +4,7 @@ Import('env') files = [ 'AOSoundStream.cpp', + 'aldlist.cpp', 'AudioCommonConfig.cpp', 'OpenALStream.cpp', 'WaveFile.cpp', diff --git a/Source/Core/AudioCommon/Src/aldlist.cpp b/Source/Core/AudioCommon/Src/aldlist.cpp index 7c6b0eeec9..46e910dc59 100644 --- a/Source/Core/AudioCommon/Src/aldlist.cpp +++ b/Source/Core/AudioCommon/Src/aldlist.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;
-}
\ No newline at end of file +}
|
