linter
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_Event, Uint64
|
||||
#include <SDL3/SDL.h> // Para SDL_Keycode, SDL_Event, Uint64
|
||||
|
||||
#include <cstdint> // Para uint8_t
|
||||
#include <memory> // Para shared_ptr, unique_ptr
|
||||
#include <string_view> // Para string_view
|
||||
#include <vector> // Para vector
|
||||
|
||||
#include "player.hpp" // Para Player
|
||||
#include "section.hpp" // Para Options, Name (ptr only)
|
||||
#include "color.hpp" // for Color
|
||||
#include "player.hpp" // for Player
|
||||
#include "section.hpp" // for Options, Name (ptr only)
|
||||
|
||||
class Fade;
|
||||
class GameLogo;
|
||||
@@ -46,15 +48,15 @@ class Title {
|
||||
|
||||
private:
|
||||
// --- Constantes de tiempo (en segundos) ---
|
||||
static constexpr float START_PRESSED_DELAY_S = 1666.67f / 1000.0f; // Tiempo antes de fade tras pulsar start (100 frames a 60fps)
|
||||
static constexpr float START_PRESSED_DELAY_S = 1666.67F / 1000.0F; // Tiempo antes de fade tras pulsar start (100 frames a 60fps)
|
||||
static constexpr int MUSIC_FADE_OUT_LONG_MS = 1500; // Fade out largo de música
|
||||
static constexpr int MUSIC_FADE_OUT_SHORT_MS = 300; // Fade out corto de música
|
||||
|
||||
// --- Constantes de parpadeo (en segundos) ---
|
||||
static constexpr float LOGO_BLINK_PERIOD_S = 833.0f / 1000.0f; // Período de parpadeo del logo (833ms)
|
||||
static constexpr float LOGO_BLINK_ON_TIME_S = 583.0f / 1000.0f; // Tiempo encendido del logo (583ms)
|
||||
static constexpr float START_BLINK_PERIOD_S = 167.0f / 1000.0f; // Período de parpadeo del start (167ms)
|
||||
static constexpr float START_BLINK_ON_TIME_S = 83.0f / 1000.0f; // Tiempo encendido del start (83ms)
|
||||
static constexpr float LOGO_BLINK_PERIOD_S = 833.0F / 1000.0F; // Período de parpadeo del logo (833ms)
|
||||
static constexpr float LOGO_BLINK_ON_TIME_S = 583.0F / 1000.0F; // Tiempo encendido del logo (583ms)
|
||||
static constexpr float START_BLINK_PERIOD_S = 167.0F / 1000.0F; // Período de parpadeo del start (167ms)
|
||||
static constexpr float START_BLINK_ON_TIME_S = 83.0F / 1000.0F; // Tiempo encendido del start (83ms)
|
||||
|
||||
// --- Constantes de layout ---
|
||||
static constexpr int MINI_LOGO_Y_DIVISOR = 5; // Divisor para posición Y del mini logo
|
||||
@@ -92,8 +94,8 @@ class Title {
|
||||
Section::Options selection_ = Section::Options::TITLE_TIME_OUT; // Opción elegida en el título
|
||||
State state_; // Estado actual de la sección
|
||||
Uint64 last_time_ = 0; // Último timestamp para calcular delta-time
|
||||
float counter_time_ = 0.0f; // Temporizador para la pantalla de título (en segundos)
|
||||
float blink_accumulator_ = 0.0f; // Acumulador para el parpadeo (en segundos)
|
||||
float counter_time_ = 0.0F; // Temporizador para la pantalla de título (en segundos)
|
||||
float blink_accumulator_ = 0.0F; // Acumulador para el parpadeo (en segundos)
|
||||
int num_controllers_; // Número de mandos conectados
|
||||
bool should_render_start_prompt_ = false; // Indica si se muestra el texto de PRESS START BUTTON TO PLAY
|
||||
bool player1_start_pressed_ = false; // Indica si se ha pulsado el botón de empezar para el jugador 1
|
||||
@@ -104,11 +106,11 @@ class Title {
|
||||
#endif
|
||||
|
||||
// --- Ciclo de vida del título ---
|
||||
void update(float deltaTime); // Actualiza las variables del objeto
|
||||
float calculateDeltaTime(); // Calcula el tiempo transcurrido desde el último frame
|
||||
void updateState(float deltaTime); // Actualiza el estado actual del título
|
||||
void setState(State state); // Cambia el estado del título
|
||||
void resetCounter(); // Reinicia el contador interno
|
||||
void update(float delta_time); // Actualiza las variables del objeto
|
||||
auto calculateDeltaTime() -> float; // Calcula el tiempo transcurrido desde el último frame
|
||||
void updateState(float delta_time); // Actualiza el estado actual del título
|
||||
void setState(State state); // Cambia el estado del título
|
||||
void resetCounter(); // Reinicia el contador interno
|
||||
|
||||
// --- Entrada de usuario ---
|
||||
void checkEvents(); // Comprueba los eventos
|
||||
@@ -125,16 +127,16 @@ class Title {
|
||||
|
||||
// --- Gestión de jugadores ---
|
||||
void initPlayers(); // Inicializa los jugadores
|
||||
void updatePlayers(float deltaTime); // Actualiza los jugadores
|
||||
void updatePlayers(float delta_time); // Actualiza los jugadores
|
||||
void renderPlayers(); // Renderiza los jugadores
|
||||
auto getPlayer(Player::Id id) -> std::shared_ptr<Player>; // Obtiene un jugador a partir de su "id"
|
||||
|
||||
// --- Visualización / Renderizado ---
|
||||
void render(); // Dibuja el objeto en pantalla
|
||||
void updateFade(); // Actualiza el efecto de fundido (fade in/out)
|
||||
void updateStartPrompt(float deltaTime); // Actualiza el mensaje de "Pulsa Start"
|
||||
void renderStartPrompt(); // Dibuja el mensaje de "Pulsa Start" en pantalla
|
||||
void renderCopyright(); // Dibuja el aviso de copyright
|
||||
void render(); // Dibuja el objeto en pantalla
|
||||
void updateFade(); // Actualiza el efecto de fundido (fade in/out)
|
||||
void updateStartPrompt(float delta_time); // Actualiza el mensaje de "Pulsa Start"
|
||||
void renderStartPrompt(); // Dibuja el mensaje de "Pulsa Start" en pantalla
|
||||
void renderCopyright(); // Dibuja el aviso de copyright
|
||||
|
||||
// --- Utilidades estáticas ---
|
||||
static void swapControllers(); // Intercambia la asignación de mandos a los jugadores
|
||||
|
||||
Reference in New Issue
Block a user