clang-format

clang-tidy (macos)
This commit is contained in:
2026-03-23 07:26:21 +01:00
parent 0ddb6c85e1
commit 6595b28790
65 changed files with 583 additions and 570 deletions

View File

@@ -42,7 +42,7 @@ void TilemapRenderer::update(float delta_time) {
// Renderiza el mapa completo en pantalla
void TilemapRenderer::render() {
// Dibuja la textura con el mapa en pantalla
SDL_FRect dest = {0, 0, PlayArea::WIDTH, PlayArea::HEIGHT};
SDL_FRect dest = {.x = 0, .y = 0, .w = PlayArea::WIDTH, .h = PlayArea::HEIGHT};
map_surface_->render(nullptr, &dest);
// Dibuja los tiles animados
@@ -103,7 +103,7 @@ void TilemapRenderer::redrawMap(const CollisionMap* collision_map) {
#endif
// Pinta el mapa estático y debug lines
void TilemapRenderer::fillMapTexture(const CollisionMap* collision_map) {
void TilemapRenderer::fillMapTexture(const CollisionMap* collision_map) { // NOLINT(readability-convert-member-functions-to-static)
const Uint8 COLOR = stringToColor(bg_color_);
auto previous_renderer = Screen::get()->getRendererSurface();
Screen::get()->setRendererSurface(map_surface_);
@@ -111,7 +111,7 @@ void TilemapRenderer::fillMapTexture(const CollisionMap* collision_map) {
// Los tileSetFiles son de 20x20 tiles. El primer tile es el 0. Cuentan hacia la derecha y hacia abajo
SDL_FRect clip = {0, 0, TILE_SIZE, TILE_SIZE};
SDL_FRect clip = {.x = 0, .y = 0, .w = TILE_SIZE, .h = TILE_SIZE};
for (int y = 0; y < MAP_HEIGHT; ++y) {
for (int x = 0; x < MAP_WIDTH; ++x) {
// Tiled pone los tiles vacios del mapa como cero y empieza a contar de 1 a n.
@@ -145,7 +145,7 @@ void TilemapRenderer::fillMapTexture(const CollisionMap* collision_map) {
}
// Localiza todos los tiles animados
void TilemapRenderer::setAnimatedTiles(const CollisionMap* collision_map) {
void TilemapRenderer::setAnimatedTiles(const CollisionMap* collision_map) { // NOLINT(readability-convert-member-functions-to-static)
// Recorre la habitación entera por filas buscando tiles de tipo t_animated
for (int i = 0; i < (int)tile_map_.size(); ++i) {
const auto TILE_TYPE = collision_map->getTile(i);
@@ -168,7 +168,7 @@ void TilemapRenderer::setAnimatedTiles(const CollisionMap* collision_map) {
}
// Actualiza tiles animados
void TilemapRenderer::updateAnimatedTiles() {
void TilemapRenderer::updateAnimatedTiles() { // NOLINT(readability-make-member-function-const)
const int NUM_FRAMES = 4;
// Calcular frame actual basado en tiempo