Index: init.c
===================================================================
--- init.c	(revision 681)
+++ init.c	(revision 682)
@@ -10,7 +10,7 @@
 #else
 #include "headers/init.h"
 
-#endif 
+#endif
 
 // proto
 void raydium_ode_init(void);
@@ -304,10 +304,10 @@
 #endif
 }
 
-//Still needs a check of void parameters. 
+//Still needs a check of void parameters.
 //Ie. it should returns error when certain parameters are not given in the conf file.
 int raydium_init_load(char *filename)
-{   
+{
     FILE *fp;
     int ret;
     char var[255],val_s[255];
@@ -316,23 +316,23 @@
     int tmp_width,tmp_height,tmp_windowtype,tmp_filter,tmp_fog,tmp_lighting,tmp_hdr,tmp_sky;
     float tmp_light0[8],tmp_background[4],tmp_fov,tmp_far,tmp_near;
     char tmp_title[255];
-    
+
     //flags
     int flag_width,flag_height,flag_title,flag_windowtype,flag_filter,flag_fov,flag_near,flag_far,flag_fog,flag_lighting,flag_light0,flag_background,flag_paths,flag_hdr,flag_sky;
-       
-     //initializing flags  
-     flag_width=flag_height=flag_title=flag_windowtype=flag_filter=flag_fov=flag_near=flag_far=flag_fog=flag_lighting=flag_light0=flag_background=flag_paths=flag_hdr=flag_sky=0;   
-    
 
+     //initializing flags
+     flag_width=flag_height=flag_title=flag_windowtype=flag_filter=flag_fov=flag_near=flag_far=flag_fog=flag_lighting=flag_light0=flag_background=flag_paths=flag_hdr=flag_sky=0;
+
+
     // Needed here as accessing file
     raydium_path_init();
-     //opening the config file   
+     //opening the config file
     fp=raydium_file_fopen(filename,"rtl"); // As php isn't initialised need to work on local
     if(fp)
-    {    
+    {
         raydium_log("Reading configuration file...");
         while( (ret=raydium_parser_read(var,val_s,val_f,&size,fp))!=RAYDIUM_PARSER_TYPE_EOF)
-        {        
+        {
             if(strcmp(var,"width")==0)
                 {
                     tmp_width=atoi(val_s);
@@ -359,7 +359,7 @@
                 strcpy(tmp_title,val_s);
                 raydium_log("Window title: \"%s\"",tmp_title);
                 flag_title=1;
-            } 
+            }
             if(strcmp(var,"filter")==0)
             {
                 raydium_parser_trim(val_s);
@@ -368,56 +368,56 @@
                 if(strcmp(val_s,"none")==0)tmp_filter=0;
                 if(strcmp(val_s,"aniso")==0)tmp_filter=3;
                 raydium_log("Texture filtering type: %d",tmp_filter);
-                flag_filter=1;            
+                flag_filter=1;
             }
             if(strcmp(var,"fov")==0)
             {
                 tmp_fov=atof(val_s);
-                raydium_log("FOV: %f",tmp_fov);          
-                flag_fov=1;            
+                raydium_log("FOV: %f",tmp_fov);
+                flag_fov=1;
             }
             if(strcmp(var,"near")==0)
             {
                 raydium_parser_trim(val_s);
                 tmp_near=atof(val_s);
                 //tmp_near=val_f;
-                raydium_log("Near plane: %f",tmp_near);          
-                flag_near=1;            
+                raydium_log("Near plane: %f",tmp_near);
+                flag_near=1;
             }
             if(strcmp(var,"far")==0)
-            {           
+            {
                 raydium_parser_trim(val_s);
                 tmp_far=atof(val_s);
-                raydium_log("Far plane: %f",tmp_far);          
-                flag_far=1;            
+                raydium_log("Far plane: %f",tmp_far);
+                flag_far=1;
             }
             if(strcmp(var,"fog")==0)
             {
                 raydium_parser_trim(val_s);
                 tmp_fog=((strcmp(val_s,"on")==0) || (strcmp(val_s,"enable")==0))?1:0;
-                raydium_log("Fog: %s",(tmp_fog?"enable":"disable"));          
-                flag_fog=1;            
+                raydium_log("Fog: %s",(tmp_fog?"enable":"disable"));
+                flag_fog=1;
             }
             if(strcmp(var,"lighting")==0)
             {
                 raydium_parser_trim(val_s);
                 tmp_lighting=((strcmp(val_s,"on")==0) || (strcmp(val_s,"enable")==0))?1:0;
-                raydium_log("Lighting: %s",(tmp_lighting?"enable":"disable"));          
-                flag_lighting=1;            
+                raydium_log("Lighting: %s",(tmp_lighting?"enable":"disable"));
+                flag_lighting=1;
             }
             if(strcmp(var,"light0")==0)
             {
                 raydium_parser_trim(val_s);
                 sscanf(val_s, "%f,%f,%f,%f,%f,%f,%f,%f", &tmp_light0[0], &tmp_light0[1],&tmp_light0[2],&tmp_light0[3],&tmp_light0[4],&tmp_light0[5],&tmp_light0[6],&tmp_light0[7]);
-                raydium_log("Light number 0 values: %.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f",tmp_light0[0],tmp_light0[1],tmp_light0[2],tmp_light0[3],tmp_light0[4],tmp_light0[5],tmp_light0[6],tmp_light0[7]);          
-                flag_light0=1;            
+                raydium_log("Light number 0 values: %.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f",tmp_light0[0],tmp_light0[1],tmp_light0[2],tmp_light0[3],tmp_light0[4],tmp_light0[5],tmp_light0[6],tmp_light0[7]);
+                flag_light0=1;
             }
              if(strcmp(var,"background")==0)
             {
                 raydium_parser_trim(val_s);
                 sscanf( val_s, "%f,%f,%f,%f", &tmp_background[0], &tmp_background[1],&tmp_background[2],&tmp_background[3]);
-                raydium_log("Background colors: %.2f,%.2f,%.2f,%.2f",tmp_background[0], tmp_background[1],tmp_background[2],tmp_background[3]);          
-                flag_background=1;            
+                raydium_log("Background colors: %.2f,%.2f,%.2f,%.2f",tmp_background[0], tmp_background[1],tmp_background[2],tmp_background[3]);
+                flag_background=1;
             }
             //symple way to allow new paths
             if(strcmp(var,"paths")==0)
@@ -434,8 +434,8 @@
             {
                 raydium_parser_trim(val_s);
                 tmp_hdr=((strcmp(val_s,"on")==0) || (strcmp(val_s,"enable")==0))?1:0;
-                raydium_log("HDR: %s",(tmp_hdr?"enable":"disable"));          
-                flag_hdr=1;            
+                raydium_log("HDR: %s",(tmp_hdr?"enable":"disable"));
+                flag_hdr=1;
             }
             //sky type
             if(strcmp(var,"sky")==0)
@@ -443,12 +443,12 @@
                 raydium_parser_trim(val_s);
                 tmp_sky=((strcmp(val_s,"box")==0))?1:0;
                 tmp_sky=((strcmp(val_s,"none")==0))?-1:tmp_sky;
-                raydium_log("Sky type: %s. Value %d",(tmp_sky?"box":"dynamic"),tmp_sky);          
-                flag_sky=1;            
+                raydium_log("Sky type: %s. Value %d",(tmp_sky?"box":"dynamic"),tmp_sky);
+                flag_sky=1;
             }
         }
-            
-        //Here, we process all the data achieved and make the raydium calls        
+
+        //Here, we process all the data achieved and make the raydium calls
         //window_create
         if(flag_width && flag_height && flag_windowtype && flag_title)
             {
@@ -464,13 +464,13 @@
         {
                 raydium_window_view_perspective(tmp_fov,tmp_near,tmp_far); // fov 60 + near and far planes
         }
-        //fog  
+        //fog
         if(flag_fog)
         {
                 if(tmp_fog)
                 raydium_fog_enable();
-            else 
-                raydium_fog_disable(); 
+            else
+                raydium_fog_disable();
         }
         //light
         if(flag_lighting)
@@ -478,23 +478,23 @@
                 if(tmp_lighting)
                 raydium_light_enable();
             else
-                raydium_light_disable(); 
+                raydium_light_disable();
         }
         if(flag_light0 && flag_lighting && tmp_lighting)
         {
                 raydium_light_on(0);
-                raydium_light_conf_7f(tmp_light0[0],tmp_light0[1],tmp_light0[2],tmp_light0[3],tmp_light0[4],tmp_light0[5],tmp_light0[6],tmp_light0[7]);         
+                raydium_light_conf_7f(tmp_light0[0],tmp_light0[1],tmp_light0[2],tmp_light0[3],tmp_light0[4],tmp_light0[5],tmp_light0[6],tmp_light0[7]);
         }
         //background
         if(flag_background)
         {
-                raydium_background_color_change(tmp_background[0], tmp_background[1],tmp_background[2],tmp_background[3]);      
+                raydium_background_color_change(tmp_background[0], tmp_background[1],tmp_background[2],tmp_background[3]);
         }
         //sky type
         if(flag_sky)
         {
             if(tmp_sky!=-1)
-            {            
+            {
                 if(tmp_sky)
                     raydium_sky_box_cache();
                 else
@@ -502,7 +502,7 @@
             }
         }
         //This must be placed after paths processing: Textures involved.
-        
+
         if(flag_paths)
         {
                 if(flag_paths==1)
@@ -524,16 +524,16 @@
                                 //raydium_path_ext("./data/levels/","terrain");
                         }
                 }
-    
+
         if(flag_hdr && tmp_hdr)
         {
             raydium_hdr_init();
             raydium_hdr_enable();
         }
-        
-        
-        
-        //ending load of configuration  
+
+
+
+        //ending load of configuration
         raydium_log("Configuration from conf file finished.");
         return 1;
     }
@@ -546,22 +546,38 @@
             if (fp){
                 raydium_log("Generating default configuration file %s",filename);
                 fprintf (fp,"%s","\
-#Automatidally generated default config file. You can custom it.\n\
-width=800                               #window width (default:  800)\n\
-height=600                              #window height (default:  600)\n\
-windowtype=\"window\"                     #window style: window or fullscreen (default: window )\n\
-title=\"Raydium Application\"             #title of the window,application (default:  Raydium application 0.1)\n\
-filter=\"aniso\"                          #texture filter: none, bilinear, trilinear, aniso (default:  trilinear)\n\
-fov=60                                  #view angle, ie fov (default:  60)\n\
-near=0.001                              #distance to the nearets object(plane) draw   (default:  0.001)\n\
-far=2500                                #distance to the further   object(plane) draw (default:  2500)\n\
-fog=\"off\"                                #fog: on/enable or off/disable (default:  off)\n\
-lighting=\"on\"                           #lighting: on/enable or off/disable (default: on )\n\
-light0=0,50,150,200,1000000,1,0.9,0.7   #light 0 parameters (default:  0,50,150,200,1000000,1,0.9,0.7)\n\
-background=1,0.9,0.7,1                  #background color (default:  1,0.9,0.7,1)\n\
-hdr=\"off\"                             #Fake HDR effect(default:off)\n\
-paths=\"foldered\"                      #data can be foldered into \"data\" folders and its subfolders: \"foldered\" or anything else. (default:\"foldered\")\n\
-sky=\"box\"                             #Sky type: \"box\" or \"dynamic\" or \"none\" \n\
+//Automatidally generated default config file. You can custom it.       \n\
+//window width (default:  800)                                          \n\
+width=800                                                               \n\
+//window height (default:  600)                                         \n\
+height=600                                                              \n\
+//window style: window or fullscreen (default: window )                 \n\
+windowtype=\"window\"                                                   \n\
+//title of the window,application (default:  Raydium application 0.1)   \n\
+title=\"Raydium Application\"                                           \n\
+//texture filter: none, bilinear, trilinear, aniso (default:  trilinear)\n\
+filter=\"aniso\"                                                        \n\
+//view angle, ie fov (default:  60)                                     \n\
+fov=60                                                                  \n\
+//distance to the nearets object(plane) draw   (default:  0.001)        \n\
+near=0.001                                                              \n\
+//distance to the further   object(plane) draw (default:  2500)         \n\
+far=2500                                                                \n\
+//fog: on/enable or off/disable (default:  off)                         \n\
+fog=\"off\"                                                             \n\
+//lighting: on/enable or off/disable (default: on )                     \n\
+lighting=\"on\"                                                         \n\
+//light 0 parameters (default:  0,50,150,200,1000000,1,0.9,0.7)         \n\
+light0=0,50,150,200,1000000,1,0.9,0.7                                   \n\
+//background color (default:  1,0.9,0.7,1)                              \n\
+background=1,0.9,0.7,1                                                  \n\
+//Fake HDR effect(default:off)                                          \n\
+hdr=\"off\"                                                             \n\
+//data can be foldered into \"data\" folders and its subfolders:        \n\
+//\"foldered\" or anything else. (default:\"foldered\")                 \n\
+paths=\"foldered\"                                                      \n\
+//Sky type: \"box\" or \"dynamic\" or \"none\"                          \n\
+sky=\"box\"                                                             \n\
 ");
             }
             fclose(fp);
@@ -577,7 +593,7 @@
             raydium_texture_filter_change(RAYDIUM_TEXTURE_FILTER_TRILINEAR);
             raydium_window_view_perspective(60,0.01,2500); // fov 60 + near and far planes
 
-            raydium_fog_disable();    
+            raydium_fog_disable();
             raydium_light_enable();
             raydium_light_on(0);