65 lines
1.7 KiB
C++
65 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include "asset.h"
|
|
#include "const.h"
|
|
#include "jail_audio.h"
|
|
#include "screen.h"
|
|
#include "sprite.h"
|
|
#include "text.h"
|
|
#include "utils.h"
|
|
|
|
#ifndef INSTRUCTIONS_H
|
|
#define INSTRUCTIONS_H
|
|
|
|
// Contadores
|
|
#define INSTRUCTIONS_COUNTER 600
|
|
|
|
// Modo para las instrucciones
|
|
#define INSTRUCTIONS_MODE_MANUAL 0
|
|
#define INSTRUCTIONS_MODE_AUTO 1
|
|
|
|
// Clase Instructions
|
|
class Instructions
|
|
{
|
|
private:
|
|
SDL_Renderer *mRenderer; // El renderizador de la ventana
|
|
Screen *mScreen; // Objeto encargado de dibujar en pantalla
|
|
LTexture *mItemTexture; // Textura con los graficos
|
|
SDL_Event *mEventHandler; // Manejador de eventos
|
|
SDL_Texture *mBackbuffer; // Textura para usar como backbuffer
|
|
Sprite *mSprite; // Sprite con la textura de las instrucciones
|
|
Asset *mAsset; // Objeto que gestiona todos los ficheros de recursos
|
|
Lang *mLang; // Objeto para gestionar los textos en diferentes idiomas
|
|
Text *mText; // Objeto para escribir texto
|
|
Uint16 mCounter; // Contador
|
|
section_t mSection; // Estado del bucle principal para saber si continua o se sale
|
|
Uint32 mTicks; // Contador de ticks para ajustar la velocidad del programa
|
|
Uint8 mTicksSpeed; // Velocidad a la que se repiten los bucles del programa
|
|
bool mManualQuit; // Indica si se quiere salir del modo manual
|
|
|
|
// Carga los recursos
|
|
bool loadMedia();
|
|
|
|
// Actualiza las variables
|
|
void update();
|
|
|
|
// Pinta en pantalla
|
|
void render();
|
|
|
|
// Inicializa las variables
|
|
void init();
|
|
|
|
public:
|
|
// Constructor
|
|
Instructions(SDL_Renderer *renderer, Screen *screen, Asset *mAsset, Lang *lang);
|
|
|
|
// Destructor
|
|
~Instructions();
|
|
|
|
// Bucle principal
|
|
void run(Uint8 mode);
|
|
};
|
|
|
|
#endif
|