Index: /orxonox/trunk/src/array.cc
===================================================================
--- /orxonox/trunk/src/array.cc	(revision 3192)
+++ /orxonox/trunk/src/array.cc	(revision 3193)
@@ -68,6 +68,6 @@
   if (verbose >= 3)
     printf ("Finalizing array. Length: %i\n", entryCount);  
-  if ((array = (GLfloat*)malloc( entryCount* sizeof(GLfloat))) == NULL)
-  //  if ((array = new GLfloat [entryCount]) == NULL)
+  //  if ((array = (GLfloat*)malloc( entryCount* sizeof(GLfloat))) == NULL)
+  if ((array = new GLfloat [entryCount]) == NULL)
     printf ("could not allocate %i data Blocks\n", entryCount);
   Entry* walker = firstEntry;
Index: /orxonox/trunk/src/array.h
===================================================================
--- /orxonox/trunk/src/array.h	(revision 3192)
+++ /orxonox/trunk/src/array.h	(revision 3193)
@@ -31,15 +31,16 @@
   void debug(void);
  private:
+  //! One entry of the Array
   struct Entry
   {
-    GLfloat value;
-    Entry* next;
+    GLfloat value;  //!< The value of this Entry.
+    Entry* next;    //!< Pointer to the Next entry.
   };
 
-  GLfloat* array;
-  int entryCount;
-  bool finalized;
-  Entry* firstEntry;
-  Entry* currentEntry;
+  GLfloat* array;      //!< The array that will be produced when finalizing the Array.
+  int entryCount;      //!< The count of Entries in this Array.
+  bool finalized;      //!< If this variable is set to true, the Array can not be changed anymore. true if finalized, false else (initially).
+  Entry* firstEntry;   //!< Pointer to the first Entry of this Array
+  Entry* currentEntry; //!< Pointer to the current Entry of this Array. The one Entry we are working with.
   
   
Index: /orxonox/trunk/src/material.cc
===================================================================
--- /orxonox/trunk/src/material.cc	(revision 3192)
+++ /orxonox/trunk/src/material.cc	(revision 3193)
@@ -15,7 +15,4 @@
    TGA-code: borrowed from nehe-Tutorials
 
-   ToDo: 
-   - free SDL-surface when deleting Material.
-   - delete imgNameWithPath after use creation.
 */
 
@@ -31,5 +28,10 @@
 using namespace std;
 
-
+/**
+   \brief creates a ned PathList.
+   
+   It is a good idea to use this as an initial List,
+   because if you give on a name the Path will not be checked for its existence.
+*/
 PathList::PathList()
 {
@@ -37,4 +39,11 @@
   next = NULL;
 }
+
+/**
+   \brief Creates a new PathList with a Name.
+   \param pName the Name of The Path.
+
+   This function just adds the Path without checking if it exists.
+*/
 PathList::PathList(char* pName)
 {
@@ -44,4 +53,9 @@
 }
 
+/**
+   \brief destroys a PathList
+
+   It does this by deleting the Name and then delete its preceding PathList.
+*/
 PathList::~PathList()
 {
@@ -52,4 +66,11 @@
 }
 
+/**
+   \brief Adds a new Pathlist Element.
+   \param pName
+   
+   Adding a Path automatically checks if the Path exists,
+   and if it does not it will not add it to the List.
+*/
 void PathList::addPath (char* pName)
 {
@@ -476,4 +497,9 @@
 }
 
