This commit is contained in:
2025-11-03 09:52:54 +01:00
parent 1409ab5bff
commit 3f1c737247
32 changed files with 254 additions and 243 deletions

View File

@@ -277,7 +277,7 @@ void LoadingScreen::renderDataBorder() {
}
// Dibuja el efecto de carga rojo y azul en el borde
void LoadingScreen::renderHeaderBorder() {
void LoadingScreen::renderHeaderBorder() const {
// Obtiene la Surface del borde
auto border = Screen::get()->getBorderSurface();
@@ -441,10 +441,10 @@ void LoadingScreen::updateCarrier(float delta_time) {
constexpr float CARRIER_HEIGHT = HEADER_DATAROW_HEIGHT;
// Oscilación compuesta: mezcla de dos frecuencias para evitar patrón predecible
const float modulation = std::sin(carrier_.total_time * 1.2F) * std::sin(carrier_.total_time * 0.35F + 1.0F);
const float speed = CARRIER_BASE_SPEED * (0.5F + 0.5F * modulation); // rango [-200, 0]
const float MODULATION = std::sin(carrier_.total_time * 1.2F) * std::sin((carrier_.total_time * 0.35F) + 1.0F);
const float SPEED = CARRIER_BASE_SPEED * (0.5F + 0.5F * MODULATION); // rango [-200, 0]
carrier_.offset += speed * delta_time;
carrier_.offset += SPEED * delta_time;
if (carrier_.offset < 0.0F) {
carrier_.offset += CARRIER_HEIGHT; // reinicia al rango [0,HEADER_DATAROW_HEIGHT]
@@ -459,8 +459,8 @@ void LoadingScreen::updateSilent(float delta_time) {
constexpr float NOISE_THRESHOLD = 0.35F;
// Oscilación compuesta para simular picos de ruido
const float modulation = std::sin(noise_.total_time * 4.2F) * std::sin(noise_.total_time * 1.7F + 0.5F);
noise_.value = std::fabs(modulation); // rango [0.0, 1.0]
const float MODULATION = std::sin(noise_.total_time * 4.2F) * std::sin((noise_.total_time * 1.7F) + 0.5F);
noise_.value = std::fabs(MODULATION); // rango [0.0, 1.0]
// Detecta cruce de umbral solo si venía de abajo
if (noise_.value > NOISE_THRESHOLD && !noise_.crossed) {