clang-tidy (amb el fuck de que no feien bona parella el clang de macos i el tidy de llvm)

This commit is contained in:
2026-03-23 12:03:07 +01:00
parent 3ca744ee46
commit a1d17ccf99
72 changed files with 487 additions and 484 deletions

View File

@@ -78,16 +78,16 @@ void Instructions::iniSprites() {
item_textures_.emplace_back(Resource::get()->getTexture("item_coffee.png"));
// Inicializa los sprites
for (int i = 0; i < (int)item_textures_.size(); ++i) {
for (int i = 0; std::cmp_less(i, item_textures_.size()); ++i) {
auto sprite = std::make_unique<Sprite>(item_textures_[i], 0, 0, Item::WIDTH, Item::HEIGHT);
sprite->setPosition((SDL_FPoint){sprite_pos_.x, sprite_pos_.y + ((Item::HEIGHT + item_space_) * i)});
sprite->setPosition((SDL_FPoint){.x = sprite_pos_.x, .y = sprite_pos_.y + ((Item::HEIGHT + item_space_) * i)});
sprites_.push_back(std::move(sprite));
}
}
// Actualiza los sprites
void Instructions::updateSprites() {
SDL_FRect src_rect = {0, 0, Item::WIDTH, Item::HEIGHT};
SDL_FRect src_rect = {.x = 0, .y = 0, .w = Item::WIDTH, .h = Item::HEIGHT};
// Disquito (desplazamiento 12/60 = 0.2s)
src_rect.y = Item::HEIGHT * (static_cast<int>((elapsed_time_ + 0.2F) / SPRITE_ANIMATION_CYCLE_S) % 2);
@@ -134,7 +134,7 @@ void Instructions::fillTexture() {
const int SPACE_BETWEEN_ITEM_LINES = Item::HEIGHT + item_space_;
const int SPACE_NEW_PARAGRAPH = SPACE_BETWEEN_LINES * 0.5F;
const int SIZE = (NUM_LINES * SPACE_BETWEEN_LINES) + (NUM_ITEM_LINES * SPACE_BETWEEN_ITEM_LINES) + (NUM_POST_HEADERS * SPACE_POST_HEADER) + (NUM_PRE_HEADERS * SPACE_PRE_HEADER) + (SPACE_NEW_PARAGRAPH);
const int SIZE = (NUM_LINES * SPACE_BETWEEN_LINES) + (NUM_ITEM_LINES * SPACE_BETWEEN_ITEM_LINES) + (NUM_POST_HEADERS * SPACE_POST_HEADER) + (NUM_PRE_HEADERS * SPACE_PRE_HEADER) + SPACE_NEW_PARAGRAPH;
const int FIRST_LINE = (param.game.height - SIZE) / 2;
// Calcula cual es el texto más largo de las descripciones de los items
@@ -333,8 +333,8 @@ auto Instructions::moveLines(std::vector<Line>& lines, int width, float duration
// Método para renderizar las líneas
void Instructions::renderLines(SDL_Renderer* renderer, SDL_Texture* texture, const std::vector<Line>& lines) {
for (const auto& line : lines) {
SDL_FRect src_rect = {0, static_cast<float>(line.y), 320, 1};
SDL_FRect dst_rect = {static_cast<float>(line.x), static_cast<float>(line.y), 320, 1};
SDL_FRect src_rect = {.x = 0, .y = static_cast<float>(line.y), .w = 320, .h = 1};
SDL_FRect dst_rect = {.x = static_cast<float>(line.x), .y = static_cast<float>(line.y), .w = 320, .h = 1};
SDL_RenderTexture(renderer, texture, &src_rect, &dst_rect);
}
}