Index: branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/bsp_file.cc	(revision 7405)
+++ branches/bsp_model/src/lib/graphics/importer/bsp_file.cc	(revision 7410)
@@ -127,10 +127,10 @@
     size    = SDL_SwapLE32(((int *)(header))[19]);
     PRINTF(4)("BSP FILE: BrushesSize: %i Bytes. \n", size);
-    PRINTF(4)("BSP FILE: NumBrushes: %i. \n", size / 12);
-    PRINTF(4)("BSP FILE: Remainder: %i. \n", size % 12);
+    PRINTF(4)("BSP FILE: NumBrushes: %i. \n", size / sizeof(brush));
+    PRINTF(4)("BSP FILE: Remainder: %i. \n", size % sizeof(brush));
     PRINTF(4)("BSP FILE: BrushesOffset: %i. \n", offset);
-    this->brushes = new char [size];
-    bspFile.seekg(offset);
-    bspFile.read(this->brushes, size);
+    this->brushes = new brush [size/sizeof(brush)];
+    bspFile.seekg(offset);
+    bspFile.read((char*)this->brushes, size);
 
     // Get the brushSides
@@ -162,10 +162,10 @@
     size    = SDL_SwapLE32(((int *)(header))[25]);
     PRINTF(4)("BSP FILE: MeshVertsSize: %i Bytes. \n", size);
-    PRINTF(4)("BSP FILE: NumMeshVerts: %i. \n", size / 4);
-    PRINTF(4)("BSP FILE: Remainder: %i. \n", size % 4);
+    PRINTF(4)("BSP FILE: NumMeshVerts: %i. \n", size / sizeof(meshvert));
+    PRINTF(4)("BSP FILE: Remainder: %i. \n", size % sizeof(meshvert));
     PRINTF(4)("BSP FILE: MeshVertsOffset: %i. \n", offset);
-    this->meshverts = new char [size];
-    bspFile.seekg(offset);
-    bspFile.read(this->meshverts, size);
+    this->meshverts = new meshvert [size / sizeof(meshvert)];
+    bspFile.seekg(offset);
+    bspFile.read((char*)this->meshverts, size);
 
     // Get the Faces
@@ -220,6 +220,6 @@
     for( int i = 0; i < this->numFaces; i++) {
       face& cFace = ((face *)(this->faces))[i];
-      if (	cFace.type == 2)
-        this->numPatches += (cFace.size[0] -1 ) / 2  * (cFace.size[1] -1) / 2;
+      if (SDL_SwapLE32(cFace.type) == 2)
+        this->numPatches += (SDL_SwapLE32(cFace.size[0]) -1 ) / 2  * (SDL_SwapLE32(cFace.size[1]) -1) / 2;
     }
 
@@ -234,5 +234,5 @@
     // Do tesselation for all Faces of type 2
     for( int i = 0; i < this->numFaces; i++) {
-      if (	((face *)(this->faces))[i].type == 2)
+      if (SDL_SwapLE32((this->faces)[i].type) == 2)
         this->tesselate(i);
     }
