From 5e6b953822d429453485888ee0702952ca5b01c2 Mon Sep 17 00:00:00 2001 From: trotFunky Date: Wed, 25 Sep 2019 01:05:29 +0200 Subject: [PATCH] Fixed loadable TGA color formats --- src/Texture.cpp | 2 +- src/Texture.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Texture.cpp b/src/Texture.cpp index e3ca94a..6a1a1a2 100644 --- a/src/Texture.cpp +++ b/src/Texture.cpp @@ -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(); diff --git a/src/Texture.h b/src/Texture.h index 15724f5..63f769d 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -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); };