]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix 3D texture loading with fixed depth
authorMikko Rasa <tdb@tdb.fi>
Thu, 9 Aug 2012 19:16:30 +0000 (22:16 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 9 Aug 2012 19:16:30 +0000 (22:16 +0300)
source/texture3d.cpp

index 4aac49edfaf82f27eaf4c3eef8c7021596d5033e..30363acc3d8046ff10fd73f9b6271bce4c353b4c 100644 (file)
@@ -99,7 +99,14 @@ void Texture3D::load_image(const string &fn, int dp)
                h = d;
        }
        else if(dp>0)
+       {
                d = dp;
+               if(h%d)
+                       throw incompatible_data("Texture3D::load_image");
+               h /= d;
+       }
+       else
+               throw invalid_argument("Texture3D::load_image");
 
        PixelFormat fmt = pixelformat_from_graphics(img.get_format());
        if(width==0)