From 188df341c3e403052557d771125f07a314afd51d Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 27 Aug 2013 16:08:58 +0200 Subject: [PATCH] Replaced log2 to make VC happy --- components/terrain/quadtreenode.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/terrain/quadtreenode.cpp b/components/terrain/quadtreenode.cpp index 95daa0afb..ef2c61013 100644 --- a/components/terrain/quadtreenode.cpp +++ b/components/terrain/quadtreenode.cpp @@ -13,6 +13,13 @@ using namespace Terrain; namespace { + int Log2( int n ) + { + assert(n > 0); + int targetlevel = 0; + while (n >>= 1) ++targetlevel; + return targetlevel; + } // Utility functions for neighbour finding algorithm ChildDirection reflect(ChildDirection dir, Direction dir2) @@ -161,7 +168,7 @@ QuadTreeNode::QuadTreeNode(World* terrain, ChildDirection dir, float size, const pos = mCenter - pos; mSceneNode->setPosition(Ogre::Vector3(pos.x*8192, pos.y*8192, 0)); - mLodLevel = log2(mSize); + mLodLevel = Log2(mSize); mMaterialGenerator = new MaterialGenerator(mTerrain->getShadersEnabled()); }