1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:23:52 +00:00

Replaced log2 to make VC happy

This commit is contained in:
scrawl 2013-08-27 16:08:58 +02:00
parent 839d251cc5
commit 188df341c3

View file

@ -13,6 +13,13 @@ using namespace Terrain;
namespace namespace
{ {
int Log2( int n )
{
assert(n > 0);
int targetlevel = 0;
while (n >>= 1) ++targetlevel;
return targetlevel;
}
// Utility functions for neighbour finding algorithm // Utility functions for neighbour finding algorithm
ChildDirection reflect(ChildDirection dir, Direction dir2) ChildDirection reflect(ChildDirection dir, Direction dir2)
@ -161,7 +168,7 @@ QuadTreeNode::QuadTreeNode(World* terrain, ChildDirection dir, float size, const
pos = mCenter - pos; pos = mCenter - pos;
mSceneNode->setPosition(Ogre::Vector3(pos.x*8192, pos.y*8192, 0)); mSceneNode->setPosition(Ogre::Vector3(pos.x*8192, pos.y*8192, 0));
mLodLevel = log2(mSize); mLodLevel = Log2(mSize);
mMaterialGenerator = new MaterialGenerator(mTerrain->getShadersEnabled()); mMaterialGenerator = new MaterialGenerator(mTerrain->getShadersEnabled());
} }