Recommended change for double precision compiling

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Van
Hobgoblin
Posts: 512
Joined: Fri Nov 19, 2004 3:56 am
Contact:

Recommended change for double precision compiling

Post by Van »

Compiler: MS 7.1

File: OgreAutoParamDataSource.cpp
Line: 401

Symptom:
When compiling with #define OGRE_DOUBLE_PRECISION 1 the following code failes compilation because the compiler can not resolve the intended overload to use:

Code: Select all


	Real AutoParamDataSource::getTime_0_X(Real x) const
	{
		return fmod(Root::getSingleton().getTimer()->getMilliseconds() / 1000.0f
			, x);
	}

I changed it to

Code: Select all


	Real AutoParamDataSource::getTime_0_X(Real x) const
	{
		return fmod((Ogre::Real) Root::getSingleton().getTimer()->getMilliseconds() / 1000.0f
			, x);
	}

which made the compiler happy.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

You can submit a patch for it - otherwise it will get lost here :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Odd, that code builds just fine without modifications for me with OGRE_DOUBLE_PRECISION 1. Must be a VC7.1 thing.
Post Reply