Removed some dead/useless joystick code

This commit is contained in:
Alex Szpakowski
2013-08-26 18:18:07 -03:00
parent 6ade6225df
commit 390a47099e
5 changed files with 0 additions and 25 deletions
-6
View File
@@ -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);