Index: trunk/src/util/loading/resource_manager.cc
===================================================================
--- trunk/src/util/loading/resource_manager.cc	(revision 6642)
+++ trunk/src/util/loading/resource_manager.cc	(revision 6645)
@@ -230,10 +230,11 @@
  * @param fileName: The fileName of the resource to load
  * @param prio: The ResourcePriority of this resource (will only be increased)
+ * @param param0: an additional option to parse (see the constuctors for more help)
  * @param param1: an additional option to parse (see the constuctors for more help)
  * @param param2: an additional option to parse (see the constuctors for more help)
- * @param param3: an additional option to parse (see the constuctors for more help)
  * @returns a pointer to a desired Resource.
 */
-BaseObject* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
+BaseObject* ResourceManager::load(const char* fileName, ResourcePriority prio,
+                                   const MultiType& param0, const MultiType& param1, const MultiType& param2)
 {
   if (fileName == NULL)
@@ -290,5 +291,5 @@
 #endif /* NO_TEXTURES */
 #undef __IF_OK
-  return this->load(fileName, tmpType, prio, param1, param2, param3);
+  return this->load(fileName, tmpType, prio, param0, param1, param2);
 }
 
@@ -303,5 +304,5 @@
  */
 void ResourceManager::cache(const char* fileName, ResourceType type, ResourcePriority prio,
-             void* param1, void* param2, void* param3)
+                            const MultiType& param0, const MultiType& param1, const MultiType& param2)
 {
   assert(fileName != NULL);
@@ -310,8 +311,8 @@
   Resource* tmpResource;
   // check if we already loaded this Resource
-  tmpResource = this->locateResourceByInfo(fileName, type, param1, param2, param3);
+  tmpResource = this->locateResourceByInfo(fileName, type, param0, param1, param2);
   // otherwise load it
   if (tmpResource == NULL)
-    tmpResource = this->loadResource(fileName, type, prio, param1, param2, param3);
+    tmpResource = this->loadResource(fileName, type, prio, param0, param1, param2);
   // return cached pointer.
   if (tmpResource != NULL) // if the resource was loaded before.
@@ -326,11 +327,11 @@
  * @param type: The Type of Resource to load.
  * @param prio: The ResourcePriority of this resource (will only be increased)
+ * @param param0: an additional option to parse (see the constuctors for more help)
  * @param param1: an additional option to parse (see the constuctors for more help)
  * @param param2: an additional option to parse (see the constuctors for more help)
- * @param param3: an additional option to parse (see the constuctors for more help)
  * @returns a pointer to a desired Resource.
 */
 BaseObject* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio,
-                                  void* param1, void* param2, void* param3)
+                                  const MultiType& param0, const MultiType& param1, const MultiType& param2)
 {
   assert(fileName != NULL);
@@ -339,8 +340,8 @@
   Resource* tmpResource;
   // check if we already loaded this Resource
-  tmpResource = this->locateResourceByInfo(fileName, type, param1, param2, param3);
+  tmpResource = this->locateResourceByInfo(fileName, type, param0, param1, param2);
   // otherwise load it
   if (tmpResource == NULL)
-    tmpResource = this->loadResource(fileName, type, prio, param1, param2, param3);
+    tmpResource = this->loadResource(fileName, type, prio, param0, param1, param2);
   // return cached pointer.
   if (tmpResource != NULL) // if the resource was loaded before.
@@ -361,11 +362,11 @@
  * @param type: The Type of Resource to load.
  * @param prio: The ResourcePriority of this resource (will only be increased)
+ * @param param0: an additional option to parse (see the constuctors for more help)
  * @param param1: an additional option to parse (see the constuctors for more help)
  * @param param2: an additional option to parse (see the constuctors for more help)
- * @param param3: an additional option to parse (see the constuctors for more help)
  * @returns a pointer to a desired Resource.
  */
 Resource* ResourceManager::loadResource(const char* fileName, ResourceType type, ResourcePriority prio,
-    void* param1, void* param2, void* param3)
+                                        const MultiType& param0, const MultiType& param1, const MultiType& param2)
 {
   // Setting up the new Resource
@@ -385,45 +386,39 @@
 #ifndef NO_MODEL
   case OBJ:
-    if (param1)
-      tmpResource->modelSize = *(float*)param1;
-    else
-      tmpResource->modelSize = 1.0;
+    if (param0.getType() != MT_NULL)
+      tmpResource->param[0] = param0;
+    else
+      tmpResource->param[0] = 1.0f;
 
     if(ResourceManager::isFile(fullName))
-      tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
+      tmpResource->pointer = new OBJModel(fullName, tmpResource->param[0].getFloat());
     else
     {
       PRINTF(2)("File %s in %s does not exist. Loading a cube-Model instead\n", fileName, dataDir);
-      tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
+      tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, tmpResource->param[0].getFloat());
     }
     break;
   case PRIM:
