mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Moved the love.joystick Lua wrapper code from modules/joystick/sdl/ to modules/joystick/.
This commit is contained in:
@@ -28,8 +28,6 @@ namespace love
|
||||
{
|
||||
namespace joystick
|
||||
{
|
||||
namespace sdl
|
||||
{
|
||||
|
||||
Joystick *luax_checkjoystick(lua_State *L, int idx)
|
||||
{
|
||||
@@ -261,6 +259,5 @@ extern "C" int luaopen_joystick(lua_State *L)
|
||||
return luax_register_type(L, "Joystick", functions);
|
||||
}
|
||||
|
||||
} // sdl
|
||||
} // joystick
|
||||
} // love
|
||||
@@ -18,8 +18,8 @@
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
|
||||
#ifndef LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_H
|
||||
#define LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_H
|
||||
#ifndef LOVE_JOYSTICK_WRAP_JOYSTICK_H
|
||||
#define LOVE_JOYSTICK_WRAP_JOYSTICK_H
|
||||
|
||||
// LOVE
|
||||
#include "common/config.h"
|
||||
@@ -30,8 +30,6 @@ namespace love
|
||||
{
|
||||
namespace joystick
|
||||
{
|
||||
namespace sdl
|
||||
{
|
||||
|
||||
Joystick *luax_checkjoystick(lua_State *L, int idx);
|
||||
int w_Joystick_isConnected(lua_State *L);
|
||||
@@ -53,7 +51,6 @@ int w_Joystick_setVibration(lua_State *L);
|
||||
int w_Joystick_getVibration(lua_State *L);
|
||||
extern "C" int luaopen_joystick(lua_State *L);
|
||||
|
||||
} // sdl
|
||||
} // joystick
|
||||
} // love
|
||||
|
||||
+3
-4
@@ -23,12 +23,12 @@
|
||||
|
||||
#include "filesystem/wrap_Filesystem.h"
|
||||
|
||||
#include "sdl/JoystickModule.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace joystick
|
||||
{
|
||||
namespace sdl
|
||||
{
|
||||
|
||||
static JoystickModule *instance = nullptr;
|
||||
|
||||
@@ -243,7 +243,7 @@ extern "C" int luaopen_love_joystick(lua_State *L)
|
||||
{
|
||||
if (instance == nullptr)
|
||||
{
|
||||
luax_catchexcept(L, [&](){ instance = new JoystickModule(); });
|
||||
luax_catchexcept(L, [&](){ instance = new sdl::JoystickModule(); });
|
||||
}
|
||||
else
|
||||
instance->retain();
|
||||
@@ -258,6 +258,5 @@ extern "C" int luaopen_love_joystick(lua_State *L)
|
||||
return luax_register_module(L, w);
|
||||
}
|
||||
|
||||
} // sdl
|
||||
} // joystick
|
||||
} // love
|
||||
+3
-6
@@ -18,8 +18,8 @@
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
|
||||
#ifndef LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_MODULE_H
|
||||
#define LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_MODULE_H
|
||||
#ifndef LOVE_JOYSTICK_WRAP_JOYSTICK_MODULE_H
|
||||
#define LOVE_JOYSTICK_WRAP_JOYSTICK_MODULE_H
|
||||
|
||||
// LOVE
|
||||
#include "common/config.h"
|
||||
@@ -30,8 +30,6 @@ namespace love
|
||||
{
|
||||
namespace joystick
|
||||
{
|
||||
namespace sdl
|
||||
{
|
||||
|
||||
int w_getJoysticks(lua_State *L);
|
||||
int w_getIndex(lua_State *L);
|
||||
@@ -42,8 +40,7 @@ int w_loadGamepadMappings(lua_State *L);
|
||||
int w_saveGamepadMapping(lua_State *L);
|
||||
extern "C" LOVE_EXPORT int luaopen_love_joystick(lua_State *L);
|
||||
|
||||
} // sdl
|
||||
} // joystick
|
||||
} // love
|
||||
|
||||
#endif // LOVE_JOYSTICK_SDL_WRAP_JOYSTICK_MODULE_H
|
||||
#endif // LOVE_JOYSTICK_WRAP_JOYSTICK_MODULE_H
|
||||
Reference in New Issue
Block a user