Index: /trunk/src/lib/graphics/importer/material.cc
===================================================================
--- /trunk/src/lib/graphics/importer/material.cc	(revision 5305)
+++ /trunk/src/lib/graphics/importer/material.cc	(revision 5306)
@@ -31,7 +31,7 @@
 
 /**
- *  creates a Material.
+ * creates a Material.
  * @param mtlName Name of the Material to be added to the Material List
-*/
+ */
 Material::Material (const char* mtlName)
 {
@@ -105,5 +105,5 @@
     glShadeModel(GL_SMOOTH);
 
-  if (this->diffuseTexture)
+  if (this->diffuseTexture != NULL)
     {
       glEnable(GL_TEXTURE_2D);
Index: /trunk/src/lib/graphics/importer/texture.cc
===================================================================
--- /trunk/src/lib/graphics/importer/texture.cc	(revision 5305)
+++ /trunk/src/lib/graphics/importer/texture.cc	(revision 5306)
@@ -33,4 +33,5 @@
 {
   this->setClassID(CL_TEXTURE, "Texture");
+  this->setName(imageName);
 
   this->bAlpha = false;
Index: /trunk/src/lib/graphics/text_engine.cc
===================================================================
--- /trunk/src/lib/graphics/text_engine.cc	(revision 5305)
+++ /trunk/src/lib/graphics/text_engine.cc	(revision 5306)
@@ -42,18 +42,55 @@
 /// TEXT ///
 ////////////
+
+/**
+ *  creates a new Text Element
+ * @param fontFile the Font to render this text in
+ * @param type The renderType to display this font in
+ */
+Text::Text(const char* fontFile, unsigned int fontSize, TEXT_RENDER_TYPE type)
+{
+  this->init();
+
+  if (fontFile != NULL)
+    this->setFont(fontFile, fontSize);
+  this->setType(type);
+}
+
 /**
  *  creates a new Text Element
  * @param font the Font to render this text in
  * @param type The renderType to display this font in
-
-   this constructor is private, because the user should initialize
-   a text with the TextEngine.
-*/
+ *
+ * this constructor is private, because the user should initialize
+ * a text with the TextEngine.
+ */
 Text::Text(Font* font, TEXT_RENDER_TYPE type)
 {
+  this->init();
+
+  this->font = font;
+  this->setType(type);
+}
+
+/**
+ *  deletes a Text out of memory
+ *
+ * This also ereases the text from the textList of the TextEngine
+*/
+Text::~Text()
+{
+  if (this->font != NULL)
+    ResourceManager::getInstance()->unload(this->font);
+
+  if (this->text)
+    delete[] this->text;
+}
+
+void Text::init()
+{
   this->setClassID(CL_TEXT, "Text");
 
   // initialize this Text
-  this->font = font;
+  this->font = NULL;
   this->text = NULL;
   this->externText = NULL;
@@ -62,21 +99,7 @@
   this->blending = TEXT_DEFAULT_BLENDING;
   this->color = TEXT_DEFAULT_COLOR;
-  this->setType(type);
+  this->setType(TEXT_RENDER_DYNAMIC);
 
   this->setText(NULL);
-}
-
-/**
- *  deletes a Text out of memory
- *
- * This also ereases the text from the textList of the TextEngine
-*/
-Text::~Text()
-{
-  if (this->font != NULL)
-    ResourceManager::getInstance()->unload(this->font);
-
-  if (this->text)
-    delete[] this->text;
 }
 
Index: /trunk/src/lib/graphics/text_engine.h
===================================================================
--- /trunk/src/lib/graphics/text_engine.h	(revision 5305)
+++ /trunk/src/lib/graphics/text_engine.h	(revision 5306)
@@ -105,9 +105,11 @@
 class Text : public Element2D
 {
+  friend class TextEngine;
  public:
-   Text(Font* font = NULL, TEXT_RENDER_TYPE type = TEXT_RENDER_DYNAMIC);
+   Text(const char* fontFile, unsigned int fontSize = FONT_DEFAULT_SIZE, TEXT_RENDER_TYPE type = TEXT_RENDER_DYNAMIC);
   ~Text();
 
-  void setFont(Font* font);
+  void init();
+
   void setFont(const char* fontFile, unsigned int fontSize);
   void setType(TEXT_RENDER_TYPE type);
@@ -128,6 +130,9 @@
 
  private:
-  static GLuint loadTexture(SDL_Surface* surface, TexCoord* texCoord);
-  static int powerOfTwo(int input);
+   Text(Font* font = NULL, TEXT_RENDER_TYPE type = TEXT_RENDER_DYNAMIC);
+   void setFont(Font* font);
+
+   static GLuint loadTexture(SDL_Surface* surface, TexCoord* texCoord);
+   static int powerOfTwo(int input);
 
  private:
Index: /trunk/src/lib/shell/shell_input.cc
===================================================================
--- /trunk/src/lib/shell/shell_input.cc	(revision 5305)
+++ /trunk/src/lib/shell/shell_input.cc	(revision 5306)
@@ -41,5 +41,5 @@
  * this also generates a ShellCompletion automatically.
 */
-ShellInput::ShellInput ()
+ShellInput::ShellInput () : Text ((const char*)NULL)
 {
   this->pressedKey = SDLK_FIRST;
Index: /trunk/src/util/resource_manager.cc
===================================================================
--- /trunk/src/util/resource_manager.cc	(revision 5305)
+++ /trunk/src/util/resource_manager.cc	(revision 5306)
@@ -236,5 +236,5 @@
  * loads resources
  * @param fileName: The fileName of the resource to load
- * @param type: The Type of Resource to load (\see ResourceType)
+ * @param type: The Type of Resource to load.
  * @param prio: The ResourcePriority of this resource (will only be increased)
  * @param param1: an additional option to parse (see the constuctors for more help)
@@ -247,8 +247,9 @@
 {
   // searching if the resource was loaded before.
-  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3);
-  if (tmpResource) // if the resource was loaded before.
+  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2, param3);
+  if (tmpResource != NULL) // if the resource was loaded before.
     {
       PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
+      printf("adding %s count: %d\n", tmpResource->pointer->getName(),  tmpResource->count);
       tmpResource->count++;
       if(tmpResource->prio < prio)
@@ -307,5 +308,5 @@
           if(ResourceManager::isFile(fullName))
             {
-              if (param1)
+              if (param1 != NULL)
                 {
                   tmpResource->skinFileName = new char[strlen((const char*)param1)+1];
@@ -321,11 +322,10 @@
         case TTF:
             if (param1)
-              tmpResource->ttfSize = *(int*)param1;
+              tmpResource->ttfSize = *(unsigned int*)param1;
             else
               tmpResource->ttfSize = FONT_DEFAULT_SIZE;
 
           if(isFile(fullName))
-            tmpResource->pointer = new Font(fullName,
-                                            tmpResource->ttfSize);
+            tmpResource->pointer = new Font(fullName, tmpResource->ttfSize);
           else
             PRINTF(2)("Sorry, %s does not exist. Not loading Font\n", fullName);
@@ -375,5 +375,5 @@
         default:
           tmpResource->pointer = NULL;
-          PRINTF(1)("No type found for %s.\n   !!This should not happen unless the Type is not supported yet.!!\n", tmpResource->name);
+          PRINTF(1)("No type found for %s.\n   !!This should not happen unless the Type is not supported yet. JUST DO IT!!\n", tmpResource->name);
           break;
         }
@@ -419,6 +419,10 @@
 bool ResourceManager::unload(Resource* resource, ResourcePriority prio)
 {
+  if (resource == NULL)
+    return false;
+  printf("removing %s count: %d\n", resource->pointer->getName(),  resource->count);
   if (resource->count > 0)
     resource->count--;
+
   if (resource->prio <= prio)
     {
@@ -538,5 +542,5 @@
                     match = true;
                 }
-              else if (!strcmp(enumRes->skinFileName, (const char*) param1))
+              else if (enumRes->skinFileName!= NULL && !strcmp(enumRes->skinFileName, (const char*) param1))
                 match = true;
               break;
@@ -549,5 +553,5 @@
                     subMatch = true;
                 }
-              else if (enumRes->ttfSize == *(int*)param1)
+              else if (enumRes->ttfSize == *(unsigned int*)param1)
                 subMatch = true;
               break;
@@ -793,32 +797,6 @@
     {
       PRINT(0)("-----------------------------------------\n");
-      PRINT(0)("Name: %s; References: %d; Type:", enumRes->name, enumRes->count);
-      switch (enumRes->type)
-        {
-#ifndef NO_MODEL
-          case OBJ:
-          PRINT(0)("ObjectModel\n");
-          break;
-        case PRIM:
-          PRINT(0)("PrimitiveModel\n");
-          break;
-#endif
-#ifndef NO_TEXTURES
-        case IMAGE:
-          PRINT(0)("ImageFile (Texture)\n");
-          break;
-#endif
-#ifndef NO_AUDIO
-        case WAV:
-          PRINT(0)("SoundFile\n");
-          break;
-        case OGG:
-          PRINT(0)("MusicFile\n");
-          break;
-#endif
-        default:
-          PRINT(0)("Do not know this format\n");
-          break;
-        }
+      PRINT(0)("Name: %s; References: %d; Type: %s ", enumRes->name, enumRes->count, ResourceManager::ResourceTypeToChar(enumRes->type));
+
       PRINT(0)("gets deleted at ");
       switch(enumRes->prio)
@@ -846,2 +824,47 @@
   PRINT(0)("==================================RM==\n");
 }
+
+
+/**
+ * converts a ResourceType into the corresponding String
+ * @param type the ResourceType to translate
+ * @returns the converted String.
+ */
+const char* ResourceManager::ResourceTypeToChar(ResourceType type)
+{
+  switch (type)
+  {
+#ifndef NO_MODEL
+    case OBJ:
+      return "ObjectModel";
+      break;
+    case PRIM:
+      return "PrimitiveModel";
+      break;
+    case MD2:
+      return "MD2-Data";
+      break;
+#endif
+#ifndef NO_TEXTURES
+    case IMAGE:
+      return "ImageFile (Texture)";
+      break;
+#endif
+#ifndef NO_AUDIO
+    case WAV:
+      return "SoundFile";
+      break;
+    case OGG:
+      return "MusicFile";
+      break;
+#endif
+#ifndef NO_TEXT
+    case TTF:
+      return "Font (TTF)";
+      break;
+#endif
+    default:
+      return "unknown Format";
+      break;
+  }
+}
Index: /trunk/src/util/resource_manager.h
===================================================================
--- /trunk/src/util/resource_manager.h	(revision 5305)
+++ /trunk/src/util/resource_manager.h	(revision 5306)
@@ -106,7 +106,7 @@
   bool addImageDir(const char* imageDir);
   BaseObject* load(const char* fileName, ResourcePriority prio = RP_NO,
-             void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+               void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
   BaseObject* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
-             void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+               void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
   bool unload(void* pointer, ResourcePriority prio = RP_NO);
   bool unload(Resource* resource, ResourcePriority = RP_NO);
@@ -123,4 +123,6 @@
   static char* homeDirCheck(const char* fileName);
   static char* getFullName(const char* fileName);
+
+  static const char* ResourceTypeToChar(ResourceType type);
 
  private:
