- Timestamp:
- 04/25/06 09:27:16 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OGRE/trunk/ogre_changes/Ogre1.2/OgreMain/src/OgreMaterialSerializer.cpp
r768 r812 1979 1979 return true; 1980 1980 } 1981 1982 #ifdef GAMETOOLS_ILLUMINATION_MODULE 1983 1984 bool parseIllumTechniques(String& params, MaterialScriptContext& context) 1985 { 1986 1987 1988 context.section = MSS_ILLUMTECHNIQUES; 1989 return true; 1990 1991 } 1992 1993 bool parseIllumTechniqueParams(String& params, MaterialScriptContext& context) 1994 { 1995 IllumTechniqueParams* illumParams = new IllumTechniqueParams(); 1996 context.pass->addIllumTechniqueParams(illumParams); 1997 context.illumTechniqueParams = illumParams; 1998 1999 illumParams->setTypeName(params); 2000 2001 context.section = MSS_ILLUMTECHNIQUE_PARAMS; 2002 return true; 2003 } 2004 2005 bool parseUnknownIllumParam(String& paramName, String& paramValue, MaterialScriptContext& context) 2006 { 2007 context.illumTechniqueParams->addParam(paramName, paramValue); 2008 2009 return false; 2010 } 2011 2012 #endif 1981 2013 //----------------------------------------------------------------------- 1982 2014 bool parseTextureUnit(String& params, MaterialScriptContext& context) … … 2518 2550 #ifdef GAMETOOLS_ILLUMINATION_MODULE 2519 2551 mTextureUnitAttribParsers.insert(AttribParserList::value_type("vertex_texture", (ATTRIBUTE_PARSER)parseVertexTexture)); 2552 2553 mPassAttribParsers.insert(AttribParserList::value_type("IllumTechniques", (ATTRIBUTE_PARSER)parseIllumTechniques)); 2554 mIllumTechniqueParsers.insert(AttribParserList::value_type("RenderTechnique", (ATTRIBUTE_PARSER)parseIllumTechniqueParams)); 2520 2555 #endif 2521 2556 // Set up program reference attribute parsers … … 2684 2719 } 2685 2720 break; 2721 #ifdef GAMETOOLS_ILLUMINATION_MODULE 2722 2723 case MSS_ILLUMTECHNIQUES: 2724 if (line == "}") 2725 { 2726 // End of illumtechniques 2727 mScriptContext.section = MSS_PASS; 2728 mScriptContext.stateLev = -1; //Reset state level (yes, the state level) 2729 } 2730 else 2731 { 2732 // find & invoke a parser 2733 return invokeParser(line, mIllumTechniqueParsers); 2734 } 2735 break; 2736 case MSS_ILLUMTECHNIQUE_PARAMS: 2737 if (line == "}") 2738 { 2739 // End of illumtechnique params 2740 mScriptContext.section = MSS_ILLUMTECHNIQUES; 2741 mScriptContext.illumTechniqueParams = NULL; 2742 mScriptContext.stateLev = -1; //Reset state level (yes, the state level) 2743 } 2744 else 2745 { 2746 // find & invoke a parser 2747 return invokeParser(line, mIllumTechniqueParsers); 2748 } 2749 break; 2750 #endif 2686 2751 case MSS_TEXTUREUNIT: 2687 2752 if (line == "}") … … 2901 2966 if (iparser == parsers.end()) 2902 2967 { 2968 #ifdef GAMETOOLS_ILLUMINATION_MODULE 2969 2970 if(mScriptContext.section == MSS_ILLUMTECHNIQUE_PARAMS) 2971 if(splitCmd.size() >= 2) 2972 return parseUnknownIllumParam( splitCmd[0], 2973 splitCmd[1], 2974 mScriptContext); 2975 #endif 2903 2976 // BAD command. BAD! 2904 2977 logParseError("Unrecognised command: " + splitCmd[0], mScriptContext);
Note: See TracChangeset
for help on using the changeset viewer.