clang-tidy readability-function-cognitive-complexity
clang-format
This commit is contained in:
@@ -30,61 +30,61 @@ enum class FadeState : Uint8 {
|
||||
};
|
||||
|
||||
class Fade {
|
||||
public:
|
||||
// --- Constructores y destructor ---
|
||||
Fade();
|
||||
~Fade();
|
||||
public:
|
||||
// --- Constructores y destructor ---
|
||||
Fade();
|
||||
~Fade();
|
||||
|
||||
// --- Métodos principales ---
|
||||
void reset(); // Resetea variables para reutilizar el fade
|
||||
void render(); // Dibuja la transición en pantalla
|
||||
void update(); // Actualiza el estado interno
|
||||
void activate(); // Activa el fade
|
||||
// --- Métodos principales ---
|
||||
void reset(); // Resetea variables para reutilizar el fade
|
||||
void render(); // Dibuja la transición en pantalla
|
||||
void update(); // Actualiza el estado interno
|
||||
void activate(); // Activa el fade
|
||||
|
||||
// --- Configuración ---
|
||||
void setColor(Uint8 r, Uint8 g, Uint8 b);
|
||||
void setColor(Color color);
|
||||
void setType(FadeType type) { type_ = type; }
|
||||
void setMode(FadeMode mode) { mode_ = mode; }
|
||||
void setPostDuration(int value) { post_duration_ = value; }
|
||||
void setPreDuration(int value) { pre_duration_ = value; }
|
||||
// --- Configuración ---
|
||||
void setColor(Uint8 r, Uint8 g, Uint8 b);
|
||||
void setColor(Color color);
|
||||
void setType(FadeType type) { type_ = type; }
|
||||
void setMode(FadeMode mode) { mode_ = mode; }
|
||||
void setPostDuration(int value) { post_duration_ = value; }
|
||||
void setPreDuration(int value) { pre_duration_ = value; }
|
||||
|
||||
// --- Getters ---
|
||||
[[nodiscard]] auto getValue() const -> int { return value_; }
|
||||
[[nodiscard]] auto isEnabled() const -> bool { return state_ != FadeState::NOT_ENABLED; }
|
||||
[[nodiscard]] auto hasEnded() const -> bool { return state_ == FadeState::FINISHED; }
|
||||
// --- Getters ---
|
||||
[[nodiscard]] auto getValue() const -> int { return value_; }
|
||||
[[nodiscard]] auto isEnabled() const -> bool { return state_ != FadeState::NOT_ENABLED; }
|
||||
[[nodiscard]] auto hasEnded() const -> bool { return state_ == FadeState::FINISHED; }
|
||||
|
||||
private:
|
||||
// --- Objetos y punteros ---
|
||||
SDL_Renderer *renderer_; // Renderizador de la ventana
|
||||
SDL_Texture *backbuffer_; // Backbuffer para efectos
|
||||
private:
|
||||
// --- Objetos y punteros ---
|
||||
SDL_Renderer *renderer_; // Renderizador de la ventana
|
||||
SDL_Texture *backbuffer_; // Backbuffer para efectos
|
||||
|
||||
// --- Variables de estado ---
|
||||
FadeType type_; // Tipo de fade
|
||||
FadeMode mode_; // Modo de fade
|
||||
FadeState state_ = FadeState::NOT_ENABLED; // Estado actual
|
||||
Uint16 counter_; // Contador interno
|
||||
// --- Variables de estado ---
|
||||
FadeType type_; // Tipo de fade
|
||||
FadeMode mode_; // Modo de fade
|
||||
FadeState state_ = FadeState::NOT_ENABLED; // Estado actual
|
||||
Uint16 counter_; // Contador interno
|
||||
|
||||
// --- Parámetros de color y geometría ---
|
||||
Uint8 r_, g_, b_, a_; // Color del fade
|
||||
SDL_FRect rect1_, rect2_; // Rectángulos para efectos
|
||||
// --- Parámetros de color y geometría ---
|
||||
Uint8 r_, g_, b_, a_; // Color del fade
|
||||
SDL_FRect rect1_, rect2_; // Rectángulos para efectos
|
||||
|
||||
// --- Parámetros para RANDOM_SQUARE ---
|
||||
int num_squares_width_; // Cuadrados en horizontal
|
||||
int num_squares_height_; // Cuadrados en vertical
|
||||
std::vector<SDL_FRect> square_; // Vector de cuadrados
|
||||
int fade_random_squares_delay_; // Delay entre cuadrados
|
||||
int fade_random_squares_mult_; // Cuadrados por paso
|
||||
// --- Parámetros para RANDOM_SQUARE ---
|
||||
int num_squares_width_; // Cuadrados en horizontal
|
||||
int num_squares_height_; // Cuadrados en vertical
|
||||
std::vector<SDL_FRect> square_; // Vector de cuadrados
|
||||
int fade_random_squares_delay_; // Delay entre cuadrados
|
||||
int fade_random_squares_mult_; // Cuadrados por paso
|
||||
|
||||
// --- Temporizadores ---
|
||||
int post_duration_ = 0, post_counter_ = 0;
|
||||
int pre_duration_ = 0, pre_counter_ = 0;
|
||||
// --- Temporizadores ---
|
||||
int post_duration_ = 0, post_counter_ = 0;
|
||||
int pre_duration_ = 0, pre_counter_ = 0;
|
||||
|
||||
// --- Valor de progreso ---
|
||||
int value_ = 0; // Estado del fade (0-100)
|
||||
// --- Valor de progreso ---
|
||||
int value_ = 0; // Estado del fade (0-100)
|
||||
|
||||
// --- Métodos internos ---
|
||||
void init(); // Inicializa variables
|
||||
void cleanBackbuffer(Uint8 r, Uint8 g, Uint8 b, Uint8 a); // Limpia el backbuffer
|
||||
static auto calculateValue(int min, int max, int current) -> int; // Calcula el valor del fade
|
||||
// --- Métodos internos ---
|
||||
void init(); // Inicializa variables
|
||||
void cleanBackbuffer(Uint8 r, Uint8 g, Uint8 b, Uint8 a); // Limpia el backbuffer
|
||||
static auto calculateValue(int min, int max, int current) -> int; // Calcula el valor del fade
|
||||
};
|
||||
Reference in New Issue
Block a user