Commits

Alex Szpakowski  committed 6a630ed

Removed some dead/useless joystick code

  • Participants
  • Parent commits 6a0413b

Comments (0)

Files changed (5)

File src/modules/joystick/JoystickModule.h

 	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.
 	 * If any joysticks with the specified GUID are connected, they will be

File src/modules/joystick/sdl/JoystickModule.cpp

 	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++)

File src/modules/joystick/sdl/JoystickModule.h

 	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);
 

File src/modules/joystick/sdl/wrap_JoystickModule.cpp

 	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
 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 }

File src/modules/joystick/sdl/wrap_JoystickModule.h

 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);