Index: orxonox/trunk/src/lib/graphics/light.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/light.cc	(revision 4733)
+++ orxonox/trunk/src/lib/graphics/light.cc	(revision 4734)
@@ -23,9 +23,24 @@
 #include "vector.h"
 #include "debug.h"
+#include "tinyxml.h"
+#include "load_param.h"
+#include "factory.h"
 
 using namespace std;
 
+CREATE_FACTORY(Light);
+
 //! Definition of the Lights
-int lightsV[] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7};
+int lightsV[] =
+{
+                  GL_LIGHT0,
+                  GL_LIGHT1,
+                  GL_LIGHT2,
+                  GL_LIGHT3,
+                  GL_LIGHT4,
+                  GL_LIGHT5,
+                  GL_LIGHT6,
+                  GL_LIGHT7
+};
 
 
@@ -34,4 +49,29 @@
 */
 Light::Light(int lightNumber)
+{
+  this->init(lightNumber);
+}
+
+/**
+ * \param root The XML-element to load the Light from
+ */
+ Light::Light(const TiXmlElement* root)
+{
+  this->init(1);
+  this->loadParams(root);
+}
+
+/**
+   \brief destroys a Light
+*/
+Light::~Light(void)
+{
+  glDisable(lightsV[this->lightNumber]);
+}
+
+/**
+ * \brief initializes a Light
+ */
+void Light::init(int lightNumber)
 {
   this->setClassID(CL_LIGHT, "Light");
@@ -46,18 +86,28 @@
   // set values (defaults)
   this->lightNumber = lightNumber;
-  this->setPosition(0.0, 0.0, 0.0);
+  this->setPosition(0,0,0);
   this->setDiffuseColor(1.0, 1.0, 1.0);
   this->setSpecularColor(1.0, 1.0, 1.0);
 }
 
-
-/**
-   \brief destroys a Light
-*/
-Light::~Light(void)
-{
-  glDisable(lightsV[this->lightNumber]);
-}
-
+/**
+ * \param root The XML-element to load the Light from
+ */
+void Light::loadParams(const TiXmlElement* root)
+{
+  static_cast<PNode*>(this)->loadParams(root);
+
+  LoadParam<Light>(root, "diffuse-color", this, &Light::setDiffuseColor)
+      .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])");
+
+  LoadParam<Light>(root, "specular-color", this, &Light::setSpecularColor)
+      .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
+
+  LoadParam<Light>(root, "spot-direction", this, &Light::setSpotDirection)
+      .describe("sets the Direction of the Spot");
+
+  LoadParam<Light>(root, "spot-cutoff", this, &Light::setSpotCutoff)
+      .describe("the cuttoff of the Spotlight");
+}
 
 /**
@@ -66,5 +116,5 @@
    \todo patrick: is it ok to set a Light Position even if it is derived from p_node??
 */
-void Light::setPosition(Vector position)
+void Light::setPosition(const Vector& position)
 {
   this->lightPosition[0] = position.x;
@@ -107,5 +157,4 @@
 }
 
-
 /**
    \brief sets an emitting Specular color of this Light
@@ -147,5 +196,5 @@
    \param direction The direction of the Spot Light.
 */
-void Light::setSpotDirection(Vector direction)
+void Light::setSpotDirection(const Vector& direction)
 {
   this->spotDirection[0] = direction.x;
Index: orxonox/trunk/src/lib/graphics/light.h
===================================================================
--- orxonox/trunk/src/lib/graphics/light.h	(revision 4733)
+++ orxonox/trunk/src/lib/graphics/light.h	(revision 4734)
@@ -1,3 +1,3 @@
-/*! 
+/*!
     \file light.h
     \brief Handles Lights.
@@ -20,5 +20,5 @@
 // FORWARD DEFINITIONS //
 class Vector;
-
+class TiXmlElement;
 
 //! A class that handles Lights. The LightManager operates on this.
@@ -27,7 +27,11 @@
  public:
   Light(int lightNumber);
+  Light(const TiXmlElement* root);
   virtual ~Light(void);
 
-  void setPosition(Vector position);
+  void init(int lightNumber);
+  void loadParams(const TiXmlElement* root);
+
+  void setPosition(const Vector& position);
   void setPosition(GLfloat x, GLfloat y, GLfloat z);
   Vector getPosition() const;
@@ -36,10 +40,11 @@
   void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
   void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
-  void setSpotDirection(Vector direction);
+  void setSpotDirection(const Vector& direction);
+  void setSpotDirection(float x, float y, float z) { setSpotDirection(Vector(x,y,z)); };
   void setSpotCutoff(GLfloat cutoff);
 
   /** \returns the lightNumber*/
   int getLightNumber(void) const {return this->lightNumber;}
-  
+
   virtual void draw();
 
@@ -89,5 +94,5 @@
    To redraw the light use
    \li void draw();
-   
+
    and to delete one just use
    \li void deleteLight(void);
@@ -96,5 +101,5 @@
    \li void debug(void) const;
 
-   You can also operate on the single Lights themselves, by first retreaving them with 
+   You can also operate on the single Lights themselves, by first retreaving them with
    \li Light* getLight(int LightNumber);
    \n
@@ -108,4 +113,6 @@
   /** \returns a Pointer to the only object of this Class */
   inline static LightManager* getInstance(void) { if (!singletonRef) singletonRef = new LightManager();  return singletonRef; };
+
+  void loadParams(const TiXmlElement* root);
 
   // set Attributes
@@ -132,7 +139,7 @@
   Vector getPosition(void) const;
   Vector getPosition(int lightNumber) const;
-  
+
   Light* getLight(int lightNumber) const;
-  
+
   void debug(void) const;
 
@@ -141,5 +148,5 @@
   LightManager(void);
   void initLight(int LightNumber);
-  
+
 
  private:
@@ -149,5 +156,5 @@
   Light**                 lights;             //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues.
   Light*                  currentLight;       //!< The current Light, we are working with.
-  
+
 };
 