+/**
+   \brief Loads a Texture to the openGL-environment.
+   \param pImage The Image to load to openGL
+   \param texture The Texture to apply it to.
+*/
 bool Material::loadTexToGL (Image* pImage, GLuint* texture)
 {
Index: /orxonox/trunk/src/material.h
===================================================================
--- /orxonox/trunk/src/material.h	(revision 3192)
+++ /orxonox/trunk/src/material.h	(revision 3193)
@@ -2,8 +2,12 @@
   \file material.h
   \brief Contains the Material Class that handles Material for 3D-Objects.
+  \todo free SDL-surface when deleting Material.
+  \todo delete imgNameWithPath after use creation.
 */
 
 #ifndef _MATERIAL_H
 #define _MATERIAL_H
+
+
 
 extern int verbose; //!< will be obsolete soon.
@@ -29,4 +33,11 @@
 #endif /* HAVE_SDL_SDL_IMAGE_H */
 
+//! Class to handle lists of paths.
+/**
+   \todo Ability to return Paths by itself.
+
+   It is simple to use, and good, for all PathList you want.
+   just create a new Pathlist, and add Paths.
+*/
 class PathList
 {
@@ -37,6 +48,6 @@
   ~PathList();
   void addPath (char* pName);
-  char* pathName;
-  PathList* next;
+  char* pathName;          //!< The Name of the current Path.
+  PathList* next;          //!< Pointer to the next Pathlist.
 };
 
@@ -81,32 +92,33 @@
 
  private:
+  //! Struct to handle Infos about an Image
   struct Image
   {
-    int rowSpan;
-    GLuint width;
-    GLuint height;
-    GLuint bpp;
-    GLuint type;
-    GLubyte *data;
+    int rowSpan;    //!< The count of the rows this Image has.
+    GLuint width;   //!< The width of the Image.
+    GLuint height;  //!< The height of the Image.
+    GLuint bpp;     //!< BitsPerPixel
+    GLuint type;    //!< Type of the Image.
+    GLubyte *data;  //!< The Image Data comes here! DANGER: uncompressed data.
   };
 
 
-  char* name;
-  int illumModel;
-  float diffuse [4];
-  float ambient [4];
-  float specular [4];
-  float shininess;
-  float transparency;
+  char* name;        //!< The Name of the Material.
+  int illumModel;    //!< The IlluminationModel is either flat or smooth.
+  float diffuse [4]; //!< The diffuse color of the Material.
+  float ambient [4]; //!< The ambient color of the Material.
+  float specular [4];//!< The specular color of the Material.
+  float shininess;   //!< The shininess of the Material.
+  float transparency;//!< The transperency of the Material.
 
-  static PathList* pathList;
+  static PathList* pathList; //!< A pointer to the first element of Pathlist. This is static, because pathlists are global \todo copy this to the Globals.h or DataTank for deletion at the end.
   
-  GLuint diffuseTexture;
-  GLuint ambientTexture;
-  GLuint specularTexture;
+  GLuint diffuseTexture; //!< The diffuse texture of the Material.
+  GLuint ambientTexture; //!< The ambient texture of the Material.
+  GLuint specularTexture;//!< The specular texture of the Material.
   
-  bool diffuseTextureSet;
-  bool ambientTextureSet;
-  bool specularTextureSet;
+  bool diffuseTextureSet; //!< Chekcs if the diffuse texture is Set.
+  bool ambientTextureSet; //!< Chekcs if the ambient texture is Set.
+  bool specularTextureSet;//!< Chekcs if the specular texture is Set.
 
   Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
Index: /orxonox/trunk/src/object.cc
===================================================================
--- /orxonox/trunk/src/object.cc	(revision 3192)
+++ /orxonox/trunk/src/object.cc	(revision 3193)
@@ -20,6 +20,7 @@
 
 /**
-   \brief Creates a 3D-Object, but does not load any 3D-models
-   pretty useless
+   \brief Creates a 3D-Object, but does not load any 3D-models.
+
+   This Constructor is pretty useless, because why load no object in an object-loader??
 */
 Object::Object ()
@@ -36,5 +37,5 @@
 
 /**
-   \brief Crates a 3D-Object and loads in a File
+   \brief Crates a 3D-Object and loads in a File.
    \param fileName file to parse and load (must be a .obj file)
 */
@@ -68,5 +69,7 @@
 
 /**
-   \brief deletes an Object
+   \brief deletes an Object.
+
+   Looks if any from object allocated space is still in use, and if so deleted it.
 */
 Object::~Object()
@@ -117,6 +120,7 @@
 /**
    \brief Draws the Object number groupNumber
+   \param groupNumber The number of the group that will be displayed.
+
    It does this by just calling the List that must have been created earlier.
-   \param groupNumber The number of the group that will be displayed.
 */
 void Object::draw (int groupNumber) const 
@@ -152,6 +156,7 @@
 /**
    \brief Draws the Object with a specific groupName
+   \param groupName The name of the group that will be displayed.
+
    It does this by just calling the List that must have been created earlier.
-   \param groupName The name of the group that will be displayed.
 */
 void Object::draw (char* groupName) const
@@ -185,6 +190,8 @@
 
 /**
-    \brief initializes the Object
-    This Function initializes all the needed arrays, Lists and clientStates
+    \brief initializes the Object.
+
+    This Function initializes all the needed arrays, Lists and clientStates.
+    It also defines default values.
 */
 bool Object::initialize (void)
@@ -214,4 +221,7 @@
 /**
    \brief initializes a new Group object
+   \param group the group that should be initialized.
+   \todo Maybe Group should be a Class, because it does a lot of stuff
+   
 */
 bool Object::initGroup(Group* group)
@@ -231,4 +241,5 @@
 /**
    \brief initializes a new Face. (sets default Values)
+   \param face The face to initialize
 */
 bool Object::initFace (Face* face)
@@ -285,6 +296,6 @@
 
 /**
-   \brief Cleans up all Faces starting from face.
-   \param face the first face to clean
+   \brief Cleans up all Faces starting from face until NULL is reached.
+   \param face the first face to clean.
 */
 bool Object::cleanupFace (Face* face)
@@ -386,4 +397,5 @@
       BoxObject();
       delete []fileName;
+      OBJ_FILE->close();
       return false;
     }
