REPEAT_TRUE/FALSE → enum class Input::Repeat
This commit is contained in:
@@ -104,7 +104,7 @@ void Input::bindGameControllerButton(Uint8 input, SDL_GamepadButton button) {
|
||||
}
|
||||
|
||||
// Comprueba si un input esta activo
|
||||
auto Input::checkInput(Uint8 input, bool repeat, int device, int index) -> bool {
|
||||
auto Input::checkInput(Uint8 input, Repeat repeat, int device, int index) -> bool {
|
||||
if (!enabled_) {
|
||||
return false;
|
||||
}
|
||||
@@ -127,11 +127,11 @@ auto Input::checkInput(Uint8 input, bool repeat, int device, int index) -> bool
|
||||
}
|
||||
|
||||
// Helper de checkInput: comprueba el estado de una tecla
|
||||
auto Input::checkKeyboardInput(Uint8 input, bool repeat) -> bool {
|
||||
auto Input::checkKeyboardInput(Uint8 input, Repeat repeat) -> bool {
|
||||
const bool *key_states = SDL_GetKeyboardState(nullptr);
|
||||
const bool IS_DOWN = key_states[key_bindings_[input].scancode];
|
||||
|
||||
if (repeat) {
|
||||
if (repeat == Repeat::ON) {
|
||||
return IS_DOWN;
|
||||
}
|
||||
|
||||
@@ -142,10 +142,10 @@ auto Input::checkKeyboardInput(Uint8 input, bool repeat) -> bool {
|
||||
}
|
||||
|
||||
// Helper de checkInput: comprueba el estado de un botón de mando
|
||||
auto Input::checkGameControllerInput(Uint8 input, bool repeat, int index) -> bool {
|
||||
auto Input::checkGameControllerInput(Uint8 input, Repeat repeat, int index) -> bool {
|
||||
const bool IS_DOWN = SDL_GetGamepadButton(connected_controllers_[index], game_controller_bindings_[input].button);
|
||||
|
||||
if (repeat) {
|
||||
if (repeat == Repeat::ON) {
|
||||
return IS_DOWN;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user