clang-tidy readability
This commit is contained in:
@@ -74,8 +74,8 @@ Background::Background()
|
||||
|
||||
// Inicializa objetos
|
||||
{
|
||||
constexpr float TOP_CLOUDS_SPEED = 0.1f;
|
||||
constexpr float BOTTOM_CLOUDS_SPEED = 0.05f;
|
||||
constexpr float TOP_CLOUDS_SPEED = 0.1F;
|
||||
constexpr float BOTTOM_CLOUDS_SPEED = 0.05F;
|
||||
|
||||
top_clouds_sprite_a_->setSpriteClip(0, 0, top_clouds_texture_->getWidth(), top_clouds_texture_->getHeight());
|
||||
top_clouds_sprite_a_->setVelX(-TOP_CLOUDS_SPEED);
|
||||
@@ -187,7 +187,7 @@ void Background::renderBottomClouds() {
|
||||
// Compone todos los elementos del fondo en la textura
|
||||
void Background::fillCanvas() {
|
||||
// Cambia el destino del renderizador
|
||||
auto temp = SDL_GetRenderTarget(renderer_);
|
||||
auto *temp = SDL_GetRenderTarget(renderer_);
|
||||
SDL_SetRenderTarget(renderer_, canvas_);
|
||||
|
||||
// Dibuja el gradiente de fondo
|
||||
@@ -234,7 +234,7 @@ void Background::setGradientNumber(int value) {
|
||||
|
||||
// Ajusta el valor de la variable
|
||||
void Background::setTransition(float value) {
|
||||
transition_ = std::clamp(value, 0.0f, 1.0f);
|
||||
transition_ = std::clamp(value, 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
// Establece la posición del objeto
|
||||
@@ -253,7 +253,7 @@ void Background::setColor(Color color) {
|
||||
attenuate_color_ = color;
|
||||
|
||||
// Colorea la textura
|
||||
auto temp = SDL_GetRenderTarget(renderer_);
|
||||
auto *temp = SDL_GetRenderTarget(renderer_);
|
||||
SDL_SetRenderTarget(renderer_, color_texture_);
|
||||
|
||||
SDL_SetRenderDrawColor(renderer_, attenuate_color_.r, attenuate_color_.g, attenuate_color_.b, 255);
|
||||
@@ -276,10 +276,9 @@ void Background::setAlpha(int alpha) {
|
||||
void Background::updateAlphaColorTexture() {
|
||||
if (alpha_color_text_ == alpha_color_text_temp_) {
|
||||
return;
|
||||
} else {
|
||||
alpha_color_text_ > alpha_color_text_temp_ ? ++alpha_color_text_temp_ : --alpha_color_text_temp_;
|
||||
SDL_SetTextureAlphaMod(color_texture_, alpha_color_text_temp_);
|
||||
}
|
||||
alpha_color_text_ > alpha_color_text_temp_ ? ++alpha_color_text_temp_ : --alpha_color_text_temp_;
|
||||
SDL_SetTextureAlphaMod(color_texture_, alpha_color_text_temp_);
|
||||
}
|
||||
|
||||
// Actualiza las nubes
|
||||
@@ -359,12 +358,12 @@ void Background::createMoonPath() {
|
||||
|
||||
// Establece la posición del sol
|
||||
void Background::setSunProgression(float progress) {
|
||||
progress = std::clamp(progress, 0.0f, 1.0f);
|
||||
progress = std::clamp(progress, 0.0F, 1.0F);
|
||||
sun_index_ = static_cast<size_t>(progress * (sun_path_.size() - 1));
|
||||
}
|
||||
|
||||
// Establece la posición de la luna
|
||||
void Background::setMoonProgression(float progress) {
|
||||
progress = std::clamp(progress, 0.0f, 1.0f);
|
||||
progress = std::clamp(progress, 0.0F, 1.0F);
|
||||
moon_index_ = static_cast<size_t>(progress * (moon_path_.size() - 1));
|
||||
}
|
||||
Reference in New Issue
Block a user