mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Removed love.joystick.getBall and love.joystick.getBallCount (issue #648)
This commit is contained in:
@@ -146,11 +146,6 @@ int Joystick::getAxisCount(int index)
|
||||
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;
|
||||
@@ -194,25 +189,6 @@ int Joystick::getAxes(lua_State *L)
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user