From Lionel Largarde, "fix for the Image::computeNumberOfMipmapLevels method. The method did use the float version of the log function and the / operator.

It works for most of the input sizes, but fails for 8192, 32768...
For 8192, the method returns 13 instead of 14."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14815 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2015-04-01 09:37:53 +00:00
parent 9eb02084a6
commit f26be0155c

View File

@@ -799,7 +799,11 @@ int Image::computeNumberOfMipmapLevels(int s,int t, int r)
{
int w = maximum(s, t);
w = maximum(w, r);
return 1 + static_cast<int>(floor(logf(w)/logf(2.0f)));
int n = 0;
while (w >>= 1)
++n;
return n+1;
}
bool Image::isCompressed() const