@@ -450,7 +462,8 @@
 /**
    \brief parses a group String
+   \param groupString the new Group to create
+
    This function initializes a new Group. 
    With it you should be able to import .obj-files with more than one Objects inside. 
-   \param groupString the new Group to create
 */
 bool Object::readGroup (char* groupString)
@@ -476,6 +489,7 @@
 /**
    \brief parses a vertex-String
+   \param vertexString The String that will be parsed.
+
    If a vertex line is found this function will inject it into the vertex-Array
-   \param vertexString The String that will be parsed.
 */
 bool Object::readVertex (char* vertexString)
@@ -493,7 +507,8 @@
 /**
    \brief parses a face-string
+   \param faceString The String that will be parsed.
+
    If a face line is found this function will add it to the glList.
    The function makes a difference between QUADS and TRIANGLES, and will if changed re-open, set and re-close the gl-processe.
-   \param faceString The String that will be parsed.
 */
 bool Object::readFace (char* faceString)
@@ -556,6 +571,7 @@
 /**
    \brief parses a vertexNormal-String
+   \param normalString The String that will be parsed.
+
    If a vertexNormal line is found this function will inject it into the vertexNormal-Array
-   \param normalString The String that will be parsed.
 */
 bool Object::readVertexNormal (char* normalString)
@@ -573,6 +589,8 @@
 /**
    \brief parses a vertexTextureCoordinate-String
-   If a vertexTextureCoordinate line is found this function will inject it into the vertexTexture-Array
    \param vTextureString The String that will be parsed.
+
+   If a vertexTextureCoordinate line is found,
+   this function will inject it into the vertexTexture-Array
 */
 bool Object::readVertexTexture (char* vTextureString)
@@ -590,6 +608,10 @@
 /** 
     \brief Function to read in a mtl File.
-    this Function parses all Lines of an mtl File
     \param mtlFile The .mtl file to read
+
+    This Function parses all Lines of an mtl File.
+    The reason for it not to be in the materials-class is,
+    that a material does not have to be able to read itself in from a File.
+
 */
 bool Object::readMtlLib (char* mtlFile)
@@ -611,4 +633,5 @@
 	printf ("unable to open file: %s\n", fileName);
       delete []fileName;
+      MTL_FILE->close();
       return false;
     }
@@ -809,4 +832,6 @@
 /**
    \brief Adds a Face-element (one vertex of a face) with all its information. 
+   \param elem The FaceElement to add to the OpenGL-environment.
+
    It does this by searching:
    1. The Vertex itself
@@ -814,5 +839,4 @@
    3. The VertexTextureCoordinate
    merging this information, the face will be drawn.
-
 */
 bool Object::addGLElement (FaceElement* elem)
