Index: GTP/trunk/App/Demos/Illum/Ogre/src/Common/src/SceneSerializer.cpp
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/Common/src/SceneSerializer.cpp	(revision 2163)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/Common/src/SceneSerializer.cpp	(revision 2186)
@@ -1,3 +1,4 @@
 #include "SceneSerializer.h"
+#include "OgreIlluminationManager.h"
 
 void logParseError(const String& error, const SceneScriptContext& context)
@@ -27,4 +28,5 @@
 	StringUtil::trim(params);
 	String meshfilename = context.meshFiles[params];
+	context.meshName = params;
 	context.entity = context.sceneManager->createEntity(context.entityName, meshfilename);
 	SceneNode* root = context.sceneManager->getRootSceneNode();
@@ -32,4 +34,24 @@
 	context.sceneNode->attachObject(context.entity);
 
+    return false;
+}
+
+bool parseClusters(String& params, SceneScriptContext& context)
+{
+	if(params == "")
+		logParseError("No clusters given!", context);
+
+	//create the Entity with the given mesh, attach to a scene node
+	std::vector<String> parameters = StringUtil::split(params);
+	String subentityname = context.entityName + "_SE_" + parameters[0];
+	PathMapClusters clasters;
+	clasters.count = parameters.size() - 2;
+	clasters.clusters = new unsigned int[clasters.count];
+	for(int i = 2; i < parameters.size(); i++)
+		clasters.clusters[i-2] = StringConverter::parseUnsignedInt(parameters.at(i));
+	clasters.pathMapTextureFilename = context.pathMapTextureName + "_" + parameters[0]+ ".hdr";
+	clasters.pathMapResolution = context.pathMapResolutions[context.meshName];
+	OgreIlluminationManager::getSingleton().addPathMapClusters(subentityname, clasters);
+	
     return false;
 }
@@ -76,4 +98,16 @@
 }
 
+bool parsePMRes(String& params, SceneScriptContext& context)
+{
+	context.pathMapResolutions[context.meshName] = StringConverter::parseUnsignedInt(params);
+	return false;
+}
+
+bool parsePRMMapName(String& params, SceneScriptContext& context)
+{
+	context.pathMapTextureName = params;
+	return false;
+}
+
 SceneSerializer::SceneSerializer(SceneManager* sm)
 {
@@ -85,8 +119,55 @@
 	
 	mMeshAttribParsers.insert(AttribParserList::value_type("ogrefile", (SCENE_ATTRIBUTE_PARSER)parseMeshFileName));
+	mMeshAttribParsers.insert(AttribParserList::value_type("pathmapresolution", (SCENE_ATTRIBUTE_PARSER)parsePMRes));
 
 	mEntityAttribParsers.insert(AttribParserList::value_type("mesh", (SCENE_ATTRIBUTE_PARSER)parseMeshName));
 	mEntityAttribParsers.insert(AttribParserList::value_type("transformation", (SCENE_ATTRIBUTE_PARSER)parseTransform));
-
+	mEntityAttribParsers.insert(AttribParserList::value_type("subentity", (SCENE_ATTRIBUTE_PARSER)parseClusters));
+	mEntityAttribParsers.insert(AttribParserList::value_type("pathmapfile", (SCENE_ATTRIBUTE_PARSER)parsePRMMapName));
+
+}
+
+void SceneSerializer::parseEntryPoints(String filename)
+{
+	DataStreamPtr stream; 
+	stream = ResourceGroupManager::getSingleton().openResource(filename);
+
+	char buffer[500];
+    
+	stream->readLine(buffer, 500);
+	String line = buffer;
+
+	std::vector<String> tokens = StringUtil::split(line);
+	unsigned int entryPointCnt = StringConverter::parseUnsignedInt(tokens[1]);
+	for(int i= 0; i < entryPointCnt; i++)
+	{
+		stream->readLine(buffer, 500);
+		line = buffer;
+		tokens = StringUtil::split(line);
+		PathMapEntryPoint ep;
+		ep.position = Vector3(StringConverter::parseReal(tokens[1]),
+			                  StringConverter::parseReal(tokens[2]),
+							  StringConverter::parseReal(tokens[3]));
+
+		stream->readLine(buffer, 500);
+		line = buffer;
+		tokens = StringUtil::split(line);
+		ep.normal = Vector3(StringConverter::parseReal(tokens[1]),
+			                StringConverter::parseReal(tokens[2]),
+							StringConverter::parseReal(tokens[3]));
+
+		OgreIlluminationManager::getSingleton().addPathMapEntryPoint(ep);
+		stream->readLine(buffer, 500);
+	}
+	stream->readLine(buffer, 500);
+	line = buffer;
+	tokens = StringUtil::split(line);
+    unsigned int clusterCnt = StringConverter::parseUnsignedInt(tokens[1]);
+	for(int i= 0; i < clusterCnt; i++)
+	{
+		stream->readLine(buffer, 500);
+		unsigned int clusterlength = StringConverter::parseUnsignedInt(buffer);
+		OgreIlluminationManager::getSingleton().addPathMapClusterLength(clusterlength);		
+	}
 }
 
