Pos ja compila pero no es veu una puta merda ...
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
#include "text.h"
|
||||
#include <fstream> // for char_traits, basic_ostream, basic_ifstream, ope...
|
||||
#include <iostream> // for cout
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for color_t
|
||||
#include <fstream> // for char_traits, basic_ostream, basic_ifstream, ope...
|
||||
#include <iostream> // for cout
|
||||
#include "sprite.h" // for Sprite
|
||||
#include "texture.h" // for Texture
|
||||
#include "utils.h" // for color_t
|
||||
|
||||
// Llena una estructuta textFile_t desde un fichero
|
||||
textFile_t LoadTextFile(std::string file, bool verbose)
|
||||
textFile_t LoadTextFile(std::string file)
|
||||
{
|
||||
textFile_t tf;
|
||||
|
||||
@@ -51,21 +51,19 @@ textFile_t LoadTextFile(std::string file, bool verbose)
|
||||
line_read++;
|
||||
};
|
||||
|
||||
// Cierra el fichero
|
||||
if (verbose)
|
||||
{
|
||||
std::cout << "Text loaded: " << filename.c_str() << std::endl;
|
||||
}
|
||||
// Cierra el fichero
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Text loaded: " << filename.c_str() << std::endl;
|
||||
#endif
|
||||
rfile.close();
|
||||
}
|
||||
|
||||
// El fichero no se puede abrir
|
||||
else
|
||||
{
|
||||
if (verbose)
|
||||
{
|
||||
std::cout << "Warning: Unable to open " << filename.c_str() << " file" << std::endl;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Warning: Unable to open " << filename.c_str() << " file" << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Establece las coordenadas para cada caracter ascii de la cadena y su ancho
|
||||
@@ -103,7 +101,7 @@ Text::Text(std::string bitmapFile, std::string textFile, SDL_Renderer *renderer)
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Text::Text(std::string textFile, Texture *texture)
|
||||
Text::Text(std::string textFile, std::shared_ptr<Texture> texture)
|
||||
{
|
||||
// Carga los offsets desde el fichero
|
||||
textFile_t tf = LoadTextFile(textFile);
|
||||
@@ -126,7 +124,7 @@ Text::Text(std::string textFile, Texture *texture)
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Text::Text(textFile_t *textFile, Texture *texture)
|
||||
Text::Text(textFile_t *textFile, std::shared_ptr<Texture> texture)
|
||||
{
|
||||
// Inicializa variables desde la estructura
|
||||
boxHeight = textFile->boxHeight;
|
||||
|
||||
@@ -26,7 +26,7 @@ struct textFile_t
|
||||
};
|
||||
|
||||
// Llena una estructuta textFile_t desde un fichero
|
||||
textFile_t LoadTextFile(std::string file, bool verbose = false);
|
||||
textFile_t LoadTextFile(std::string file);
|
||||
|
||||
// Clase texto. Pinta texto en pantalla a partir de un bitmap
|
||||
class Text
|
||||
@@ -45,8 +45,8 @@ private:
|
||||
public:
|
||||
// Constructor
|
||||
Text(std::string bitmapFile, std::string textFile, SDL_Renderer *renderer);
|
||||
Text(std::string textFile, Texture *texture);
|
||||
Text(textFile_t *textFile, Texture *texture);
|
||||
Text(std::string textFile, std::shared_ptr<Texture> texture);
|
||||
Text(textFile_t *textFile, std::shared_ptr<Texture> texture);
|
||||
|
||||
// Destructor
|
||||
~Text() = default;
|
||||
|
||||
Reference in New Issue
Block a user