mirror of
https://github.com/love2d/love.git
synced 2026-08-21 21:15:09 +02:00
Moved the love.joystick Lua wrapper code from modules/joystick/sdl/ to modules/joystick/.
This commit is contained in:
+4
-4
@@ -365,6 +365,10 @@ set(LOVE_SRC_MODULE_JOYSTICK_ROOT
|
||||
src/modules/joystick/Joystick.cpp
|
||||
src/modules/joystick/Joystick.h
|
||||
src/modules/joystick/JoystickModule.h
|
||||
src/modules/joystick/wrap_Joystick.cpp
|
||||
src/modules/joystick/wrap_Joystick.h
|
||||
src/modules/joystick/wrap_JoystickModule.cpp
|
||||
src/modules/joystick/wrap_JoystickModule.h
|
||||
)
|
||||
|
||||
set(LOVE_SRC_MODULE_JOYSTICK_SDL
|
||||
@@ -372,10 +376,6 @@ set(LOVE_SRC_MODULE_JOYSTICK_SDL
|
||||
src/modules/joystick/sdl/Joystick.h
|
||||
src/modules/joystick/sdl/JoystickModule.cpp
|
||||
src/modules/joystick/sdl/JoystickModule.h
|
||||
src/modules/joystick/sdl/wrap_Joystick.cpp
|
||||
src/modules/joystick/sdl/wrap_Joystick.h
|
||||
src/modules/joystick/sdl/wrap_JoystickModule.cpp
|
||||
src/modules/joystick/sdl/wrap_JoystickModule.h
|
||||
)
|
||||
|
||||
set(LOVE_SRC_MODULE_JOYSTICK
|
||||
|
||||
@@ -1436,6 +1436,10 @@
|
||||
FAB0078E1740C12D00A9664D /* Joystick.h */,
|
||||
4C606AEC342457600C3F0741 /* JoystickModule.h */,
|
||||
687216AD6FA406C838284B91 /* sdl */,
|
||||
FAB007951740C87D00A9664D /* wrap_Joystick.cpp */,
|
||||
FAB007961740C87D00A9664D /* wrap_Joystick.h */,
|
||||
139411436818381E493F00F5 /* wrap_JoystickModule.cpp */,
|
||||
2D7B7DEC4FC87878332E41B3 /* wrap_JoystickModule.h */,
|
||||
);
|
||||
path = joystick;
|
||||
sourceTree = "<group>";
|
||||
@@ -1610,10 +1614,6 @@
|
||||
FAB007921740C28900A9664D /* Joystick.h */,
|
||||
55B425307C0C1C4B3EFC3A5F /* JoystickModule.cpp */,
|
||||
439E46D768A266780E894800 /* JoystickModule.h */,
|
||||
FAB007951740C87D00A9664D /* wrap_Joystick.cpp */,
|
||||
FAB007961740C87D00A9664D /* wrap_Joystick.h */,
|
||||
139411436818381E493F00F5 /* wrap_JoystickModule.cpp */,
|
||||
2D7B7DEC4FC87878332E41B3 /* wrap_JoystickModule.h */,
|
||||
);
|
||||
path = sdl;
|
||||
sourceTree = "<group>";
|
||||
|
||||
@@ -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