Fixed loadable TGA color formats

This commit is contained in:
trotFunky 2019-09-25 01:05:29 +02:00
parent e83cdba55b
commit 5e6b953822
2 changed files with 3 additions and 3 deletions

View file

@ -48,7 +48,7 @@ bool Texture::load_tga(const std::string& filename, uint8_t*& data_array)
file_stream.read((char*)&height,2);
file_stream >> color_bits;
if (color_bits != 24 && color_bits != 32)
if (color_bits != 24)
{
std::cerr << "Error loading file " << filename << ": Unsupported " << color_bits << " bits colors" << std::endl;
file_stream.close();

View file

@ -24,13 +24,13 @@ public:
Texture();
~Texture();
/// Load an RGBA image from an RGB TGA file
/// Load an RGB image from an RGB TGA file
bool load_rgb_tga(const std::string& rgb_filename);
/// Load an RGBA image from an rgb and an alpha tga file
bool load_rgba_tga(const std::string& rgb_filename,const std::string& mask_filename);
private:
/// Load TGA image file to an array
/// Load and RGB TGA image file to an array
bool load_tga(const std::string& filename, uint8_t*& data_array);
};