treball en curs: correccions de tidy

This commit is contained in:
2026-05-16 15:49:21 +02:00
parent 18cd287808
commit 3421f34a84
18 changed files with 658 additions and 651 deletions
+10 -10
View File
@@ -115,12 +115,12 @@ void Title::init() {
InputDevice inp;
inp.id = 0;
inp.name = "KEYBOARD";
inp.deviceType = INPUT_USE_KEYBOARD;
inp.device_type = INPUT_USE_KEYBOARD;
Options::inputs.push_back(inp);
inp.id = 0;
inp.name = "GAME CONTROLLER";
inp.deviceType = INPUT_USE_GAMECONTROLLER;
inp.device_type = INPUT_USE_GAMECONTROLLER;
Options::inputs.push_back(inp);
// Comprueba si hay mandos conectados
@@ -135,7 +135,7 @@ void Title::init() {
if (Input::get()->gameControllerFound()) {
Options::inputs[1].id = available_input_devices_[device_index_[1]].id;
Options::inputs[1].name = available_input_devices_[device_index_[1]].name;
Options::inputs[1].deviceType = available_input_devices_[device_index_[1]].deviceType;
Options::inputs[1].device_type = available_input_devices_[device_index_[1]].device_type;
} else { // Si no ha encontrado un mando, deshabilita la opción de jugar a 2 jugadores
menu_.title->setSelectable(1, false);
menu_.title->setGreyed(1, true);
@@ -625,7 +625,7 @@ void Title::render() {
// Comprueba las entradas
void Title::checkInput() {
#ifndef __EMSCRIPTEN__
if (Input::get()->checkInput(input_exit, REPEAT_FALSE)) {
if (Input::get()->checkInput(EXIT, REPEAT_FALSE)) {
section_->name = SECTION_PROG_QUIT;
return;
}
@@ -678,7 +678,7 @@ void Title::updateMenuLabels() const {
i++;
// PLAYER 1 CONTROLS - OPTIONS
switch (Options::inputs[0].deviceType) {
switch (Options::inputs[0].device_type) {
case INPUT_USE_KEYBOARD:
menu_.options->setItemCaption(i, Lang::get()->getText(69)); // KEYBOARD
menu_.options->setGreyed(i, false);
@@ -705,7 +705,7 @@ void Title::updateMenuLabels() const {
i++;
// PLAYER 2 CONTROLS - OPTIONS
switch (Options::inputs[1].deviceType) {
switch (Options::inputs[1].device_type) {
case INPUT_USE_KEYBOARD:
menu_.options->setItemCaption(i, Lang::get()->getText(69)); // KEYBOARD
menu_.options->setGreyed(i, false);
@@ -966,11 +966,11 @@ auto Title::updatePlayerInputs(int num_player) -> bool {
Options::inputs[0].id = -1;
Options::inputs[0].name = "KEYBOARD";
Options::inputs[0].deviceType = INPUT_USE_KEYBOARD;
Options::inputs[0].device_type = INPUT_USE_KEYBOARD;
Options::inputs[1].id = 0;
Options::inputs[1].name = "GAME CONTROLLER";
Options::inputs[1].deviceType = INPUT_USE_GAMECONTROLLER;
Options::inputs[1].device_type = INPUT_USE_GAMECONTROLLER;
return true;
} // Si hay mas de un dispositivo, se recorre el vector
@@ -1062,7 +1062,7 @@ void Title::checkInputDevices() {
for (int i = 0; i < NUM_CONTROLLERS; ++i) {
temp.id = i;
temp.name = Input::get()->getControllerName(i);
temp.deviceType = INPUT_USE_GAMECONTROLLER;
temp.device_type = INPUT_USE_GAMECONTROLLER;
available_input_devices_.push_back(temp);
if (Options::settings.console) {
std::cout << "Device " << (int)available_input_devices_.size() << " - " << temp.name.c_str() << '\n';
@@ -1073,7 +1073,7 @@ void Title::checkInputDevices() {
// Añade el teclado al final
temp.id = -1;
temp.name = "KEYBOARD";
temp.deviceType = INPUT_USE_KEYBOARD;
temp.device_type = INPUT_USE_KEYBOARD;
available_input_devices_.push_back(temp);
if (Options::settings.console) {
std::cout << "Device " << (int)available_input_devices_.size() << " - " << temp.name.c_str() << '\n';