Index: branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.cc	(revision 8457)
@@ -30,7 +30,6 @@
  * @param root The XML-element to load the AtmosphericEngine from
  */
-AtmosphericEngine::AtmosphericEngine()
-{
-  this->setClassID(CL_ATMOSPHERIC_ENGINE, "AtmosphericEngine");
+AtmosphericEngine::AtmosphericEngine() {
+    this->setClassID(CL_ATMOSPHERIC_ENGINE, "AtmosphericEngine");
 }
 
@@ -44,15 +43,13 @@
  *  destroys a AtmosphericEngine
  */
-AtmosphericEngine::~AtmosphericEngine()
-{
-  AtmosphericEngine::singletonRef = NULL;
+AtmosphericEngine::~AtmosphericEngine() {
+    AtmosphericEngine::singletonRef = NULL;
 
-  const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
+    const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
 
-  if (weatherEffects != NULL)
-  {
-      while(!weatherEffects->empty())
-        delete weatherEffects->front();
-  }
+    if (weatherEffects != NULL) {
+        while(!weatherEffects->empty())
+            delete weatherEffects->front();
+    }
 }
 
@@ -60,8 +57,7 @@
  * @param root The XML-element to load the AtmosphericEngine from
  */
-void AtmosphericEngine::loadParams(const TiXmlElement* root)
-{
-  LoadParamXML(root, "WeatherEffect", this, AtmosphericEngine, loadWeatherEffect);
-  LoadParamXML(root, "SunEffect", this, AtmosphericEngine, loadSunEffect);
+void AtmosphericEngine::loadParams(const TiXmlElement* root) {
+    LoadParamXML(root, "WeatherEffect", this, AtmosphericEngine, loadWeatherEffect);
+    LoadParamXML(root, "SunEffect", this, AtmosphericEngine, loadSunEffect);
 }
 
@@ -69,16 +65,15 @@
  * @param root The XML-element to load WeatherEffects from
  */
-void AtmosphericEngine::loadWeatherEffect(const TiXmlElement* root)
-{
-  LOAD_PARAM_START_CYCLE(root, element);
-  {
-    PRINTF(4)("element is: %s\n", element->Value());
-    // Factory::fabricate(element);
+void AtmosphericEngine::loadWeatherEffect(const TiXmlElement* root) {
+    LOAD_PARAM_START_CYCLE(root, element);
+    {
+        PRINTF(4)("element is: %s\n", element->Value());
+        // Factory::fabricate(element);
 
-    BaseObject* bo = Factory::fabricate(element);
-    if( bo == NULL)
-      PRINTF(0)(" Could not create Element %s\n", element->Value());
-  }
-  LOAD_PARAM_END_CYCLE(element);
+        BaseObject* bo = Factory::fabricate(element);
+        if( bo == NULL)
+            PRINTF(0)(" Could not create Element %s\n", element->Value());
+    }
+    LOAD_PARAM_END_CYCLE(element);
 }
 
@@ -86,11 +81,10 @@
  * @param root The XML-element to load SunEffects from
  */
-void AtmosphericEngine::loadSunEffect(const TiXmlElement* root)
-{
-  LOAD_PARAM_START_CYCLE(root, element);
-  {
-    PRINTF(4)("element is: %s\n", element->Value());
-  }
-  LOAD_PARAM_END_CYCLE(element);
+void AtmosphericEngine::loadSunEffect(const TiXmlElement* root) {
+    LOAD_PARAM_START_CYCLE(root, element);
+    {
+        PRINTF(4)("element is: %s\n", element->Value());
+    }
+    LOAD_PARAM_END_CYCLE(element);
 }
 
@@ -99,15 +93,13 @@
  * draws the effect, if needed
  */
-void AtmosphericEngine::draw() const
-{
-  const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
+void AtmosphericEngine::draw() const {
+    const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
 
-  // draw the weather effects
-  if (weatherEffects != NULL)
-  {
-    std::list<BaseObject*>::const_iterator it;
-    for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
-      dynamic_cast<WeatherEffect*>(*it)->draw();
-  }
+    // draw the weather effects
+    if (weatherEffects != NULL) {
+        std::list<BaseObject*>::const_iterator it;
+        for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
+            dynamic_cast<WeatherEffect*>(*it)->draw();
+    }
 }
 
@@ -117,17 +109,14 @@
  * ticks the effect if there is any time dependancy
  */
-void AtmosphericEngine::tick(float dt)
-{
-  const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
+void AtmosphericEngine::tick(float dt) {
+    const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
 
-  // tick the weather effects
-  if (weatherEffects != NULL)
-  {
-    std::list<BaseObject*>::const_iterator it;
-    for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
-    {
-/*      printf("%s::%s \n", (*it)->getClassName(), (*it)->getName());*/
-      dynamic_cast<WeatherEffect*>(*it)->tick(dt);
+    // tick the weather effects
+    if (weatherEffects != NULL) {
+        std::list<BaseObject*>::const_iterator it;
+        for (it = weatherEffects->begin(); it != weatherEffects->end(); it++) {
+            /*      printf("%s::%s \n", (*it)->getClassName(), (*it)->getName());*/
+            dynamic_cast<WeatherEffect*>(*it)->tick(dt);
+        }
     }
-  }
 }
Index: branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h	(revision 8457)
@@ -20,44 +20,48 @@
 class Vector;
 
-class CloudEffect : public WeatherEffect
-{
-	public:
-		CloudEffect(const TiXmlElement* root = NULL);
-		virtual ~CloudEffect();
+class CloudEffect : public WeatherEffect {
+public:
+    CloudEffect(const TiXmlElement* root = NULL);
+    virtual ~CloudEffect();
 
-		virtual void loadParams(const TiXmlElement* root);
+    virtual void loadParams(const TiXmlElement* root);
 
-		virtual void init();
+    virtual void init();
 
-		virtual void activate();
-		virtual void deactivate();
+    virtual void activate();
+    virtual void deactivate();
 
-		inline void activateCloud() { this->activate(); }
-		inline void deactivateCloud() { this->deactivate(); }
-		
-		virtual void draw() const;
-		virtual void tick(float dt);
+    inline void activateCloud() {
+        this->activate();
+    }
+    inline void deactivateCloud() {
+        this->deactivate();
+    }
 
-		inline void setCloudOption(const std::string& option) {
-			if (option == "activate") this->cloudActivate = true;
-		}
+    virtual void draw() const;
+    virtual void tick(float dt);
+
+    inline void setCloudOption(const std::string& option) {
+        if (option == "activate")
+            this->cloudActivate = true;
+    }
 
 
-	private:
-		void initialize(char* fileName);
+private:
+    void initialize(char* fileName);
 
-		bool				cloudActivate;
+    bool        cloudActivate;
 
-		Material*			cloudMaterial;		// A Material for the Sphere.
+    Material*     cloudMaterial;    // A Material for the Sphere.
 
-		std::string			cloudTexture;
+    std::string     cloudTexture;
 
-		Sglmodel_sgl			cloudModel;
-		Shader*				cloudShader;
+    Sglmodel_sgl      cloudModel;
+    Shader*       cloudShader;
 
-		GLfloat				cloudTint[4];
-		GLfloat				cloudScroll;
+    GLfloat       cloudTint[4];
+    GLfloat       cloudScroll;
 
-		float				time;
+    float       time;
 
 };
Index: branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc	(revision 8457)
@@ -1,14 +1,14 @@
 /*
-	orxonox - the future of 3D-vertical-scrollers
-
-	Copyright (C) 2004 orx
-
-	This program is free software; you can redistribute it and/or modify
-	it under the terms of the GNU General Public License as published by
-	the Free Software Foundation; either version 2, or (at your option)
-	any later version.
+  orxonox - the future of 3D-vertical-scrollers
+
+  Copyright (C) 2004 orx
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2, or (at your option)
+  any later version.
 
 ### File Specific:
-	main-programmer: hdavid, amaechler
+  main-programmer: hdavid, amaechler
 */
 
@@ -33,98 +33,92 @@
 CREATE_FACTORY(FogEffect, CL_FOG_EFFECT);
 
-FogEffect::FogEffect(const TiXmlElement* root)
-{
-	this->setClassID(CL_FOG_EFFECT, "FogEffect");
-
-	this->init();
-
-	if (root != NULL)
-		this->loadParams(root);
-
-	if (this->fogActivate)
-		this->activate();
-}
-
-
-FogEffect::~FogEffect()
-{
-	this->deactivate();
-}
-
-
-void FogEffect::loadParams(const TiXmlElement* root)
-{
-	WeatherEffect::loadParams(root);
-
-	LoadParam(root, "mode", this, FogEffect, setFogMode);
-	LoadParam(root, "density", this, FogEffect, setFogDensity);
-	LoadParam(root, "range", this, FogEffect, setFogRange);
-	LoadParam(root, "color", this, FogEffect, setFogColor);
-	LoadParam(root, "fadeinduration", this, FogEffect, setFogFadeIn);
-	LoadParam(root, "fadeoutduration", this, FogEffect, setFogFadeOut);
-
-	LOAD_PARAM_START_CYCLE(root, element);
-	{
-		LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption);
-	}
-	LOAD_PARAM_END_CYCLE(element);
-}
-
-void FogEffect::init()
-{
-	// default values
-	this->fogMode = GL_LINEAR;
-	this->fogDensity = 0.03;
-	this->fogStart = 0;
-	this->fogEnd = 50;
-	this->colorVector = Vector(0.3, 0.3, 0.3);
-
-	// init variables
-	this->fogFadeInDuration = 0;
-	this->fogFadeOutDuration = 0;
-	this->fogFadeInDensity = 0;
-	this->fogFadeOutDensity = 0;
-	this->localTimer = 0;
-	this->fogActivate = false;
-	this->fogFadeInActivate = false;
-	this->fogFadeOutActivate = false;
-
-}
-
-
-void FogEffect::activate()
-{
-	PRINTF(0)( "Enabling FogEffect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);
-
-	this->fogActivate = true;
-	
-	GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0};
-	glFogi(GL_FOG_MODE, this->fogMode);
-	glFogfv(GL_FOG_COLOR, fogColor);
-	glHint(GL_FOG_HINT, GL_DONT_CARE);
-	glFogf(GL_FOG_START, this->fogStart);
-	glFogf(GL_FOG_END, this->fogEnd);
-
-	if ( this->fogFadeInActivate )
-		glFogf(GL_FOG_DENSITY, this->fogFadeInDensity);
-	else if ( this->fogFadeOutActivate )
-		glFogf(GL_FOG_DENSITY, this->fogFadeOutDensity);
-	else
-		glFogf(GL_FOG_DENSITY, this->fogDensity);
-		
-	glEnable(GL_FOG);
-
-}
-
-
-void FogEffect::deactivate()
-{
-	PRINTF(0)("Deactivating FogEffect\n");
-
-	this->fogFadeInActivate = false;
-	this->fogFadeOutActivate = false;
-	this->fogActivate = false;
-	
-	glDisable(GL_FOG);
+FogEffect::FogEffect(const TiXmlElement* root) {
+    this->setClassID(CL_FOG_EFFECT, "FogEffect");
+
+    this->init();
+
+    if (root != NULL)
+        this->loadParams(root);
+
+    if (this->fogActivate)
+        this->activate();
+}
+
+
+FogEffect::~FogEffect() {
+    this->deactivate();
+}
+
+
+void FogEffect::loadParams(const TiXmlElement* root) {
+    WeatherEffect::loadParams(root);
+
+    LoadParam(root, "mode", this, FogEffect, setFogMode);
+    LoadParam(root, "density", this, FogEffect, setFogDensity);
+    LoadParam(root, "range", this, FogEffect, setFogRange);
+    LoadParam(root, "color", this, FogEffect, setFogColor);
+    LoadParam(root, "fadeinduration", this, FogEffect, setFogFadeIn);
+    LoadParam(root, "fadeoutduration", this, FogEffect, setFogFadeOut);
+
+    LOAD_PARAM_START_CYCLE(root, element);
+    {
+        LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption);
+    }
+    LOAD_PARAM_END_CYCLE(element);
+}
+
+void FogEffect::init() {
+    // default values
+    this->fogMode = GL_LINEAR;
+    this->fogDensity = 0.03;
+    this->fogStart = 0;
+    this->fogEnd = 50;
+    this->colorVector = Vector(0.3, 0.3, 0.3);
+
+    // init variables
+    this->fogFadeInDuration = 0;
+    this->fogFadeOutDuration = 0;
+    this->fogFadeInDensity = 0;
+    this->fogFadeOutDensity = 0;
+    this->localTimer = 0;
+    this->fogActivate = false;
+    this->fogFadeInActivate = false;
+    this->fogFadeOutActivate = false;
+
+}
+
+
+void FogEffect::activate() {
+    PRINTF(0)( "Enabling FogEffect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);
+
+    this->fogActivate = true;
+
+    GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0};
+    glFogi(GL_FOG_MODE, this->fogMode);
+    glFogfv(GL_FOG_COLOR, fogColor);
+    glHint(GL_FOG_HINT, GL_DONT_CARE);
+    glFogf(GL_FOG_START, this->fogStart);
+    glFogf(GL_FOG_END, this->fogEnd);
+
+    if ( this->fogFadeInActivate )
+        glFogf(GL_FOG_DENSITY, this->fogFadeInDensity);
+    else if ( this->fogFadeOutActivate )
+        glFogf(GL_FOG_DENSITY, this->fogFadeOutDensity);
+    else
+        glFogf(GL_FOG_DENSITY, this->fogDensity);
+
+    glEnable(GL_FOG);
+
+}
+
+
+void FogEffect::deactivate() {
+    PRINTF(0)("Deactivating FogEffect\n");
+
+    this->fogFadeInActivate = false;
+    this->fogFadeOutActivate = false;
+    this->fogActivate = false;
+
+    glDisable(GL_FOG);
 
 }
@@ -132,60 +126,59 @@
 void FogEffect::draw() const {
 
-	if (!this->fogActivate)
-		return;
-
-	// If Fog Fade In
-	if ( this->fogFadeInActivate )
-		glFogf(GL_FOG_DENSITY, this->fogFadeInDensity);
-
-	// If Fog Fade Out
-	if ( this->fogFadeOutActivate )
-		glFogf(GL_FOG_DENSITY, this->fogFadeOutDensity);
-
-}
-
-void FogEffect::tick(float dt)
-{
-	if (!this->fogActivate)
-		return;
-		
-	if ( this->fogFadeInActivate ) {
-		this->localTimer += dt;
-		this->fogFadeInDensity = ( this->localTimer / this->fogFadeInDuration ) * this->fogDensity;
-
-		if ( this->localTimer >= this->fogFadeOutDuration )
-			this->fogFadeInActivate = false;
-	}
-
-	if ( this->fogFadeOutActivate ) {
-		this->localTimer += dt;
-		this->fogFadeOutDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity);
-
-		if ( this->localTimer >= this->fogFadeOutDuration )
-			this->deactivate();
-	}
+    if (!this->fogActivate)
+        return;
+
+    // If Fog Fade In
+    if ( this->fogFadeInActivate )
+        glFogf(GL_FOG_DENSITY, this->fogFadeInDensity);
+
+    // If Fog Fade Out
+    if ( this->fogFadeOutActivate )
+        glFogf(GL_FOG_DENSITY, this->fogFadeOutDensity);
+
+}
+
+void FogEffect::tick(float dt) {
+    if (!this->fogActivate)
+        return;
+
+    if ( this->fogFadeInActivate ) {
+        this->localTimer += dt;
+        this->fogFadeInDensity = ( this->localTimer / this->fogFadeInDuration ) * this->fogDensity;
+
+        if ( this->localTimer >= this->fogFadeOutDuration )
+            this->fogFadeInActivate = false;
+    }
+
+    if ( this->fogFadeOutActivate ) {
+        this->localTimer += dt;
+        this->fogFadeOutDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity);
+
+        if ( this->localTimer >= this->fogFadeOutDuration )
+            this->deactivate();
+    }
 }
 
 void FogEffect::fadeInFog() {
 
-	// If Fog is already fading out, stop it
-	this->fogFadeOutActivate = false;
-
-	// If Fog is already on, turn it off first
-	if (this->fogActivate)
-		this->deactivate();
-
-	// If no manual FadeIn value was set, set a default value
-	if (!this->fogFadeInDuration > 0)
-		this->fogFadeInDuration = 20;
-
-	// Reset local timer
-	this->localTimer = 0;
-
-	// set FogFadeIn activate
-	this->fogFadeInActivate = true;
-
-	// Activate Fog
-	this->activate();
+    // If Fog is already fading out, stop it
+    this->fogFadeOutActivate = false;
+
+    // If Fog is already on, turn it off first
+    if (this->fogActivate)
+        this->deactivate();
+
+    // If no manual FadeIn value was set, set a default value
+    if (!this->fogFadeInDuration > 0)
+        this->fogFadeInDuration = 20;
+
+    // Reset local timer
+    this->localTimer = 0;
+
+    // set FogFadeIn activate
+    this->fogFadeInActivate = true;
+
+    // Activate Fog
+    this->activate();
 
 }
@@ -194,35 +187,34 @@
 void FogEffect::fadeOutFog() {
 
-	// If Fog is already fading in, stop it
-	this->fogFadeInActivate = false;
-
-	// If Fog is off, turn it on first
-	if (!this->fogActivate)
-		this->activate();
-
-	// If no manual FadeOut value was set, set a default value
-	if (!this->fogFadeOutDuration > 0)
-		this->fogFadeOutDuration = 20;
-
-	// set FogFadeOut activate
-	this->fogFadeOutActivate = true;
-
-	// Reset local timer
-	this->localTimer = 0;
-
-}
-
-
-GLint FogEffect::stringToFogMode(const std::string& mode)
-{
-	if(mode == "GL_LINEAR")
-		return GL_LINEAR;
-	else if(mode == "GL_EXP")
-		return GL_EXP;
-	else if(mode == "GL_EXP2" )
-		return GL_EXP2;
-	else
-		return -1;
-}
-
-
+    // If Fog is already fading in, stop it
+    this->fogFadeInActivate = false;
+
+    // If Fog is off, turn it on first
+    if (!this->fogActivate)
+        this->activate();
+
+    // If no manual FadeOut value was set, set a default value
+    if (!this->fogFadeOutDuration > 0)
+        this->fogFadeOutDuration = 20;
+
+    // set FogFadeOut activate
+    this->fogFadeOutActivate = true;
+
+    // Reset local timer
+    this->localTimer = 0;
+
+}
+
+
+GLint FogEffect::stringToFogMode(const std::string& mode) {
+    if(mode == "GL_LINEAR")
+        return GL_LINEAR;
+    else if(mode == "GL_EXP")
+        return GL_EXP;
+    else if(mode == "GL_EXP2" )
+        return GL_EXP2;
+    else
+        return -1;
+}
+
+
Index: branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h	(revision 8457)
@@ -10,57 +10,76 @@
 #include "weather_effect.h"
 
-class FogEffect : public WeatherEffect
-{
-	public:
-		FogEffect(const TiXmlElement* root = NULL);
-		virtual ~FogEffect();
+class FogEffect : public WeatherEffect {
+public:
+    FogEffect(const TiXmlElement* root = NULL);
+    virtual ~FogEffect();
 
-		virtual void loadParams(const TiXmlElement* root);
+    virtual void loadParams(const TiXmlElement* root);
 
-		virtual void init();
+    virtual void init();
 
-		virtual void activate();
-		virtual void deactivate();
+    virtual void activate();
+    virtual void deactivate();
 
-		void activateFog() { this->activate(); }
-		void deactivateFog() { this->deactivate(); }
+    void activateFog() {
+        this->activate();
+    }
+    void deactivateFog() {
+        this->deactivate();
+    }
 
-		virtual void draw() const;
-		virtual void tick(float dt);
+    virtual void draw() const;
+    virtual void tick(float dt);
 
-		inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); }
-		inline void setFogDensity(float density) { this->fogDensity = density; }
-		inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; }
-		inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); }
-		inline void setFogFadeIn(float fadein) { this->fogFadeInDuration = fadein; }
-		inline void setFogFadeOut(float fadeout) { this->fogFadeOutDuration = fadeout; }
+    inline void setFogMode(const std::string& mode) {
+        this->fogMode = this->stringToFogMode(mode);
+    }
+    inline void setFogDensity(float density) {
+        this->fogDensity = density;
+    }
+    inline void setFogRange(float start, float end) {
+        this->fogStart = start;
+        this->fogEnd = end;
+    }
+    inline void setFogColor(float r, float g, float b) {
+        this->colorVector = Vector(r, g, b);
+    }
+    inline void setFogFadeIn(float fadein) {
+        this->fogFadeInDuration = fadein;
+    }
+    inline void setFogFadeOut(float fadeout) {
+        this->fogFadeOutDuration = fadeout;
+    }
 
-		inline void setFogOption(const std::string& option) { if (option == "activate") this->fogActivate = true; }
+    inline void setFogOption(const std::string& option) {
+        if (option == "activate")
+            this->fogActivate = true;
+    }
 
-		void fadeInFog();
-		void fadeOutFog();
+    void fadeInFog();
+    void fadeOutFog();
 
 
-	private:
-		GLint stringToFogMode(const std::string& mode);
+private:
+    GLint stringToFogMode(const std::string& mode);
 
-		bool				fogActivate;
+    bool        fogActivate;
 
-		bool				fogFadeInActivate;
-		bool				fogFadeOutActivate;
+    bool        fogFadeInActivate;
+    bool        fogFadeOutActivate;
 
-		GLfloat				fogFadeInDuration;
-		GLfloat				fogFadeOutDuration;
+    GLfloat       fogFadeInDuration;
+    GLfloat       fogFadeOutDuration;
 
-		float				localTimer;
-		
-		GLint				fogMode;
-		GLfloat				fogDensity;
-		GLfloat				fogFadeInDensity;
-		GLfloat				fogFadeOutDensity;
+    float       localTimer;
 
-		GLfloat				fogStart;
-		GLfloat				fogEnd;
-		Vector				colorVector;
+    GLint       fogMode;
+    GLfloat       fogDensity;
+    GLfloat       fogFadeInDensity;
+    GLfloat       fogFadeOutDensity;
+
+    GLfloat       fogStart;
+    GLfloat       fogEnd;
+    Vector        colorVector;
 };
 
Index: branches/atmospheric_engine/src/lib/graphics/effects/graphics_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/graphics_effect.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/graphics_effect.cc	(revision 8457)
@@ -32,8 +32,7 @@
   @todo what to do, if no GraphicsEffect-Slots are open anymore ???
  */
-GraphicsEffect::GraphicsEffect(const TiXmlElement* root)
-{
-  this->setClassID(CL_GRAPHICS_EFFECT, "GraphicsEffect");
-  this->bActivated = false;
+GraphicsEffect::GraphicsEffect(const TiXmlElement* root) {
+    this->setClassID(CL_GRAPHICS_EFFECT, "GraphicsEffect");
+    this->bActivated = false;
 }
 
@@ -42,7 +41,5 @@
  *  destroys a GraphicsEffect
  */
-GraphicsEffect::~GraphicsEffect()
-{
-
+GraphicsEffect::~GraphicsEffect() {
 }
 
@@ -51,7 +48,6 @@
  * @param root The XML-element to load the GraphicsEffect from
  */
-void GraphicsEffect::loadParams(const TiXmlElement* root)
-{
-  BaseObject::loadParams(root);
+void GraphicsEffect::loadParams(const TiXmlElement* root) {
+    BaseObject::loadParams(root);
 }
 
@@ -60,6 +56,5 @@
  *  initializes the graphics effect
  */
-bool GraphicsEffect::init()
-{}
+void GraphicsEffect::init() {}
 
 
@@ -68,6 +63,5 @@
  * draws the effect, if needed
  */
-void GraphicsEffect::draw() const
-{}
+void GraphicsEffect::draw() const {}
 
 
@@ -76,4 +70,3 @@
  * ticks the effect if there is any time dependancy
  */
-void GraphicsEffect::tick(float dt)
-{}
+void GraphicsEffect::tick(float dt) {}
Index: branches/atmospheric_engine/src/lib/graphics/effects/graphics_effect.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/graphics_effect.h	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/graphics_effect.h	(revision 8457)
@@ -12,7 +12,6 @@
 
 //! A class that handles GraphicsEffects. The GraphicsEffectManager operates on this.
-class GraphicsEffect : public BaseObject
-{
-  public:
+class GraphicsEffect : public BaseObject {
+public:
     GraphicsEffect(const TiXmlElement* root = NULL);
     virtual ~GraphicsEffect();
@@ -20,16 +19,18 @@
     virtual void loadParams(const TiXmlElement* root);
 
-    virtual bool init();
+    virtual void init();
 
-    virtual bool activate() = 0;
-    virtual bool deactivate() = 0;
+    virtual void activate() = 0;
+    virtual void deactivate() = 0;
 
     virtual void draw() const;
     virtual void tick(float dt);
 
-    inline bool isActivated() const { return this->bActivated; }
+    inline bool isActivated() const {
+        return this->bActivated;
+    }
 
 
-  protected:
+protected:
     bool              bActivated;
 };
Index: branches/atmospheric_engine/src/lib/graphics/effects/lense_flare.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/lense_flare.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/lense_flare.cc	(revision 8457)
@@ -44,29 +44,34 @@
  * @param root The XML-element to load the LenseFlare from
  */
- LenseFlare::LenseFlare(const TiXmlElement* root)
-{
-  this->setClassID(CL_LENSE_FLARE, "LenseFlare");
-
-  this->flareMatrix = new float[14];
-  /*          length                      image scale */
-  this->flareMatrix[0] = 1.0f; this->flareMatrix[1] = 1.0f;
-  this->flareMatrix[2] = 0.5f; this->flareMatrix[3] = 0.5f;
-  this->flareMatrix[4] = 0.33f; this->flareMatrix[5] = 0.25f;
-  this->flareMatrix[6] = 0.125f; this->flareMatrix[7] = 1.0f;
-  this->flareMatrix[8] = -0.5f; this->flareMatrix[9] = 0.5f;
-  this->flareMatrix[10] = -0.25f; this->flareMatrix[11] = 0.15f;
-  this->flareMatrix[12] = -1.82f; this->flareMatrix[13] = 0.25f;
-
-  this->lightSource = (LightManager::getInstance())->getLight(0);
-  PRINTF(0)("light is: %p\n", this->lightSource);
-
-  if (root != NULL)
-  {
-    this->loadParams(root);
-    this->activate();
-  }
-
-  this->bVisible = true;
-  this->setSourceVisibility(false);
+LenseFlare::LenseFlare(const TiXmlElement* root) {
+    this->setClassID(CL_LENSE_FLARE, "LenseFlare");
+
+    this->flareMatrix = new float[14];
+    /*          length                      image scale */
+    this->flareMatrix[0] = 1.0f;
+    this->flareMatrix[1] = 1.0f;
+    this->flareMatrix[2] = 0.5f;
+    this->flareMatrix[3] = 0.5f;
+    this->flareMatrix[4] = 0.33f;
+    this->flareMatrix[5] = 0.25f;
+    this->flareMatrix[6] = 0.125f;
+    this->flareMatrix[7] = 1.0f;
+    this->flareMatrix[8] = -0.5f;
+    this->flareMatrix[9] = 0.5f;
+    this->flareMatrix[10] = -0.25f;
+    this->flareMatrix[11] = 0.15f;
+    this->flareMatrix[12] = -1.82f;
+    this->flareMatrix[13] = 0.25f;
+
+    this->lightSource = (LightManager::getInstance())->getLight(0);
+    PRINTF(0)("light is: %p\n", this->lightSource);
+
+    if (root != NULL) {
+        this->loadParams(root);
+        this->activate();
+    }
+
+    this->bVisible = true;
+    this->setSourceVisibility(false);
 
 }
@@ -76,9 +81,8 @@
  *  destroys a LenseFlare
  */
-LenseFlare::~LenseFlare()
-{
-  std::vector<ImagePlane*>::iterator it;
-  for( it = flares.begin(); it != flares.end(); it++)
-    delete (*it);
+LenseFlare::~LenseFlare() {
+    std::vector<ImagePlane*>::iterator it;
+    for( it = flares.begin(); it != flares.end(); it++)
+        delete (*it);
 }
 
@@ -87,14 +91,13 @@
  * @param root The XML-element to load the LenseFlare from
  */
-void LenseFlare::loadParams(const TiXmlElement* root)
-{
-  GraphicsEffect::loadParams(root);
-
-  LOAD_PARAM_START_CYCLE(root, element);
-  {
-    LoadParam_CYCLE(element, "add-flare-texture", this, LenseFlare, addFlare)
+void LenseFlare::loadParams(const TiXmlElement* root) {
+    GraphicsEffect::loadParams(root);
+
+    LOAD_PARAM_START_CYCLE(root, element);
+    {
+        LoadParam_CYCLE(element, "add-flare-texture", this, LenseFlare, addFlare)
         .describe("adds a lensflare texture to the engine");
-  }
-  LOAD_PARAM_END_CYCLE(element);
+    }
+    LOAD_PARAM_END_CYCLE(element);
 }
 
@@ -103,6 +106,5 @@
  * initializes the fog effect
  */
-bool LenseFlare::init()
-{}
+void LenseFlare::init() {}
 
 
@@ -110,7 +112,6 @@
  * activates the fog effect
  */
-bool LenseFlare::activate()
-{
-  this->bActivated = true;
+void LenseFlare::activate() {
+    this->bActivated = true;
 }
 
@@ -119,7 +120,6 @@
  * deactivates the fog effect
  */
-bool LenseFlare::deactivate()
-{
-  this->bActivated = false;
+void LenseFlare::deactivate() {
+    this->bActivated = false;
 }
 
@@ -129,6 +129,7 @@
  * @param mode the mode character
  */
-GLint LenseFlare::stringToFogMode(const std::string& mode)
-{}
+GLint LenseFlare::stringToFogMode(const std::string& mode) {
+    return 0;
+}
 
 
@@ -145,41 +146,37 @@
  *  7th: Texture of the third burst
  */
-void LenseFlare::addFlare(const std::string& textureName)
-{
-  if( this->flares.size() > LF_MAX_FLARES)
-  {
-    PRINTF(2)("You tried to add more than %i lense flares, ignoring\n", LF_MAX_FLARES);
-    return;
-  }
-
-  ImagePlane* bb = new ImagePlane(NULL);
-  if (this->flares.empty())
-    bb->setLayer(E2D_LAYER_BELOW_ALL);
-  bb->setTexture(textureName);
-  bb->setSize(50, 50);
-  this->flares.push_back(bb);
-  bb->setVisibility(true);
-
-  PRINTF(4)("Added a Lenseflare ImagePlane with texture %s\n", textureName.c_str());
-
-  // the first flare belongs to the light source
-  if( this->flares.size() == 1 && this->lightSource != NULL)
-  {
-    bb->setBindNode(static_cast<PNode*>(this->lightSource));
-  }
-
-  PRINTF(4)("Finished adding\n");
-}
-
-
-void LenseFlare::setSourceVisibility(bool visibility)
-{
-   if (this->bVisible == visibility)
-     return;
-
-  std::vector<ImagePlane*>::const_iterator it;
+void LenseFlare::addFlare(const std::string& textureName) {
+    if( this->flares.size() > LF_MAX_FLARES) {
+        PRINTF(2)("You tried to add more than %i lense flares, ignoring\n", LF_MAX_FLARES);
+        return;
+    }
+
+    ImagePlane* bb = new ImagePlane(NULL);
+    if (this->flares.empty())
+        bb->setLayer(E2D_LAYER_BELOW_ALL);
+    bb->setTexture(textureName);
+    bb->setSize(50, 50);
+    this->flares.push_back(bb);
+    bb->setVisibility(true);
+
+    PRINTF(4)("Added a Lenseflare ImagePlane with texture %s\n", textureName.c_str());
+
+    // the first flare belongs to the light source
+    if( this->flares.size() == 1 && this->lightSource != NULL) {
+        bb->setBindNode(static_cast<PNode*>(this->lightSource));
+    }
+
+    PRINTF(4)("Finished adding\n");
+}
+
+
+void LenseFlare::setSourceVisibility(bool visibility) {
+    if (this->bVisible == visibility)
+        return;
+
+    std::vector<ImagePlane*>::const_iterator it;
     for(it = ++flares.begin(); it != flares.end(); it++)
-      (*it)->setVisibility(visibility);
-  this->bVisible = visibility;
+        (*it)->setVisibility(visibility);
+    this->bVisible = visibility;
 }
 
@@ -188,43 +185,40 @@
  * tick the effect
  */
-void LenseFlare::tick(float dt)
-{
-  if( unlikely(!this->bActivated || this->flares.size() == 0))
-    return;
-
-  // refetch light source information if needed
-  if( unlikely( this->lightSource == NULL))
-  {
-    this->lightSource = (LightManager::getInstance())->getLight(0);
-    if( this->flares.size() > 0)
-      this->flares[0]->setBindNode(static_cast<PNode*>(this->lightSource));
-  }
+void LenseFlare::tick(float dt) {
+    if( unlikely(!this->bActivated || this->flares.size() == 0))
+        return;
+
+    // refetch light source information if needed
+    if( unlikely( this->lightSource == NULL)) {
+        this->lightSource = (LightManager::getInstance())->getLight(0);
+        if( this->flares.size() > 0)
+            this->flares[0]->setBindNode(static_cast<PNode*>(this->lightSource));
+    }
 
     //set the frustum plane
-  if (!flares.empty())
-    this->setSourceVisibility(this->flares[0]->isVisible());
-
-
-  // always update the screen center, it could be, that the window is resized
-  this->screenCenter = Vector2D(State::getResX()/2.0f, State::getResY()/2.0f);
-
-  // flare vector is the direction from the center to the light source
-  this->flareVector = this->flares[0]->getAbsCoor2D() - this->screenCenter;
-  this->distance = this->flareVector.len();
-  this->flareVector.normalize();
-
-  // now calculate the new coordinates of the billboards
-  std::vector<ImagePlane*>::iterator it;
-  int i;
-  for( it = flares.begin(), i = 0; it != flares.end(); it++, i++)
-  {
-    // set the new position
-    if( i == 0)
-      continue;
-
-    (*it)->setAbsCoor2D( this->screenCenter + this->flareVector * this->flareMatrix[i * 2] * this->distance);
-    (*it)->setSize2D(50.0f * this->flareMatrix[i * 2 + 1], 50.0f * this->flareMatrix[i * 2 + 1]);
-    PRINTF(5)("Tick flare %i @ (%f, %f)\n", i, (*it)->getAbsCoor2D().x, (*it)->getAbsCoor2D().y);
-  }
+    if (!flares.empty())
+        this->setSourceVisibility(this->flares[0]->isVisible());
+
+
+    // always update the screen center, it could be, that the window is resized
+    this->screenCenter = Vector2D(State::getResX()/2.0f, State::getResY()/2.0f);
+
+    // flare vector is the direction from the center to the light source
+    this->flareVector = this->flares[0]->getAbsCoor2D() - this->screenCenter;
+    this->distance = this->flareVector.len();
+    this->flareVector.normalize();
+
+    // now calculate the new coordinates of the billboards
+    std::vector<ImagePlane*>::iterator it;
+    int i;
+    for( it = flares.begin(), i = 0; it != flares.end(); it++, i++) {
+        // set the new position
+        if( i == 0)
+            continue;
+
+        (*it)->setAbsCoor2D( this->screenCenter + this->flareVector * this->flareMatrix[i * 2] * this->distance);
+        (*it)->setSize2D(50.0f * this->flareMatrix[i * 2 + 1], 50.0f * this->flareMatrix[i * 2 + 1]);
+        PRINTF(5)("Tick flare %i @ (%f, %f)\n", i, (*it)->getAbsCoor2D().x, (*it)->getAbsCoor2D().y);
+    }
 }
 
@@ -233,7 +227,6 @@
  * draws the LenseFlares
  */
-void LenseFlare::draw() const
-{
-  if( !this->bActivated)
-    return;
-}
+void LenseFlare::draw() const {
+    if( !this->bActivated)
+        return;
+}
Index: branches/atmospheric_engine/src/lib/graphics/effects/lense_flare.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/lense_flare.h	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/lense_flare.h	(revision 8457)
@@ -31,8 +31,8 @@
     virtual void loadParams(const TiXmlElement* root);
 
-    virtual bool init();
+    virtual void init();
 
-    virtual bool activate();
-    virtual bool deactivate();
+    virtual void activate();
+    virtual void deactivate();
 
     virtual void draw() const;
Index: branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc	(revision 8457)
@@ -39,91 +39,87 @@
 
 /* TODO:
-	- preCaching
-	- test multiple rain emitters
-	- Think about what happens with building poss. to hang movewithcam off
-	- Possible to activate lightening
-	- turn off visibility when in a building
-	- variable emitter size depending on playable
+  - preCaching
+  - test multiple rain emitters
+  - Think about what happens with building poss. to hang movewithcam off
+  - Possible to activate lightening
+  - turn off visibility when in a building
+  - variable emitter size depending on playable
 */
 
-RainEffect::RainEffect(const TiXmlElement* root)
-{
-	this->setClassID(CL_RAIN_EFFECT, "RainEffect");
-
-	this->init();
-
-	if (root != NULL)
-		this->loadParams(root);
-
-	//load rain sound
-	if (this->rainBuffer != NULL)
-		ResourceManager::getInstance()->unload(this->rainBuffer);
-	this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/rain.wav", WAV);
-
-	//load wind sound
-	if (this->rainWindForce != 0) {
-		if (this->windBuffer != NULL)
-			ResourceManager::getInstance()->unload(this->windBuffer);
-		this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
-	}
-
-	if(rainActivate)
-		this->activate();
-}
-
-RainEffect::~RainEffect()
-{
-	this->deactivate();
-
-	if (this->rainBuffer != NULL)
-		ResourceManager::getInstance()->unload(this->rainBuffer);
-
-	if (this->windBuffer != NULL)
-		ResourceManager::getInstance()->unload(this->windBuffer);
-}
-
-void RainEffect::loadParams(const TiXmlElement* root)
-{
-	WeatherEffect::loadParams(root);
-
-	LoadParam(root, "coord", this, RainEffect, setRainCoord);
-	LoadParam(root, "size", this, RainEffect, setRainSize);
-	LoadParam(root, "rate", this, RainEffect, setRainRate);
-	LoadParam(root, "velocity", this, RainEffect, setRainVelocity);
-	LoadParam(root, "life", this, RainEffect, setRainLife);
-	LoadParam(root, "wind", this, RainEffect, setRainWind);
-	LoadParam(root, "fadeinduration", this, RainEffect, setRainFadeIn);
-	LoadParam(root, "fadeoutduration", this, RainEffect, setRainFadeOut);
-
-	LOAD_PARAM_START_CYCLE(root, element);
-	{
-		LoadParam_CYCLE(element, "option", this, RainEffect, setRainOption);
-	}
-	LOAD_PARAM_END_CYCLE(element);
-
-}
-
-
-void RainEffect::init()
-{
-	//Default values
-	this->rainActivate = false;
-	this->rainMove = false;
-	this->rainCoord = Vector(500, 500, 500);
-	this->rainSize = Vector2D(1000, 1000);
-	this->rainRate = 4000;
-	this->rainVelocity = -300;
-	this->rainLife = 4;
-	this->rainMaxParticles = this->rainRate * this->rainLife;
-	this->rainWindForce  = 0;
-	this->rainFadeInDuration = 0;
-	this->rainFadeOutDuration = 0;
-	this->localTimer = 0;
-	this->soundRainVolume = 0.8f;
-
-	this->emitter = new PlaneEmitter(this->rainSize);
-
-	lightMan = LightManager::getInstance();
-	this->rainAmbient = lightMan->getAmbientColor();
+RainEffect::RainEffect(const TiXmlElement* root) {
+    this->setClassID(CL_RAIN_EFFECT, "RainEffect");
+
+    this->init();
+
+    if (root != NULL)
+        this->loadParams(root);
+
+    //load rain sound
+    if (this->rainBuffer != NULL)
+        ResourceManager::getInstance()->unload(this->rainBuffer);
+    this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/rain.wav", WAV);
+
+    //load wind sound
+    if (this->rainWindForce != 0) {
+        if (this->windBuffer != NULL)
+            ResourceManager::getInstance()->unload(this->windBuffer);
+        this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
+    }
+
+    if(rainActivate)
+        this->activate();
+}
+
+RainEffect::~RainEffect() {
+    this->deactivate();
+
+    if (this->rainBuffer != NULL)
+        ResourceManager::getInstance()->unload(this->rainBuffer);
+
+    if (this->windBuffer != NULL)
+        ResourceManager::getInstance()->unload(this->windBuffer);
+}
+
+void RainEffect::loadParams(const TiXmlElement* root) {
+    WeatherEffect::loadParams(root);
+
+    LoadParam(root, "coord", this, RainEffect, setRainCoord);
+    LoadParam(root, "size", this, RainEffect, setRainSize);
+    LoadParam(root, "rate", this, RainEffect, setRainRate);
+    LoadParam(root, "velocity", this, RainEffect, setRainVelocity);
+    LoadParam(root, "life", this, RainEffect, setRainLife);
+    LoadParam(root, "wind", this, RainEffect, setRainWind);
+    LoadParam(root, "fadeinduration", this, RainEffect, setRainFadeIn);
+    LoadParam(root, "fadeoutduration", this, RainEffect, setRainFadeOut);
+
+    LOAD_PARAM_START_CYCLE(root, element);
+    {
+        LoadParam_CYCLE(element, "option", this, RainEffect, setRainOption);
+    }
+    LOAD_PARAM_END_CYCLE(element);
+
+}
+
+
+void RainEffect::init() {
+    //Default values
+    this->rainActivate = false;
+    this->rainMove = false;
+    this->rainCoord = Vector(500, 500, 500);
+    this->rainSize = Vector2D(1000, 1000);
+    this->rainRate = 4000;
+    this->rainVelocity = -300;
+    this->rainLife = 4;
+    this->rainMaxParticles = this->rainRate * this->rainLife;
+    this->rainWindForce  = 0;
+    this->rainFadeInDuration = 0;
+    this->rainFadeOutDuration = 0;
+    this->localTimer = 0;
+    this->soundRainVolume = 0.8f;
+
+    this->emitter = new PlaneEmitter(this->rainSize);
+
+    lightMan = LightManager::getInstance();
+    this->rainAmbient = lightMan->getAmbientColor();
 }
 
@@ -131,125 +127,121 @@
 SparkParticles* RainEffect::rainParticles = NULL;
 
-void RainEffect::activate()
-{
-	PRINTF(0)( "Activating RainEffect, coord: %f, %f, %f, size: %f, %f, rate: %f, velocity: %f, moveRain: %s\n", this->rainCoord.x, this->rainCoord.y, this->rainCoord.z, this->rainSize.x, this-> rainSize.y, this->rainRate, this->rainVelocity, this->rainMove ? "true" : "false" );
-
-	this->rainActivate = true;
-
-	if (unlikely(RainEffect::rainParticles == NULL))
-	{
-		RainEffect::rainParticles = new SparkParticles((int) this->rainMaxParticles);
-		RainEffect::rainParticles->setName("RainParticles");
-		RainEffect::rainParticles->precache((int)this->rainLife, 30); // TODO: Why doesnt this work??
-		RainEffect::rainParticles->setLifeSpan(this->rainLife, 2);
-		RainEffect::rainParticles->setRadius(0, 0.03);
-		RainEffect::rainParticles->setRadius(0.2, 0.02);
-		RainEffect::rainParticles->setRadius(1, 0.01);
-		RainEffect::rainParticles->setColor(0, 0.3, 0.3, 0.5, 0.2);	// grey blue 1
-		RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2);	// grey blue 2
-		RainEffect::rainParticles->setColor(1, 0.7, 0.7, 0.7, 0.2);	// light grey
-	}
-
-	this->emitter->setSystem(RainEffect::rainParticles);
-
-	this->emitter->setRelCoor(this->rainCoord);
-
-	this->emitter->setEmissionRate(this->rainRate);
-	this->emitter->setEmissionVelocity(this->rainVelocity);
-
-	this->emitter->setSpread(this->rainWindForce / 50, 0.2);
-	
-	this->soundSource.loop(this->rainBuffer, this->soundRainVolume);
-	if (this->rainWindForce != 0) this->soundSource.loop(this->windBuffer, 0.1f * this->rainWindForce);
-
-	if (this->rainFadeInDuration == 0)
-		lightMan->setAmbientColor(.1,.1,.1);
-
-}
-
-
-void RainEffect::deactivate()
-{
-	PRINTF(0)("Deactivating RainEffect\n");
-	
-	this->rainActivate = false;
-	this->emitter->setSystem(NULL);
-
-	// Stop Sound
-	this->soundSource.stop();
-
-	// Restore Light Ambient
-	lightMan->setAmbientColor(this->rainAmbient, this->rainAmbient, this->rainAmbient);
-
-}
-
-void RainEffect::tick (float dt)
-{
-	if (!this->rainActivate)
-		return;
-		
-	if (this->rainMove) {
-		this->rainCoord = State::getCameraNode()->getAbsCoor();
-		this->emitter->setRelCoor(this->rainCoord.x , this->rainCoord.y+800, this->rainCoord.z);
-	}
-
-	if (this->rainFadeInDuration != 0 && this->localTimer < this->rainFadeInDuration) {
-		this->localTimer += dt;
-		float progress = this->localTimer / this->rainFadeInDuration;
-
-		// Dim Light
-		lightMan->setAmbientColor(1 - progress * 0.9, 1 - progress * 0.9, 1 - progress * 0.9);
-
-		// use alpha in color to fade in
-		RainEffect::rainParticles->setColor(0,   0.3, 0.3, 0.5, 0.2 * progress); // grey blue 1
-		RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2 * progress); // grey blue 2
-		RainEffect::rainParticles->setColor(1,   0.7, 0.7, 0.7, 0.2 * progress); // light grey
-
-		// increase radius for more "heavy" rain
-		RainEffect::rainParticles->setRadius(0, 0.03 * progress);
-		RainEffect::rainParticles->setRadius(0.2, 0.02 * progress);
-		RainEffect::rainParticles->setRadius(1, 0.01 * progress);
-
-		// increase sound volume
-		// this->soundSource.fadein(this->rainBuffer, 10);
-	}
-	else if ( this->rainFadeOutDuration != 0 ) {
-		if ( this->localTimer < this->rainFadeOutDuration ) {
-			this->localTimer += dt;
-			float progress = 1 - (this->localTimer / this->rainFadeOutDuration);
-	
-			// Fade In Light
-			lightMan->setAmbientColor(1 - progress * 0.9, 1 - progress * 0.9, 1 - progress * 0.9);
-
-			// use alpha in color to fade out
-			RainEffect::rainParticles->setColor(0,   0.3, 0.3, 0.5, 0.2 * progress); // grey blue 1
-			RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2 * progress); // grey blue 2
-			RainEffect::rainParticles->setColor(1,   0.7, 0.7, 0.7, 0.2 * progress); // light grey
-	
-			// decrease radius
-			RainEffect::rainParticles->setRadius(0, 0.03 * progress);
-			RainEffect::rainParticles->setRadius(0.2, 0.02 * progress);
-			RainEffect::rainParticles->setRadius(1, 0.01 * progress);
-	
-			// decrease sound volume
-			// this->soundSource.fadeout(this->rainBuffer, 10);
-		}
-		else
-			this->deactivate();
-	}
-	
+void RainEffect::activate() {
+    PRINTF(0)( "Activating RainEffect, coord: %f, %f, %f, size: %f, %f, rate: %f, velocity: %f, moveRain: %s\n", this->rainCoord.x, this->rainCoord.y, this->rainCoord.z, this->rainSize.x, this-> rainSize.y, this->rainRate, this->rainVelocity, this->rainMove ? "true" : "false" );
+
+    this->rainActivate = true;
+
+    if (unlikely(RainEffect::rainParticles == NULL)) {
+        RainEffect::rainParticles = new SparkParticles((int) this->rainMaxParticles);
+        RainEffect::rainParticles->setName("RainParticles");
+        RainEffect::rainParticles->setLifeSpan(this->rainLife, 2);
+        RainEffect::rainParticles->setRadius(0, 0.03);
+        RainEffect::rainParticles->setRadius(0.2, 0.02);
+        RainEffect::rainParticles->setRadius(1, 0.01);
+        RainEffect::rainParticles->setColor(0, 0.3, 0.3, 0.5, 0.2); // grey blue 1
+        RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2); // grey blue 2
+        RainEffect::rainParticles->setColor(1, 0.7, 0.7, 0.7, 0.2); // light grey
+    }
+
+    this->emitter->setSystem(RainEffect::rainParticles);
+
+    this->emitter->setRelCoor(this->rainCoord);
+
+    this->emitter->setEmissionRate(this->rainRate);
+    this->emitter->setEmissionVelocity(this->rainVelocity);
+
+    this->emitter->setSpread(this->rainWindForce / 50, 0.2);
+
+    RainEffect::rainParticles->precache((int)this->rainLife);
+
+    this->soundSource.loop(this->rainBuffer, this->soundRainVolume);
+    if (this->rainWindForce != 0)
+        this->soundSource.loop(this->windBuffer, 0.1f * this->rainWindForce);
+
+    if (this->rainFadeInDuration == 0)
+        lightMan->setAmbientColor(.1,.1,.1);
+
+}
+
+
+void RainEffect::deactivate() {
+    PRINTF(0)("Deactivating RainEffect\n");
+
+    this->rainActivate = false;
+    this->emitter->setSystem(NULL);
+
+    // Stop Sound
+    this->soundSource.stop();
+
+    // Restore Light Ambient
+    lightMan->setAmbientColor(this->rainAmbient, this->rainAmbient, this->rainAmbient);
+
+}
+
+void RainEffect::tick (float dt) {
+    if (!this->rainActivate)
+        return;
+
+    if (this->rainMove) {
+        this->rainCoord = State::getCameraNode()->getAbsCoor();
+        this->emitter->setRelCoor(this->rainCoord.x , this->rainCoord.y+800, this->rainCoord.z);
+    }
+
+    if (this->rainFadeInDuration != 0 && this->localTimer < this->rainFadeInDuration) {
+        this->localTimer += dt;
+        float progress = this->localTimer / this->rainFadeInDuration;
+
+        // Dim Light
+        lightMan->setAmbientColor(1 - progress * 0.9, 1 - progress * 0.9, 1 - progress * 0.9);
+
+        // use alpha in color to fade in
+        RainEffect::rainParticles->setColor(0,   0.3, 0.3, 0.5, 0.2 * progress); // grey blue 1
+        RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2 * progress); // grey blue 2
+        RainEffect::rainParticles->setColor(1,   0.7, 0.7, 0.7, 0.2 * progress); // light grey
+
+        // increase radius for more "heavy" rain
+        RainEffect::rainParticles->setRadius(0, 0.03 * progress);
+        RainEffect::rainParticles->setRadius(0.2, 0.02 * progress);
+        RainEffect::rainParticles->setRadius(1, 0.01 * progress);
+
+        // increase sound volume
+        // this->soundSource.fadein(this->rainBuffer, 10);
+    } else if ( this->rainFadeOutDuration != 0 ) {
+        if ( this->localTimer < this->rainFadeOutDuration ) {
+            this->localTimer += dt;
+            float progress = 1 - (this->localTimer / this->rainFadeOutDuration);
+
+            // Fade In Light
+            lightMan->setAmbientColor(1 - progress * 0.9, 1 - progress * 0.9, 1 - progress * 0.9);
+
+            // use alpha in color to fade out
+            RainEffect::rainParticles->setColor(0,   0.3, 0.3, 0.5, 0.2 * progress); // grey blue 1
+            RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2 * progress); // grey blue 2
+            RainEffect::rainParticles->setColor(1,   0.7, 0.7, 0.7, 0.2 * progress); // light grey
+
+            // decrease radius
+            RainEffect::rainParticles->setRadius(0, 0.03 * progress);
+            RainEffect::rainParticles->setRadius(0.2, 0.02 * progress);
+            RainEffect::rainParticles->setRadius(1, 0.01 * progress);
+
+            // decrease sound volume
+            // this->soundSource.fadeout(this->rainBuffer, 10);
+        } else
+            this->deactivate();
+    }
+
 }
 
 void RainEffect::startRaining() {
 
-	if (this->rainActivate)
-		this->deactivate();
-
-	if (!this->rainFadeInDuration > 0)
-		this->rainFadeInDuration = 20;
-
-	this->localTimer = 0;
-
-	this->activate();
+    if (this->rainActivate)
+        this->deactivate();
+
+    if (!this->rainFadeInDuration > 0)
+        this->rainFadeInDuration = 20;
+
+    this->localTimer = 0;
+
+    this->activate();
 
 }
@@ -257,11 +249,11 @@
 void RainEffect::stopRaining() {
 
-	if (!this->rainActivate)
-		this->activate();
-
-	if (!this->rainFadeOutDuration > 0)
-		this->rainFadeOutDuration = 20;
-
-	this->localTimer = 0;
-
-}
+    if (!this->rainActivate)
+        this->activate();
+
+    if (!this->rainFadeOutDuration > 0)
+        this->rainFadeOutDuration = 20;
+
+    this->localTimer = 0;
+
+}
Index: branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h	(revision 8457)
@@ -22,67 +22,88 @@
 
 
-class RainEffect : public WeatherEffect
-{
-	public:
-		RainEffect(const TiXmlElement* root = NULL);
-		virtual ~RainEffect();
+class RainEffect : public WeatherEffect {
+public:
+    RainEffect(const TiXmlElement* root = NULL);
+    virtual ~RainEffect();
 
-		virtual void loadParams(const TiXmlElement* root);
+    virtual void loadParams(const TiXmlElement* root);
 
-		virtual void init();
+    virtual void init();
 
-		virtual void activate();
-		virtual void deactivate();
+    virtual void activate();
+    virtual void deactivate();
 
-		inline void activateRain() { this->activate(); }
-		inline void deactivateRain() { this->deactivate(); }
+    inline void activateRain() {
+        this->activate();
+    }
+    inline void deactivateRain() {
+        this->deactivate();
+    }
 
-		virtual void tick(float dt);
+    virtual void tick(float dt);
 
-		void startRaining();
-		void stopRaining();
+    void startRaining();
+    void stopRaining();
 
-		inline void setRainCoord(float x, float y, float z) { this->rainCoord = Vector(x, y, z); }
-		inline void setRainSize(float x, float y) { this->rainSize = Vector2D(x, y); }
-		inline void setRainRate(float rate) { this->rainRate = rate;}
-		inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; }
-		inline void setRainLife(float life) { this->rainLife = life; }
-		inline void setRainWind(int force) { this->rainWindForce = force; }
+    inline void setRainCoord(float x, float y, float z) {
+        this->rainCoord = Vector(x, y, z);
+    }
+    inline void setRainSize(float x, float y) {
+        this->rainSize = Vector2D(x, y);
+    }
+    inline void setRainRate(float rate) {
+        this->rainRate = rate;
+    }
+    inline void setRainVelocity(float velocity) {
+        this->rainVelocity = -velocity;
+    }
+    inline void setRainLife(float life) {
+        this->rainLife = life;
+    }
+    inline void setRainWind(int force) {
+        this->rainWindForce = force;
+    }
 
-		inline void setRainFadeIn(float fadein) { this->rainFadeInDuration = fadein; }
-		inline void setRainFadeOut(float fadeout) { this->rainFadeOutDuration = fadeout; }
+    inline void setRainFadeIn(float fadein) {
+        this->rainFadeInDuration = fadein;
+    }
+    inline void setRainFadeOut(float fadeout) {
+        this->rainFadeOutDuration = fadeout;
+    }
 
-		inline void setRainOption(const std::string& option) {
-			if (option == "moverain") this->rainMove = true;
-			if (option == "activate") this->rainActivate = true;
-		}
+    inline void setRainOption(const std::string& option) {
+        if (option == "moverain")
+            this->rainMove = true;
+        if (option == "activate")
+            this->rainActivate = true;
+    }
 
 
-	private:
-		static SparkParticles*			rainParticles;
-		ParticleEmitter*			emitter;
+private:
+    static SparkParticles*      rainParticles;
+    ParticleEmitter*      emitter;
 
-		GLfloat					rainFadeInDuration;
-		GLfloat					rainFadeOutDuration;
-		float					localTimer;
+    GLfloat         rainFadeInDuration;
+    GLfloat         rainFadeOutDuration;
+    float         localTimer;
 
-		Vector					rainCoord;
-		Vector2D				rainSize;
-		GLfloat					rainRate;
-		GLfloat					rainVelocity;
-		GLfloat					rainLife;
-		GLfloat					rainMaxParticles;
-		int					rainWindForce;
-		bool					rainMove;
-		bool					rainActivate;
+    Vector          rainCoord;
+    Vector2D        rainSize;
+    GLfloat         rainRate;
+    GLfloat         rainVelocity;
+    GLfloat         rainLife;
+    GLfloat         rainMaxParticles;
+    int         rainWindForce;
+    bool          rainMove;
+    bool          rainActivate;
 
-		OrxSound::SoundSource			soundSource;
-		OrxSound::SoundBuffer*			rainBuffer;
-		OrxSound::SoundBuffer*			windBuffer;
+    OrxSound::SoundSource     soundSource;
+    OrxSound::SoundBuffer*      rainBuffer;
+    OrxSound::SoundBuffer*      windBuffer;
 
-		float					soundRainVolume;
+    float         soundRainVolume;
 
-		LightManager*				lightMan;
-		GLfloat					rainAmbient;
+    LightManager*       lightMan;
+    GLfloat         rainAmbient;
 
 };
Index: branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc	(revision 8457)
@@ -96,5 +96,5 @@
 	this->particles = 12000;
 	this->texture = "maps/snow_flake_01_32x32.png";
-	this->life = 8;
+	this->snowLife = 8;
 	this->randomLife = 2;
 	this->snowRadius = 3.5;
@@ -122,5 +122,5 @@
 	SnowEffect::snowParticles->setName("SnowEffectTrailParticles");
 	SnowEffect::snowParticles->setMaterialTexture(texture);
-	SnowEffect::snowParticles->setLifeSpan(life, randomLife);
+	SnowEffect::snowParticles->setLifeSpan(snowLife, randomLife);
 	SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius);
 	SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius*0.8);
@@ -139,5 +139,5 @@
 	this->emitter->setSize(snowSize);
 
-	// SnowEffect::snowParticles->precache(8);
+  SnowEffect::snowParticles->precache((int) this->snowLife);
 
 	if (this->snowWindForce > 1)
Index: branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h	(revision 8457)
@@ -20,64 +20,93 @@
 #include "sound_buffer.h"
 
-class SnowEffect : public WeatherEffect
-{
-	public:
-		SnowEffect(const TiXmlElement* root = NULL);
-		virtual ~SnowEffect();
+class SnowEffect : public WeatherEffect {
+public:
+    SnowEffect(const TiXmlElement* root = NULL);
+    virtual ~SnowEffect();
 
-		virtual void loadParams(const TiXmlElement* root);
+    virtual void loadParams(const TiXmlElement* root);
 
-		virtual void init();
+    virtual void init();
 
-		virtual void activate();
-		virtual void deactivate();
+    virtual void activate();
+    virtual void deactivate();
 
-		inline void activateSnow() { this->activate(); }
-		inline void deactivateSnow() { this->deactivate(); }
-		
-		virtual void draw() const;
-		virtual void tick(float dt);
+    inline void activateSnow() {
+        this->activate();
+    }
+    inline void deactivateSnow() {
+        this->deactivate();
+    }
+
+    virtual void draw() const;
+    virtual void tick(float dt);
 
 
-		inline void numParticles(int n) { this->particles = n; }
-		inline void materialTexture(const std::string& texture) { this->texture = texture; }
-		inline void lifeSpan(float lifeSpan, float randomLifeSpan) { this->life = lifeSpan; this->randomLife = randomLifeSpan; }
-		inline void radius(float radius, float randomRadius) { this->snowRadius = radius; this->randomRadius = randomRadius; }
-		inline void mass(float mass, float randomMass) { this->snowMass = mass; this->randomMass = randomMass; }
-		inline void emissionRate(float emissionRate){ this->rate = emissionRate; }
-		inline void emissionVelocity(float velocity, float randomVelocity){ this->velocity = velocity; this->randomVelocity = randomVelocity; }
-		inline void size(float sizeX, float sizeY) { this->snowSize = Vector2D(sizeX, sizeY); }
-		inline void coord(float x, float y, float z) { this->snowCoord = Vector(x, y, z); }
-		inline void wind(int force) { this->snowWindForce = force; }
+    inline void numParticles(int n) {
+        this->particles = n;
+    }
+    inline void materialTexture(const std::string& texture) {
+        this->texture = texture;
+    }
+    inline void lifeSpan(float lifeSpan, float randomLifeSpan) {
+        this->snowLife = lifeSpan;
+        this->randomLife = randomLifeSpan;
+    }
+    inline void radius(float radius, float randomRadius) {
+        this->snowRadius = radius;
+        this->randomRadius = randomRadius;
+    }
+    inline void mass(float mass, float randomMass) {
+        this->snowMass = mass;
+        this->randomMass = randomMass;
+    }
+    inline void emissionRate(float emissionRate) {
+        this->rate = emissionRate;
+    }
+    inline void emissionVelocity(float velocity, float randomVelocity) {
+        this->velocity = velocity;
+        this->randomVelocity = randomVelocity;
+    }
+    inline void size(float sizeX, float sizeY) {
+        this->snowSize = Vector2D(sizeX, sizeY);
+    }
+    inline void coord(float x, float y, float z) {
+        this->snowCoord = Vector(x, y, z);
+    }
+    inline void wind(int force) {
+        this->snowWindForce = force;
+    }
 
-		inline void setSnowOption(const std::string& option) {
-			/*if (option == "fade") this->snowFade = true;*/
-			if (option == "movesnow") this->snowMove = true;
-			if (option == "activate") this->snowActivate = true;
-		}
+    inline void setSnowOption(const std::string& option) {
+        /*if (option == "fade") this->snowFade = true;*/
+        if (option == "movesnow")
+            this->snowMove = true;
+        if (option == "activate")
+            this->snowActivate = true;
+    }
 
 
-	private:
-		int 				particles;
-		std::string 			texture;
-		float				life, randomLife;
-		float				snowRadius, randomRadius;
-		float				snowMass, randomMass;
-		float 				rate;
-		float 				velocity, randomVelocity;
-		float 				angle, randomAngle;
-		float 				alpha;
-		Vector 				snowCoord;
-		Vector2D 			snowSize;
-		int				snowWindForce;
+private:
+    int         particles;
+    std::string       texture;
+    float       snowLife, randomLife;
+    float       snowRadius, randomRadius;
+    float       snowMass, randomMass;
+    float         rate;
+    float         velocity, randomVelocity;
+    float         angle, randomAngle;
+    float         alpha;
+    Vector        snowCoord;
+    Vector2D      snowSize;
+    int       snowWindForce;
 
-		bool 				snowMove;
-		bool 				snowActivate;
+    bool        snowMove;
+    bool        snowActivate;
 
-		PlaneEmitter*			emitter;
+    PlaneEmitter*     emitter;
 
-		static SpriteParticles*		snowParticles;
-		OrxSound::SoundSource		soundSource;
-		OrxSound::SoundBuffer*		windBuffer;
+    static SpriteParticles*   snowParticles;
+    OrxSound::SoundSource   soundSource;
+    OrxSound::SoundBuffer*    windBuffer;
 
 };
Index: branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc	(revision 8457)
@@ -1,14 +1,14 @@
 /*
-	orxonox - the future of 3D-vertical-scrollers
+  orxonox - the future of 3D-vertical-scrollers
 
-	Copyright (C) 2004 orx
+  Copyright (C) 2004 orx
 
-	This program is free software; you can redistribute it and/or modify
-	it under the terms of the GNU General Public License as published by
-	the Free Software Foundation; either version 2, or (at your option)
-	any later version.
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2, or (at your option)
+  any later version.
 
 ### File Specific:
-	main-programmer: hdavid, amaechler
+  main-programmer: hdavid, amaechler
 */
 
@@ -51,84 +51,78 @@
 CREATE_FACTORY(VolFogEffect, CL_VOLFOG_EFFECT);
 
-VolFogEffect::VolFogEffect(const TiXmlElement* root)
-{
-	this->setClassID(CL_VOLFOG_EFFECT, "VolFogEffect");
+VolFogEffect::VolFogEffect(const TiXmlElement* root) {
+    this->setClassID(CL_VOLFOG_EFFECT, "VolFogEffect");
 
-	if (root != NULL)
-		this->loadParams(root);
+    if (root != NULL)
+        this->loadParams(root);
 
-	// Initialize Effect
-	this->init();
+    // Initialize Effect
+    this->init();
 
-	// Activate Effect
-	this->activate();
+    // Activate Effect
+    this->activate();
 }
 
 
-VolFogEffect::~VolFogEffect()
-{
-	this->deactivate();
+VolFogEffect::~VolFogEffect() {
+    this->deactivate();
 }
 
-void VolFogEffect::loadParams(const TiXmlElement* root)
-{
-	WeatherEffect::loadParams(root);
+void VolFogEffect::loadParams(const TiXmlElement* root) {
+    WeatherEffect::loadParams(root);
 }
 
-void VolFogEffect::init()
-{
-	PRINTF(0)("Initalize VolFogEffect\n");
+void VolFogEffect::init() {
+    PRINTF(0)("Initalize VolFogEffect\n");
 
-	// set fog mode
-	GLenum fogMode  = GL_EXP;
+    // set fog mode
+    GLenum fogMode  = GL_EXP;
 
-	// set fog density
-	float  fogDensity  = 0.001f;
+    // set fog density
+    float  fogDensity  = 0.001f;
 
-	// set fog near & far distance
-	float fogStart = 0.0f;
-	float fogEnd   = 1000.0f;
+    // set fog near & far distance
+    float fogStart = 0.0f;
+    float fogEnd   = 1000.0f;
 
-	// Set fog color
-	float fogColor[4] = {0.6f,0.58f,0.79f,0.0f};
+    // Set fog color
+    float fogColor[4] = {0.6f,0.58f,0.79f,0.0f};
 
 
-	glFogCoordfEXT       = (PFNGLFOGCOORDFEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfEXT");
-	glFogCoordfvEXT      = (PFNGLFOGCOORDFVEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfvEXT");
-	glFogCoorddEXT       = (PFNGLFOGCOORDDEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoorddEXT");
-	glFogCoorddvEXT      = (PFNGLFOGCOORDDVEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoorddvEXT");
-	glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordPointerEXT");
+    glFogCoordfEXT       = (PFNGLFOGCOORDFEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfEXT");
+    glFogCoordfvEXT      = (PFNGLFOGCOORDFVEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfvEXT");
+    glFogCoorddEXT       = (PFNGLFOGCOORDDEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoorddEXT");
+    glFogCoorddvEXT      = (PFNGLFOGCOORDDVEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoorddvEXT");
+    glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordPointerEXT");
 
-	// set the fog attributes
-	glFogf (GL_FOG_START,  fogStart);
-	glFogf (GL_FOG_END,    fogEnd);
-	glFogfv(GL_FOG_COLOR,  fogColor);
-	glFogi (GL_FOG_MODE,   fogMode);
-	glFogf (GL_FOG_DENSITY,fogDensity);
-	glFogi (GL_FOG_COORDINATE_SOURCE_EXT,GL_FOG_COORDINATE_EXT);
+    // set the fog attributes
+    glFogf (GL_FOG_START,  fogStart);
+    glFogf (GL_FOG_END,    fogEnd);
+    glFogfv(GL_FOG_COLOR,  fogColor);
+    glFogi (GL_FOG_MODE,   fogMode);
+    glFogf (GL_FOG_DENSITY,fogDensity);
+    glFogi (GL_FOG_COORDINATE_SOURCE_EXT,GL_FOG_COORDINATE_EXT);
 
-	// enable the fog
-	glEnable(GL_FOG);
+    // enable the fog
+    glEnable(GL_FOG);
 
-	if (glewInit() == GLEW_OK)
-		PRINTF(0)("glewInit OK\n");
-	else
-		PRINTF(0)("glewInit failed\n");
+    if (glewInit() == GLEW_OK)
+        PRINTF(0)("glewInit OK\n");
+    else
+        PRINTF(0)("glewInit failed\n");
 
-	if (glewGetExtension("GL_EXT_fog_coord"))
-		PRINTF(0)("GL_EXT_fog_coord extension found\n");
+    if (glewGetExtension("GL_EXT_fog_coord"))
+        PRINTF(0)("GL_EXT_fog_coord extension found\n");
 }
 
 
-void VolFogEffect::activate()
-{
-	PRINTF(0)("Activating VolFogEffect\n");
+void VolFogEffect::activate() {
+    PRINTF(0)("Activating VolFogEffect\n");
 }
 
-void VolFogEffect::deactivate()
-{
-	PRINTF(0)("Deactivating VolFogEffect\n");
+void VolFogEffect::deactivate() {
+    PRINTF(0)("Deactivating VolFogEffect\n");
 
-	glDisable(GL_FOG);
+    glDisable(GL_FOG);
 }
 
@@ -137,62 +131,60 @@
 * draws the effect, if needed
 */
-void VolFogEffect::draw() const
-{
-  glPushAttrib(GL_ENABLE_BIT);
-  glClearColor(fogColor[0],fogColor[1],fogColor[2],0.0f);
-	glShadeModel(GL_SMOOTH);
-	glEnable(GL_DEPTH_TEST);
-	glEnable(GL_CULL_FACE);
-	glCullFace(GL_BACK);
+void VolFogEffect::draw() const {
+    glPushAttrib(GL_ENABLE_BIT);
+    glClearColor(fogColor[0],fogColor[1],fogColor[2],0.0f);
+    glShadeModel(GL_SMOOTH);
+    glEnable(GL_DEPTH_TEST);
+    glEnable(GL_CULL_FACE);
+    glCullFace(GL_BACK);
 
-	/* clear all pixels in colour buffer */
-	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+    /* clear all pixels in colour buffer */
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
-	/* Enable blending */
-	//glEnable(GL_BLEND);
-	//glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
+    /* Enable blending */
+    //glEnable(GL_BLEND);
+    //glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
 
-	int i;
-	glLoadIdentity();
+    int i;
+    glLoadIdentity();
 
 
-	glBegin( GL_LINES );
-		glNormal3f(0,1,0);
-		for(i=-20;i<=20;i+=2)
-		{
-			float fog_c;
-			float diff[3];
+    glBegin( GL_LINES );
+    glNormal3f(0,1,0);
+    for(i=-20;i<=20;i+=2) {
+        float fog_c;
+        float diff[3];
 
-			diff[0] = State::getCameraNode()->getAbsCoor().x - i;
-			diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
-			diff[1] = State::getCameraNode()->getAbsCoor().y;
-			fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
-			glFogCoordfEXT(fog_c*2);
-			glVertex3f(i,0,-20);
+        diff[0] = State::getCameraNode()->getAbsCoor().x - i;
+        diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
+        diff[1] = State::getCameraNode()->getAbsCoor().y;
+        fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
+        glFogCoordfEXT(fog_c*2);
+        glVertex3f(i,0,-20);
 
-			diff[0] = State::getCameraNode()->getAbsCoor().x - i;
-			diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
-			diff[1] = State::getCameraNode()->getAbsCoor().y;
-			fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
-			glFogCoordfEXT(fog_c*2);
-			glVertex3f(i,0,20);
+        diff[0] = State::getCameraNode()->getAbsCoor().x - i;
+        diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
+        diff[1] = State::getCameraNode()->getAbsCoor().y;
+        fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
+        glFogCoordfEXT(fog_c*2);
+        glVertex3f(i,0,20);
 
-			diff[0] = State::getCameraNode()->getAbsCoor().x - i;
-			diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
-			diff[1] = State::getCameraNode()->getAbsCoor().y;
-			fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
-			glFogCoordfEXT(fog_c*2);
-			glVertex3f(-20,0,i);
+        diff[0] = State::getCameraNode()->getAbsCoor().x - i;
+        diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
+        diff[1] = State::getCameraNode()->getAbsCoor().y;
+        fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
+        glFogCoordfEXT(fog_c*2);
+        glVertex3f(-20,0,i);
 
-			diff[0] = State::getCameraNode()->getAbsCoor().x - i;
-			diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
-			diff[1] = State::getCameraNode()->getAbsCoor().y;
-			fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
-			glFogCoordfEXT(fog_c*2);
-			glVertex3f(20,0,i);
-		}
-	glEnd();
+        diff[0] = State::getCameraNode()->getAbsCoor().x - i;
+        diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
+        diff[1] = State::getCameraNode()->getAbsCoor().y;
+        fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
+        glFogCoordfEXT(fog_c*2);
+        glVertex3f(20,0,i);
+    }
+    glEnd();
 
-  glPopAttrib();
+    glPopAttrib();
 
 }
@@ -202,5 +194,3 @@
 * ticks the effect if there is any time dependancy
 */
-void VolFogEffect::tick(float dt)
-{
-}
+void VolFogEffect::tick(float dt) {}
Index: branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h	(revision 8457)
@@ -10,22 +10,21 @@
 #include "weather_effect.h"
 
-class VolFogEffect : public WeatherEffect
-{
-	public:
-		VolFogEffect(const TiXmlElement* root = NULL);
-		virtual ~VolFogEffect();
+class VolFogEffect : public WeatherEffect {
+public:
+    VolFogEffect(const TiXmlElement* root = NULL);
+    virtual ~VolFogEffect();
 
-		virtual void loadParams(const TiXmlElement* root);
+    virtual void loadParams(const TiXmlElement* root);
 
-		virtual void init();
+    virtual void init();
 
-		virtual void activate();
-		virtual void deactivate();
+    virtual void activate();
+    virtual void deactivate();
 
-		virtual void draw() const;
-		virtual void tick(float dt);
+    virtual void draw() const;
+    virtual void tick(float dt);
 
-	private:
-		GLfloat fogColor[4];
+private:
+    GLfloat fogColor[4];
 
 };
Index: branches/atmospheric_engine/src/lib/graphics/effects/weather_effect.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/weather_effect.h	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/effects/weather_effect.h	(revision 8457)
@@ -1,5 +1,5 @@
 /*!
  * @file weather_effect.h
- *  
+ *
  */
 
@@ -20,6 +20,6 @@
     virtual void init();
 
-    virtual void activate();
-    virtual void deactivate();
+    virtual void activate() = 0;
+    virtual void deactivate() = 0;
 
     virtual void draw() const;
Index: branches/atmospheric_engine/src/lib/graphics/shader.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/shader.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/graphics/shader.cc	(revision 8457)
@@ -153,4 +153,6 @@
       glAttachObjectARB(this->shaderProgram, shader);
   }
+
+  return true;
 }
 
Index: branches/atmospheric_engine/src/lib/gui/gl/glmenu/glmenu_imagescreen.cc
===================================================================
--- branches/atmospheric_engine/src/lib/gui/gl/glmenu/glmenu_imagescreen.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/gui/gl/glmenu/glmenu_imagescreen.cc	(revision 8457)
@@ -269,5 +269,5 @@
     glEnd();
 
-    /* draw black border
+    // draw black border
     glBegin(GL_QUADS);
     glColor3f(0.0, 0.0, 0.0);
Index: branches/atmospheric_engine/src/lib/gui/qt/gui_control.cc
===================================================================
--- branches/atmospheric_engine/src/lib/gui/qt/gui_control.cc	(revision 8456)
+++ branches/atmospheric_engine/src/lib/gui/qt/gui_control.cc	(revision 8457)
@@ -285,4 +285,7 @@
         return -1;
     }
+
+    return 0;
+
   }
 
Index: branches/atmospheric_engine/src/subprojects/benchmark.cc
===================================================================
--- branches/atmospheric_engine/src/subprojects/benchmark.cc	(revision 8456)
+++ branches/atmospheric_engine/src/subprojects/benchmark.cc	(revision 8457)
@@ -455,9 +455,7 @@
         }
       printf("\n");
-
-
-
     }
 
+    return 0;
 }
 
Index: branches/atmospheric_engine/src/util/kill_target.cc
===================================================================
--- branches/atmospheric_engine/src/util/kill_target.cc	(revision 8456)
+++ branches/atmospheric_engine/src/util/kill_target.cc	(revision 8457)
@@ -31,10 +31,9 @@
 */
 KillTarget::KillTarget (const TiXmlElement* root)
-  : MissionGoal(root)
-{
-  this->setClassID(CL_KILL_TARGET, "KillTarget");
+        : MissionGoal(root) {
+    this->setClassID(CL_KILL_TARGET, "KillTarget");
 
-  if( root != NULL)
-    this->loadParams(root);
+    if( root != NULL)
+        this->loadParams(root);
 }
 
@@ -43,28 +42,18 @@
  * standard deconstructor
 */
-KillTarget::~KillTarget ()
-{
-
+KillTarget::~KillTarget () {
 }
 
 
-void KillTarget::loadParams(const TiXmlElement* root)
-{
-  MissionGoal::loadParams(root);
+void KillTarget::loadParams(const TiXmlElement* root) {
+    MissionGoal::loadParams(root);
 
-  LoadParam(root, "numberofkills", this, KillTarget, setNumberOfKills)
-       .describe("sets the number of kills a target has to be killed");
-  LoadParam(root, "targetclassid", this, KillTarget, setTargetClassID)
-      .describe("sets the targets class id");
+    LoadParam(root, "numberofkills", this, KillTarget, setNumberOfKills)
+    .describe("sets the number of kills a target has to be killed");
+    LoadParam(root, "targetclassid", this, KillTarget, setTargetClassID)
+    .describe("sets the targets class id");
 }
 
 
-MissionState KillTarget::checkMissionGoal(float dt)
-{
+MissionState KillTarget::checkMissionGoal(float dt) {}
 
-}
-
-
-
-
-
Index: branches/atmospheric_engine/src/world_entities/movie_entity.cc
===================================================================
--- branches/atmospheric_engine/src/world_entities/movie_entity.cc	(revision 8456)
+++ branches/atmospheric_engine/src/world_entities/movie_entity.cc	(revision 8457)
@@ -120,5 +120,5 @@
     counter = (int)(fps * timer);
 
-    if (counter >= media_container->getFrameCount())
+    if ((unsigned int)counter >= media_container->getFrameCount())
     {
       timer = 0;
@@ -138,6 +138,6 @@
 void MovieEntity::draw() const
 {
-  if(!mediaLoaded)
-    false;
+//   if(!mediaLoaded)
+//     false;
 
   glPushAttrib(GL_ENABLE_BIT);
