Index: orxonox/trunk/src/lib/util/list.h
===================================================================
--- orxonox/trunk/src/lib/util/list.h	(revision 3677)
+++ orxonox/trunk/src/lib/util/list.h	(revision 3790)
@@ -107,4 +107,5 @@
   void destroy();
   T* firstElement();
+  T* lastElement();
   bool isEmpty();
   int getSize();
@@ -217,4 +218,10 @@
 }
 
+template<class T>
+T* tList<T>::lastElement()
+{
+  return this->last->curr;
+}
+
 
 template<class T>
Index: orxonox/trunk/src/lib/util/resource_manager.cc
===================================================================
--- orxonox/trunk/src/lib/util/resource_manager.cc	(revision 3677)
+++ orxonox/trunk/src/lib/util/resource_manager.cc	(revision 3790)
@@ -22,4 +22,5 @@
 #include "primitive_model.h"
 #include "texture.h"
+#include "text_engine.h"
 
 #include "list.h"
@@ -141,5 +142,5 @@
    \returns a pointer to a desired Resource.
 */
-void* ResourceManager::load(const char* fileName, ResourcePriority prio)
+void* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
 {
   ResourceType tmpType;
@@ -158,8 +159,10 @@
            !strcmp(fileName, "cone"))
     tmpType = PRIM;
+  else if (!strncmp(fileName+(strlen(fileName)-4), ".ttf", 4))
+    tmpType = TTF;
   else 
     tmpType = IMAGE;
 
-  return this->load(fileName, tmpType, prio);
+  return this->load(fileName, tmpType, prio, param1, param2, param3);
 }
 
@@ -171,8 +174,8 @@
    \returns a pointer to a desired Resource.
 */
-void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio)
+void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio, void* param1, void* param2, void* param3)
 {
   // searching if the resource was loaded before.
-  Resource* tmpResource = this->locateResourceByName(fileName);
+  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3);
   if (tmpResource) // if the resource was not loaded before.
     {
@@ -201,23 +204,61 @@
 	{
 	case OBJ:
+	  if (param1)
+	    tmpResource->modelSize = *(float*)param1;
+	  else
+	    tmpResource->modelSize = 1.0;
+
 	  if(isFile(fullName))
-	    tmpResource->pointer = new OBJModel(fullName);
+	    tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
 	  else
 	    {
 	      PRINTF(2)("Sorry, %s does not exist. Loading a cube-Model instead\n", fullName);
-	      tmpResource->pointer = ResourceManager::load("cube", PRIM);
+	      tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
 	    }
 	  break;
 	case PRIM:
+	  if (param1)
+	    tmpResource->modelSize = *(float*)param1;
+	  else
+	    tmpResource->modelSize = 1.0;
+
 	  if (!strcmp(tmpResource->name, "cube"))
-	    tmpResource->pointer = new PrimitiveModel(CUBE);
+	    tmpResource->pointer = new PrimitiveModel(CUBE, tmpResource->modelSize);
 	  else if (!strcmp(tmpResource->name, "sphere"))
-	    tmpResource->pointer = new PrimitiveModel(SPHERE);
+	    tmpResource->pointer = new PrimitiveModel(SPHERE, tmpResource->modelSize);
 	  else if (!strcmp(tmpResource->name, "plane"))
-	    tmpResource->pointer = new PrimitiveModel(PLANE);
+	    tmpResource->pointer = new PrimitiveModel(PLANE, tmpResource->modelSize);
 	  else if (!strcmp(tmpResource->name, "cylinder"))
-	    tmpResource->pointer = new PrimitiveModel(CYLINDER);
+	    tmpResource->pointer = new PrimitiveModel(CYLINDER, tmpResource->modelSize);
 	  else if (!strcmp(tmpResource->name, "cone"))
-	    tmpResource->pointer = new PrimitiveModel(CONE);
+	    tmpResource->pointer = new PrimitiveModel(CONE, tmpResource->modelSize);
+	  break;
+	case TTF:
+	    if (param1)
+	      tmpResource->ttfSize = *(int*)param1;
+	    else
+	      tmpResource->ttfSize = FONT_DEFAULT_SIZE;
+	    if (param2)
+	      {
+		Vector* tmpVec = (Vector*)param2;
+		tmpResource->ttfColorR = (int)tmpVec->x;
+		tmpResource->ttfColorG = (int)tmpVec->y;
+		tmpResource->ttfColorB = (int)tmpVec->z;
+	      }
+	    else
+	      {
+		tmpResource->ttfColorR = FONT_DEFAULT_COLOR_R;
+		tmpResource->ttfColorG = FONT_DEFAULT_COLOR_G;
+		tmpResource->ttfColorB = FONT_DEFAULT_COLOR_B;
+	      }
+	    
+	  if(isFile(fullName))
+	    tmpResource->pointer = new Font(fullName,
+					    tmpResource->ttfSize,
+					    tmpResource->ttfColorR,
+					    tmpResource->ttfColorG,
+					    tmpResource->ttfColorB);
+	  else
+	    PRINTF(2)("Sorry, %s does not exist. Not loading Font\n", fullName);
 	  break;
 	case IMAGE:
@@ -259,6 +300,12 @@
       delete []fullName;
     }
-
-  return tmpResource->pointer;
+  if (tmpResource->pointer)
+    return tmpResource->pointer;
+  else 
+    {
+      PRINTF(2)("Resource %s could not be loaded\n", fileName);
+      delete tmpResource;
+      return NULL;
+    }
 }
 
