X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftexture2d.cpp;h=d435a356a9ef3f215c6f11d912e1c76fade17959;hb=e079d5a878e83dc0baffcec66a57659c885cd593;hp=64ad124f97a1952f19307d429c8f9acd427d76c1;hpb=1ef3f6df6d85627190e311b4b09f56a4983ec797;p=libs%2Fgl.git diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 64ad124f..d435a356 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -118,12 +118,7 @@ void Texture2D::image(const Graphics::Image &img, bool srgb, bool from_buffer) unsigned h = img.get_height(); PixelFormat fmt = pixelformat_from_graphics(img.get_format()); if(width==0) - { - PixelFormat f = storage_pixelformat_from_graphics(img.get_format()); - if(srgb) - f = get_srgb_pixelformat(f); - storage(f, w, h); - } + storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, h); else if(w!=width || h!=height) throw incompatible_data("Texture2D::image");