80 lines
1.8 KiB
C++
80 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include <string>
|
|
#include "asset.h"
|
|
#include "jail_audio.h"
|
|
#include "game.h"
|
|
#include "input.h"
|
|
#include "utils.h"
|
|
#include "screen.h"
|
|
#include "logo.h"
|
|
#include "intro.h"
|
|
#include "title.h"
|
|
#include "prog.h"
|
|
|
|
#ifndef PROG_H
|
|
#define PROG_H
|
|
|
|
#define WINDOW_CAPTION "Volcano"
|
|
#define GAME_WIDTH 320
|
|
#define GAME_HEIGHT 240
|
|
|
|
class Prog
|
|
{
|
|
private:
|
|
SDL_Window *window; // La ventana donde dibujamos
|
|
SDL_Renderer *renderer; // El renderizador de la ventana
|
|
Asset *asset; // Objeto encargado de gestionar los ficheros de recursos
|
|
Screen *screen; // Objeto encargado de dibujar en pantalla
|
|
Input *input; // Objeto Input para gestionar las entradas
|
|
Game *game; // Objeto para la sección del juego
|
|
Intro *intro; // Objeto encargado de gestionar la intro del juego
|
|
Logo *logo; // Objeto encargado de gestionar el logo del juego
|
|
Title *title; // Objeto encargado de gestionar el titulo del juego, con el menu principal
|
|
section_t section; // Sección y subsección actual del programa;
|
|
struct options_t *options; // Contiene las opciones del programa
|
|
|
|
// Inicializa jail_audio
|
|
void initJailAudio();
|
|
|
|
// Arranca SDL y crea la ventana
|
|
bool initSDL();
|
|
|
|
// Crea el indice de ficheros
|
|
bool setFileList();
|
|
|
|
// Obtiene el valor de la variable
|
|
Uint8 getSubsection();
|
|
|
|
// Obtiene el valor de la variable
|
|
Uint8 getSection();
|
|
|
|
// Establece el valor de la variable
|
|
void setSection(section_t section);
|
|
|
|
// Ejecuta la seccion de juego con el logo
|
|
void runLogo();
|
|
|
|
// Ejecuta la seccion de juego de la introducción
|
|
void runIntro();
|
|
|
|
// Ejecuta la seccion de juego con el titulo y los menus
|
|
void runTitle();
|
|
|
|
// Ejecuta la seccion de juego donde se juega
|
|
void runGame();
|
|
|
|
public:
|
|
// Constructor
|
|
Prog(std::string executablePath);
|
|
|
|
// Destructor
|
|
~Prog();
|
|
|
|
// Bucle principal
|
|
void run();
|
|
};
|
|
|
|
#endif
|