Commit 82a2ef82 authored by Janis Born's avatar Janis Born
Browse files

support paletted PNG files when loading with lodePNG

parent 181fc1ce
......@@ -174,6 +174,7 @@ SharedTextureData loadTextureDataFromLodepng(const std::string &_filename)
if(colorType == LCT_GREY_ALPHA) { channels = 2; glFormat = GL_RG; }
if(colorType == LCT_RGB) { channels = 3; glFormat = GL_RGB; }
if(colorType == LCT_RGBA) { channels = 4; glFormat = GL_RGBA; }
if(colorType == LCT_PALETTE) { channels = 4; glFormat = GL_RGBA; colorType = LCT_RGBA; } // force LodePNG to convert paletted data to RGBA
GLenum glType = 0;
if(bitdepth == 8) glType = GL_UNSIGNED_BYTE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment