Commits

Alex Szpakowski committed b20b89a

Removed love.joystick.getBall and love.joystick.getBallCount (issue #648)

Comments (0)

Files changed (4)

src/modules/joystick/sdl/Joystick.cpp

 	return verifyJoystick(index) ? SDL_JoystickNumAxes(joysticks[index]) : 0;
 }
 
-int Joystick::getBallCount(int index)
-{
-	return verifyJoystick(index) ? SDL_JoystickNumBalls(joysticks[index]) : 0;
-}
-
 int Joystick::getButtonCount(int index)
 {
 	return verifyJoystick(index) ? SDL_JoystickNumButtons(joysticks[index]) : 0;
 	return num;
 }
 
-int Joystick::getBall(lua_State *L)
-{
-	int index = luaL_checkint(L, 1) - 1;
-	int ball = luaL_checkint(L, 2) - 1;
-
-	if (!verifyJoystick(index))
-		return 0;
-
-	if (ball >= getBallCount(index))
-		return 0;
-
-	int dx, dy;
-	SDL_JoystickGetBall(joysticks[index], ball, &dx, &dy);
-
-	lua_pushnumber(L, dx);
-	lua_pushnumber(L, dy);
-	return 2;
-}
-
 bool Joystick::isDown(int index, int *buttonlist)
 {
 	if (!verifyJoystick(index))

src/modules/joystick/sdl/Joystick.h

 	bool isOpen(int index);
 	bool verifyJoystick(int index);
 	int getAxisCount(int index);
-	int getBallCount(int index);
 	int getButtonCount(int index);
 	int getHatCount(int index);
 	float clampval(float x);
 	float getAxis(int index, int axis);
 	int getAxes(lua_State *L);
-	int getBall(lua_State *L);
 	bool isDown(int index, int *buttonlist);
 	Hat getHat(int index, int hat);
 	void close(int index);

src/modules/joystick/sdl/wrap_Joystick.cpp

 	return 1;
 }
 
-int w_getBallCount(lua_State *L)
-{
-	int index = luaL_checkint(L, 1) - 1;
-	lua_pushinteger(L, instance->getBallCount(index));
-	return 1;
-}
-
 int w_getButtonCount(lua_State *L)
 {
 	int index = luaL_checkint(L, 1) - 1;
 	return instance->getAxes(L);
 }
 
-int w_getBall(lua_State *L)
-{
-	return instance->getBall(L);
-}
-
 int w_isDown(lua_State *L)
 {
 	int index = luaL_checkint(L, 1) - 1;
 	{ "getJoystickCount", w_getJoystickCount },
 	{ "getName", w_getName },
 	{ "getAxisCount", w_getAxisCount },
-	{ "getBallCount", w_getBallCount },
 	{ "getButtonCount", w_getButtonCount },
 	{ "getHatCount", w_getHatCount },
 	{ "getAxis", w_getAxis },
-
 	{ "getAxes", w_getAxes },
-	{ "getBall", w_getBall },
-
 	{ "isDown", w_isDown },
 	{ "getHat", w_getHat },
 	{ 0, 0 }

src/modules/joystick/sdl/wrap_Joystick.h

 int w_getJoystickCount(lua_State *L);
 int w_getName(lua_State *L);
 int w_getAxisCount(lua_State *L);
-int w_getBallCount(lua_State *L);
 int w_getButtonCount(lua_State *L);
 int w_getHatCount(lua_State *L);
 int w_getAxis(lua_State *L);
 int w_getAxes(lua_State *L);
-int w_getBall(lua_State *L);
 int w_isDown(lua_State *L);
 int w_getHat(lua_State *L);
 extern "C" LOVE_EXPORT int luaopen_love_joystick(lua_State *L);