Index: trunk/src/lib/graphics/effects/cloud_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/cloud_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/cloud_effect.cc	(revision 9235)
@@ -90,4 +90,5 @@
     this->planetRadius = 1500;
     this->divs = 15;
+    this->cloudActivate = false;
     fadeSky = false;
     fadeCloud = false;
Index: trunk/src/lib/graphics/effects/fog_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/fog_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/fog_effect.cc	(revision 9235)
@@ -20,8 +20,9 @@
 #include "shell_command.h"
 #include "script_class.h"
+#include "cloud_effect.h"
 
 // Define shell commands
-SHELL_COMMAND(activate, FogEffect, activateFog);
-SHELL_COMMAND(deactivate, FogEffect, deactivateFog);
+//SHELL_COMMAND(activate, FogEffect, activateFog);
+//SHELL_COMMAND(deactivate, FogEffect, deactivateFog);
 SHELL_COMMAND(fadein, FogEffect, fadeInFog);
 SHELL_COMMAND(fadeout, FogEffect, fadeOutFog);
@@ -84,4 +85,7 @@
   this->fogFadeInActivate = false;
   this->fogFadeOutActivate = false;
+  
+  this->cloudColor = Vector(0.2f, 0.3f, 0.3f);
+  this->skyColor = Vector(0.2f, 0.3f, 0.3f);
 }
 
@@ -93,14 +97,16 @@
     WeatherEffect::loadParams(root);
 
-    LoadParam(root, "mode", this, FogEffect, setFogMode).describe("fog mode (linear, exponential)");;
-    LoadParam(root, "density", this, FogEffect, setFogDensity).describe("fog density if exp. fog");;
-    LoadParam(root, "range", this, FogEffect, setFogRange).describe("fog range: start, end");;
-    LoadParam(root, "color", this, FogEffect, setFogColor).describe("fog color: r,g,b");;
-    LoadParam(root, "fadeinduration", this, FogEffect, setFogFadeIn).describe("duration of the fade in");;
-    LoadParam(root, "fadeoutduration", this, FogEffect, setFogFadeOut).describe("duration of the fade out");;
-
+    LoadParam(root, "mode", this, FogEffect, setFogMode).describe("fog mode (linear, exponential)");
+    LoadParam(root, "density", this, FogEffect, setFogDensity).describe("fog density if exp. fog");
+    LoadParam(root, "range", this, FogEffect, setFogRange).describe("fog range: start, end");
+    LoadParam(root, "color", this, FogEffect, setFogColor).describe("fog color: r,g,b");
+    LoadParam(root, "fadeinduration", this, FogEffect, setFogFadeIn).describe("duration of the fade in");
+    LoadParam(root, "fadeoutduration", this, FogEffect, setFogFadeOut).describe("duration of the fade out");
+    LoadParam(root, "cloudcolor", this, FogEffect, setCloudColor);
+    LoadParam(root, "skycolor", this, FogEffect, setSkyColor);
+    
     LOAD_PARAM_START_CYCLE(root, element);
     {
-      LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption).describe("sets a fog option: activate");;
+      LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption).describe("sets a fog option: activate");
     }
     LOAD_PARAM_END_CYCLE(element);
@@ -125,4 +131,12 @@
 
     glEnable(GL_FOG);
+    
+    // Store cloud- and sky color before the snow
+    this->oldCloudColor = CloudEffect::cloudColor;
+    this->oldSkyColor   = CloudEffect::skyColor;
+    
+    // Change the colors
+    CloudEffect::changeCloudColor(this->cloudColor, this->fogFadeInDuration);
+    CloudEffect::changeSkyColor(this->skyColor, this->fogFadeInDuration);
 }
 
@@ -184,7 +198,7 @@
 
         if ( this->fogMode == GL_LINEAR)
-          this->fogFadeEnd = 2000 * ( this->localTimer / this->fogFadeInDuration ) + this->fogEnd;
+          this->fogFadeEnd = 2000 * ( this->localTimer / this->fogFadeOutDuration ) + this->fogEnd;
         else
-            this->fogFadeDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity);
+            this->fogFadeDensity = 1 - (( this->localTimer / this->fogFadeOutDuration ) * this->fogDensity);
 
         if ( this->localTimer >= this->fogFadeOutDuration )
@@ -207,5 +221,5 @@
     // If no manual FadeIn value was set, set a default value
     if (!this->fogFadeInDuration > 0)
-        this->fogFadeInDuration = 20;
+        this->fogFadeInDuration = 10;
 
     // Reset local timer
