Browse Source

Register love.sensor module.

Miku AuahDark 2 years ago
parent
commit
1fa9159f04
3 changed files with 9 additions and 0 deletions
  1. 1 0
      src/common/config.h
  2. 2 0
      src/modules/love/boot.lua
  3. 6 0
      src/modules/love/love.cpp

+ 1 - 0
src/common/config.h

@@ -159,6 +159,7 @@
 #	define LOVE_ENABLE_MATH
 #	define LOVE_ENABLE_MOUSE
 #	define LOVE_ENABLE_PHYSICS
+#	define LOVE_ENABLE_SENSOR
 #	define LOVE_ENABLE_SOUND
 #	define LOVE_ENABLE_SYSTEM
 #	define LOVE_ENABLE_THREAD

+ 2 - 0
src/modules/love/boot.lua

@@ -189,6 +189,7 @@ function love.init()
 			audio = true,
 			math = true,
 			physics = true,
+			sensor = true,
 			sound = true,
 			system = true,
 			font = true,
@@ -311,6 +312,7 @@ function love.init()
 		"touch",
 		"sound",
 		"system",
+		"sensor",
 		"audio",
 		"image",
 		"video",

+ 6 - 0
src/modules/love/love.cpp

@@ -152,6 +152,9 @@ extern "C"
 #if defined(LOVE_ENABLE_PHYSICS)
 	extern int luaopen_love_physics(lua_State*);
 #endif
+#if defined(LOVE_ENABLE_SENSOR)
+	extern int luaopen_love_sensor(lua_State*);
+#endif
 #if defined(LOVE_ENABLE_SOUND)
 	extern int luaopen_love_sound(lua_State*);
 #endif
@@ -221,6 +224,9 @@ static const luaL_Reg modules[] = {
 #if defined(LOVE_ENABLE_PHYSICS)
 	{ "love.physics", luaopen_love_physics },
 #endif
+#if defined(LOVE_ENABLE_SENSOR)
+	{ "love.sensor", luaopen_love_sensor },
+#endif
 #if defined(LOVE_ENABLE_SOUND)
 	{ "love.sound", luaopen_love_sound },
 #endif