Menudo puto lio de renamar coses, a vore si tot va quedant al lloc que els structs i els enums estan revolant i duplicats per tots llocs

This commit is contained in:
2024-10-11 20:12:50 +02:00
parent a9ca23138d
commit 3a6950f3a4
28 changed files with 445 additions and 454 deletions

View File

@@ -56,7 +56,7 @@ Texture::~Texture()
// Carga una imagen desde un fichero
bool Texture::loadFromFile(std::string path)
{
const std::string filename = path.substr(path.find_last_of("\\/") + 1);
const std::string file_name = path.substr(path.find_last_of("\\/") + 1);
int req_format = STBI_rgb_alpha;
int width, height, orig_format;
unsigned char *data = stbi_load(path.c_str(), &width, &height, &orig_format, req_format);
@@ -70,7 +70,7 @@ bool Texture::loadFromFile(std::string path)
else
{
#ifdef VERBOSE
std::cout << "Image loaded: " << filename.c_str() << std::endl;
std::cout << "Image loaded: " << file_name.c_str() << std::endl;
#endif
}
@@ -265,9 +265,9 @@ void Texture::deleteSurface(Surface surface)
}
// Crea una surface desde un fichero .gif
Surface Texture::loadSurface(const char *filename)
Surface Texture::loadSurface(const char *file_name)
{
FILE *f = fopen(filename, "rb");
FILE *f = fopen(file_name, "rb");
if (!f)
{
return NULL;
@@ -303,7 +303,7 @@ Surface Texture::loadSurface(const char *filename)
void Texture::flipSurface()
{
// Limpia la textura
auto *temp = SDL_GetRenderTarget(renderer_);
auto temp = SDL_GetRenderTarget(renderer_);
SDL_SetRenderTarget(renderer_, texture_);
SDL_SetRenderDrawColor(renderer_, 0, 0, 0, 0);
SDL_RenderClear(renderer_);
@@ -327,11 +327,11 @@ void Texture::setPaletteColor(int palette, int index, Uint32 color)
}
// Carga una paleta desde un fichero
std::vector<Uint32> Texture::loadPal(const char *filename)
std::vector<Uint32> Texture::loadPal(const char *file_name)
{
std::vector<Uint32> palette;
FILE *f = fopen(filename, "rb");
FILE *f = fopen(file_name, "rb");
if (!f)
{
return palette;