Pasaeta de cppcheck, ale

This commit is contained in:
2024-10-22 09:24:19 +02:00
parent 1d0c2e01a5
commit 5df85e1b1a
28 changed files with 164 additions and 194 deletions

View File

@@ -69,13 +69,12 @@ bool Texture::loadFromFile(const std::string &file_path)
unsigned char *data = stbi_load(file_path.c_str(), &width, &height, &orig_format, req_format);
if (!data)
{
std::cerr << "Error: Fichero no encontrado " << file_path << std::endl;
throw std::runtime_error("Fichero no encontrado: " + file_path);
std::cerr << "Error: Fichero no encontrado " << getFileName(file_path) << std::endl;
throw std::runtime_error("Fichero no encontrado: " + getFileName(file_path));
}
else
{
const std::string file_name = file_path.substr(file_path.find_last_of("\\/") + 1);
printWithDots("Image : ", file_name, "[ LOADED ]");
printWithDots("Image : ", getFileName(file_path), "[ LOADED ]");
}
int depth, pitch;
@@ -320,13 +319,12 @@ std::vector<Uint32> Texture::loadPaletteFromFile(const std::string &file_path)
FILE *f = fopen(file_path.c_str(), "rb");
if (!f)
{
std::cerr << "Error: Fichero no encontrado " << file_path << std::endl;
throw std::runtime_error("Fichero no encontrado: " + file_path);
std::cerr << "Error: Fichero no encontrado " << getFileName(file_path) << std::endl;
throw std::runtime_error("Fichero no encontrado: " + getFileName(file_path));
}
else
{
const std::string file_name = file_path.substr(file_path.find_last_of("\\/") + 1);
printWithDots("Image : ", file_name, "[ LOADED ]");
printWithDots("Image : ", getFileName(file_path), "[ LOADED ]");
}
fseek(f, 0, SEEK_END);