X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexture2d.cpp;h=806e4a179bded9f8a71264ecce78bccafc529870;hp=44ee6406420e85f261c988f5e8b14f678c90cfe3;hb=aea9ceca71b59358248be94fdf272fd4791ca990;hpb=03d3984ecd2c4e7c38b6a62b4b7a81bab69f8d40 diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 44ee6406..806e4a17 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -141,7 +141,7 @@ void Texture2D::image(const Graphics::Image &img, bool srgb, bool from_buffer) PixelFormat fmt = pixelformat_from_graphics(img.get_format()); if(width==0) { - unsigned l = (is_mipmapped(min_filter) ? 0 : 1); + unsigned l = (is_mipmapped(min_filter) ? mipmap_levels ? mipmap_levels : 0 : 1); storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, h, l); } else if(w!=width || h!=height) @@ -218,8 +218,6 @@ void Texture2D::Loader::raw_data(const string &data) void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h) { - if(srgb) - fmt = get_srgb_pixelformat(fmt); obj.storage(fmt, w, h); }