Precarga de los ficheros .txt con los offsets del texto
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <SDL2/SDL.h>
|
||||
#include "animatedsprite.h"
|
||||
#include "asset.h"
|
||||
#include "text.h"
|
||||
#include "texture.h"
|
||||
#include "utils.h"
|
||||
#include <string>
|
||||
@@ -19,10 +20,17 @@ struct texture_t
|
||||
|
||||
struct animation_t
|
||||
{
|
||||
std::string name; // Nombre de la textura
|
||||
std::string name; // Nombre de la textura
|
||||
animatedSprite_t *animation; // La animación
|
||||
};
|
||||
|
||||
struct textOffset_t
|
||||
{
|
||||
std::string name; // Nombre del offeset
|
||||
textFile_t *textFile; // Los offsets de la fuente
|
||||
};
|
||||
|
||||
// Clase Resource. Almacena recursos de disco en memoria
|
||||
class Resource
|
||||
{
|
||||
private:
|
||||
@@ -34,6 +42,7 @@ private:
|
||||
// Variables
|
||||
std::vector<texture_t> textures;
|
||||
std::vector<animation_t> animations;
|
||||
std::vector<textOffset_t> offsets;
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
@@ -45,6 +54,9 @@ public:
|
||||
// Carga las animaciones desde una lista
|
||||
void loadAnimations(std::vector<std::string> list);
|
||||
|
||||
// Carga los offsets desde una lista
|
||||
void loadOffsets(std::vector<std::string> list);
|
||||
|
||||
// Recarga las texturas
|
||||
void reLoadTextures();
|
||||
|
||||
@@ -54,6 +66,9 @@ public:
|
||||
// Libera las animaciones
|
||||
void freeAnimations();
|
||||
|
||||
// Libera los offsets
|
||||
void freeOffsets();
|
||||
|
||||
// Libera todos los recursos
|
||||
void free();
|
||||
|
||||
@@ -62,6 +77,9 @@ public:
|
||||
|
||||
// Obtiene una animación
|
||||
animatedSprite_t *getAnimation(std::string name);
|
||||
|
||||
// Obtiene un offset
|
||||
textFile_t *getOffset(std::string name);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user