X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexturecube.cpp;h=6239688cb304d66a381298d8057d4c9d3330a046;hb=24b24e2203c776aacd9744bb947f5cf47b03d328;hp=2a15eb1bec3359a3f665e4d48c4f62392644b41f;hpb=4a639bc5e80fce2467855a9e8f4c6cdff2f0adc0;p=libs%2Fgl.git diff --git a/source/core/texturecube.cpp b/source/core/texturecube.cpp index 2a15eb1b..6239688c 100644 --- a/source/core/texturecube.cpp +++ b/source/core/texturecube.cpp @@ -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"); @@ -251,7 +248,7 @@ void TextureCube::Loader::storage_levels(PixelFormat fmt, unsigned s, unsigned l } -GLenum get_gl_cube_face(TextureCubeFace face) +unsigned get_gl_cube_face(TextureCubeFace face) { switch(face) {