diff --git a/source/director.cpp b/source/director.cpp index 9b6cda3..a4a282c 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -44,7 +44,7 @@ Director::Director(int argc, std::span argv) { Section::name = Section::Name::GAME; Section::options = Section::Options::GAME_PLAY_1P; #elif _DEBUG - Section::name = Section::Name::INSTRUCTIONS; + Section::name = Section::Name::HI_SCORE_TABLE; Section::options = Section::Options::GAME_PLAY_1P; #else // NORMAL GAME Section::name = Section::Name::LOGO; diff --git a/source/sections/hiscore_table.cpp b/source/sections/hiscore_table.cpp index 6a387d2..d96d161 100644 --- a/source/sections/hiscore_table.cpp +++ b/source/sections/hiscore_table.cpp @@ -74,11 +74,11 @@ void HiScoreTable::render() { SCREEN->start(); // Prepara para empezar a dibujar en la textura de juego SCREEN->clean(); // Limpia la pantalla - background_->render(); // Pinta el fondo - float counter_equivalent = elapsed_time_ * 60.0F; // Convertir tiempo a equivalente frame para UI - view_area_.y = std::max(0.0F, param.game.height - counter_equivalent + 100); // Establece la ventana del backbuffer - SDL_RenderTexture(renderer_, backbuffer_, nullptr, &view_area_); // Copia el backbuffer al renderizador - fade_->render(); // Renderiza el fade + background_->render(); // Pinta el fondo + float scroll_offset = elapsed_time_ * SCROLL_SPEED_PPS; // Calcula el desplazamiento del scroll usando velocidad en pixels/segundo + view_area_.y = std::round(std::max(0.0F, (param.game.height + 100.0F) - scroll_offset)); // Establece la ventana del backbuffer (redondeado para evitar deformaciones) + SDL_RenderTexture(renderer_, backbuffer_, nullptr, &view_area_); // Copia el backbuffer al renderizador + fade_->render(); // Renderiza el fade SCREEN->render(); // Vuelca el contenido del renderizador en pantalla } diff --git a/source/sections/hiscore_table.hpp b/source/sections/hiscore_table.hpp index d9017f5..3cde6ca 100644 --- a/source/sections/hiscore_table.hpp +++ b/source/sections/hiscore_table.hpp @@ -38,6 +38,7 @@ class HiScoreTable { static constexpr float BACKGROUND_CHANGE_S = 150.0F / 60.0F; // Tiempo cambio fondo (≈2.5s) static constexpr float ANIM_DURATION_S = 80.0F / 60.0F; // Duración animación (≈1.33s) static constexpr float CLOUDS_SPEED = -6.0F; // Velocidad nubes (pixels/s) + static constexpr float SCROLL_SPEED_PPS = 60.0F; // Velocidad de scroll (60 pixels por segundo) // --- Objetos y punteros --- SDL_Renderer* renderer_; // El renderizador de la ventana diff --git a/source/sections/instructions.cpp b/source/sections/instructions.cpp index 61cd69d..3edf27e 100644 --- a/source/sections/instructions.cpp +++ b/source/sections/instructions.cpp @@ -343,8 +343,9 @@ void Instructions::renderLines(SDL_Renderer* renderer, SDL_Texture* texture, con void Instructions::updateBackbuffer(float delta_time) { // Establece la ventana del backbuffer usando velocidad en pixels por segundo // El scroll comienza desde (param.game.height + 100) y desciende a 0 + // IMPORTANTE: Se redondea a entero para evitar deformaciones de textura causadas por sub-pixel rendering float scroll_offset = elapsed_time_ * SCROLL_SPEED_PPS; - view_.y = std::max(0.0F, (param.game.height + 100.0F) - scroll_offset); + view_.y = std::round(std::max(0.0F, (param.game.height + 100.0F) - scroll_offset)); // Verifica si view_.y == 0 y gestiona el temporizador if (view_.y == 0.0F) {