Commit 004694a7 authored by Janis Born's avatar Janis Born

change signature for custom texture loading functions

Warning: might break some existing code
parent 6d9ff644
......@@ -29,7 +29,7 @@ namespace OpenGL{
///////////////////////////////////////////////////////////////////////////////////////////////////
//! functionpointer which can be used for generic Texture loading
typedef SharedTextureData (*TextureLoadFuncPtr)(const std::string&);
typedef SharedTextureData (*TextureLoadFuncPtr)(const std::string&, ColorSpace);
//! registers a functionpointer to be used for loading specified file types (E.G. provide a load function which loads compressed)
void registerTextureLoadFunction(std::vector<std::string> _endings, TextureLoadFuncPtr _function);
......
......@@ -93,22 +93,22 @@ SharedTextureData loadTextureData(const std::string &_filename, ColorSpace _colo
SharedTextureData textureData;
if(textureLoadFunctions.find(fileEnding) != textureLoadFunctions.end()) {
textureData = textureLoadFunctions[fileEnding](_filename);
textureData = textureLoadFunctions[fileEnding](_filename, _colorSpace);
} else if (fileEnding == "png") {
textureData = loadTextureDataFromLodepng( _filename );
textureData = loadTextureDataFromLodepng( _filename, _colorSpace );
} else if (fileEnding == "hdr") {
textureData = loadTextureDataFromRGBE( _filename );
textureData = loadTextureDataFromRGBE( _filename, _colorSpace );
} else if (fileEnding == "exr") {
textureData = loadTextureDataFromEXR( _filename );
textureData = loadTextureDataFromEXR( _filename, _colorSpace );
} else if (fileEnding == "ppm") {
textureData = loadTextureDataFromPNM( _filename );
textureData = loadTextureDataFromPNM( _filename, _colorSpace );
}
#ifdef ACGL_COMPILE_WITH_QT
else if ( fileEnding == "bmp" || fileEnding == "jpg" || fileEnding == "jpeg"
|| fileEnding == "png" || fileEnding == "pbm" || fileEnding == "ppm"
|| fileEnding == "tif" || fileEnding == "tiff"|| fileEnding == "xbm"
|| fileEnding == "xpm" || fileEnding == "pgm") {
textureData = loadTextureDataFromQT( _filename );
textureData = loadTextureDataFromQT( _filename, _colorSpace );
}
#endif
else {
......
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