From 6d607e3ae8d60d2d5f11f053511a305db415205e Mon Sep 17 00:00:00 2001 From: erihel Date: Fri, 21 Dec 2012 17:31:55 +0100 Subject: latest changes --- src/app/app.cpp | 17 +++++++++++------ src/common/config.h.cmake | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src') 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 +#ifdef OPENAL_SOUND + #include "sound/oalsound/alsound.h" +#endif + + template<> CApplication* CSingleton::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(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(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 -- cgit v1.2.3-1-g7c22