migrat Input a la ultima versió

cohesionats tots els metodes update de les escenes
This commit is contained in:
2025-11-01 22:28:51 +01:00
parent 1dd750ba0c
commit 824e7417ad
58 changed files with 26926 additions and 978 deletions

View File

@@ -33,16 +33,16 @@ class Credits {
};
// --- Constantes de tiempo (basado en 60 FPS) ---
static constexpr float REVEAL_PHASE_1_DURATION = 3.733F; // 224 frames @ 60fps
static constexpr float PAUSE_DURATION = 1.667F; // 100 frames @ 60fps
static constexpr float REVEAL_PHASE_2_DURATION = 5.333F; // 320 frames (544-224) @ 60fps
static constexpr float REVEAL_PHASE_3_DURATION = 2.133F; // 128 frames (672-544) @ 60fps
static constexpr float DISPLAY_WITH_SHINE_DURATION = 7.967F; // 478 frames (1150-672) @ 60fps
static constexpr float FADE_OUT_DURATION = 0.833F; // 50 frames (1200-1150) @ 60fps
static constexpr float TOTAL_DURATION = 20.0F; // 1200 frames @ 60fps
static constexpr float SHINE_START_TIME = 12.833F; // 770 frames @ 60fps
static constexpr float FADE_OUT_START = 19.167F; // 1150 frames @ 60fps
static constexpr float REVEAL_SPEED = 60.0F; // counter equivalente por segundo @ 60fps
static constexpr float REVEAL_PHASE_1_DURATION = 3.733F; // 224 frames @ 60fps
static constexpr float PAUSE_DURATION = 1.667F; // 100 frames @ 60fps
static constexpr float REVEAL_PHASE_2_DURATION = 5.333F; // 320 frames (544-224) @ 60fps
static constexpr float REVEAL_PHASE_3_DURATION = 2.133F; // 128 frames (672-544) @ 60fps
static constexpr float DISPLAY_WITH_SHINE_DURATION = 7.967F; // 478 frames (1150-672) @ 60fps
static constexpr float FADE_OUT_DURATION = 0.833F; // 50 frames (1200-1150) @ 60fps
static constexpr float TOTAL_DURATION = 20.0F; // 1200 frames @ 60fps
static constexpr float SHINE_START_TIME = 12.833F; // 770 frames @ 60fps
static constexpr float FADE_OUT_START = 19.167F; // 1150 frames @ 60fps
static constexpr float REVEAL_SPEED = 60.0F; // counter equivalente por segundo @ 60fps
struct Captions {
std::string label; // Texto a escribir
Uint8 color; // Color del texto
@@ -59,16 +59,15 @@ class Credits {
float state_time_ = 0.0F; // Tiempo acumulado en el estado actual
float total_time_ = 0.0F; // Tiempo total acumulado
float reveal_time_ = 0.0F; // Tiempo acumulado solo durante revelación (se congela en pausas)
float current_delta_ = 0.0F; // Delta time del frame actual
std::vector<Captions> texts_; // Vector con los textos
// --- Funciones ---
void update(); // Actualiza las variables
void render(); // Dibuja en pantalla
static void checkEvents(); // Comprueba el manejador de eventos
static void checkInput(); // Comprueba las entradas
void updateState(float delta_time); // Actualiza la máquina de estados
void transitionToState(State new_state); // Transición entre estados
void iniTexts(); // Inicializa los textos
void fillTexture(); // Escribe el texto en la textura
void update(); // Actualiza las variables
void render(); // Dibuja en pantalla
static void handleEvents(); // Comprueba el manejador de eventos
static void handleInput(); // Comprueba las entradas
void updateState(float delta_time); // Actualiza la máquina de estados
void transitionToState(State new_state); // Transición entre estados
void iniTexts(); // Inicializa los textos
void fillTexture(); // Escribe el texto en la textura
};