@@ -227,4 +241,5 @@
     this->fogFadeInActivate = false;
 
+    
     // If Fog is off, turn it on first
     if (!this->fogActivate)
@@ -233,5 +248,5 @@
     // If no manual FadeOut value was set, set a default value
     if (!this->fogFadeOutDuration > 0)
-        this->fogFadeOutDuration = 20;
+        this->fogFadeOutDuration = 10;
 
     // set FogFadeOut activate
@@ -240,4 +255,8 @@
     // Reset local timer
     this->localTimer = 0;
-}
-
+
+    // Restore the old cloud- and sky color
+    CloudEffect::changeCloudColor(this->oldCloudColor, this->fogFadeOutDuration);
+    CloudEffect::changeSkyColor(this->oldSkyColor, this->fogFadeOutDuration);
+}
+
Index: trunk/src/lib/graphics/effects/fog_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/fog_effect.h	(revision 9112)
+++ trunk/src/lib/graphics/effects/fog_effect.h	(revision 9235)
@@ -10,4 +10,6 @@
 #include "glincl.h"
 #include "vector.h"
+
+class CloudEffect;
 
 class FogEffect : public WeatherEffect
@@ -73,4 +75,13 @@
       this->fogActivate = true;
   }
+  
+  inline void setCloudColor(float colorX, float colorY, float colorZ)
+  {
+    this->cloudColor = Vector(colorX, colorY, colorZ);
+  }
+  inline void setSkyColor(float colorX, float colorY, float colorZ)
+  {
+    this->skyColor = Vector(colorX, colorY, colorZ);
+  }
 
   void fadeInFog();
@@ -109,4 +120,9 @@
   Vector        colorVector;
   float         localTimer; 
+  
+  Vector oldSkyColor;
+  Vector oldCloudColor;
+  Vector skyColor;
+  Vector cloudColor;
 };
 
Index: trunk/src/lib/graphics/effects/lightning_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/lightning_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/lightning_effect.cc	(revision 9235)
@@ -112,6 +112,8 @@
     }
 
+    //should load both texture
     this->thunderTextureA = true;
     this->setTexture();
+    this->switchTexture();
 
     if (this->lightningMove) {
Index: trunk/src/lib/graphics/effects/rain_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/rain_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/rain_effect.cc	(revision 9235)
@@ -34,6 +34,6 @@
 
 // Define shell commands
-SHELL_COMMAND(activate, RainEffect, activateRain);
-SHELL_COMMAND(deactivate, RainEffect, deactivateRain);
+//SHELL_COMMAND(activate, RainEffect, activateRain);
+//SHELL_COMMAND(deactivate, RainEffect, deactivateRain);
 SHELL_COMMAND(startraining, RainEffect, startRaining);
 SHELL_COMMAND(stopraining, RainEffect, stopRaining);
@@ -96,4 +96,11 @@
  */
 void RainEffect::init() {
+
+    this->rainParticles = NULL;
+    this->emitter = NULL;
+    this->rainBuffer = NULL;
+    this->windBuffer = NULL;
+    this->lightMan = NULL;
+
     //Default values
     this->rainActivate = false;
@@ -119,4 +126,5 @@
     this->emitter = new PlaneEmitter(this->rainSize);
 
+    lightMan = LightManager::getInstance();
 }
 
@@ -187,7 +195,9 @@
     // If we're not fading, change color immediately
     if (!this->rainFadeInActivate || !this->rainFadeOutActivate) {
-        CloudEffect::changeCloudColor(this->cloudColor, 0);
-        CloudEffect::changeSkyColor(this->skyColor, 0);
-    }
+        CloudEffect::changeCloudColor(this->cloudColor, 0.2);
+        CloudEffect::changeSkyColor(this->skyColor, 0.2);
+    }
+
+    //lightMan->setAmbientColor(.1,.1,.1);
 }
 
@@ -202,5 +212,7 @@
     this->rainFadeOutActivate = false;
 
-    this->emitter->setSystem(NULL);
+    //if(this->emitter)
+    //  this->emitter->setSystem(NULL);
+    //this->hideRain();
 
     // Stop Sound
@@ -208,6 +220,6 @@
 
     // Restore the old cloud- and sky color
-    CloudEffect::changeCloudColor(this->oldCloudColor, 0);
-    CloudEffect::changeSkyColor(this->oldSkyColor, 0);
+    CloudEffect::changeCloudColor(this->oldCloudColor, 0.2);
+    CloudEffect::changeSkyColor(this->oldSkyColor, 0.2);
 }
 
@@ -242,10 +254,14 @@
 
         // increase sound volume
