Index: file.c
===================================================================
--- file.c	(revision 574)
+++ file.c	(revision 575)
@@ -228,3 +228,35 @@
 fclose(fp);
 return mem;
 }
+
+int raydium_file_binary_fgets(char *dest, int max, FILE *stream)
+{
+int c;
+int i;
+
+i=0;
+do {
+    c=fgetc(stream);
+
+    if(c==EOF)
+	{
+	dest[i]=0;
+	break;
+	}
+
+    dest[i]=c;
+
+    if(c==0)
+	break;
+
+    i++;
+    if(i>=(max-1))
+	{
+	dest[i]=0;
+	break;
+	}
+    } while(1);
+
+return i;
+}
+
ES); 
+                RAYDIUM_MAX_TEXTURES); 
     return 0; 
     }
 
@@ -162,28 +162,28 @@
     raydium_live_Texture *tex;
 
     if(or_live_id_fake>=0)
-	{
-	tex=&raydium_live_texture[or_live_id_fake];
-	tx=tex->hardware_tx;
-	ty=tex->hardware_ty;
-	bpp=tex->bpp/8;
-	}
+        {
+        tex=&raydium_live_texture[or_live_id_fake];
+        tx=tex->hardware_tx;
+        ty=tex->hardware_ty;
+        bpp=tex->bpp/8;
+        }
     else
-	{
-	tx=faked_tx;
-	ty=faked_ty;
-	bpp=faked_bpp;
-	}
+        {
+        tx=faked_tx;
+        ty=faked_ty;
+        bpp=faked_bpp;
+        }
 
     texsize = tx * ty * bpp;
     data=malloc(texsize);
     memset(data,0,texsize);
     if(!data) 
-	{ 
-	fclose(file); 
-    	raydium_log("texture: ERROR ! malloc for %s failed ! (%i bytes needed)",filename,tx*ty*bpp);
-	return 0; 
-	}
+        { 
+        fclose(file); 
+        raydium_log("texture: ERROR ! malloc for %s failed ! (%i bytes needed)",filename,tx*ty*bpp);
+        return 0; 
+        }
     }
 
 if(!rgb)
@@ -211,9 +211,9 @@
  if(raydium_texture_compression_enabled && !faked)
     {
     if(GLbppi==GL_RGBA8)
-	GLbppi=GL_COMPRESSED_RGBA;
+        GLbppi=GL_COMPRESSED_RGBA;
     if(GLbppi==GL_ALPHA8)
-	GLbppi=GL_COMPRESSED_ALPHA;
+        GLbppi=GL_COMPRESSED_ALPHA;
     }
 
  raydium_texture_blended[id]=0;
@@ -240,15 +240,15 @@
  if(strstr(filename,".tri."))
     raydium_texture_islightmap[id]=1;
 
- memcpy(temp,filename,3);						// TEMP !!
- temp[3]=0;								// TEMP !!
+ memcpy(temp,filename,3);                                               // TEMP !!
+ temp[3]=0;                                                             // TEMP !!
  if(!simulate)
  {
-  if(!strcmp("BOX",(char *)temp) || faked)				// TEMP !!
-  {									// TEMP !!
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);	// TEMP !!
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);	// TEMP !!
-  }									// TEMP !!
+  if(!strcmp("BOX",(char *)temp) || faked)                              // TEMP !!
+  {                                                                     // TEMP !!
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);        // TEMP !!
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);        // TEMP !!
+  }                                                                     // TEMP !!
   else
   {
     glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
@@ -258,7 +258,7 @@
 
  filter=raydium_texture_filter;
 
- if(!strcmp("HDR",(char *)temp))				// TEMP !!
+ if(!strcmp("HDR",(char *)temp))                                // TEMP !!
     {
     raydium_texture_hdr[id]=1;
     raydium_texture_nolight[id]=1;
@@ -322,11 +322,11 @@
     strcpy(comp_str,"");
 
  raydium_log("Texture num %i (%s) %s: %ix%i, %i Bpp (b%i lm%i hdr%i)%s",
-	     id,raydium_texture_name[id],
-	     (faked?"FAKED":"loaded"),
-	     tx,ty,bpp,
-	     blended,raydium_texture_islightmap[id],
-	     raydium_texture_hdr[id],comp_str);
+             id,raydium_texture_name[id],
+             (faked?"FAKED":"loaded"),
+             tx,ty,bpp,
+             blended,raydium_texture_islightmap[id],
+             raydium_texture_hdr[id],comp_str);
  free(data);
 } else /* is rgb color */
 {