forked from jaildesigner-jailgames/jaildoctors_dilemma
Transició a surface: vaig per title.cpp
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory> // for shared_ptr
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
#include "animated_sprite.h" // for AnimationsFileBuffer
|
||||
#include "room.h" // for room_t
|
||||
#include "text.h" // for Text, TextFile
|
||||
#include "texture.h" // for Texture
|
||||
struct JA_Music_t; // lines 11-11
|
||||
struct JA_Sound_t; // lines 12-12
|
||||
#include <memory> // for shared_ptr
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
#include "s_animated_sprite.h" // for AnimationsFileBuffer
|
||||
#include "room.h" // for room_t
|
||||
#include "text.h" // for Text, TextFile
|
||||
#include "surface.h" // for Surface
|
||||
struct JA_Music_t; // lines 11-11
|
||||
struct JA_Sound_t; // lines 12-12
|
||||
|
||||
// Estructura para almacenar ficheros de sonido y su nombre
|
||||
struct ResourceSound
|
||||
@@ -32,15 +32,15 @@ struct ResourceMusic
|
||||
: name(name), music(music) {}
|
||||
};
|
||||
|
||||
// Estructura para almacenar objetos Texture y su nombre
|
||||
struct ResourceTexture
|
||||
// Estructura para almacenar objetos Surface y su nombre
|
||||
struct ResourceSurface
|
||||
{
|
||||
std::string name; // Nombre de la textura
|
||||
std::shared_ptr<Texture> texture; // Objeto con la textura
|
||||
std::string name; // Nombre de la surface
|
||||
std::shared_ptr<Surface> surface; // Objeto con la surface
|
||||
|
||||
// Constructor
|
||||
ResourceTexture(const std::string &name, std::shared_ptr<Texture> texture)
|
||||
: name(name), texture(texture) {}
|
||||
ResourceSurface(const std::string &name, std::shared_ptr<Surface> surface)
|
||||
: name(name), surface(surface) {}
|
||||
};
|
||||
|
||||
// Estructura para almacenar ficheros TextFile y su nombre
|
||||
@@ -101,14 +101,6 @@ struct ResourceRoom
|
||||
// Estructura para llevar la cuenta de los recursos cargados
|
||||
struct ResourceCount
|
||||
{
|
||||
// int sounds; // Número de sonidos cargados
|
||||
// int musics; // Número de musicas cargadas
|
||||
// int textures; // Número de texturas cargadas
|
||||
// int text_files; // Número de ficheros de texto cargados
|
||||
// int texts; // Número de objetos de texto cargados
|
||||
// int animations; // Número de animaciones cargadas
|
||||
// int tile_maps; // Número de mapas de tiles cargados
|
||||
// int rooms; // Número de habitaciones cargadas
|
||||
int total; // Número total de recursos
|
||||
int loaded; // Número de recursos cargados
|
||||
|
||||
@@ -141,7 +133,7 @@ private:
|
||||
|
||||
std::vector<ResourceSound> sounds_; // Vector con los sonidos
|
||||
std::vector<ResourceMusic> musics_; // Vector con las musicas
|
||||
std::vector<ResourceTexture> textures_; // Vector con las musicas
|
||||
std::vector<ResourceSurface> surfaces_; // Vector con las surfaces
|
||||
std::vector<ResourceTextFile> text_files_; // Vector con los ficheros de texto
|
||||
std::vector<ResourceText> texts_; // Vector con los objetos de texto
|
||||
std::vector<ResourceAnimation> animations_; // Vector con las animaciones
|
||||
@@ -156,8 +148,8 @@ private:
|
||||
// Carga las musicas
|
||||
void loadMusics();
|
||||
|
||||
// Carga las texturas
|
||||
void loadTextures();
|
||||
// Carga las surfaces
|
||||
void loadSurfaces();
|
||||
|
||||
// Carga los ficheros de texto
|
||||
void loadTextFiles();
|
||||
@@ -222,8 +214,8 @@ public:
|
||||
// Obtiene la música a partir de un nombre
|
||||
JA_Music_t *getMusic(const std::string &name);
|
||||
|
||||
// Obtiene la textura a partir de un nombre
|
||||
std::shared_ptr<Texture> getTexture(const std::string &name);
|
||||
// Obtiene la surface a partir de un nombre
|
||||
std::shared_ptr<Surface> getSurface(const std::string &name);
|
||||
|
||||
// Obtiene el fichero de texto a partir de un nombre
|
||||
std::shared_ptr<TextFile> getTextFile(const std::string &name);
|
||||
|
||||
Reference in New Issue
Block a user