Removed log2 and replaced the places where is was used with a new Image::computeNumberOfMipmapLevels method.

This commit is contained in:
Robert Osfield
2007-10-01 08:50:58 +00:00
parent 69eddaa7bb
commit 7086aeeebc
9 changed files with 17 additions and 10 deletions

View File

@@ -429,6 +429,13 @@ int Image::computeNearestPowerOfTwo(int s,float bias)
return s;
}
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)));
}
unsigned int Image::getTotalSizeInBytesIncludingMipmaps() const
{
if (_mipmapData.empty())