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

@@ -464,7 +464,7 @@ void Texture2DArray::allocateMipmap(State& state) const
// compute number of mipmap levels
int width = _textureWidth;
int height = _textureHeight;
int numMipmapLevels = 1 + (int)floor(log2(maximum(width, height)));
int numMipmapLevels = Image::computeNumberOfMipmapLevels(width, height);
// we do not reallocate the level 0, since it was already allocated
width >>= 1;