Page 1 of 1

[Request] Remove exception from SceneManager::_setSkyDome(.)

Posted: Sun Apr 18, 2010 11:12 pm
by spacegaier
Current situation:
If you try to create a sky dome with a non-existing material, you directly get a crash in the function SceneManager::_setSkyDome(...) in line 1939 in OgreSceneManager.cpp.

Proposal:
I would propose to change that behaviour to the same that is implemented e.g. in the SubEntitie's setMaterialName(...) function: If you try to set a non-existing material for a SubEntity you get a warning output in logfile and the default "BaseWhite" material is applied instead of crashing the whole application.

Note:
Unless there is a special reasoning behind the fact that Ogre just crahses here, I would strongly suggest to change that behaviour.

Cheers
spacegaier

Re: Remove exception from SceneManager::_setSkyDome(...)

Posted: Wed Apr 21, 2010 2:04 pm
by spacegaier
Any comments / opinions?

Re: Remove exception from SceneManager::_setSkyDome(...)

Posted: Mon Apr 26, 2010 11:59 am
by madmarx
Personnaly, I like the fact that 'underscored' functions perform less tests, since it is 'use it at your own risks'.
Why don't you use setSkyDome() ? Would you appreciate a new function setSkyDome() with the renderqueue directly + some tests on the parameters, instead of changing the _setSkyDome() behavior ?
Maybe you can do the test yourself too quite easily before calling the _setSkyDome() function, what do you think ?

Re: Remove exception from SceneManager::_setSkyDome(...)

Posted: Mon Apr 26, 2010 12:20 pm
by spacegaier
There already is a setSkyDome that calls then _setSkyDome without any further tests. I would now like that e.g. in setSkyDome there is done a test much like in setMaterial (I linked to it in my first post). That would be more consistent and would prevent apps from crashing here.

Re: [Request] Remove exception from SceneManager::_setSkyDom

Posted: Tue Apr 27, 2010 9:45 pm
by madmarx
Ah ok! Yes your right. I think I can look at this when I will switch to mercurial.

Re: [Request] Remove exception from SceneManager::_setSkyDom

Posted: Wed Apr 28, 2010 11:12 am
by spacegaier
Perhaps I should create a patch for it and send it to them team?

Re: [Request] Remove exception from SceneManager::_setSkyDom

Posted: Wed Apr 28, 2010 11:51 am
by madmarx
Yes, using the traditional patching system. You can look at this :
http://www.ogre3d.org/developers/submit-patch

Re: [Request] Remove exception from SceneManager::_setSkyDom

Posted: Wed Apr 28, 2010 1:15 pm
by spacegaier
Yes, I know this page (in fact I just reminded sinbad that the patch tracker link was wrong ;) ).