]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texturecube.cpp
Depracate the srgb parameter of Texture::image functions
[libs/gl.git] / source / texturecube.cpp
index 824ff2cc14d29743bf3e8adadd4709936a5f712d..9ea33eabc1658213c63082a6e09dd5037d3380af 100644 (file)
@@ -165,7 +165,7 @@ void TextureCube::sub_image(TextureCubeFace face, unsigned level, int x, int y,
        sub_image(face, level, x, y, wd, ht, data);
 }
 
-void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool srgb)
+void TextureCube::image(TextureCubeFace face, const Graphics::Image &img)
 {
        unsigned w = img.get_width();
        unsigned h = img.get_height();
@@ -175,7 +175,7 @@ void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool s
                if(w!=h)
                        throw incompatible_data("TextureCube::image");
 
-               storage(make_pixelformat(get_components(fmt), get_component_type(fmt), srgb), w);
+               storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w);
        }
        else if(w!=size || h!=size)
                throw incompatible_data("TextureCube::image");
@@ -186,7 +186,12 @@ void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool s
        image(face, 0, img.get_data());
 }
 
-void TextureCube::image(const Graphics::Image &img, unsigned lv, bool srgb)
+void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool)
+{
+       image(face, img);
+}
+
+void TextureCube::image(const Graphics::Image &img, unsigned lv)
 {
        unsigned w = img.get_width();
        unsigned h = img.get_height();
@@ -197,7 +202,7 @@ void TextureCube::image(const Graphics::Image &img, unsigned lv, bool srgb)
 
        PixelFormat fmt = pixelformat_from_image(img);
        if(size==0)
-               storage(make_pixelformat(get_components(fmt), get_component_type(fmt), srgb), w, lv);
+               storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w, lv);
        else if(w!=size || h!=size)
                throw incompatible_data("TextureCube::image");
 
@@ -301,7 +306,7 @@ void TextureCube::Loader::external_image(TextureCubeFace face, const string &fn)
        RefPtr<IO::Seekable> io = get_collection().open_raw(fn);
        img.load_io(*io);
 
-       obj.image(face, img, srgb);
+       obj.image(face, img);
 }
 
 void TextureCube::Loader::image_data(TextureCubeFace face, const string &data)
@@ -310,7 +315,7 @@ void TextureCube::Loader::image_data(TextureCubeFace face, const string &data)
        IO::Memory mem(data.data(), data.size());
        img.load_io(mem);
 
-       obj.image(face, img, srgb);
+       obj.image(face, img);
 }
 
 void TextureCube::Loader::raw_data(TextureCubeFace face, const string &data)