|
@@ -37,8 +37,12 @@
|
|
#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK
|
|
#endif // LOVE_LEGENDARY_CONSOLE_IO_HACK
|
|
|
|
|
|
// Libraries.
|
|
// Libraries.
|
|
-#include "libraries/luasocket/luasocket.h"
|
|
|
|
-#include "libraries/enet/lua-enet.h"
|
|
|
|
|
|
+#ifdef LOVE_ENABLE_LUASOCKET
|
|
|
|
+# include "libraries/luasocket/luasocket.h"
|
|
|
|
+#endif
|
|
|
|
+#ifdef LOVE_ENABLE_ENET
|
|
|
|
+# include "libraries/enet/lua-enet.h"
|
|
|
|
+#endif
|
|
|
|
|
|
// Scripts
|
|
// Scripts
|
|
#include "scripts/boot.lua.h"
|
|
#include "scripts/boot.lua.h"
|
|
@@ -48,42 +52,106 @@
|
|
// of addressing implementations directly.
|
|
// of addressing implementations directly.
|
|
extern "C"
|
|
extern "C"
|
|
{
|
|
{
|
|
|
|
+#if defined(LOVE_ENABLE_AUDIO)
|
|
extern int luaopen_love_audio(lua_State*);
|
|
extern int luaopen_love_audio(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_EVENT)
|
|
extern int luaopen_love_event(lua_State*);
|
|
extern int luaopen_love_event(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_FILESYSTEM)
|
|
extern int luaopen_love_filesystem(lua_State*);
|
|
extern int luaopen_love_filesystem(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_FONT)
|
|
extern int luaopen_love_font(lua_State*);
|
|
extern int luaopen_love_font(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_GRAPHICS)
|
|
extern int luaopen_love_graphics(lua_State*);
|
|
extern int luaopen_love_graphics(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_IMAGE)
|
|
extern int luaopen_love_image(lua_State*);
|
|
extern int luaopen_love_image(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_JOYSTICK)
|
|
extern int luaopen_love_joystick(lua_State*);
|
|
extern int luaopen_love_joystick(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_KEYBOARD)
|
|
extern int luaopen_love_keyboard(lua_State*);
|
|
extern int luaopen_love_keyboard(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_MATH)
|
|
extern int luaopen_love_math(lua_State*);
|
|
extern int luaopen_love_math(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_MOUSE)
|
|
extern int luaopen_love_mouse(lua_State*);
|
|
extern int luaopen_love_mouse(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_PHYSICS)
|
|
extern int luaopen_love_physics(lua_State*);
|
|
extern int luaopen_love_physics(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_SOUND)
|
|
extern int luaopen_love_sound(lua_State*);
|
|
extern int luaopen_love_sound(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_SYSTEM)
|
|
extern int luaopen_love_system(lua_State*);
|
|
extern int luaopen_love_system(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_TIMER)
|
|
extern int luaopen_love_timer(lua_State*);
|
|
extern int luaopen_love_timer(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_THREAD)
|
|
extern int luaopen_love_thread(lua_State*);
|
|
extern int luaopen_love_thread(lua_State*);
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_WINDOW)
|
|
extern int luaopen_love_window(lua_State*);
|
|
extern int luaopen_love_window(lua_State*);
|
|
|
|
+#endif
|
|
extern int luaopen_love_boot(lua_State*);
|
|
extern int luaopen_love_boot(lua_State*);
|
|
}
|
|
}
|
|
|
|
|
|
static const luaL_Reg modules[] = {
|
|
static const luaL_Reg modules[] = {
|
|
|
|
+#if defined(LOVE_ENABLE_AUDIO)
|
|
{ "love.audio", luaopen_love_audio },
|
|
{ "love.audio", luaopen_love_audio },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_EVENT)
|
|
{ "love.event", luaopen_love_event },
|
|
{ "love.event", luaopen_love_event },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_FILESYSTEM)
|
|
{ "love.filesystem", luaopen_love_filesystem },
|
|
{ "love.filesystem", luaopen_love_filesystem },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_FONT)
|
|
{ "love.font", luaopen_love_font },
|
|
{ "love.font", luaopen_love_font },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_GRAPHICS)
|
|
{ "love.graphics", luaopen_love_graphics },
|
|
{ "love.graphics", luaopen_love_graphics },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_IMAGE)
|
|
{ "love.image", luaopen_love_image },
|
|
{ "love.image", luaopen_love_image },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_JOYSTICK)
|
|
{ "love.joystick", luaopen_love_joystick },
|
|
{ "love.joystick", luaopen_love_joystick },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_KEYBOARD)
|
|
{ "love.keyboard", luaopen_love_keyboard },
|
|
{ "love.keyboard", luaopen_love_keyboard },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_MATH)
|
|
{ "love.math", luaopen_love_math },
|
|
{ "love.math", luaopen_love_math },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_MOUSE)
|
|
{ "love.mouse", luaopen_love_mouse },
|
|
{ "love.mouse", luaopen_love_mouse },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_PHYSICS)
|
|
{ "love.physics", luaopen_love_physics },
|
|
{ "love.physics", luaopen_love_physics },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_SOUND)
|
|
{ "love.sound", luaopen_love_sound },
|
|
{ "love.sound", luaopen_love_sound },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_SYSTEM)
|
|
{ "love.system", luaopen_love_system },
|
|
{ "love.system", luaopen_love_system },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_TIMER)
|
|
{ "love.timer", luaopen_love_timer },
|
|
{ "love.timer", luaopen_love_timer },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_THREAD)
|
|
{ "love.thread", luaopen_love_thread },
|
|
{ "love.thread", luaopen_love_thread },
|
|
|
|
+#endif
|
|
|
|
+#if defined(LOVE_ENABLE_WINDOW)
|
|
{ "love.window", luaopen_love_window },
|
|
{ "love.window", luaopen_love_window },
|
|
|
|
+#endif
|
|
{ "love.boot", luaopen_love_boot },
|
|
{ "love.boot", luaopen_love_boot },
|
|
{ 0, 0 }
|
|
{ 0, 0 }
|
|
};
|
|
};
|
|
@@ -152,8 +220,12 @@ int luaopen_love(lua_State * L)
|
|
love::luax_preload(L, modules[i].func, modules[i].name);
|
|
love::luax_preload(L, modules[i].func, modules[i].name);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#ifdef LOVE_ENABLE_LUASOCKET
|
|
love::luasocket::__open(L);
|
|
love::luasocket::__open(L);
|
|
|
|
+#endif
|
|
|
|
+#ifdef LOVE_ENABLE_ENET
|
|
love::luax_preload(L, luaopen_enet, "enet");
|
|
love::luax_preload(L, luaopen_enet, "enet");
|
|
|
|
+#endif
|
|
|
|
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|