clang-tidy
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_SetRenderTarget, SDL_CreateTexture, SDL_DestroyTexture, SDL_FRect, SDL_GetRenderTarget, SDL_RenderTexture, SDL_PixelFormat, SDL_TextureAccess
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath> // Para sin
|
||||
#include <cstdlib> // Para rand
|
||||
#include <memory> // Para allocator, unique_ptr, make_unique
|
||||
@@ -25,17 +26,17 @@ TiledBG::TiledBG(SDL_FRect pos, TiledBGMode mode)
|
||||
// Inicializa variables
|
||||
switch (mode_) {
|
||||
case TiledBGMode::STATIC:
|
||||
window_ = {0, 0, pos_.w, pos_.h};
|
||||
window_ = {.x = 0, .y = 0, .w = pos_.w, .h = pos_.h};
|
||||
speed_ = 0.0F;
|
||||
break;
|
||||
case TiledBGMode::DIAGONAL:
|
||||
window_ = {0, 0, pos_.w, pos_.h};
|
||||
window_ = {.x = 0, .y = 0, .w = pos_.w, .h = pos_.h};
|
||||
break;
|
||||
case TiledBGMode::CIRCLE:
|
||||
window_ = {128, 128, pos_.w, pos_.h};
|
||||
window_ = {.x = 128, .y = 128, .w = pos_.w, .h = pos_.h};
|
||||
break;
|
||||
default:
|
||||
window_ = {0, 0, pos_.w, pos_.h};
|
||||
window_ = {.x = 0, .y = 0, .w = pos_.w, .h = pos_.h};
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -116,9 +117,7 @@ void TiledBG::updateStop() {
|
||||
speed_ /= 1.05F; // Reduce gradualmente la velocidad
|
||||
|
||||
// Asegura que no baje demasiado
|
||||
if (speed_ < 0.1F) {
|
||||
speed_ = 0.1F;
|
||||
}
|
||||
speed_ = std::max(speed_, 0.1F);
|
||||
}
|
||||
|
||||
// Si estamos en 0, detener
|
||||
|
||||
Reference in New Issue
Block a user