-        if (!this->soundSource.isPlaying())
+        if (progress > 0.5) {
+          if (!this->soundSource.isPlaying())
             this->soundSource.play(this->rainBuffer, this->soundRainVolume, true);
-        this->soundSource.gain(this->rainBuffer, this->soundRainVolume * progress);
+          this->soundSource.gain(this->rainBuffer, this->soundRainVolume * progress * 2 - 0.5);
+        }
 
         if (progress >= 1)
             this->rainFadeInActivate = false;
+
+        lightMan->setAmbientColor(1-progress, 1-progress, 1-progress);
     }
 
@@ -276,4 +292,5 @@
             this->deactivate();
         }
+        lightMan->setAmbientColor(1-progress, 1-progress, 1-progress);
     }
 }
Index: trunk/src/lib/graphics/effects/rain_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/rain_effect.h	(revision 9112)
+++ trunk/src/lib/graphics/effects/rain_effect.h	(revision 9235)
@@ -132,8 +132,10 @@
   float                       soundRainVolume;
 
-  Vector oldSkyColor;
-  Vector oldCloudColor;
-  Vector skyColor;
-  Vector cloudColor;
+  Vector                      oldSkyColor;
+  Vector                      oldCloudColor;
+  Vector                      skyColor;
+  Vector                      cloudColor;
+  
+  LightManager*               lightMan;
 
 };
Index: trunk/src/lib/graphics/effects/snow_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/snow_effect.cc	(revision 9112)
+++ trunk/src/lib/graphics/effects/snow_effect.cc	(revision 9235)
@@ -28,4 +28,5 @@
 #include "shell_command.h"
 #include "script_class.h"
+#include "cloud_effect.h"
 
 #include "parser/tinyxml/tinyxml.h"
@@ -53,8 +54,8 @@
 
 	//load wind sound
-	if (this->snowWindForce > 1) {
+	if (this->snowWindForce >= 1) {
 		if (this->windBuffer != NULL)
 			ResourceManager::getInstance()->unload(this->windBuffer);
-	       		this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
+	  this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
 	}
 
@@ -87,4 +88,7 @@
 	LoadParam(root, "size", this, SnowEffect, size);
 	LoadParam(root, "coord", this, SnowEffect, coord);
+  LoadParam(root, "cloudcolor", this, SnowEffect, setCloudColor);
+  LoadParam(root, "skycolor", this, SnowEffect, setSkyColor);
+  LoadParam(root, "fadetime", this, SnowEffect, setFadeTime);
 
 	LOAD_PARAM_START_CYCLE(root, element);
@@ -119,4 +123,8 @@
 	this->snowCoord = Vector(100,450,400);
 	this->snowWindForce = 1;
+  
+  this->fadeTime = 10;
+  this->cloudColor = Vector(0.2f, 0.2f, 0.2f);
+  this->skyColor = Vector(0.0f, 0.0f, 0.0f);
 }
 
@@ -149,4 +157,12 @@
   if (this->snowWindForce != 0)
     this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true);
+  
+  // Store cloud- and sky color before the snow
+  this->oldCloudColor = CloudEffect::cloudColor;
+  this->oldSkyColor   = CloudEffect::skyColor;
+
+  // Change the colors
+  CloudEffect::changeCloudColor(this->cloudColor, this->fadeTime);
+  CloudEffect::changeSkyColor(this->skyColor, this->fadeTime);
 
 }
@@ -162,4 +178,8 @@
 	if (this->windBuffer != NULL)
 		ResourceManager::getInstance()->unload(this->windBuffer);
+  
+  // Restore the old cloud- and sky color
+  CloudEffect::changeCloudColor(this->oldCloudColor, this->fadeTime);
+  CloudEffect::changeSkyColor(this->oldSkyColor, this->fadeTime);
 }
 
Index: trunk/src/lib/graphics/effects/snow_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/snow_effect.h	(revision 9112)
+++ trunk/src/lib/graphics/effects/snow_effect.h	(revision 9235)
@@ -16,4 +16,5 @@
 class PlaneEmitter;
 class PNode;
+class CloudEffect;
 
 #include "sound_source.h"
@@ -77,4 +78,16 @@
         this->snowWindForce = force;
     }
