neteja cppcheck (105 → 0)

This commit is contained in:
2026-05-16 19:35:23 +02:00
parent c9d16959d0
commit fcd2718794
48 changed files with 293 additions and 486 deletions
+4 -5
View File
@@ -562,14 +562,13 @@ void Background::createMoonPath() {
const int FREEZE_START_INDEX = static_cast<int>(NUM_STEPS * (1.0F - FREEZE_PERCENTAGE));
for (int i = 0; i < NUM_STEPS; ++i) {
double theta = i * STEP;
float x = CENTER_X + (RADIUS * cos(theta));
float y = CENTER_Y - (RADIUS * sin(theta));
if (i >= FREEZE_START_INDEX && !moon_path_.empty()) {
moon_path_.push_back(moon_path_.back()); // Repite el último punto válido
} else {
moon_path_.push_back({.x = x, .y = y});
const double THETA = i * STEP;
const float X = CENTER_X + (RADIUS * cos(THETA));
const float Y = CENTER_Y - (RADIUS * sin(THETA));
moon_path_.push_back({.x = X, .y = Y});
}
}
}
+2 -2
View File
@@ -28,8 +28,8 @@ class Background {
using ProgressCallback = std::function<void(float)>; // Callback para sincronización
// --- Constructor y destructor ---
Background(float total_progress_to_complete = 6100.0F); // Constructor principal
~Background(); // Destructor
explicit Background(float total_progress_to_complete = 6100.0F); // Constructor principal
~Background(); // Destructor
// --- Métodos principales ---
void update(float delta_time); // Actualiza la lógica del objeto
+1 -1
View File
@@ -66,7 +66,7 @@ class Screen {
[[nodiscard]] auto getText() const -> std::shared_ptr<Text> { return text_; } // Obtiene el puntero al texto de Screen
// --- Display Monitor getters ---
[[nodiscard]] auto getDisplayMonitorName() const -> std::string { return display_monitor_.name; }
[[nodiscard]] auto getDisplayMonitorName() const -> const std::string& { return display_monitor_.name; }
[[nodiscard]] auto getDisplayMonitorWidth() const -> int { return display_monitor_.width; }
[[nodiscard]] auto getDisplayMonitorHeight() const -> int { return display_monitor_.height; }
[[nodiscard]] auto getDisplayMonitorRefreshRate() const -> int { return display_monitor_.refresh_rate; }
+6 -6
View File
@@ -25,12 +25,12 @@ enum class PathCentered { // Centrado del recorrido
// --- Estructuras ---
struct Path { // Define un recorrido para el sprite
float start_pos; // Posición inicial
float end_pos; // Posición final
PathType type; // Tipo de movimiento (horizontal/vertical)
float fixed_pos; // Posición fija en el eje contrario
float duration_s; // Duración de la animación en segundos
float waiting_time_s; // Tiempo de espera una vez en el destino
float start_pos = 0.0F; // Posición inicial
float end_pos = 0.0F; // Posición final
PathType type = PathType::HORIZONTAL; // Tipo de movimiento (horizontal/vertical)
float fixed_pos = 0.0F; // Posición fija en el eje contrario
float duration_s = 0.0F; // Duración de la animación en segundos
float waiting_time_s = 0.0F; // Tiempo de espera una vez en el destino
std::function<double(double)> easing_function; // Función de easing
float elapsed_time = 0.0F; // Tiempo transcurrido
float waiting_elapsed = 0.0F; // Tiempo de espera transcurrido
+1 -2
View File
@@ -403,9 +403,8 @@ auto Text::loadFile(const std::string& file_path) -> std::shared_ptr<Text::File>
file.open(file_path);
}
std::istream& input_stream = using_resource_data ? stream : static_cast<std::istream&>(file);
if ((using_resource_data && stream.good()) || (!using_resource_data && file.is_open() && file.good())) {
std::istream& input_stream = using_resource_data ? stream : static_cast<std::istream&>(file);
std::string buffer;
// Lee los dos primeros valores del fichero
+1 -1
View File
@@ -39,7 +39,7 @@ class Text {
int kerning;
// Constructor con argumentos por defecto
Style(Uint8 flags = 0,
explicit Style(Uint8 flags = 0,
Color text = Color(),
Color shadow = Color(),
Uint8 distance = 1,