menu selector now resizes smooth
This commit is contained in:
@@ -80,44 +80,45 @@ bool Input::checkInput(Uint8 input, bool repeat, int device)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((device == INPUT_USE_GAMECONTROLLER) || (device == INPUT_USE_ANY))
|
||||
{
|
||||
if (repeat)
|
||||
|
||||
if (gameControllerFound())
|
||||
if ((device == INPUT_USE_GAMECONTROLLER) || (device == INPUT_USE_ANY))
|
||||
{
|
||||
if (SDL_GameControllerGetButton(mGameController, mGameControllerBindings[input].button) != 0)
|
||||
successGameController = true;
|
||||
else
|
||||
successGameController = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!mGameControllerBindings[input].active)
|
||||
if (repeat)
|
||||
{
|
||||
if (SDL_GameControllerGetButton(mGameController, mGameControllerBindings[input].button) != 0)
|
||||
{
|
||||
mGameControllerBindings[input].active = true;
|
||||
successGameController = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
successGameController = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SDL_GameControllerGetButton(mGameController, mGameControllerBindings[input].button) == 0)
|
||||
if (!mGameControllerBindings[input].active)
|
||||
{
|
||||
mGameControllerBindings[input].active = false;
|
||||
successGameController = false;
|
||||
if (SDL_GameControllerGetButton(mGameController, mGameControllerBindings[input].button) != 0)
|
||||
{
|
||||
mGameControllerBindings[input].active = true;
|
||||
successGameController = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
successGameController = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
successGameController = false;
|
||||
if (SDL_GameControllerGetButton(mGameController, mGameControllerBindings[input].button) == 0)
|
||||
{
|
||||
mGameControllerBindings[input].active = false;
|
||||
successGameController = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
successGameController = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (successKeyboard || successGameController);
|
||||
}
|
||||
@@ -159,4 +160,13 @@ bool Input::discoverGameController()
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
// Comprueba si hay algun mando conectado
|
||||
bool Input::gameControllerFound()
|
||||
{
|
||||
if (mNumGamepads > 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user