Persistent Compiling Error

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Tracekill
Posts: 5
Joined: Wed Feb 20, 2008 2:52 pm

Persistent Compiling Error

Post by Tracekill »

When compiling my FPS created by IrrWizard, I get this error:

Code: Select all

.\source\core\GameFXManager.cpp(158) : error C2664: 'irr::scene::ISceneManager::addHillPlaneMesh' : cannot convert parameter 3 from 'irr::core::dimension2d<T>' to 'const irr::core::dimension2d<T> &'
1>        with
1>        [
1>            T=irr::s32
1>        ]
1>        and
1>        [
1>            T=irr::u32
1>        ]
1>        Reason: cannot convert from 'irr::core::dimension2d<T>' to 'const irr::core::dimension2d<T>'
1>        with
1>        [
1>            T=irr::s32
1>        ]
1>        and
1>        [
1>            T=irr::u32
1>        ]
1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
In reference to this method (Lines 151-167, GameFXManager.cpp):

Code: Select all

 void CGameFXManager::createWaterEffectNode(CGameManager* pManager, core::vector3df position, const core::dimension2d<f32> size, const c8 *layer1, const c8 *layer2)
{
     scene::ISceneNode* waterNode = 0;
     pManager->getSceneManager()->addHillPlaneMesh("waterMesh",
		size,
		core::dimension2d<s32>(40,40), 0, 0,
		core::dimension2d<f32>(0,0),
		core::dimension2d<f32>(10,10));
       
       // wave size and speed can be modified here
   	   waterNode = pManager->getSceneManager()->addWaterSurfaceSceneNode(pManager->getSceneManager()->getMesh("waterMesh")->getMesh(0), 3.0f, 300.0f, 30.0f);
       waterNode->setID(ID_NODE_WATER);
       waterNode->setPosition(position);
	   waterNode->setMaterialTexture(0, pManager->getDriver()->getTexture(layer1));
	   waterNode->setMaterialTexture(1, pManager->getDriver()->getTexture(layer2));
	   waterNode->setMaterialType(video::EMT_REFLECTION_2_LAYER); 
}
The original method being:

Code: Select all

	virtual IAnimatedMesh* addHillPlaneMesh(const c8* name,
			const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
			video::SMaterial* material = 0,	f32 hillHeight = 0.0f,
			const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f),
			const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0;
I've tried every variation of the templating syntax I can think of to get it to work but the closest I've come is pre-defining the parameters like:

Code: Select all

 const core::dimension2d<f32> param2 = core::dimension2d<f32>(40,40);
I know the answer is going to be humiliatingly simple but for now it's stopping the show. [/code]
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

the error is telling you that you're trying to give a dimension2d<s32> where a dimension2d<u32> is required.

Probably the parameter changed at some point and irrwizard has given you the old version rather than the new version as it hasn't been updated for some time i think.
Image Image Image
Tracekill
Posts: 5
Joined: Wed Feb 20, 2008 2:52 pm

Post by Tracekill »

JP wrote:the error is telling you that you're trying to give a dimension2d<s32> where a dimension2d<u32> is required.

Probably the parameter changed at some point and irrwizard has given you the old version rather than the new version as it hasn't been updated for some time i think.
Ah of course, and just as embarrassingly simple as I thought. Thanks a ton!
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

No worries! It happens to us all at some point! Just takes a fresh pair of eyes to look at it to see the bleeding obvious when we're actually looking for something much deeper.
Image Image Image
Post Reply