From b205b8a020cab429465f2c8855b29e5b8ea8ed37 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Thu, 30 Mar 2017 19:09:15 +0200 Subject: [PATCH] Remove references to old LOVE_ENABLE_module_implementation defines As far as I know they are no longer used, as autotools was the primary (only) user and it now switches entire modules. I've also taken the opportunity to clean up the default list in src/common/config.h. Oh yeah, and this fixes linux builds not having graphics or audio backends. --HG-- branch : minor --- src/common/config.h | 45 +++++++------------------- src/modules/audio/wrap_Audio.cpp | 4 --- src/modules/graphics/wrap_Graphics.cpp | 6 ---- src/modules/love/love.cpp | 6 ++-- 4 files changed, 15 insertions(+), 46 deletions(-) diff --git a/src/common/config.h b/src/common/config.h index 38ac69b46..e11d6c3b8 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -137,50 +137,29 @@ # define LOVE_LITTLE_ENDIAN 1 # endif #else -# define LOVE_ENABLE_AUDIO -# define LOVE_ENABLE_AUDIO_NULL -# define LOVE_ENABLE_AUDIO_OPENAL -# define LOVE_ENABLE_BOX2D -# define LOVE_ENABLE_DDSPARSE -# define LOVE_ENABLE_ENET -# define LOVE_ENABLE_EVENT -# define LOVE_ENABLE_EVENT_SDL -# define LOVE_ENABLE_FILESYSTEM -# define LOVE_ENABLE_FILESYSTEM_PHYSFS -# define LOVE_ENABLE_FONT -# define LOVE_ENABLE_FONT_FREETYPE -# define LOVE_ENABLE_GRAPHICS -# define LOVE_ENABLE_GRAPHICS_OPENGL -# define LOVE_ENABLE_IMAGE -# define LOVE_ENABLE_IMAGE_MAGPIE -# define LOVE_ENABLE_JOYSTICK -# define LOVE_ENABLE_JOYSTICK_SDL -# define LOVE_ENABLE_KEYBOARD -# define LOVE_ENABLE_KEYBOARD_SDL # define LOVE_ENABLE_LOVE -# define LOVE_ENABLE_LUASOCKET -# define LOVE_ENABLE_LUAUTF8 +# define LOVE_ENABLE_AUDIO +# define LOVE_ENABLE_EVENT +# define LOVE_ENABLE_FILESYSTEM +# define LOVE_ENABLE_FONT +# define LOVE_ENABLE_GRAPHICS +# define LOVE_ENABLE_IMAGE +# define LOVE_ENABLE_JOYSTICK +# define LOVE_ENABLE_KEYBOARD # define LOVE_ENABLE_MATH # define LOVE_ENABLE_MOUSE -# define LOVE_ENABLE_MOUSE_SDL -# define LOVE_ENABLE_NOISE1234 # define LOVE_ENABLE_PHYSICS -# define LOVE_ENABLE_PHYSICS_BOX2D # define LOVE_ENABLE_SOUND -# define LOVE_ENABLE_SOUND_LULLABY # define LOVE_ENABLE_SYSTEM -# define LOVE_ENABLE_SYSTEM_SDL # define LOVE_ENABLE_THREAD -# define LOVE_ENABLE_THREAD_SDL # define LOVE_ENABLE_TIMER # define LOVE_ENABLE_TOUCH -# define LOVE_ENABLE_TOUCH_SDL -# define LOVE_ENABLE_UTF8 # define LOVE_ENABLE_VIDEO -# define LOVE_ENABLE_VIDEO_THEORA # define LOVE_ENABLE_WINDOW -# define LOVE_ENABLE_WINDOW_SDL -# define LOVE_ENABLE_WUFF + +# define LOVE_ENABLE_ENET +# define LOVE_ENABLE_LUASOCKET +# define LOVE_ENABLE_LUAUTF8 #endif // Check we have a sane configuration diff --git a/src/modules/audio/wrap_Audio.cpp b/src/modules/audio/wrap_Audio.cpp index 6890c60c9..fc230a297 100644 --- a/src/modules/audio/wrap_Audio.cpp +++ b/src/modules/audio/wrap_Audio.cpp @@ -524,7 +524,6 @@ extern "C" int luaopen_love_audio(lua_State *L) { Audio *instance = instance(); -#ifdef LOVE_ENABLE_AUDIO_OPENAL if (instance == nullptr) { // Try OpenAL first. @@ -539,9 +538,7 @@ extern "C" int luaopen_love_audio(lua_State *L) } else instance->retain(); -#endif -#ifdef LOVE_ENABLE_AUDIO_NULL if (instance == nullptr) { // Fall back to nullaudio. @@ -554,7 +551,6 @@ extern "C" int luaopen_love_audio(lua_State *L) std::cout << e.what() << std::endl; } } -#endif if (instance == nullptr) return luaL_error(L, "Could not open any audio module."); diff --git a/src/modules/graphics/wrap_Graphics.cpp b/src/modules/graphics/wrap_Graphics.cpp index f6e0a0413..fb6f20e0c 100644 --- a/src/modules/graphics/wrap_Graphics.cpp +++ b/src/modules/graphics/wrap_Graphics.cpp @@ -30,9 +30,7 @@ #include "common/Reference.h" #include "math/wrap_Transform.h" -#ifdef LOVE_ENABLE_GRAPHICS_OPENGL #include "opengl/Graphics.h" -#endif #include #include @@ -2637,11 +2635,7 @@ extern "C" int luaopen_love_graphics(lua_State *L) Graphics *instance = instance(); if (instance == nullptr) { -#ifdef LOVE_ENABLE_GRAPHICS_OPENGL luax_catchexcept(L, [&](){ instance = new love::graphics::opengl::Graphics(); }); -#else - return luaL_error(L, "LOVE was compiled without any love.graphics backend!"); -#endif } else instance->retain(); diff --git a/src/modules/love/love.cpp b/src/modules/love/love.cpp index a5b7741b1..1cecb42a9 100644 --- a/src/modules/love/love.cpp +++ b/src/modules/love/love.cpp @@ -168,12 +168,12 @@ static const luaL_Reg modules[] = { #if defined(LOVE_ENABLE_SYSTEM) { "love.system", luaopen_love_system }, #endif -#if defined(LOVE_ENABLE_TIMER) - { "love.timer", luaopen_love_timer }, -#endif #if defined(LOVE_ENABLE_THREAD) { "love.thread", luaopen_love_thread }, #endif +#if defined(LOVE_ENABLE_TIMER) + { "love.timer", luaopen_love_timer }, +#endif #if defined(LOVE_ENABLE_TOUCH) { "love.touch", luaopen_love_touch }, #endif