+    inline void setCloudColor(float colorX, float colorY, float colorZ)
+    {
+      this->cloudColor = Vector(colorX, colorY, colorZ);
+    }
+    inline void setSkyColor(float colorX, float colorY, float colorZ)
+    {
+      this->skyColor = Vector(colorX, colorY, colorZ);
+    }
+    inline void setFadeTime(float time)
+    {
+      this->fadeTime = time;
+    }
 
     inline void setSnowOption(const std::string& option) {
@@ -97,4 +110,5 @@
     float         angle, randomAngle;
     float         alpha;
+    float         fadeTime;
     Vector        snowCoord;
     Vector2D      snowSize;
@@ -110,4 +124,8 @@
     OrxSound::SoundBuffer*    windBuffer;
 
+    Vector oldSkyColor;
+    Vector oldCloudColor;
+    Vector skyColor;
+    Vector cloudColor;
 };
 
Index: trunk/src/lib/graphics/importer/bsp_manager.cc
===================================================================
--- trunk/src/lib/graphics/importer/bsp_manager.cc	(revision 9112)
+++ trunk/src/lib/graphics/importer/bsp_manager.cc	(revision 9235)
@@ -53,4 +53,5 @@
 {
 
+  this->lastTex = -1;
   this->parent = parent;
   /*// open a BSP file
@@ -101,4 +102,6 @@
   return 0;
 }
+
+
 /*
 BspManager::BspManager(const char* fileName, float scale)
@@ -270,5 +273,5 @@
         const float dMaxs = dir.x*(float)curLeaf.maxs[0] +dir.y*(float)curLeaf.maxs[1] +dir.z*(float)curLeaf.maxs[2] - dist;
 
-        if(dMins < -50.0 && dMaxs < -  50.0) {
+        if(dMins < -70.0 && dMaxs < -70.0) {
           continue;
         }
@@ -1371,7 +1374,7 @@
   else
   {
-    if( this->outputFraction == 1.0f)
+    if( this->outputFraction == 1.0f) // No collision Detected
     {
-      if( this->outputAllSolid )
+      if( this->outputAllSolid ) 
       {
         this->collPlane = new plane;
@@ -1382,5 +1385,5 @@
         SolidFlag = true;
       }
-      else
+      else      // No collision happened
       {
         yCollisionDown = false;
@@ -1388,9 +1391,8 @@
       }
     }
-    else
+    else           // A collision has happended
     {
       yCollisionDown = true;
       collPos = position + (down - position) * this->outputFraction;
-      this->out = collPos;        // why this????
     }
   }
Index: trunk/src/lib/graphics/importer/md2/md2Model.cc
===================================================================
--- trunk/src/lib/graphics/importer/md2/md2Model.cc	(revision 9112)
+++ trunk/src/lib/graphics/importer/md2/md2Model.cc	(revision 9235)
@@ -40,5 +40,5 @@
 
 //! list of all different animations a std md2model supports
-sAnim MD2Model::animationList[21] =
+sAnim MD2Model::animationList[22] =
   {
  // begin, end, fps, interruptable
@@ -64,4 +64,5 @@
     { 190, 197,  10, 0 },   //!< DEATH_FALLBACKSLOW
     { 198, 198,  5, 1 },   //!< BOOM
+    {  199, 204, 10, 1 },  //!< WALK (only for spectial models)
   };
 
Index: trunk/src/lib/graphics/importer/md2/md2Model.h
===================================================================
--- trunk/src/lib/graphics/importer/md2/md2Model.h	(revision 9112)
+++ trunk/src/lib/graphics/importer/md2/md2Model.h	(revision 9235)
@@ -30,6 +30,6 @@
 #define MD2_VERSION                     8                                        //!< the md2 version in the header
 #define MD2_MAX_TRIANGLES               4096                                     //!< maximal triangles count
-#define MD2_MAX_VERTICES                2048                                     //!< maximal vertices count
-#define MD2_MAX_TEXCOORDS               2048                                     //!< maximal tex coordinates
+#define MD2_MAX_VERTICES                3048                                     //!< maximal vertices count
+#define MD2_MAX_TEXCOORDS               3048                                     //!< maximal tex coordinates
 #define MD2_MAX_FRAMES                  512                                      //!< maximal frames
 #define MD2_MAX_SKINS                   32                                       //!< maximal skins
@@ -92,4 +92,5 @@
     DEATH_FALLBACKSLOW,
     BOOM,
+    WALK,
 
     MAX_ANIMATIONS
@@ -180,5 +181,5 @@
   static sVec3D       anorms[NUM_VERTEX_NORMALS];       //!< the anormals
   static float        anormsDots[SHADEDOT_QUANT][256];  //!< the anormals dot products
-  static sAnim        animationList[21];                //!< the anomation list
+  static sAnim        animationList[22];                //!< the anomation list
    //! again one of these strange id software parts
   float*              shadeDots;