Index: orxonox/trunk/src/lib/util/substring.cc
===================================================================
--- orxonox/trunk/src/lib/util/substring.cc	(revision 4733)
+++ orxonox/trunk/src/lib/util/substring.cc	(revision 4734)
@@ -27,5 +27,5 @@
 #include <assert.h>
 
-SubString::SubString( const char* string)
+SubString::SubString( const char* string, char splitter)
 {
   n = 0;
@@ -33,5 +33,5 @@
   assert( string != NULL);
 
-  for( int i = 0; i < strlen(string); i++) if( string[i] == ',') n++;
+  for( int i = 0; i < strlen(string); i++) if( string[i] == splitter) n++;
 
   n += 1;
@@ -45,5 +45,5 @@
 
   const char* offset = string;
-  char* end = strchr( string, ',');
+  char* end = strchr( string, splitter);
   while( end != NULL)
     {
@@ -57,5 +57,5 @@
       end++;
       offset = end;
-      end = strchr( offset, ',');
+      end = strchr( offset, splitter);
     }
 
Index: orxonox/trunk/src/lib/util/substring.h
===================================================================
--- orxonox/trunk/src/lib/util/substring.h	(revision 4733)
+++ orxonox/trunk/src/lib/util/substring.h	(revision 4734)
@@ -11,5 +11,5 @@
 {
  public:
-  SubString(const char* string);
+  SubString(const char* string, char splitter = ',');
   ~SubString();
 
Index: orxonox/trunk/src/util/loading/load_param.cc
===================================================================
--- orxonox/trunk/src/util/loading/load_param.cc	(revision 4733)
+++ orxonox/trunk/src/util/loading/load_param.cc	(revision 4734)
@@ -114,10 +114,10 @@
 
 
-int isInt(const char* Int, int defaultValue)
+int isInt(const char* INT, int defaultValue)
 {
   char* endPtr = NULL;
-  int result = strtol(Int, &endPtr, 10);
-
-  if ( endPtr >= Int && endPtr < Int + strlen(Int))
+  int result = strtol(INT, &endPtr, 10);
+
+  if ( endPtr >= INT && endPtr < INT + strlen(INT))
     return defaultValue;
   else
@@ -125,10 +125,10 @@
 }
 
-float isFloat(const char* Float, float defaultValue)
+float isFloat(const char* FLOAT, float defaultValue)
 {
   char* endPtr = NULL;
-  double result = strtod(Float, &endPtr);
-
-  if ( endPtr >= Float && endPtr < Float + strlen(Float))
+  double result = strtod(FLOAT, &endPtr);
+
+  if ( endPtr >= FLOAT && endPtr < FLOAT + strlen(FLOAT))
     return defaultValue;
   else
@@ -136,8 +136,14 @@
 }
 
-const char* isString(const char* string, const char* defaultValue)
-{
-  if (string != NULL)
-    return string;
+const Vector& isVector(const char* VECTOR, const Vector& defaultValue)
+{
+
+
+}
+
+const char* isString(const char* STRING, const char* defaultValue)
+{
+  if (STRING != NULL)
+    return STRING;
   else
     return defaultValue;
Index: orxonox/trunk/src/util/loading/load_param.h
===================================================================
--- orxonox/trunk/src/util/loading/load_param.h	(revision 4733)
+++ orxonox/trunk/src/util/loading/load_param.h	(revision 4734)
@@ -23,4 +23,5 @@
 
 #include "base_object.h"
+#include "vector.h"
 #include "factory.h"
 #include "debug.h"
@@ -69,4 +70,9 @@
 #define l_FLOAT_NAME       "float"              //!< The name of a FLOAT
 #define l_FLOAT_DEFAULT    0.0                  //!< a default Value for a FLOAT
+
+//#define l_VECTOR_TYPE      const Vector&        //!< The type of a VECTOR
+//#define l_VECTOR_FUNC      isVector             //!< The function to parse a VECTOR
+//#define l_VECTOR_NAME      "Vector[x/y/z]"      //!< The name of a VECTOR
+//#define l_VECTOR_DEFAULT   Vector(0,0,0)        //!< Default value for a VECTOR
 
 #define l_STRING_TYPE      const char*          //!< The type of a STRING
@@ -230,7 +236,9 @@
 *** HELPER FUNCTIONS ***
 ***********************/
-int           isInt(const char* Int, int defaultValue);
-float         isFloat(const char* Float, float defaultValue);
-const char*   isString(const char* string, const char* defaultValue);
+int           isInt(const char* INT, int defaultValue);
+float         isFloat(const char* FLOAT, float defaultValue);
+//const Vector& isVector(const char* VECTOR, const Vector& defaultValue);
+const char*   isString(const char* STRING, const char* defaultValue);
+
 //TiXmlEmlemnt* isXmlElem(const)
 
@@ -346,4 +354,7 @@
   LoadParam5(l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT, l_FLOAT);
 
+  //! makes functions with one Vector loadable
+  //LoadParam1(l_VECTOR);
+
   // loads a Ti-XML-element
   LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const TiXmlElement*), bool multi = false)
