102 lines
2.4 KiB
C++
102 lines
2.4 KiB
C++
#pragma once
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include "asset.h"
|
|
#include "balloon.h"
|
|
#include "bullet.h"
|
|
#include "coffeedrop.h"
|
|
#include "const.h"
|
|
#include "fade.h"
|
|
#include "game.h"
|
|
#include "input.h"
|
|
#include "intro.h"
|
|
#include "item.h"
|
|
#include "jail_audio.h"
|
|
#include "logo.h"
|
|
#include "menu.h"
|
|
#include "movingsprite.h"
|
|
#include "player.h"
|
|
#include "screen.h"
|
|
#include "smartsprite.h"
|
|
#include "sprite.h"
|
|
#include "text.h"
|
|
#include "title.h"
|
|
#include "utils.h"
|
|
#include "writer.h"
|
|
|
|
#ifndef DIRECTOR_H
|
|
#define DIRECTOR_H
|
|
|
|
// Textos
|
|
#define WINDOW_CAPTION "Coffee Crisis"
|
|
|
|
// Clase Director
|
|
class Director
|
|
{
|
|
private:
|
|
SDL_Window *mWindow; // La ventana donde dibujamos
|
|
SDL_Renderer *mRenderer; // El renderizador de la ventana
|
|
Screen *mScreen; // Objeto encargado de dibujar en pantalla
|
|
Logo *mLogo; // Objeto para la sección del logo
|
|
Intro *mIntro; // Objeto para la sección de la intro
|
|
Title *mTitle; // Objeto para la sección del titulo y el menu de opciones
|
|
Game *mGame; // Objeto para la sección del juego
|
|
Input *mInput; // Objeto Input para gestionar las entradas
|
|
Lang *mLang; // Objeto para gestionar los textos en diferentes idiomas
|
|
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;
|
|
|
|
// Inicializa jail_audio
|
|
void initJailAudio();
|
|
|
|
// Arranca SDL y crea la ventana
|
|
bool initSDL();
|
|
|
|
// Crea el indice de ficheros
|
|
bool setFileList();
|
|
|
|
// Carga el fichero de configuración
|
|
bool loadConfigFile();
|
|
|
|
// Guarda el fichero de configuración
|
|
bool saveConfigFile();
|
|
|
|
// 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
|
|
Director(std::string path);
|
|
|
|
// Destructor
|
|
~Director();
|
|
|
|
// Inicia las variables necesarias para arrancar el programa
|
|
void init(Uint8 name);
|
|
|
|
// Bucle principal
|
|
void run();
|
|
};
|
|
|
|
#endif
|