X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexturecube.cpp;h=0613a39a8ebba335a56f42a9ec958c9a796ac45e;hb=fb5ca4dbba257d3eb7fa15800d9663b774e41e7e;hp=14ddf43d41c2cdc076e4489a62e2ed2e7341dd36;hpb=d6db27e633b1b8850fb093a8e5fad439ac3b0465;p=libs%2Fgl.git diff --git a/source/texturecube.cpp b/source/texturecube.cpp index 14ddf43d..0613a39a 100644 --- a/source/texturecube.cpp +++ b/source/texturecube.cpp @@ -176,10 +176,7 @@ void TextureCube::image(const Graphics::Image &img, unsigned lv, bool srgb) PixelFormat fmt = pixelformat_from_graphics(img.get_format()); if(size==0) - { - unsigned l = (is_mipmapped(min_filter) ? lv : 1); - storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, l); - } + storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, lv); else if(w!=size || h!=size) throw incompatible_data("TextureCube::image"); @@ -274,6 +271,7 @@ void TextureCube::Loader::init() add("image_data", &Loader::image_data); add("raw_data", &Loader::raw_data); add("storage", &Loader::storage); + add("storage", &Loader::storage_levels); } void TextureCube::Loader::external_image(TextureCubeFace face, const string &fn) @@ -304,6 +302,11 @@ void TextureCube::Loader::storage(PixelFormat fmt, unsigned s) obj.storage(fmt, s); } +void TextureCube::Loader::storage_levels(PixelFormat fmt, unsigned s, unsigned l) +{ + obj.storage(fmt, s, l); +} + void operator>>(const LexicalConverter &conv, TextureCubeFace &face) {