]> git.lizzy.rs Git - minetest.git/blobdiff - src/gui/guiEngine.cpp
Fix broken client if openal cannot be opened (#9804)
[minetest.git] / src / gui / guiEngine.cpp
index f0a8f40eb230dc12d8255704abafecb42ed1048f..b40707d0165a3bf8d5fcb109d760f2ad5a4733da 100644 (file)
@@ -39,9 +39,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "client/guiscalingfilter.h"
 #include "irrlicht_changes/static_text.h"
 
-#ifdef __ANDROID__
+#if ENABLE_GLES
 #include "client/tile.h"
-#include <GLES/gl.h>
 #endif
 
 
@@ -78,7 +77,7 @@ video::ITexture *MenuTextureSource::getTexture(const std::string &name, u32 *id)
 
        m_to_delete.insert(name);
 
-#ifdef __ANDROID__
+#if ENABLE_GLES
        video::ITexture *retval = m_driver->findTexture(name.c_str());
        if (retval)
                return retval;
@@ -145,10 +144,10 @@ GUIEngine::GUIEngine(JoystickController *joystick,
        //create soundmanager
        MenuMusicFetcher soundfetcher;
 #if USE_SOUND
-       if (g_settings->getBool("enable_sound"))
+       if (g_settings->getBool("enable_sound") && g_sound_manager_singleton.get())
                m_sound_manager = createOpenALSoundManager(g_sound_manager_singleton.get(), &soundfetcher);
 #endif
-       if(!m_sound_manager)
+       if (!m_sound_manager)
                m_sound_manager = &dummySoundManager;
 
        //create topleft header
@@ -390,6 +389,15 @@ void GUIEngine::cloudPostProcess()
        }
 }
 
+/******************************************************************************/
+void GUIEngine::setFormspecPrepend(const std::string &fs)
+{
+       if (m_menu) {
+               m_menu->setFormspecPrepend(fs);
+       }
+}
+
+
 /******************************************************************************/
 void GUIEngine::drawBackground(video::IVideoDriver *driver)
 {
@@ -611,4 +619,3 @@ unsigned int GUIEngine::queueAsync(const std::string &serialized_func,
 {
        return m_script->queueAsync(serialized_func, serialized_params);
 }
-