@@ -832,4 +856,5 @@
 /**
    \brief A routine that is able to create normals.
+
    The algorithm does the following:
    1. It calculates creates Vectors for each normale, and sets them to zero.
@@ -912,56 +937,57 @@
 /**
    \brief Includes a default object
+
    This will inject a Cube, because this is the most basic object.
 */
 void Object::BoxObject(void)
 {
-  readVertex ("-0.500000 -0.500000 0.500000");
-  readVertex ("0.500000 -0.500000 0.500000");
-  readVertex ("-0.500000 0.500000 0.500000");
-  readVertex ("0.500000 0.500000 0.500000");
-  readVertex ("-0.500000 0.500000 -0.500000");
-  readVertex ("0.500000 0.500000 -0.500000");
-  readVertex ("-0.500000 -0.500000 -0.500000");
-  readVertex ("0.500000 -0.500000 -0.500000");
-
-  readVertexTexture ("0.000000 0.000000");
-  readVertexTexture ("1.000000 0.000000");
-  readVertexTexture ("0.000000 1.000000");
-  readVertexTexture ("1.000000 1.000000");
-  readVertexTexture ("0.000000 2.000000");
-  readVertexTexture ("1.000000 2.000000");
-  readVertexTexture ("0.000000 3.000000");
-  readVertexTexture ("1.000000 3.000000");
-  readVertexTexture ("0.000000 4.000000");
-  readVertexTexture ("1.000000 4.000000");
-  readVertexTexture ("2.000000 0.000000");
-  readVertexTexture ("2.000000 1.000000");
-  readVertexTexture ("-1.000000 0.000000");
-  readVertexTexture ("-1.000000 1.000000");
-
-  readVertexNormal ("0.000000 0.000000 1.000000");
-  readVertexNormal ("0.000000 0.000000 1.000000");
-  readVertexNormal ("0.000000 0.000000 1.000000");
-  readVertexNormal ("0.000000 0.000000 1.000000");
-  readVertexNormal ("0.000000 1.000000 0.000000");
-  readVertexNormal ("0.000000 1.000000 0.000000");
-  readVertexNormal ("0.000000 1.000000 0.000000");
-  readVertexNormal ("0.000000 1.000000 0.000000");
-  readVertexNormal ("0.000000 0.000000 -1.000000");
-  readVertexNormal ("0.000000 0.000000 -1.000000");
-  readVertexNormal ("0.000000 0.000000 -1.000000");
-  readVertexNormal ("0.000000 0.000000 -1.000000");
-  readVertexNormal ("0.000000 -1.000000 0.000000");
-  readVertexNormal ("0.000000 -1.000000 0.000000");
-  readVertexNormal ("0.000000 -1.000000 0.000000");
-  readVertexNormal ("0.000000 -1.000000 0.000000");
-  readVertexNormal ("1.000000 0.000000 0.000000");
-  readVertexNormal ("1.000000 0.000000 0.000000");
-  readVertexNormal ("1.000000 0.000000 0.000000");
-  readVertexNormal ("1.000000 0.000000 0.000000");
-  readVertexNormal ("-1.000000 0.000000 0.000000");
-  readVertexNormal ("-1.000000 0.000000 0.000000");
-  readVertexNormal ("-1.000000 0.000000 0.000000");
-  readVertexNormal ("-1.000000 0.000000 0.000000");
+  readVertex ("-0.5 -0.5 0.5");
+  readVertex ("0.5 -0.5 0.5");
+  readVertex ("-0.5 0.5 0.5");
+  readVertex ("0.5 0.5 0.5");
+  readVertex ("-0.5 0.5 -0.5");
+  readVertex ("0.5 0.5 -0.5");
+  readVertex ("-0.5 -0.5 -0.5");
+  readVertex ("0.5 -0.5 -0.5");
+
+  readVertexTexture ("0.0 0.0");
+  readVertexTexture ("1.0 0.0");
+  readVertexTexture ("0.0 1.0");
+  readVertexTexture ("1.0 1.0");
+  readVertexTexture ("0.0 2.0");
+  readVertexTexture ("1.0 2.0");
+  readVertexTexture ("0.0 3.0");
+  readVertexTexture ("1.0 3.0");
+  readVertexTexture ("0.0 4.0");
+  readVertexTexture ("1.0 4.0");
+  readVertexTexture ("2.0 0.0");
+  readVertexTexture ("2.0 1.0");
+  readVertexTexture ("-1.0 0.0");
+  readVertexTexture ("-1.0 1.0");
+
+  readVertexNormal ("0.0 0.0 1.0");
+  readVertexNormal ("0.0 0.0 1.0");
+  readVertexNormal ("0.0 0.0 1.0");
+  readVertexNormal ("0.0 0.0 1.0");
+  readVertexNormal ("0.0 1.0 0.0");
+  readVertexNormal ("0.0 1.0 0.0");
+  readVertexNormal ("0.0 1.0 0.0");
+  readVertexNormal ("0.0 1.0 0.0");
+  readVertexNormal ("0.0 0.0 -1.0");
+  readVertexNormal ("0.0 0.0 -1.0");
+  readVertexNormal ("0.0 0.0 -1.0");
+  readVertexNormal ("0.0 0.0 -1.0");
+  readVertexNormal ("0.0 -1.0 0.0");
+  readVertexNormal ("0.0 -1.0 0.0");
+  readVertexNormal ("0.0 -1.0 0.0");
+  readVertexNormal ("0.0 -1.0 0.0");
+  readVertexNormal ("1.0 0.0 0.0");
+  readVertexNormal ("1.0 0.0 0.0");
+  readVertexNormal ("1.0 0.0 0.0");
+  readVertexNormal ("1.0 0.0 0.0");
+  readVertexNormal ("-1.0 0.0 0.0");
+  readVertexNormal ("-1.0 0.0 0.0");
+  readVertexNormal ("-1.0 0.0 0.0");
+  readVertexNormal ("-1.0 0.0 0.0");
 
   /* normaleLess-testingMode
Index: /orxonox/trunk/src/object.h
===================================================================
--- /orxonox/trunk/src/object.h	(revision 3192)
+++ /orxonox/trunk/src/object.h	(revision 3193)
@@ -35,55 +35,62 @@
 
  private:
-  struct FaceElement
+  //! This is the placeholder of one Vertex beloning to a Face.
+  struct FaceElement 
   {
-    int vertexNumber;
-    int normalNumber;
-    int texCoordNumber;
-    FaceElement* next;
+    int vertexNumber;    //!< The number of the Vertex out of the Array* vertices, this vertex points to.
+    int normalNumber;    //!< The number of the Normal out of the Array* normals, this vertex points to.
+    int texCoordNumber;  //!< The number of the textureCoordinate out of the Array* vTexture, this vertex points to.
+    FaceElement* next;   //!< Point to the next FaceElement in this List.
   };
 
-  //! Face
-  struct Face
+  //! This is the placeholder of a Face belonging to a Group of Faces.
+  /**
+     \todo take Material to a call for itself.
+
+     This can also be a Material-Change switch. 
+     That means if you want to change a Material inside of a group,
+     you can create an empty face and apply a material to it, and the Importer will cahnge Colors
+  */
+  struct Face 
   {
-    int vertexCount;
-    FaceElement* firstElem;
+    int vertexCount;        //!< The Count of vertices this Face has.
+    FaceElement* firstElem; //!< Points to the first Vertex (FaceElement) of this Face.
 
-    char* materialString;
+    char* materialString;   //!< The Name of the Material to which to Change.
 
-    Face* next;
-  };
+    Face* next;             //!< Pointer to the next Face.
+  }; 
 
