REPEAT_TRUE/FALSE → enum class Input::Repeat
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "core/audio/audio.hpp" // for Audio
|
||||
#include "core/input/global_inputs.hpp" // for GlobalInputs::handle
|
||||
#include "core/input/input.h" // for InputAction, Input, REPEAT_TRUE, REPEAT_FALSE
|
||||
#include "core/input/input.h" // for InputAction, Input, Input::Repeat::ON, Input::Repeat::OFF
|
||||
#include "core/locale/lang.h" // for Lang
|
||||
#include "core/rendering/fade.h" // for Fade, FADE_CENTER
|
||||
#include "core/rendering/movingsprite.h" // for MovingSprite
|
||||
@@ -2531,10 +2531,10 @@ void Game::processPlayerLiveInput(Player *player, int i) {
|
||||
const auto &device = Options::inputs[i];
|
||||
|
||||
// Movimiento izquierda / derecha / nada
|
||||
if (input->checkInput(LEFT, REPEAT_TRUE, device.device_type, device.id)) {
|
||||
if (input->checkInput(LEFT, Input::Repeat::ON, device.device_type, device.id)) {
|
||||
player->setInput(LEFT);
|
||||
demo_.keys.left = 1;
|
||||
} else if (input->checkInput(RIGHT, REPEAT_TRUE, device.device_type, device.id)) {
|
||||
} else if (input->checkInput(RIGHT, Input::Repeat::ON, device.device_type, device.id)) {
|
||||
player->setInput(RIGHT);
|
||||
demo_.keys.right = 1;
|
||||
} else {
|
||||
@@ -2543,7 +2543,7 @@ void Game::processPlayerLiveInput(Player *player, int i) {
|
||||
}
|
||||
|
||||
// Disparo al centro
|
||||
if (input->checkInput(FIRE_CENTER, REPEAT_TRUE, device.device_type, device.id) && player->canFire()) {
|
||||
if (input->checkInput(FIRE_CENTER, Input::Repeat::ON, device.device_type, device.id) && player->canFire()) {
|
||||
player->setInput(FIRE_CENTER);
|
||||
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), Bullet::Kind::UP, player->isPowerUp(), i);
|
||||
player->setFireCooldown(10);
|
||||
@@ -2552,7 +2552,7 @@ void Game::processPlayerLiveInput(Player *player, int i) {
|
||||
}
|
||||
|
||||
// Disparo a la izquierda
|
||||
if (input->checkInput(FIRE_LEFT, REPEAT_TRUE, device.device_type, device.id) && player->canFire()) {
|
||||
if (input->checkInput(FIRE_LEFT, Input::Repeat::ON, device.device_type, device.id) && player->canFire()) {
|
||||
player->setInput(FIRE_LEFT);
|
||||
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), Bullet::Kind::LEFT, player->isPowerUp(), i);
|
||||
player->setFireCooldown(10);
|
||||
@@ -2561,7 +2561,7 @@ void Game::processPlayerLiveInput(Player *player, int i) {
|
||||
}
|
||||
|
||||
// Disparo a la derecha
|
||||
if (input->checkInput(FIRE_RIGHT, REPEAT_TRUE, device.device_type, device.id) && player->canFire()) {
|
||||
if (input->checkInput(FIRE_RIGHT, Input::Repeat::ON, device.device_type, device.id) && player->canFire()) {
|
||||
player->setInput(FIRE_RIGHT);
|
||||
createBullet(player->getPosX() + (player->getWidth() / 2) - 4, player->getPosY() + (player->getHeight() / 2), Bullet::Kind::RIGHT, player->isPowerUp(), i);
|
||||
player->setFireCooldown(10);
|
||||
@@ -2570,7 +2570,7 @@ void Game::processPlayerLiveInput(Player *player, int i) {
|
||||
}
|
||||
|
||||
// Pausa
|
||||
if (input->checkInput(PAUSE, REPEAT_FALSE, device.device_type, device.id)) {
|
||||
if (input->checkInput(PAUSE, Input::Repeat::OFF, device.device_type, device.id)) {
|
||||
section_->subsection = SUBSECTION_GAME_PAUSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user