reestructuració
This commit is contained in:
62
source/game/scenes/logo.h
Normal file
62
source/game/scenes/logo.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
class Asset;
|
||||
class Input;
|
||||
class Screen;
|
||||
class Sprite;
|
||||
class Texture;
|
||||
struct section_t;
|
||||
|
||||
// Clase Logo
|
||||
class Logo {
|
||||
private:
|
||||
// Objetos y punteros
|
||||
SDL_Renderer *renderer; // El renderizador de la ventana
|
||||
Screen *screen; // Objeto encargado de dibujar en pantalla
|
||||
Asset *asset; // Objeto que gestiona todos los ficheros de recursos
|
||||
Input *input; // Objeto pata gestionar la entrada
|
||||
Texture *texture; // Textura con los graficos
|
||||
SDL_Event *eventHandler; // Manejador de eventos
|
||||
Sprite *sprite; // Sprite con la textura del logo
|
||||
section_t *section; // Estado del bucle principal para saber si continua o se sale
|
||||
|
||||
// Variables
|
||||
Uint32 ticks; // Contador de ticks para ajustar la velocidad del programa
|
||||
Uint32 ticksSpeed; // Velocidad a la que se repiten los bucles del programa
|
||||
int counter; // Contador
|
||||
|
||||
// Actualiza las variables del objeto
|
||||
void update();
|
||||
|
||||
// Dibuja el objeto en pantalla
|
||||
void render();
|
||||
|
||||
// Comprueba si ha terminado el logo
|
||||
void checkLogoEnd();
|
||||
|
||||
// Comprueba los eventos
|
||||
void checkEvents();
|
||||
|
||||
// Comprueba las entradas
|
||||
void checkInput();
|
||||
|
||||
// Dibuja el fade
|
||||
void renderFade();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Logo(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input, section_t *section);
|
||||
|
||||
// Destructor
|
||||
~Logo();
|
||||
|
||||
// Bucle principal
|
||||
void run();
|
||||
|
||||
// Ejecuta un frame
|
||||
void iterate();
|
||||
|
||||
// Procesa un evento
|
||||
void handleEvent(SDL_Event *event);
|
||||
};
|
||||
Reference in New Issue
Block a user