diff options
author | erihel <erihel@gmail.com> | 2012-12-21 17:31:55 +0100 |
---|---|---|
committer | erihel <erihel@gmail.com> | 2012-12-21 17:31:55 +0100 |
commit | 6d607e3ae8d60d2d5f11f053511a305db415205e (patch) | |
tree | a82cfd5eb7ac41db9eb6f29d6272e4e2bac29dc4 /src | |
parent | f0e76ad446e58ea9b1564517fc3a823e61fd7410 (diff) | |
download | colobot-6d607e3ae8d60d2d5f11f053511a305db415205e.tar.gz colobot-6d607e3ae8d60d2d5f11f053511a305db415205e.tar.bz2 colobot-6d607e3ae8d60d2d5f11f053511a305db415205e.zip |
latest changes
Diffstat (limited to 'src')
-rw-r--r-- | src/app/app.cpp | 17 | ||||
-rw-r--r-- | src/common/config.h.cmake | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp index 924ec74..683b053 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -40,6 +40,11 @@ #include <unistd.h> +#ifdef OPENAL_SOUND + #include "sound/oalsound/alsound.h" +#endif + + template<> CApplication* CSingleton<CApplication>::mInstance = nullptr; //! Static buffer for putenv locale @@ -332,12 +337,12 @@ bool CApplication::Create() if (GetProfile().GetLocalProfileString("Resources", "Data", path)) m_dataPath = path; - m_sound = static_cast<CSoundInterface*>(CInstanceManager::GetInstancePointer()->SearchInstance(CLASS_SOUND)); - - if (!m_sound) { - GetLogger()->Error("Sound not loaded, falling back to fake sound!\n"); - m_sound = new CSoundInterface(); - } + #ifdef OPENAL_SOUND + m_sound = static_cast<CSoundInterface *>(new ALSound()); + #else + GetLogger()->Info("No sound support.\n"); + m_sound = new CSoundInterface(); + #endif m_sound->Create(true); if (GetProfile().GetLocalProfileString("Resources", "Sound", path)) diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index 9b30720..dd280a3 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -10,3 +10,5 @@ #define COLOBOT_DEFAULT_DATADIR "@COLOBOT_INSTALL_DATA_DIR@" #define COLOBOT_I18N_DIR "@COLOBOT_INSTALL_I18N_DIR@" + +#cmakedefine OPENAL_SOUND |