Changeset 812 for OGRE/trunk/ogre_changes
- Timestamp:
- 04/25/06 09:27:16 (19 years ago)
- Location:
- OGRE/trunk/ogre_changes/Ogre1.2/OgreMain
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OGRE/trunk/ogre_changes/Ogre1.2/OgreMain/include/OgrePass.h
r768 r812 34 34 35 35 namespace Ogre { 36 37 #ifdef GAMETOOLS_ILLUMINATION_MODULE 38 39 class IllumTechniqueParams 40 { 41 String techniqueType; 42 NameValuePairList params; 43 44 public: 45 46 void setTypeName(String& type){ techniqueType = type;} 47 void addParam(String& param, String& value) 48 { 49 params[param] = value; 50 } 51 52 String& getTypeName(){return techniqueType;} 53 NameValuePairList& getParams(){return params;} 54 }; 55 56 #endif 36 57 /** Class defining a single pass of a Technique (of a Material), ie 37 58 a single rendering call. … … 1153 1174 #ifdef GAMETOOLS_ILLUMINATION_MODULE 1154 1175 public: 1176 1155 1177 void setActive(bool active){mActive = active;} 1156 1178 bool isActive() const {return mActive;} 1179 1180 void addIllumTechniqueParams(IllumTechniqueParams* params) 1181 { 1182 illumTechniques.push_back(params); 1183 } 1184 std::vector<IllumTechniqueParams*>& getIllumTechniques() 1185 { 1186 return illumTechniques; 1187 } 1188 1157 1189 protected: 1190 1158 1191 bool mActive; 1192 1193 std::vector<IllumTechniqueParams*> illumTechniques; 1159 1194 #endif 1160 1195 }; -
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.