mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Removed some dead/useless joystick code
This commit is contained in:
@@ -70,12 +70,6 @@ public:
|
||||
**/
|
||||
virtual int getJoystickCount() const = 0;
|
||||
|
||||
/**
|
||||
* Determines whether the Joystick at the specified index is a recognized
|
||||
* Gamepad.
|
||||
**/
|
||||
virtual bool isGamepad(int joyindex) const = 0;
|
||||
|
||||
/**
|
||||
* Sets the virtual Gamepad mapping for a joystick input value for all
|
||||
* joystick devices with the specified joystick GUID.
|
||||
|
||||
@@ -93,14 +93,6 @@ int JoystickModule::getJoystickCount() const
|
||||
return (int) activeSticks.size();
|
||||
}
|
||||
|
||||
bool JoystickModule::isGamepad(int joyindex) const
|
||||
{
|
||||
if (joyindex < 0 || (size_t) joyindex >= activeSticks.size())
|
||||
return false;
|
||||
|
||||
return activeSticks[joyindex]->isGamepad();
|
||||
}
|
||||
|
||||
love::joystick::Joystick *JoystickModule::getJoystickFromID(int instanceid)
|
||||
{
|
||||
for (size_t i = 0; i < activeSticks.size(); i++)
|
||||
|
||||
@@ -52,7 +52,6 @@ public:
|
||||
love::joystick::Joystick *getJoystick(int joyindex);
|
||||
int getIndex(const love::joystick::Joystick *joystick);
|
||||
int getJoystickCount() const;
|
||||
bool isGamepad(int joyindex) const;
|
||||
bool setGamepadMapping(const std::string &guid, Joystick::GamepadInput gpinput, Joystick::JoystickInput joyinput);
|
||||
Joystick::JoystickInput getGamepadMapping(const std::string &guid, Joystick::GamepadInput gpinput);
|
||||
|
||||
|
||||
@@ -63,13 +63,6 @@ int w_getJoystickCount(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_isGamepad(lua_State *L)
|
||||
{
|
||||
int index = luaL_checkint(L, 1) - 1;
|
||||
luax_pushboolean(L, instance->isGamepad(index));
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_setGamepadMapping(lua_State *L)
|
||||
{
|
||||
// Only accept a GUID string. We don't accept a Joystick object because
|
||||
@@ -200,9 +193,7 @@ int w_getGamepadMapping(lua_State *L)
|
||||
static const luaL_Reg functions[] =
|
||||
{
|
||||
{ "getJoysticks", w_getJoysticks },
|
||||
// { "getIndex", w_getIndex },
|
||||
{ "getJoystickCount", w_getJoystickCount },
|
||||
{ "isGamepad", w_isGamepad },
|
||||
{ "setGamepadMapping", w_setGamepadMapping },
|
||||
{ "getGamepadMapping", w_getGamepadMapping },
|
||||
{ 0, 0 }
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace sdl
|
||||
int w_getJoysticks(lua_State *L);
|
||||
int w_getIndex(lua_State *L);
|
||||
int w_getJoystickCount(lua_State *L);
|
||||
int w_isGamepad(lua_State *L);
|
||||
int w_setGamepadMapping(lua_State *L);
|
||||
int w_getGamepadMapping(lua_State *L);
|
||||
extern "C" LOVE_EXPORT int luaopen_love_joystick(lua_State *L);
|
||||
|
||||
Reference in New Issue
Block a user