-    if (param1)
-      tmpResource->modelSize = *(float*)param1;
-    else
-      tmpResource->modelSize = 1.0;
+    if (param0 != MT_NULL)
+      tmpResource->param[0] = param0;
+    else
+      tmpResource->param[0] = 1.0f;
 
     if (!strcmp(tmpResource->name, "cube"))
-      tmpResource->pointer = new PrimitiveModel(PRIM_CUBE, tmpResource->modelSize);
+      tmpResource->pointer = new PrimitiveModel(PRIM_CUBE, tmpResource->param[0].getFloat());
     else if (!strcmp(tmpResource->name, "sphere"))
-      tmpResource->pointer = new PrimitiveModel(PRIM_SPHERE, tmpResource->modelSize);
+      tmpResource->pointer = new PrimitiveModel(PRIM_SPHERE, tmpResource->param[0].getFloat());
     else if (!strcmp(tmpResource->name, "plane"))
-      tmpResource->pointer = new PrimitiveModel(PRIM_PLANE, tmpResource->modelSize);
+      tmpResource->pointer = new PrimitiveModel(PRIM_PLANE, tmpResource->param[0].getFloat());
     else if (!strcmp(tmpResource->name, "cylinder"))
-      tmpResource->pointer = new PrimitiveModel(PRIM_CYLINDER, tmpResource->modelSize);
+      tmpResource->pointer = new PrimitiveModel(PRIM_CYLINDER, tmpResource->param[0].getFloat());
     else if (!strcmp(tmpResource->name, "cone"))