@@ -299,4 +346,7 @@
 	    case IMAGE:
 	      delete (Texture*)resource->pointer;
+	      break;
+	    case TTF:
+	      delete (Font*)resource->pointer;
 	      break;
 	    default:
@@ -342,9 +392,9 @@
 
 /**
-   \brief Searches for a Resource by Name
+   \brief Searches for a Resource by some information
    \param fileName The name to look for
    \returns a Pointer to the Resource if found, NULL otherwise.
 */
-Resource* ResourceManager::locateResourceByName(const char* fileName)
+Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3)
 {
   //  Resource* enumRes = resourceList->enumerate();
@@ -353,8 +403,54 @@
   while (enumRes)
     {
-      if (!strcmp(fileName, enumRes->name))
-	{
-	  delete iterator;
-	  return enumRes;
+      if (enumRes->type == type && !strcmp(fileName, enumRes->name))
+	{
+	  bool match = false;
+	  bool subMatch = false;
+	  switch (type)
+	    {
+	    case PRIM:
+	    case OBJ:
+	      if (!param1)
+		{
+		  if (enumRes->modelSize == 1.0)
+		    match = true;
+		}
+	      else if (enumRes->modelSize == *(float*)param1)
+		match = true;
+	      break;
+	    case TTF:
+	      if (!param1)
+		{
+		  if (enumRes->ttfSize == FONT_DEFAULT_SIZE)
+		    subMatch = true;
+		}
+	      else if (enumRes->modelSize =- *(int*)param1)
+		subMatch = true;
+	      if(subMatch)
+		{
+		  Vector* tmpVec = (Vector*)param2;
+		  if (!param2)
+		    {
+		      if(enumRes->ttfColorR == FONT_DEFAULT_COLOR_R &&
+			 enumRes->ttfColorG == FONT_DEFAULT_COLOR_G &&
+			 enumRes->ttfColorB == FONT_DEFAULT_COLOR_B )
+			match = true;
+		    }
+		  else if (enumRes->ttfColorR == (int)tmpVec->x &&
+			   enumRes->ttfColorG == (int)tmpVec->y &&
+			   enumRes->ttfColorB == (int)tmpVec->z )
+		    match = true;
+		}
+
+	      break;
+	    default:
+	      match = true;
+	      break;
+	    }
+	  if (match)
+	    {
+	      delete iterator;
+	      return enumRes;
+	    }
 	}
       enumRes = iterator->nextElement();
@@ -396,5 +492,9 @@
   struct stat status;
   stat(directoryName, &status);
-  if (status.st_mode & (S_IFDIR | S_IFLNK))
+  if (status.st_mode & (S_IFDIR 
+#ifndef __WIN32__
+			| S_IFLNK
+#endif
+			))
     return true;
   else
@@ -411,5 +511,9 @@
   struct stat status;
   stat(fileName, &status);
-  if (status.st_mode & (S_IFREG | S_IFLNK))
+  if (status.st_mode & (S_IFREG 
+#ifndef __WIN32__
+			| S_IFLNK
+#endif
+			))
     return true;
   else
Index: orxonox/trunk/src/lib/util/resource_manager.h
===================================================================
--- orxonox/trunk/src/lib/util/resource_manager.h	(revision 3677)
+++ orxonox/trunk/src/lib/util/resource_manager.h	(revision 3790)
@@ -19,5 +19,5 @@
 
 //! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support
-enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, IMAGE};
+enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, TTF, IMAGE};
 //! An enumerator for different UNLOAD-types. 
 /**
@@ -33,9 +33,16 @@
 {
   void* pointer;             //!< Pointer to the Resource.
+  int count;                 //!< How many times this Resource has been loaded.
   
   char* name;                //!< Name of the Resource.
   ResourceType type;         //!< ResourceType of this Resource.
   ResourcePriority prio;     //!< The Priority of this resource. (This will only be increased)
-  int count;                 //!< How many times this Resource has been loaded.
+
+  // more specific
+  float modelSize;
+  unsigned int ttfSize;
+  unsigned char ttfColorR;
+  unsigned char ttfColorG;
+  unsigned char ttfColorB;
 };
 
@@ -49,4 +56,6 @@
 
    It does it by looking, if a desired file has already been loaded.
+
+   \todo loading also dependant by parameters.
 */
 class ResourceManager : public BaseObject 
@@ -58,6 +67,8 @@
   bool setDataDir(char* dataDir);
   bool addImageDir(char* imageDir);
-  void* load(const char* fileName, ResourcePriority prio = RP_NO);
-  void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO);
+  void* load(const char* fileName, ResourcePriority prio = RP_NO,
+	     void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+  void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
+	     void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
   bool unload(void* pointer, ResourcePriority prio = RP_NO);
   bool unload(Resource* resource, ResourcePriority = RP_NO);
@@ -74,5 +85,5 @@
 
 
-  Resource* locateResourceByName(const char* fileName);
+  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3);
   Resource* locateResourceByPointer(const void* pointer);
   
