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

@@ -44,13 +44,13 @@ Item::Item(ItemType type, float x, float y, SDL_FRect &play_area, std::shared_pt
}
void Item::alignTo(int x) {
const float min_x = param.game.play_area.rect.x + 1;
const float max_x = play_area_.w - width_ - 1;
const float MIN_X = param.game.play_area.rect.x + 1;
const float MAX_X = play_area_.w - width_ - 1;
pos_x_ = x - (width_ / 2);
// Ajusta para que no quede fuera de la zona de juego
pos_x_ = std::clamp(pos_x_, min_x, max_x);
pos_x_ = std::clamp(pos_x_, MIN_X, MAX_X);
// Actualiza el sprite
shiftSprite();