X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftexturecube.cpp;h=9ea33eabc1658213c63082a6e09dd5037d3380af;hb=635e5dc;hp=824ff2cc14d29743bf3e8adadd4709936a5f712d;hpb=d0a888978ab0c2226ed5961c736c7cac551e79b1;p=libs%2Fgl.git diff --git a/source/texturecube.cpp b/source/texturecube.cpp index 824ff2cc..9ea33eab 100644 --- a/source/texturecube.cpp +++ b/source/texturecube.cpp @@ -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 = 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)