Custom script patterns with 1.6 script compiler

What it says on the tin: a place to discuss proposed new features.
Post Reply
Tsh't
Kobold
Posts: 26
Joined: Tue Apr 12, 2005 9:39 pm
Location: Paris - France
Contact:

Custom script patterns with 1.6 script compiler

Post by Tsh't »

Hello.

Right now I'm using Shoggoth script engine for my files, with the custom translator (see http://www.ogre3d.org/wiki/index.php/Ex ... tCompilers).
There's only one issue. At parsing time, Ogre checks for patterns defined like this :

Code: Select all

#if OGRE_USE_NEW_COMPILERS == 1
		mScriptPatterns.push_back("*.program");
		mScriptPatterns.push_back("*.material");
		mScriptPatterns.push_back("*.particle");
		mScriptPatterns.push_back("*.compositor");
#endif
                       mScriptPatterns.push_back("*.os");
So I call my files with these extensions, which are not very representative of the content...

What would be great would be to, say, associate a script translator to a kind of file.
We may be able to register it this way :

Code: Select all

Ogre::ScriptCompilerManager::getSingleton().addTranslatorManager(&translatorManager, "*.myfile");
What would you think of this ? Maybe I'm totally out of scope with the translator intended features... There is the old way to do this though (see for example http://www.ogre3d.org/wiki/index.php/Al ... ipt_parser which registers *.object).

Tx.
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:

Re: Custom script patterns with 1.6 script compiler

Post by sinbad »

Sounds like you want ResourceGroupManager::_registerScriptLoader instead. That's what decides what files get parsed, the translators hook in at a lower level.
Post Reply