forked from jaildesigner-jailgames/jaildoctors_dilemma
95 lines
2.0 KiB
C++
95 lines
2.0 KiB
C++
#pragma once
|
|
#include <SDL2/SDL.h>
|
|
#include "sprite.h"
|
|
#include "movingsprite.h"
|
|
#include "text.h"
|
|
#include "menu.h"
|
|
#include "const.h"
|
|
#include "jail_audio.h"
|
|
#include "utils.h"
|
|
#include "input.h"
|
|
#include "game.h"
|
|
#include "asset.h"
|
|
|
|
#ifndef DIRECTOR_H
|
|
#define DIRECTOR_H
|
|
|
|
#define MAX_FILE_LIST 100
|
|
|
|
// Director
|
|
class Director
|
|
{
|
|
private:
|
|
SDL_Window *mWindow; // La ventana donde dibujamos
|
|
SDL_Renderer *mRenderer; // El renderizador de la ventana
|
|
|
|
Input *mInput; // Objeto Input para gestionar las entradas
|
|
Game *mGame; // Objeto para la sección del juego
|
|
Asset *mAsset; // Objeto que gestiona todos los ficheros de recursos
|
|
|
|
struct options_t *mOptions; // Variable con todas las opciones del programa
|
|
|
|
std::string mExecutablePath; // Path del ejecutable
|
|
section_t mSection; // Sección y subsección actual del programa;
|
|
|
|
// Inicia las variables necesarias para arrancar el programa
|
|
void init(Uint8 name);
|
|
|
|
// Inicializa jail_audio
|
|
void initJailAudio();
|
|
|
|
// Arranca SDL y crea la ventana
|
|
bool initSDL();
|
|
|
|
// Crea el indice de ficheros
|
|
void setFileList();
|
|
|
|
// Comprueba que todos los ficheros existen
|
|
bool checkFileList();
|
|
|
|
// Carga el fichero de configuración
|
|
bool loadConfigFile();
|
|
|
|
// Guarda el fichero de configuración
|
|
bool saveConfigFile();
|
|
|
|
// Establece el valor de la variable
|
|
void setExecutablePath(std::string path);
|
|
|
|
// 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();
|
|
|
|
// Comprueba los ficheros del vector de ficheros que coinciden con una ruta dada
|
|
bool checkFolder(std::string name, std::string path);
|
|
|
|
public:
|
|
// Constructor
|
|
Director(std::string path);
|
|
|
|
// Destructor
|
|
~Director();
|
|
|
|
// Bucle principal
|
|
void run();
|
|
};
|
|
|
|
#endif
|