jugant amb clang-tidy

This commit is contained in:
2025-07-19 22:38:01 +02:00
parent 1d3fd79a9e
commit a7ef29b750
28 changed files with 735 additions and 734 deletions

View File

@@ -109,65 +109,65 @@ void Title::checkEvents() {
while (SDL_PollEvent(&event)) {
#ifdef DEBUG
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 1) {
static Color color = param.title.bg_color;
static Color color_ = param.title.bg_color;
switch (event.key.key) {
case SDLK_A:
if (color.r < 255)
++color.r;
if (color_.r < 255)
++color_.r;
break;
case SDLK_Z:
if (color.r > 0)
--color.r;
if (color_.r > 0)
--color_.r;
break;
case SDLK_S:
if (color.g < 255)
++color.g;
if (color_.g < 255)
++color_.g;
break;
case SDLK_X:
if (color.g > 0)
--color.g;
if (color_.g > 0)
--color_.g;
break;
case SDLK_D:
if (color.b < 255)
++color.b;
if (color_.b < 255)
++color_.b;
break;
case SDLK_C:
if (color.b > 0)
--color.b;
if (color_.b > 0)
--color_.b;
break;
case SDLK_F:
if (color.r < 255)
++color.r;
if (color.g < 255)
++color.g;
if (color.b < 255)
++color.b;
if (color_.r < 255)
++color_.r;
if (color_.g < 255)
++color_.g;
if (color_.b < 255)
++color_.b;
break;
case SDLK_V:
if (color.r > 0)
--color.r;
if (color.g > 0)
--color.g;
if (color.b > 0)
--color.b;
if (color_.r > 0)
--color_.r;
if (color_.g > 0)
--color_.g;
if (color_.b > 0)
--color_.b;
break;
default:
break;
}
counter_ = 0;
tiled_bg_->setColor(color);
tiled_bg_->setColor(color_);
std::cout << "#"
<< std::hex << std::setw(2) << std::setfill('0') << (int)color.r
<< std::setw(2) << std::setfill('0') << (int)color.g
<< std::setw(2) << std::setfill('0') << (int)color.b
<< std::hex << std::setw(2) << std::setfill('0') << (int)color_.r
<< std::setw(2) << std::setfill('0') << (int)color_.g
<< std::setw(2) << std::setfill('0') << (int)color_.b
<< std::endl;
}
#endif
@@ -218,11 +218,11 @@ void Title::checkInput() {
if (!ServiceMenu::get()->isEnabled()) {
// Comprueba todos los métodos de control
for (const auto &CONTROLLER : Options::controllers) {
for (const auto &controller : Options::controllers) {
// Boton START
if (Input::get()->checkInput(InputAction::START, INPUT_DO_NOT_ALLOW_REPEAT, CONTROLLER.type, CONTROLLER.index)) {
if (Input::get()->checkInput(InputAction::START, INPUT_DO_NOT_ALLOW_REPEAT, controller.type, controller.index)) {
if ((state_ != TitleState::LOGO_ANIMATING || ALLOW_TITLE_ANIMATION_SKIP)) {
if (CONTROLLER.player_id == 1) {
if (controller.player_id == 1) {
if (!player1_start_pressed_) {
player1_start_pressed_ = true;
getPlayer(1)->setPlayingState(PlayerState::TITLE_ANIMATION);
@@ -231,7 +231,7 @@ void Title::checkInput() {
}
}
if (CONTROLLER.player_id == 2) {
if (controller.player_id == 2) {
if (!player2_start_pressed_) {
player2_start_pressed_ = true;
getPlayer(2)->setPlayingState(PlayerState::TITLE_ANIMATION);
@@ -292,9 +292,9 @@ void Title::showControllers() {
// Genera el texto correspondiente
for (size_t i = 0; i < NUM_CONTROLLERS; ++i) {
const size_t index = player_controller_index.at(i);
if (Options::controllers.at(index).plugged) {
text.at(i) = Lang::getText("[DEFINE_BUTTONS] PLAYER") + std::to_string(i + 1) + ": " + Options::controllers.at(index).name;
const size_t INDEX = player_controller_index.at(i);
if (Options::controllers.at(INDEX).plugged) {
text.at(i) = Lang::getText("[DEFINE_BUTTONS] PLAYER") + std::to_string(i + 1) + ": " + Options::controllers.at(INDEX).name;
}
}