clang-tidy readability

This commit is contained in:
2025-07-20 14:56:00 +02:00
parent f5245273a1
commit ca99f7be34
57 changed files with 623 additions and 557 deletions

View File

@@ -51,7 +51,7 @@ class Screen {
void show() { SDL_ShowWindow(window_); } // Muestra la ventana
void hide() { SDL_HideWindow(window_); } // Oculta la ventana
void getSingletons(); // Obtiene los punteros a los singletones
[[nodiscard]] auto getVSync() const -> bool { return Options::video.v_sync; } // Obtiene el valor de V-Sync
[[nodiscard]] static auto getVSync() -> bool { return Options::video.v_sync; } // Obtiene el valor de V-Sync
[[nodiscard]] auto getText() const -> std::shared_ptr<Text> { return text_; } // Obtiene el puntero al texto de Screen
#ifdef DEBUG
@@ -93,8 +93,8 @@ class Screen {
explicit FlashEffect(bool enabled = false, int lenght = 0, int delay = 0, Color color = Color(0xFF, 0xFF, 0xFF))
: enabled(enabled), lenght(lenght), delay(delay), counter(lenght), color(color) {}
void update() { (enabled && counter > 0) ? counter-- : enabled = false; }
auto isRendarable() -> bool { return enabled && counter < lenght - delay; }
void update() { (enabled && counter > 0) ? counter-- : static_cast<int>(enabled = false); }
auto isRendarable() const -> bool { return enabled && counter < lenght - delay; }
};
// Efecto de sacudida/agitación de pantalla: mueve la imagen para simular un temblor
@@ -119,12 +119,15 @@ class Screen {
original_width = src_rect.w;
// Usar nuevos valores si se proporcionan, sino mantener los actuales
if (new_desp != -1)
if (new_desp != -1) {
desp = new_desp;
if (new_delay != -1)
}
if (new_delay != -1) {
delay = new_delay;
if (new_lenght != -1)
}
if (new_lenght != -1) {
lenght = new_lenght;
}
src_rect.w -= desp;
dst_rect.w = src_rect.w;