-      tmpResource->pointer = new PrimitiveModel(PRIM_CONE, tmpResource->modelSize);
+      tmpResource->pointer = new PrimitiveModel(PRIM_CONE, tmpResource->param[0].getFloat());
     break;
   case MD2:
     if(ResourceManager::isFile(fullName))
     {
-      if (param1 != NULL)
-      {
-        tmpResource->secFileName = new char[strlen((const char*)param1)+1];
-        strcpy(tmpResource->secFileName, (const char*) param1);
-      }
-      else
-        tmpResource->secFileName = NULL;
-      tmpResource->pointer = new MD2Data(fullName, tmpResource->secFileName);
+      tmpResource->param[0] = param0;
+      tmpResource->pointer = new MD2Data(fullName, tmpResource->param[0].getString());
       //               tmpResource->pointer = new MD2Model(fullName, tmpResource->secFileName);
 
@@ -433,11 +428,14 @@
 #ifndef NO_TEXT
   case TTF:
-    if (param1 != NULL)
-      tmpResource->ttfSize = *(unsigned int*)param1;
-    else
-      tmpResource->ttfSize = FONT_DEFAULT_RENDER_SIZE;
+    if (param0 != MT_NULL)
+    {
+      assert(param0.getInt() >= 0);
+      tmpResource->param[0] = param0;
+    }
+    else
+      tmpResource->param[0] = FONT_DEFAULT_RENDER_SIZE;
 
     if(isFile(fullName))
-      tmpResource->pointer = new Font(fullName, tmpResource->ttfSize);
+      tmpResource->pointer = new Font(fullName, (unsigned int) tmpResource->param[0].getInt());
     else
       PRINTF(2)("%s does not exist in %s. Not loading Font\n", fileName, this->dataDir);
@@ -456,8 +454,8 @@
 #ifndef NO_TEXTURES
   case IMAGE:
-    if (param1 != NULL)
-      tmpResource->texTarget = *(GLenum*)param1;
-    else
-      tmpResource->texTarget = GL_TEXTURE_2D;
+    if (param0 != MT_NULL)
+      tmpResource->param[0] = param0;
+    else
+      tmpResource->param[0] = GL_TEXTURE_2D;
     if(isFile(fullName))
     {
@@ -475,5 +473,5 @@
         {
           PRINTF(4)("Image %s resides to %s\n", fileName, imgName);
-          tmpResource->pointer = new Texture(imgName, tmpResource->texTarget);
+          tmpResource->pointer = new Texture(imgName, tmpResource->param[0].getInt());
           delete[] imgName;
           break;
@@ -490,11 +488,11 @@
     if(ResourceManager::isFile(fullName))
     {
-      if (param1 != NULL)
+      if (param0 != MT_NULL)
       {
-        char* secFullName = ResourceManager::getFullName((const char*)param1);
+        MultiType param = param0; /// HACK
+        char* secFullName = ResourceManager::getFullName(param.getString());
         if (ResourceManager::isFile(secFullName))
         {
-          tmpResource->secFileName = new char[strlen((const char*)param1)+1];
-          strcpy(tmpResource->secFileName, (const char*) param1);
+          tmpResource->param[0] = secFullName;
           tmpResource->pointer = new Shader(fullName, secFullName);
         }
@@ -503,5 +501,5 @@
       else
       {
-        tmpResource->secFileName = NULL;
+        tmpResource->param[0] = param0;
         tmpResource->pointer = new Shader(fullName, NULL);
       }
@@ -659,11 +657,11 @@
  * @param fileName: The name to look for
  * @param type the Type of resource to locate.
+ * @param param0: an additional option to parse (see the constuctors for more help)
  * @param param1: an additional option to parse (see the constuctors for more help)
  * @param param2: an additional option to parse (see the constuctors for more help)
- * @param param3: an additional option to parse (see the constuctors for more help)
  * @returns a Pointer to the Resource if found, NULL otherwise.
 */
 Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type,
-    void* param1, void* param2, void* param3) const
+        const MultiType& param0, const MultiType& param1, const MultiType& param2) const
 {
   std::vector<Resource*>::const_iterator resource;
@@ -679,19 +677,19 @@
       case PRIM:
       case OBJ:
-        if (!param1)
+        if (param0 == MT_NULL)
         {
-          if ((*resource)->modelSize == 1.0)
+          if ((*resource)->param[0] == 1.0f)
             match = true;
         }
-        else if ((*resource)->modelSize == *(float*)param1)
+        else if ((*resource)->param[0] == param0)
           match = true;
         break;
       case MD2:
-        if (!param1)
+        if (param0 == MT_NULL)
         {
-          if ((*resource)->secFileName == NULL)
+          if ((*resource)->param[0] == "")
             match = true;
         }
-        else if (!strcmp((*resource)->secFileName, (const char*)param1))
+        else if ((*resource)->param[0] == param0)
           match = true;
         break;
@@ -699,10 +697,10 @@
 #ifndef NO_TEXT
       case TTF:
-        if (param1 == NULL)
+        if (param0 == MT_NULL)
         {
-          if ((*resource)->ttfSize == FONT_DEFAULT_RENDER_SIZE)
+          if ((*resource)->param[0] == FONT_DEFAULT_RENDER_SIZE)
             match = true;
         }
-        else if ((*resource)->ttfSize == *(unsigned int*)param1)
+        else if ((*resource)->param[0] == param0)
           match = true;
         break;
@@ -710,20 +708,20 @@
 #ifndef NO_SHADERS
       case SHADER:
-        if (!param1)
+        if (param0 == MT_NULL)
         {
-          if ((*resource)->secFileName == NULL)
+          if ((*resource)->param[0] == "")
             match = true;
         }
-        else if (!strcmp((*resource)->secFileName, (const char*)param1))
+        else if ((*resource)->param[0] == param0)
           match = true;
 #endif /* NO_SHADERS */
 #ifndef NO_TEXTURES
       case IMAGE:
-        if (!param1)
+        if (param0 == MT_NULL)
         {
-          if ((*resource)->texTarget == GL_TEXTURE_2D)
+          if ((*resource)->param[0] == GL_TEXTURE_2D)
             match = true;
         }
-        else if ((*resource)->texTarget ==  *(GLenum*)param1)
+        else if ((*resource)->param[0] ==  param0)
           match = true;
 #endif /* NO_TEXTURES */
Index: trunk/src/util/loading/resource_manager.h
===================================================================
--- trunk/src/util/loading/resource_manager.h	(revision 6642)
+++ trunk/src/util/loading/resource_manager.h	(revision 6645)
@@ -21,5 +21,5 @@
 
 #include "base_object.h"
-
+#include "multi_type.h"
 
 #include <vector>
@@ -74,17 +74,5 @@
   ResourcePriority  prio;              //!< The Priority of this resource. (This will only be increased)
 
-  // more specific
-  union {
-#ifndef NO_MODEL
-  float             modelSize;         //!< the size of the model (OBJ/PRIM)
-  char*             secFileName;       //!< a seconf fileName
-#endif /* NO_MODEL */
-#ifndef NO_TEXT
-  unsigned int      ttfSize;           //!< the size of the ttf-font (TTF)
-#endif /* NO_TEXT */
-#ifndef NO_TEXTURES
-  GLenum            texTarget;
-#endif /* NO_TEXTURES */
-  };
+  MultiType         param[3];          //!< The Parameters given to this Resource.
 };
 
@@ -117,15 +105,16 @@
 
   void cache(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
-             void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+             const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType());
 
   BaseObject* load(const char* fileName, ResourcePriority prio = RP_NO,
-               void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+                   const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType());
   BaseObject* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
-               void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+                   const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType());
   bool unload(void* pointer, ResourcePriority prio = RP_NO);
   bool unload(Resource* resource, ResourcePriority = RP_NO);
   bool unloadAllByPriority(ResourcePriority prio);
 
-  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3) const;
+  Resource* locateResourceByInfo(const char* fileName, ResourceType type,
+                                 const MultiType& param0 = MultiType(), const MultiType& param1 = MultiType(), const MultiType& param2 = MultiType()) const;
   Resource* locateResourceByPointer(const void* pointer) const;
 
@@ -148,5 +137,5 @@
   ResourceManager();
   Resource* loadResource(const char* fileName, ResourceType type, ResourcePriority prio,
-                     void* param1, void* param2, void* param3);
+                         const MultiType& param0, const MultiType& param1, const MultiType& param2);
 
  private:
