From 22354fd7ced08a4564794e4d3a02e10ce061146e Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Fri, 27 Oct 2017 15:31:21 -0700 Subject: [PATCH] Use standard library log2f. --- src/RawModel.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/RawModel.cpp b/src/RawModel.cpp index f9ffee7..8b3e134 100644 --- a/src/RawModel.cpp +++ b/src/RawModel.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #if defined( __unix__ ) @@ -21,11 +22,6 @@ #include "utils/Image_Utils.h" #include "RawModel.h" -static float Log2f(float f) -{ - return logf(f) * 1.442695041f; -} - bool RawVertex::operator==(const RawVertex &other) const { return (position == other.position) && @@ -101,7 +97,7 @@ int RawModel::AddTexture(const std::string &name, const std::string &fileName, c texture.name = name; texture.width = properties.width; texture.height = properties.height; - texture.mipLevels = (int) ceilf(Log2f(std::max((float) properties.width, (float) properties.height))); + texture.mipLevels = (int) ceilf(log2f(std::max((float) properties.width, (float) properties.height))); texture.usage = usage; texture.occlusion = (properties.occlusion == IMAGE_TRANSPARENT) ? RAW_TEXTURE_OCCLUSION_TRANSPARENT : RAW_TEXTURE_OCCLUSION_OPAQUE;