clang-tidy readability
This commit is contained in:
@@ -27,7 +27,7 @@ TiledBG::TiledBG(SDL_FRect pos, TiledBGMode mode)
|
||||
switch (mode_) {
|
||||
case TiledBGMode::STATIC:
|
||||
window_ = {0, 0, pos_.w, pos_.h};
|
||||
speed_ = 0.0f;
|
||||
speed_ = 0.0F;
|
||||
break;
|
||||
case TiledBGMode::DIAGONAL:
|
||||
window_ = {0, 0, pos_.w, pos_.h};
|
||||
@@ -57,7 +57,7 @@ void TiledBG::fillTexture() {
|
||||
auto tile = std::make_unique<Sprite>(Resource::get()->getTexture("title_bg_tile.png"), (SDL_FRect){0, 0, TILE_WIDTH, TILE_HEIGHT});
|
||||
|
||||
// Prepara para dibujar sobre la textura
|
||||
auto temp = SDL_GetRenderTarget(renderer_);
|
||||
auto *temp = SDL_GetRenderTarget(renderer_);
|
||||
SDL_SetRenderTarget(renderer_, canvas_);
|
||||
|
||||
// Rellena la textura con el tile
|
||||
@@ -114,17 +114,17 @@ void TiledBG::updateStop() {
|
||||
|
||||
// Desacelerar si estamos cerca de completar el ciclo (ventana a punto de regresar a 0)
|
||||
if (window_.x >= TILE_WIDTH - UMBRAL) {
|
||||
speed_ /= 1.05f; // Reduce gradualmente la velocidad
|
||||
speed_ /= 1.05F; // Reduce gradualmente la velocidad
|
||||
|
||||
// Asegura que no baje demasiado
|
||||
if (speed_ < 0.1f) {
|
||||
speed_ = 0.1f;
|
||||
if (speed_ < 0.1F) {
|
||||
speed_ = 0.1F;
|
||||
}
|
||||
}
|
||||
|
||||
// Si estamos en 0, detener
|
||||
if (window_.x == 0) {
|
||||
speed_ = 0.0f;
|
||||
speed_ = 0.0F;
|
||||
stopping_ = false; // Desactivamos el estado de "stopping"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user