X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture2d.cpp;h=703b719a211f6390c78f35aacfe9f12a9c07701b;hb=8b3e51aeff0e22d29a34772c77b8647108f58677;hp=31d7016574b17ecdf3200d587f781d940914d21e;hpb=729a477b47e97aea41f3f0b5db551f02bf70d1ee;p=libs%2Fgl.git diff --git a/source/core/texture2d.cpp b/source/core/texture2d.cpp index 31d70165..703b719a 100644 --- a/source/core/texture2d.cpp +++ b/source/core/texture2d.cpp @@ -120,11 +120,7 @@ void Texture2D::image(const Graphics::Image &img, unsigned lv) void Texture2D::image(const Graphics::Image &img, unsigned lv, bool from_buffer) { - unsigned w = img.get_width(); - unsigned h = img.get_height(); - PixelFormat fmt = pixelformat_from_image(img); - storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w, h, lv); - + storage(pixelformat_from_image(img, use_srgb_format), img.get_width(), img.get_height(), lv); image(0, from_buffer ? 0 : img.get_pixels()); }