-  //! Group to handle multiple Objects per obj-file
+  //! Group to handle multiple Objects per obj-file.
   struct Group
   {
-    char* name;
+    char* name;         //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function.
 
-    GLuint listNumber;
-    Face* firstFace;
-    Face* currentFace;
-    int faceMode;
-    int faceCount;
+    GLuint listNumber;  //!< The number of the GL-List this Group gets.
+    Face* firstFace;    //!< The first Face in this group.
+    Face* currentFace;  //!< The current Face in this Group (the one we are currently working with.)
+    int faceMode;       //!< The Mode the Face is in: initially -1, 0 for FaceList opened, 1 for Material,  3 for triangle, 4 for Quad, 5+ for Poly \todo ENUM...
+    int faceCount;      //!< The Number of Faces this Group holds.
 
-    Group* next;
+    Group* next;        //!< Pointer to the next Group.
   };
 
 
-  Array* vertices;
-  int verticesCount;
-  Array* colors;
-  Array* normals;
-  Array* vTexture;
+  Array* vertices;      //!< The Array that handles the Vertices.
+  int verticesCount;    //!< A global Counter for vertices.
+  Array* normals;       //!< The Array that handles the Normals.
+  Array* vTexture;      //!< The Array that handles the VertexTextureCoordinates.
 
   
-  Group* firstGroup; //!< the first of all groups.
-  Group* currentGroup; //!< the currentGroup. this is the one we will work with.
-  int groupCount;
+  Group* firstGroup;    //!< The first of all groups.
+  Group* currentGroup;  //!< The currentGroup. this is the one we will work with.
+  int groupCount;       //!< The Count of Groups.
 
-  Material* material;
-  float scaleFactor;
+  Material* material;   //!< Initial pointer to the Material. This can hold many materials, because Material can be added with Material::addMaterial(..)
+  float scaleFactor;    //!< The Factor with which the Object hould be scaled. \todo maybe one wants to scale the Object after Initialisation
 
-  char* objPath;
-  char* objFileName;
-  char* mtlFileName;
+  char* objPath;        //!< The Path wher the obj and mtl-file are located.
+  char* objFileName;    //!< The Name of the obj-file.
+  char* mtlFileName;    //!< The Name of the mtl-file (parsed out of the obj-file)
 
   bool initialize (void);
Index: /orxonox/trunk/src/stdincl.h
===================================================================
--- /orxonox/trunk/src/stdincl.h	(revision 3192)
+++ /orxonox/trunk/src/stdincl.h	(revision 3193)
@@ -1,7 +1,13 @@
+/*!
+  \file stdincl.h
+  \brief This file includes default headers that nearly every Class needs.
+  
+  no Class is defined here, but many headers to classes, and more general Headers like the openGL-header.
+*/
 
 #ifndef STDINCL_H
 #define STDINCL_H
 
-#define null 0
+#define null 0   //!< null
 
 #ifdef __WIN32__
