]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texturecube.cpp
Add an srgb flag to pixelformat_from_image
[libs/gl.git] / source / core / texturecube.cpp
index 2a15eb1bec3359a3f665e4d48c4f62392644b41f..3f8eabb3ed8a31b86d2ad236d34cf1095ce285f4 100644 (file)
@@ -126,9 +126,7 @@ void TextureCube::image(TextureCubeFace face, const Graphics::Image &img)
        if(w!=h)
                throw incompatible_data("TextureCube::image");
 
-       PixelFormat fmt = pixelformat_from_image(img);
-       storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w);
-
+       storage(pixelformat_from_image(img, use_srgb_format), w);
        image(face, 0, img.get_pixels());
 }
 
@@ -141,9 +139,8 @@ void TextureCube::image(const Graphics::Image &img, unsigned lv)
                throw incompatible_data("TextureCube::image");
        h /= 6;
 
-       PixelFormat fmt = pixelformat_from_image(img);
        if(size==0)
-               storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w, lv);
+               storage(pixelformat_from_image(img, use_srgb_format), w, lv);
        else if(w!=size || h!=size)
                throw incompatible_data("TextureCube::image");