Index: orxonox/trunk/src/lib/graphics/importer/material.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 4582)
+++ orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 4584)
@@ -1,3 +1,3 @@
-/* 
+/*
    orxonox - the future of 3D-vertical-scrollers
 
@@ -36,6 +36,5 @@
 Material::Material (const char* mtlName)
 {
-   PRINTF(4)("initializing new Material.\n");
-  this->name = NULL;
+  PRINTF(4)("initializing new Material.\n");
   this->setIllum(3);
   this->setDiffuse(0,0,0);
@@ -52,12 +51,10 @@
 }
 
-/** 
+/**
     \brief deletes a Material
 */
 Material::~Material()
 {
-  PRINTF(4)("delete Material %s.\n", this->name);
-  if (this->name)
-    delete []this->name;
+  PRINTF(4)("delete Material %s.\n", this->getName());
   if (this->diffuseTexture)
     ResourceManager::getInstance()->unload(this->diffuseTexture);
@@ -81,5 +78,5 @@
   // setting up Shininess
   glMaterialf(GL_FRONT, GL_SHININESS, this->shininess);
-  
+
   // setting the transparency
   if (this->transparency < 1.0)
@@ -96,5 +93,5 @@
 
 
-  // setting illumination Model 
+  // setting illumination Model
   if (this->illumModel == 1) //! \todo make this work, if no vertex-normals are read.
     glShadeModel(GL_FLAT);
@@ -109,8 +106,8 @@
       /* This allows alpha blending of 2D textures with the scene */
       if (this->diffuseTexture->hasAlpha())
-	{
-	  glEnable(GL_BLEND);
-	  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-	}
+        {
+          glEnable(GL_BLEND);
+          glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+        }
     }
   else
@@ -122,42 +119,14 @@
 
 /**
-   \brief Set the Name of the Material. (Important for searching)
-   \param mtlName the Name of the Material to be set.
-*/ 
-void Material::setName (const char* mtlName)
-{
-  if (this->name)
-    delete this->name;
-  if (mtlName)
-    {
-      this->name = new char [strlen(mtlName)+1];
-      strcpy(this->name, mtlName);
-    }
-  else
-    {
-      this->name = new char[2];
-      strcpy(this->name, "");
-    }
-}
-
-/**
-   \returns The Name of The Material
-*/
-char* Material::getName (void)
-{
-  return this->name;
-}
-
-/**
-   \brief Sets the Material Illumination Model. 
+   \brief Sets the Material Illumination Model.
    \brief illu illumination Model in int form
 */
 void Material::setIllum (int illum)
 {
-  PRINTF(4)("setting illumModel of Material %s to %i\n", this->name, illum);
+  PRINTF(4)("setting illumModel of Material %s to %i\n", this->getName(), illum);
   this->illumModel = illum;
 }
 /**
-   \brief Sets the Material Illumination Model. 
+   \brief Sets the Material Illumination Model.
    \brief illu illumination Model in char* form
 */void Material::setIllum (char* illum)
@@ -174,8 +143,8 @@
 void Material::setDiffuse (float r, float g, float b)
 {
-  PRINTF(4)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  PRINTF(4)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->getName(), r, g, b);
   this->diffuse[0] = r;
   this->diffuse[1] = g;
-  this->diffuse[2] = b;  
+  this->diffuse[2] = b;
   this->diffuse[3] = 1.0;
 
@@ -193,5 +162,5 @@
 
 /**
-   \brief Sets the Material Ambient Color. 
+   \brief Sets the Material Ambient Color.
    \param r Red Color Channel.
    \param g Green Color Channel.
@@ -200,5 +169,5 @@
 void Material::setAmbient (float r, float g, float b)
 {
-  PRINTF(4)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  PRINTF(4)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->getName(), r, g, b);
   this->ambient[0] = r;
   this->ambient[1] = g;
@@ -218,5 +187,5 @@
 
 /**
-   \brief Sets the Material Specular Color. 
+   \brief Sets the Material Specular Color.
    \param r Red Color Channel.
    \param g Green Color Channel.
@@ -225,5 +194,5 @@
 void Material::setSpecular (float r, float g, float b)
 {
-  PRINTF(4)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  PRINTF(4)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->getName(), r, g, b);
   this->specular[0] = r;
   this->specular[1] = g;
@@ -265,5 +234,5 @@
 void Material::setTransparency (float trans)
 {
-  PRINTF(4)("setting Transparency of Material %s to %f.\n", this->name, trans);
+  PRINTF(4)("setting Transparency of Material %s to %f.\n", this->getName(), trans);
   this->transparency = trans;
 }
Index: orxonox/trunk/src/lib/graphics/importer/material.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/material.h	(revision 4582)
+++ orxonox/trunk/src/lib/graphics/importer/material.h	(revision 4584)
@@ -8,8 +8,8 @@
 #ifndef _MATERIAL_H
 #define _MATERIAL_H
+#include "base_object.h"
 
-
-#if HAVE_CONFIG_H 
-#include <config.h> 
+#if HAVE_CONFIG_H
+#include <config.h>
 #endif /* HAVE_CONFIG_H */
 
@@ -22,5 +22,5 @@
 
 //! Class to handle Materials.
-class Material
+class Material : public BaseObject
 {
  public:
@@ -30,6 +30,4 @@
   bool select (void);
 
-  void setName (const char* mtlName);
-  char* getName (void);
   void setIllum (int illum);
   void setIllum (char* illum);
@@ -54,5 +52,4 @@
 
  private:
-  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.
