Index: trunk/src/util/resource_manager.cc
===================================================================
--- trunk/src/util/resource_manager.cc	(revision 5308)
+++ trunk/src/util/resource_manager.cc	(revision 5323)
@@ -36,4 +36,7 @@
 #include "ogg_player.h"
 #endif /* NO_AUDIO */
+#ifndef NO_SHADERS
+#include "shader.h"
+#endif /* NO_SHADERS */
 
 #include "list.h"
@@ -190,13 +193,13 @@
 #ifndef NO_MODEL
 #define __IF_OK
-  if (!strncmp(fileName+(strlen(fileName)-4), ".obj", 4))
+  if (!strncasecmp(fileName+(strlen(fileName)-4), ".obj", 4))
     tmpType = OBJ;
   else if (!strncmp(fileName+(strlen(fileName)-4), ".md2", 4))
     tmpType = MD2;
-  else if (!strcmp(fileName, "cube") ||
-           !strcmp(fileName, "sphere") ||
-           !strcmp(fileName, "plane") ||
-           !strcmp(fileName, "cylinder") ||
-           !strcmp(fileName, "cone"))
+  else if (!strcasecmp(fileName, "cube") ||
+           !strcasecmp(fileName, "sphere") ||
+           !strcasecmp(fileName, "plane") ||
+           !strcasecmp(fileName, "cylinder") ||
+           !strcasecmp(fileName, "cone"))
     tmpType = PRIM;
 #endif /* NO_MODEL */
@@ -206,9 +209,9 @@
 #endif
 #define __IF_OK
-  if (!strncmp(fileName+(strlen(fileName)-4), ".wav", 4))
+  if (!strncasecmp(fileName+(strlen(fileName)-4), ".wav", 4))
     tmpType = WAV;
-  else if (!strncmp(fileName+(strlen(fileName)-4), ".mp3", 4))
+  else if (!strncasecmp(fileName+(strlen(fileName)-4), ".mp3", 4))
     tmpType = MP3;
-  else if (!strncmp(fileName+(strlen(fileName)-4), ".ogg", 4))
+  else if (!strncasecmp(fileName+(strlen(fileName)-4), ".ogg", 4))
     tmpType = OGG;
 #endif /* NO_AUDIO */
@@ -218,7 +221,15 @@
 #endif
 #define __IF_OK
- if (!strncmp(fileName+(strlen(fileName)-4), ".ttf", 4))
+ if (!strncasecmp(fileName+(strlen(fileName)-4), ".ttf", 4))
     tmpType = TTF;
 #endif /* NO_TEXT */
+#ifndef NO_SHADERS
+#ifdef __IF_OK
+  else
+#endif
+#define __IF_OK
+ if (!strncasecmp(fileName+(strlen(fileName)-5), ".vert", 5))
+    tmpType = SHADER;
+#endif /* NO_SHADERS */
 #ifndef NO_TEXTURES
 #ifdef __IF_OK
@@ -308,10 +319,10 @@
               if (param1 != NULL)
                 {
-                  tmpResource->skinFileName = new char[strlen((const char*)param1)+1];
-                  strcpy(tmpResource->skinFileName, (const char*) param1);
+                  tmpResource->secFileName = new char[strlen((const char*)param1)+1];
+                  strcpy(tmpResource->secFileName, (const char*) param1);
                 }
               else
-                tmpResource->skinFileName = NULL;
-              tmpResource->pointer = new MD2Data(fullName, tmpResource->skinFileName);
+                tmpResource->secFileName = NULL;
+              tmpResource->pointer = new MD2Data(fullName, tmpResource->secFileName);
             }
               break;
@@ -372,4 +383,35 @@
           break;
 #endif /* NO_TEXTURES */
+#ifndef NO_SHADERS
+          case SHADER:
+            if(ResourceManager::isFile(fullName))
+            {
+              char* secFullName = NULL;
+              if (param1 != NULL)
+              {
+                secFullName = ResourceManager::getFullName((const char*)param1);
+                printf("%s\n", secFullName);
+                if (ResourceManager::isFile(secFullName))
+                {
+                  printf("ok:: %s\n", secFullName);
+                  tmpResource->secFileName = new char[strlen((const char*)param1)+1];
+                  strcpy(tmpResource->secFileName, (const char*) param1);
+                }
+                else
+                {
+                  delete[] secFullName;
+                  secFullName = NULL;
+                  tmpResource->secFileName = NULL;
+                }
+              }
+              else
+                tmpResource->secFileName = NULL;
+              printf("%s::%s\n", fullName, secFullName);
+              tmpResource->pointer = new Shader(fullName, secFullName);
+              if (secFullName != NULL)
+                delete[] secFullName;
+            }
+            break;
+#endif /* NO_SHADERS */
         default:
           tmpResource->pointer = NULL;
@@ -458,4 +500,9 @@
               break;
 #endif /* NO_TEXTURES */
+#ifndef NO_SHADERS
+            case SHADER:
+              delete (Shader*)resource->pointer;
+              break;
+#endif /* NO_SHADERS */
             default:
               PRINTF(2)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
@@ -537,8 +584,8 @@
               if (!param1)
                 {
-                  if (enumRes->skinFileName == NULL)
+                  if (enumRes->secFileName == NULL)
                     match = true;
                 }
-              else if (!strcmp(enumRes->skinFileName, (const char*)param1))
+              else if (!strcmp(enumRes->secFileName, (const char*)param1))
                 match = true;
               break;
@@ -555,4 +602,14 @@
               break;
 #endif /* NO_TEXT */
+#ifndef NO_SHADERS
+              case SHADER:
+                if (!param1)
+                {
+                  if (enumRes->secFileName == NULL)
+                    match = true;
+                }
+                else if (!strcmp(enumRes->secFileName, (const char*)param1))
+                  match = true;
+#endif /* NO_SHADERS */
             default:
               match = true;
@@ -862,4 +919,9 @@
       break;
 #endif
+#ifndef NO_SHADERS
+    case SHADER:
+      return "Shader";
+      break;
+#endif
     default:
       return "unknown Format";