@@ -473,12 +473,13 @@
 void BspFile::tesselate(int iface)
 {
-  face*  Face =  & (((face *)(this->faces))[iface]);
+  face*  Face =  &((this->faces)[iface]);
   BspVertex *  BspVrtx = (BspVertex*)this->vertice;
   int level = 7;
   int level1 = 8;
-
+  int size0 = SDL_SwapLE32(Face->size[0]);
+  int size1 = SDL_SwapLE32(Face->size[1]);
   // For each patch...
-  for(int i = 0; i <(Face->size[0] - 1)    ; i+=2) {
-    for(int j = 0; j <(Face->size[1] -1)    ; j+=2) {
+  for(int i = 0; i <  ( size0 - 1)    ; i+=2) {
+    for(int j = 0; j < ( size1 -1)    ; j+=2) {
 
 
@@ -490,24 +491,24 @@
       for(int k = 0; k < 3; k++) {
         for(int l = 0; l < 3; l++) {
-          controls[k +3*l]. position[0] =   BspVrtx[Face->vertex +( j * Face->size[0])+ i + l+ Face->size[0]*k].position[0];
-          controls[k +3*l]. position[1] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i +l+ Face->size[0]*k].position[1];
-          controls[k +3*l]. position[2] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i + l+ Face->size[0]*k].position[2]; /*Face->n_vertexes*/
-
-          controlsTmp[2-k +6-3*l]. position[0] =   BspVrtx[Face->vertex +( j * Face->size[0])+ i + l+ Face->size[0]*k].position[0];
-          controlsTmp[2-k +6-3*l]. position[1] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i +l+ Face->size[0]*k].position[1];
-          controlsTmp[2-k +6-3*l]. position[2] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i + l+ Face->size[0]*k].position[2]; /*Face->n_vertexes*/
-
-          VControls[k +3*l]. position[0] =   BspVrtx[Face->vertex +( j * Face->size[0])+ i + l+ Face->size[0]*k].position[0];
-          VControls[k +3*l]. position[1] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i +l+ Face->size[0]*k].position[1];
-          VControls[k +3*l]. position[2] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i + l+ Face->size[0]*k].position[2];
-
-          VControls[k +3*l]. normal[0] =   BspVrtx[Face->vertex +( j * Face->size[0])+ i + l+ Face->size[0]*k].normal[0];
-          VControls[k +3*l]. normal[1] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i +l+ Face->size[0]*k].normal[1];
-          VControls[k +3*l]. normal[2] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i + l+ Face->size[0]*k].normal[2];
-
-          VControls[k +3*l]. texcoord[0][0]=   BspVrtx[Face->vertex +( j * Face->size[0])+ i + l+ Face->size[0]*k].texcoord[0][0];
-          VControls[k +3*l]. texcoord[0][1] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i +l+ Face->size[0]*k].texcoord[0][1];
-          VControls[k +3*l]. texcoord[1][0] =   BspVrtx[Face->vertex +( j * Face->size[0])+ i + l+ Face->size[0]*k].texcoord[1][0];
-          VControls[k +3*l]. texcoord[1][1] =   BspVrtx[Face->vertex + (j * Face->size[0])+ i +l+ Face->size[0]*k].texcoord[1][1];
+          controls[k +3*l]. position[0] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i + l+ size0*k].position[0]);
+          controls[k +3*l]. position[1] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i +l+ size0*k].position[1]);
+          controls[k +3*l]. position[2] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i + l+ size0*k].position[2]); /*Face->n_vertexes*/
+
+          controlsTmp[2-k +6-3*l]. position[0] =   SDL_SwapLE32(    BspVrtx[Face->vertex +( j * size0)+ i + l+ size0*k].position[0]);
+          controlsTmp[2-k +6-3*l]. position[1] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i +l+ size0*k].position[1]);
+          controlsTmp[2-k +6-3*l]. position[2] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i + l+ size0*k].position[2]); /*Face->n_vertexes*/
+
+          VControls[k +3*l]. position[0] =   SDL_SwapLE32(    BspVrtx[Face->vertex +( j * size0)+ i + l+ size0*k].position[0]);
+          VControls[k +3*l]. position[1] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i +l+ size0*k].position[1]);
+          VControls[k +3*l]. position[2] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i + l+ size0*k].position[2]);
+
+          VControls[k +3*l]. normal[0] =   SDL_SwapLE32(    BspVrtx[Face->vertex +( j * size0)+ i + l+ size0*k].normal[0]);
+          VControls[k +3*l]. normal[1] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i +l+ size0*k].normal[1]);
+          VControls[k +3*l]. normal[2] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i + l+ size0*k].normal[2]);
+
+          VControls[k +3*l]. texcoord[0][0]=    SDL_SwapLE32(    BspVrtx[Face->vertex +( j * size0)+ i + l+ size0*k].texcoord[0][0]);
+          VControls[k +3*l]. texcoord[0][1] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i +l+ size0*k].texcoord[0][1]);
+          VControls[k +3*l]. texcoord[1][0] =   SDL_SwapLE32(    BspVrtx[Face->vertex +( j * size0)+ i + l+ size0*k].texcoord[1][0]);
+          VControls[k +3*l]. texcoord[1][1] =   SDL_SwapLE32(    BspVrtx[Face->vertex + (j * size0)+ i +l+ size0*k].texcoord[1][1]);
 
 
@@ -593,4 +594,8 @@
         for(int v=0; v<=level; ++v) {
           px=(float)v/level;
+
+
+
+
 
           //Vertice[u*(tesselation+1)+v]=	temp[0]*((1.0f-px)*(1.0f-px))+ temp[1]*((1.0f-px)*px*2)+ temp[2]*(px*px);
Index: branches/bsp_model/src/lib/graphics/importer/bsp_file.h
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/bsp_file.h	(revision 7405)
+++ branches/bsp_model/src/lib/graphics/importer/bsp_file.h	(revision 7410)
@@ -147,8 +147,8 @@
   face* faces;               //!<
   char* leafBrushes;         //!< Buffer to store brush indice
-  char* brushes;             //!< Buffer to store  brushes
+  brush* brushes;            //!< Buffer to store  brushes
   char* brushSides;          //!<
   char* vertice;             //!<
-  char* meshverts;           //!<
+  meshvert* meshverts;       //!<
   char* visData;             //!<
   char* textures;            //!<
