X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftexture3d.cpp;h=03c58d0afdf05e6273cfbbea2892ea2d7e067ca9;hb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;hp=667f8c31c1ede8dfe9c1896159eaa263385738be;hpb=635e5dc39adf09051bdacadbc402ddf22f7807a3;p=libs%2Fgl.git diff --git a/source/texture3d.cpp b/source/texture3d.cpp index 667f8c31..03c58d0a 100644 --- a/source/texture3d.cpp +++ b/source/texture3d.cpp @@ -142,22 +142,11 @@ void Texture3D::image(const Graphics::Image &img, unsigned lv) { unsigned w = img.get_width(); unsigned h = img.get_height(); - unsigned d = 1; - if(depth) - { - if(h%depth) - throw incompatible_data("Texture3D::load_image"); - h /= depth; - d = depth; - } - else - { - if(h%w) - throw incompatible_data("Texture3D::load_image"); - d = h/w; - h = w; - } + if(h%w) + throw incompatible_data("Texture3D::load_image"); + unsigned d = h/w; + h = w; PixelFormat fmt = pixelformat_from_image(img); if(width==0) @@ -168,7 +157,7 @@ void Texture3D::image(const Graphics::Image &img, unsigned lv) PixelStore pstore = PixelStore::from_image(img); BindRestore _bind_ps(pstore); - image(0, img.get_data()); + image(0, img.get_pixels()); } unsigned Texture3D::get_n_levels() const