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

@@ -43,7 +43,7 @@ const Notifier::Style Notifier::Style::CHEEVO = {
.play_sound = true};
// [SINGLETON] Crearemos el objeto con esta función estática
void Notifier::init(const std::string& icon_file, const std::string& text) {
void Notifier::init(const std::string& icon_file, const std::string& text) { // NOLINT(readability-convert-member-functions-to-static)
Notifier::notifier = new Notifier(icon_file, text);
}
@@ -128,8 +128,8 @@ void Notifier::update(float delta_time) {
}
// Elimina las notificaciones finalizadas
void Notifier::clearFinishedNotifications() {
auto result = std::ranges::remove_if(notifications_, [](const Notification& notification) {
void Notifier::clearFinishedNotifications() { // NOLINT(readability-convert-member-functions-to-static)
auto result = std::ranges::remove_if(notifications_, [](const Notification& notification) -> bool {
return notification.state == Status::FINISHED;
});
notifications_.erase(result.begin(), result.end());
@@ -147,7 +147,7 @@ void Notifier::show(std::vector<std::string> texts, const Style& style, int icon
}
// Elimina las cadenas vacías
auto result = std::ranges::remove_if(texts, [](const std::string& s) { return s.empty(); });
auto result = std::ranges::remove_if(texts, [](const std::string& s) -> bool { return s.empty(); });
texts.erase(result.begin(), result.end());
// Encuentra la cadena más larga
@@ -219,15 +219,15 @@ void Notifier::show(std::vector<std::string> texts, const Style& style, int icon
else if (SHAPE == Shape::SQUARED) {
n.surface->clear(style.bg_color);
SDL_FRect squared_rect = {0, 0, n.surface->getWidth(), n.surface->getHeight()};
SDL_FRect squared_rect = {.x = 0, .y = 0, .w = n.surface->getWidth(), .h = n.surface->getHeight()};
n.surface->drawRectBorder(&squared_rect, style.border_color);
}
// Dibuja el icono de la notificación
if (has_icons_ && icon >= 0 && texts.size() >= 2) {
auto sp = std::make_unique<SurfaceSprite>(icon_surface_, (SDL_FRect){0, 0, ICON_SIZE, ICON_SIZE});
sp->setPosition({PADDING_IN_H, PADDING_IN_V, ICON_SIZE, ICON_SIZE});
sp->setClip((SDL_FRect){ICON_SIZE * (icon % 10), ICON_SIZE * (icon / 10), ICON_SIZE, ICON_SIZE});
auto sp = std::make_unique<SurfaceSprite>(icon_surface_, SDL_FRect{.x = 0, .y = 0, .w = ICON_SIZE, .h = ICON_SIZE});
sp->setPosition({.x = PADDING_IN_H, .y = PADDING_IN_V, .w = ICON_SIZE, .h = ICON_SIZE});
sp->setClip(SDL_FRect{.x = ICON_SIZE * (icon % 10), .y = ICON_SIZE * (icon / 10), .w = ICON_SIZE, .h = ICON_SIZE});
sp->render();
}