Index: /trunk/src/lib/collision_reaction/collision_handle.cc
===================================================================
--- /trunk/src/lib/collision_reaction/collision_handle.cc	(revision 8494)
+++ /trunk/src/lib/collision_reaction/collision_handle.cc	(revision 8495)
@@ -1,4 +1,4 @@
 /*
-   orxonox - the future of 3D-vertical-scrollers
+   orxonox - the future of 3D-vertical-scrollersf
 
    Copyright (C) 2004 orx
@@ -101,6 +101,7 @@
       return;
 
-  // add element
-   PRINTF(0)("addTarget: %i \n", target);
+   // add element
+   //PRINTF(0)("addTarget: %i \n", target);
+
    this->targetList.push_back(target);
 }
Index: /trunk/src/lib/graphics/effects/atmospheric_engine.cc
===================================================================
--- /trunk/src/lib/graphics/effects/atmospheric_engine.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/atmospheric_engine.cc	(revision 8495)
@@ -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: /trunk/src/lib/graphics/effects/cloud_effect.cc
===================================================================
--- /trunk/src/lib/graphics/effects/cloud_effect.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/cloud_effect.cc	(revision 8495)
@@ -21,5 +21,4 @@
 #include "util/loading/resource_manager.h"
 
-#include "glincl.h"
 #include "material.h"
 #include <math.h>
@@ -31,5 +30,4 @@
 #include "parser/tinyxml/tinyxml.h"
 
-#include "sglmodel.h"
 
 using namespace std;
@@ -43,4 +41,5 @@
 {
 	this->setClassID(CL_CLOUD_EFFECT, "CloudEffect");
+//  this->toList(OM_ENVIRON);
 
 	this->init();
@@ -49,5 +48,5 @@
 		this->loadParams(root);
 
-	if(cloudActivate)
+	//if(cloudActivate)
 		this->activate();
 }
@@ -56,45 +55,35 @@
 {
 	this->deactivate();
-
-	delete this->cloudMaterial;
-
-	cloudModel.Delete();
-	Shader::unload(this->cloudShader);
-
 }
 
 
-bool CloudEffect::init()
+void CloudEffect::init()
 {
-	PRINTF(1)("Initializing CloudEffect\n");
+	PRINTF(0)("Initializing CloudEffect\n");
+  
+    /// initialization of the texture coords, speeds etc...
+/*  this->move = 0.0f;
+  this->g_WaterUV = 35.0f;
+  this->kNormalMapScale = 0.25f;
+  this->g_WaterFlow = 0.0015f;*/
+  
+  cloudMaterial.setDiffuseMap("pictures/sky/cloud1.jpg", GL_TEXTURE_2D, 0);
 
-	// Default values
-	this->cloudActivate = false;
-	this->cloudTint[4] = ( 0.9f, 0.7f, 0.7f, 1.0f );
-	this->cloudScroll = 1.0f;
-	this->time = 0.0f;
-	//g_cloud_texture = 0;
+  shader = new Shader(ResourceManager::getInstance()->getDataDir() + "/shaders/cloud.vert",
+                      ResourceManager::getInstance()->getDataDir() + "/shaders/cloud.frag");
+  
+  this->shader->activateShader();
 
-	this->cloudTexture = "pictures/sky/cloud1.jpg";
-
-	cloudModel.Load("sky.sgl");
-	cloudModel.Unitize();
-
-	// Get the bounding box of the sky dome
-	float bbox[3] = {0};
-	cloudModel.GetDimensions(bbox[0], bbox[1], bbox[2]);
-	
-	// Load Shaders
-	this->cloudShader = new Shader( ResourceManager::getInstance()->getDataDir() + "/shaders/sky.vert", ResourceManager::getInstance()->getDataDir() +"/shaders/sky.frag");
-
-	// Tell the shader the bounding box of the sky dome
-	this->cloudShader->bindShader("bbox", bbox, 4);
-
-	// Initialze Cloud Material
-	this->cloudMaterial = new Material("Sky");
-	this->cloudMaterial->setIllum(3);
-	this->cloudMaterial->setAmbient(1.0, 1.0, 1.0);
-	this->cloudMaterial->setDiffuseMap(this->cloudTexture);
-
+  Shader::Uniform(shader, "Noise").set(0);
+  Shader::Uniform(shader, "SkyColor").set(0.0f, 0.0f, 0.8f);
+  Shader::Uniform(shader, "CloudColor").set(0.8f, 0.8f, 0.8f);
+  
+  // Change: Have to be updated each frame!like camerpos in mapped_water.cc
+  Shader::Uniform(shader, "Offset").set(0.0f, 0.0f, 0.0f);
+  
+  Shader::Uniform(shader, "LightPos").set(100.0f, 100.0f, 100.0f);
+  Shader::Uniform(shader, "Scale").set(1.0f);
+  
+  this->shader->deactivateShader();
 }
 
@@ -106,118 +95,64 @@
 	// LoadParam(root, "speed", this, CloudEffect, setCloudAnimation);
 	// LoadParam(root, "texture", this, CloudEffect, setCloudTexture);
-
+  /*
 	LOAD_PARAM_START_CYCLE(root, element);
 	{
 		LoadParam_CYCLE(element, "option", this, CloudEffect, setCloudOption);
 	}
-	LOAD_PARAM_END_CYCLE(element);
+  LOAD_PARAM_END_CYCLE(element);*/
 }
 
 
-bool CloudEffect::activate()
+void CloudEffect::activate()
 {
-	PRINTF(0)( "Activating CloudEffect with Material %s\n", this->cloudTexture.c_str());
+	PRINTF(0)( "Activating\n");
 
-	this->cloudActivate = true;
-	
+//	this->cloudActivate = true;
 }
 
-bool CloudEffect::deactivate()
+void CloudEffect::deactivate()
 {
 	PRINTF(0)("Deactivating CloudEffect\n");
 
-	this->cloudActivate = false;
+//	this->cloudActivate = false;
 }
 
 void CloudEffect::draw() const
 {
-	if (!this->cloudActivate)
-		return;
-		
-	// 	glMatrixMode(GL_MODELVIEW);
-	// 	glPushMatrix();
-	//
-	// 	// Move sphere along with the camera
-	// 	Vector r = State::getCameraNode()->getAbsCoor();
-	// 	glTranslatef(r.x, r.y, r.z);
-	//
-	// 	// Sky movement
-	// 	glRotatef(mover, 0, 0, 1);
-	//
-	// 	cloudMaterial->select();
-	// 	gluSphere(this->sphereObj, this->sphereRadius, 20, 20);
-	// 	glPopMatrix();
+	//if (!this->cloudActivate)
+	//	return;
 
-	// ******
+  //glMatrixMode(GL_MODELVIEW);
+  //glColor4f(1,1,1,1);
+  glPushMatrix();
+  //glTranslatef(0,this->waterHeight,0);
 
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
+  cloudMaterial.unselect();
+  cloudMaterial.select();
 
-	// glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-	// glShadeModel(GL_SMOOTH);
-	// glEnable(GL_DEPTH_TEST);
-	// glEnable(GL_CULL_FACE);
-	// glCullFace(GL_BACK);
-	// glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
-	
-	// glLineWidth(3.0f);
+  this->shader->activateShader();
 
-	static float time = 0.0f;
-	// static vector3f eye = {0.0f, 0.0f, 0.0f}, look = {0.0f, 0.0f, 1.0f}, up = {0.0f, 1.0f, 0.0f};
 
-	// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-	// glLoadIdentity();
-	// gluLookAt(eye[x], eye[y], eye[z], look[x], look[y], look[z], up[x], up[y], up[z]);
+  glBegin(GL_QUADS);
+  
+  glTexCoord2f(1.0f, 1.0f); glVertex3f(0.0f, 0.0f,  0.0f);
+  glTexCoord2f(0.0f, 1.0f); glVertex3f( 0.0f, 0.0f,  100.0f);
+  glTexCoord2f(0.0f, 0.0f); glVertex3f( 100.0f, 0.0f,  100.0f);
+  glTexCoord2f(1.0f, 0.0f); glVertex3f(100.0f, 0.0f,  0.0f);
+  
+  glEnd();
 
-	// Turn off the depth buffer when rendering the background
-	// glDisable(GL_DEPTH_TEST);
+  this->shader->deactivateShader();
 
-	this->cloudShader->activateShader();
+  cloudMaterial.unselect();
 
-	/* Select the shader program and update parameters. */
-	/* The "time" parameter controls the cloud scrolling. */
-	this->cloudShader->bindShader("time", &time, 1);
-	/* The "horizon" parameter controls the sky tinting. */
-	this->cloudShader->bindShader("horizon", cloudTint, 4);
+  glPopMatrix();
 
-	glActiveTexture(GL_TEXTURE0 + 0);
-	glActiveTexture(GL_TEXTURE0 + 1);
-
-	// Load the cloud texture
-	//glBindTexture(GL_TEXTURE_2D, g_cloud_texture);
-	this->cloudMaterial->select();
-
-	// Render the sky dome
-	cloudModel.Render();
-
-	// Unselect the shader
-	Shader::deactivateShader();
-
-	/* Turn on the depth buffer when rendering the foreground. */
-	// glEnable(GL_DEPTH_TEST);
-
-	/* Render the forground, for example, a teapot or bunny. */
-	//    glEnable(GL_LIGHTING);
-	//    glColor3f(0.0f, 1.0f, 0.0f);
-	//    glBegin(GL_QUADS);
-	//    glNormal3f( 0.0f,  1.0f,  0.0f);
-	//    glVertex3f( 20.0f, -1.0f,  20.0f);
-	//    glVertex3f( 20.0f, -1.0f, -20.0f);
-	//    glVertex3f(-20.0f, -1.0f, -20.0f);
-	//    glVertex3f(-20.0f, -1.0f,  20.0f);
-	//    glEnd();
-	//    glDisable(GL_LIGHTING);
-
-	glPopMatrix();
-	
 }
 
 void CloudEffect::tick (float dt)
 {
-	if (!this->cloudActivate)
-		return;
-
-	// Update the timer for scrolling the clouds
-	time = time + ((1.0f / 2000.0f) * cloudScroll);
+	//if (!this->cloudActivate)
+	//	return;
 }
 
Index: /trunk/src/lib/graphics/effects/cloud_effect.h
===================================================================
--- /trunk/src/lib/graphics/effects/cloud_effect.h	(revision 8494)
+++ /trunk/src/lib/graphics/effects/cloud_effect.h	(revision 8495)
@@ -12,53 +12,42 @@
 
 #include "world_entity.h"
-#include "glincl.h"
+#include "material.h"
+#include "shader.h"
 
-#include "sglmodel.h"
+class CloudEffect : public WeatherEffect {
+public:
+    CloudEffect(const TiXmlElement* root = NULL);
+    virtual ~CloudEffect();
 
-class Shader;
-class Material;
-class Vector;
+    virtual void loadParams(const TiXmlElement* root);
 
-class CloudEffect : public WeatherEffect
-{
-	public:
-		CloudEffect(const TiXmlElement* root = NULL);
-		virtual ~CloudEffect();
+    virtual void init();
 
-		virtual void loadParams(const TiXmlElement* root);
+    virtual void activate();
+    virtual void deactivate();
 
-		virtual bool init();
+    inline void activateCloud() {
+        this->activate();
+    }
+    inline void deactivateCloud() {
+        this->deactivate();
+    }
 
-		virtual bool activate();
-		virtual bool deactivate();
+    virtual void draw() const;
+    virtual void tick(float dt);
 
-		inline void activateCloud() { this->activate(); }
-		inline void deactivateCloud() { this->deactivate(); }
-		
-		virtual void draw() const;
-		virtual void tick(float dt);
-
-		inline void setCloudOption(const std::string& option) {
-			if (option == "activate") this->cloudActivate = true;
-		}
+    /*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.
-
-		std::string			cloudTexture;
-
-		Sglmodel_sgl			cloudModel;
-		Shader*				cloudShader;
-
-		GLfloat				cloudTint[4];
-		GLfloat				cloudScroll;
-
-		float				time;
-
+    Material                 cloudMaterial;
+    Shader*                 shader;
 };
 
Index: /trunk/src/lib/graphics/effects/fog_effect.cc
===================================================================
--- /trunk/src/lib/graphics/effects/fog_effect.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/fog_effect.cc	(revision 8495)
@@ -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
 */
 
@@ -22,5 +22,8 @@
 SHELL_COMMAND(activate, FogEffect, activateFog);
 SHELL_COMMAND(deactivate, FogEffect, deactivateFog);
-SHELL_COMMAND(startfogging, FogEffect, startFogging);
+SHELL_COMMAND(fadein, FogEffect, fadeInFog);
+SHELL_COMMAND(fadeout, FogEffect, fadeOutFog);
+
+// TODO: Fix fades
 
 using namespace std;
@@ -28,132 +31,177 @@
 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);
-
-	LOAD_PARAM_START_CYCLE(root, element);
-	{
-		LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption);
-	}
-	LOAD_PARAM_END_CYCLE(element);
-}
-
-bool FogEffect::init()
-{
-	//default values
-	this->fogActivate = false;
-	this->fogFadeDuration = 0;
-	this->localTimer = 0;
-
-	this->fogMode = GL_EXP2;
-	this->fogDensity = 0.001;
-	this->fogStart = 0;
-	this->fogEnd = 5000;
-	this->colorVector = Vector(0.7, 0.7, 0.7);
-
-        return true;
-}
-
-
-bool 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);
-	glFogf(GL_FOG_DENSITY, this->fogDensity);
-	glHint(GL_FOG_HINT, GL_DONT_CARE);
-	glFogf(GL_FOG_START, this->fogStart);
-	glFogf(GL_FOG_END, this->fogEnd);
-
-	glEnable(GL_FOG);
-	// glClearColor(0.5, 0.5, 0.5, 1.0);
-        return true;
-}
-
-
-bool FogEffect::deactivate()
-{
-	PRINTF(0)("Deactivating FogEffect\n");
-
-	this->fogActivate = false;
-
-	glDisable(GL_FOG);
-
-        return true;
+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->fogFadeDensity = 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_DENSITY, this->fogDensity);
+    glFogf(GL_FOG_START, this->fogStart);
+    glFogf(GL_FOG_END, this->fogEnd);
+
+    glEnable(GL_FOG);
+
+}
+
+
+void FogEffect::deactivate() {
+    PRINTF(0)("Deactivating FogEffect\n");
+
+    this->fogFadeInActivate = false;
+    this->fogFadeOutActivate = false;
+    this->fogActivate = false;
+
+    glDisable(GL_FOG);
+
 }
 
 void FogEffect::draw() const {
 
-	if (this->fogFadeDuration != 0 && this->localTimer < this->fogFadeDuration)
-		glFogf(GL_FOG_DENSITY, this->fogFadeDensity);
-	//else
-	//	glFogf(GL_FOG_DENSITY, this->fogDensity);
-
-}
-void FogEffect::tick(float dt)
-{
-	if (!this->fogActivate)
-		return;
-
-
-	if (this->fogFadeDuration != 0 && this->localTimer < this->fogFadeDuration) {
-		this->localTimer += dt;
-		float progress = this->localTimer / this->fogFadeDuration;
-		this->fogFadeDensity = progress * this->fogDensity;
-	}
-}
-
-void FogEffect::startFogging() {
-
-	if (this->fogActivate)
-		this->deactivate();
-
-	this->fogFadeDuration = 10;
-	this->localTimer = 0;
-	this->activate();
-
-}
-
-
-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 (!this->fogActivate)
+        return;
+
+    // If Fog Fade
+    if ( this->fogFadeInActivate || this->fogFadeOutActivate )
+        glFogf(GL_FOG_DENSITY, this->fogFadeDensity);
+
+}
+
+void FogEffect::tick(float dt) {
+    if (!this->fogActivate)
+        return;
+
+    if ( this->fogFadeInActivate ) {
+        this->localTimer += dt;
+        this->fogFadeDensity = ( this->localTimer / this->fogFadeInDuration ) * this->fogDensity;
+
+        if ( this->localTimer >= this->fogFadeOutDuration )
+            this->fogFadeInActivate = false;
+    }
+
+    if ( this->fogFadeOutActivate ) {
+        this->localTimer += dt;
+        this->fogFadeDensity = 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();
+
+}
+
+
+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;
+}
+
+
Index: /trunk/src/lib/graphics/effects/fog_effect.h
===================================================================
--- /trunk/src/lib/graphics/effects/fog_effect.h	(revision 8494)
+++ /trunk/src/lib/graphics/effects/fog_effect.h	(revision 8495)
@@ -6,51 +6,80 @@
 #define _FOG_EFFECT
 
-#include "vector.h"
 
 #include "weather_effect.h"
 #include "glincl.h"
+#include "vector.h"
+
+class FogEffect : public WeatherEffect {
+public:
+    FogEffect(const TiXmlElement* root = NULL);
+    virtual ~FogEffect();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void init();
+
+    virtual void activate();
+    virtual void deactivate();
+
+    void activateFog() {
+        this->activate();
+    }
+    void deactivateFog() {
+        this->deactivate();
+    }
+
+    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 setFogOption(const std::string& option) {
+        if (option == "activate")
+            this->fogActivate = true;
+    }
+
+    void fadeInFog();
+    void fadeOutFog();
 
 
-class FogEffect : public WeatherEffect
-{
-	public:
-		FogEffect(const TiXmlElement* root = NULL);
-		virtual ~FogEffect();
+private:
+    GLint stringToFogMode(const std::string& mode);
 
-		virtual void loadParams(const TiXmlElement* root);
+    bool          fogActivate;
 
-		virtual bool init();
+    bool          fogFadeInActivate;
+    bool          fogFadeOutActivate;
 
-		virtual bool activate();
-		virtual bool deactivate();
+    GLfloat       fogFadeInDuration;
+    GLfloat       fogFadeOutDuration;
 
-		void activateFog() { this->activate(); }
-		void deactivateFog() { this->deactivate(); }
+    float         localTimer;
 
-		virtual void draw() const;
-		virtual void tick(float dt);
+    GLint         fogMode;
+    GLfloat       fogDensity;
+    GLfloat       fogFadeDensity;
 
-		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 setFogOption(const std::string& option) { if (option == "activate") this->fogActivate = true; }
-
-		void startFogging();
-
-	private:
-		GLint stringToFogMode(const std::string& mode);
-
-		bool				fogActivate;
-		GLfloat				fogFadeDuration;
-		float				localTimer;
-
-		GLint				fogMode;
-		GLfloat				fogDensity;
-		GLfloat				fogFadeDensity;
-
-		GLfloat				fogStart;
-		GLfloat				fogEnd;
-		Vector				colorVector;
+    GLfloat       fogStart;
+    GLfloat       fogEnd;
+    Vector        colorVector;
 };
 
Index: /trunk/src/lib/graphics/effects/graphics_effect.cc
===================================================================
--- /trunk/src/lib/graphics/effects/graphics_effect.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/graphics_effect.cc	(revision 8495)
@@ -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,8 +56,5 @@
  *  initializes the graphics effect
  */
-bool GraphicsEffect::init()
-{
-  return true;
-}
+void GraphicsEffect::init() {}
 
 
@@ -70,6 +63,5 @@
  * draws the effect, if needed
  */
-void GraphicsEffect::draw() const
-{}
+void GraphicsEffect::draw() const {}
 
 
@@ -78,4 +70,3 @@
  * ticks the effect if there is any time dependancy
  */
-void GraphicsEffect::tick(float dt)
-{}
+void GraphicsEffect::tick(float dt) {}
Index: /trunk/src/lib/graphics/effects/graphics_effect.h
===================================================================
--- /trunk/src/lib/graphics/effects/graphics_effect.h	(revision 8494)
+++ /trunk/src/lib/graphics/effects/graphics_effect.h	(revision 8495)
@@ -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: /trunk/src/lib/graphics/effects/lense_flare.cc
===================================================================
--- /trunk/src/lib/graphics/effects/lense_flare.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/lense_flare.cc	(revision 8495)
@@ -22,4 +22,5 @@
 #include "util/loading/factory.h"
 
+#include "glincl.h"
 #include "texture.h"
 
@@ -43,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);
 
 }
@@ -75,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);
 }
 
@@ -86,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);
 }
 
@@ -102,8 +106,5 @@
  * initializes the fog effect
  */
-bool LenseFlare::init()
-{
-  return true;
-}
+void LenseFlare::init() {}
 
 
@@ -111,9 +112,6 @@
  * activates the fog effect
  */
-bool LenseFlare::activate()
-{
-  this->bActivated = true;
-
-  return true;
+void LenseFlare::activate() {
+    this->bActivated = true;
 }
 
@@ -122,9 +120,6 @@
  * deactivates the fog effect
  */
-bool LenseFlare::deactivate()
-{
-  this->bActivated = false;
-
-  return true;
+void LenseFlare::deactivate() {
+    this->bActivated = false;
 }
 
@@ -134,8 +129,6 @@
  * @param mode the mode character
  */
-GLint LenseFlare::stringToFogMode(const std::string& mode)
-{
-  PRINTF(1)("NOT IMPLEMENTED");
-  return 0;
+GLint LenseFlare::stringToFogMode(const std::string& mode) {
+    return 0;
 }
 
@@ -153,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;
 }
 
@@ -196,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);
+    }
 }
 
@@ -241,7 +227,6 @@
  * draws the LenseFlares
  */
-void LenseFlare::draw() const
-{
-  if( !this->bActivated)
-    return;
-}
+void LenseFlare::draw() const {
+    if( !this->bActivated)
+        return;
+}
Index: /trunk/src/lib/graphics/effects/lense_flare.h
===================================================================
--- /trunk/src/lib/graphics/effects/lense_flare.h	(revision 8494)
+++ /trunk/src/lib/graphics/effects/lense_flare.h	(revision 8495)
@@ -32,8 +32,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: /trunk/src/lib/graphics/effects/lightening_effect.cc
===================================================================
--- /trunk/src/lib/graphics/effects/lightening_effect.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/lightening_effect.cc	(revision 8495)
@@ -33,4 +33,6 @@
 CREATE_FACTORY(LighteningEffect, CL_LIGHTENING_EFFECT);
 
+// TODO: FIx Lightening with Fog enabled
+
 LighteningEffect::LighteningEffect(const TiXmlElement* root)
 {
@@ -42,6 +44,6 @@
 		this->loadParams(root);
 
-  if(this->lighteningActivate)
-	 this->activate();
+	if(this->lighteningActivate)
+		this->activate();
 }
 
@@ -55,79 +57,114 @@
 	WeatherEffect::loadParams(root);
 
-  LoadParam(root, "coord", this, LighteningEffect, coord);
-  LoadParam(root, "option", this, LighteningEffect, setLighteningOption);
-  LoadParam(root, "frequency", this, LighteningEffect, setFlashFrequency);
-  LoadParam(root, "const-time", this, LighteningEffect, setFlashConstTime);
-  LoadParam(root, "rising-time", this, LighteningEffect, setFlashRisingTime);
-  LoadParam(root, "size", this, LighteningEffect, setFlashSize);
-  LoadParam(root, "seed", this, LighteningEffect, setFlashSeed);
-}
-
-
-bool LighteningEffect::init()
-{
-  lighteningActivate = false;
-
-  this->time = 0.0;
-  this->flashFrequency = 1.4f;
-  this->flashConstTime = 0.5f;
-  this->flashRisingTime = 0.1f;
-
-  this->width = 400.0f;
-  this->height = 100.0f;
-  this->seedWidth = 50;
-  this->seedHeight = 50;
-  this->bNewCoordinate = false;
-
-  this->seedX = 500.f;
-  this->seedZ = 1000.0f;
-  this->seedTime = 4.0f;
-
-  this->billboard[0] = new Billboard(NULL);
-  this->billboard[0]->setTexture("maps/lightning_bolt1.png");
-  this->billboard[0]->setSize(this->width, this->height);
-  this->billboard[0]->setAbsCoor(3000,850,0);
-  this->billboard[0]->setVisibiliy(false);
-
-  this->billboard[1] = new Billboard(NULL);
-  this->billboard[1]->setTexture("maps/lightning_bolt2.png");
-  this->billboard[1]->setSize(this->width, this->height);
-  this->billboard[1]->setAbsCoor(3000,850,0);
-  this->billboard[1]->setVisibiliy(false);
-
-  this->billboard[2] = new Billboard(NULL);
-  this->billboard[2]->setTexture("maps/lightning_bolt3.png");
-  this->billboard[2]->setSize(this->width, this->height);
-  this->billboard[2]->setAbsCoor(3000,850,0);
-  this->billboard[2]->setVisibiliy(false);
-
-  this->billboard[3] = new Billboard(NULL);
-  this->billboard[3]->setTexture("maps/lightning_bolt4.png");
-  this->billboard[3]->setSize(this->width, this->height);
-  this->billboard[3]->setAbsCoor(0.0f, 50.0f, 0.0f);
-  this->billboard[3]->setVisibiliy(false);
-/*
-  this->soundSource = NULL;
-  this->thunderBuffer = NULL;
-
-  this->soundSource.setSourceNode(this);
-
-  //load sound
-  if (this->thunderBuffer != NULL)
-    ResourceManager::getInstance()->unload(this->thunderBuffer);
-  this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/thunder.wav", WAV);*/
-
-  return true;
+	LoadParam(root, "coord", this, LighteningEffect, coord);
+	LoadParam(root, "frequency", this, LighteningEffect, setFlashFrequency);
+	LoadParam(root, "const-time", this, LighteningEffect, setFlashConstTime);
+	LoadParam(root, "rising-time", this, LighteningEffect, setFlashRisingTime);
+	LoadParam(root, "size", this, LighteningEffect, setFlashSize);
+	LoadParam(root, "seed", this, LighteningEffect, setFlashSeed);
+
+	LOAD_PARAM_START_CYCLE(root, element);
+	{
+		LoadParam_CYCLE(element, "option", this, LighteningEffect, setLighteningOption);
+	}
+	LOAD_PARAM_END_CYCLE(element);
+}
+
+
+void LighteningEffect::init()
+{
+	//default values
+	this->lighteningActivate = false;
+
+	this->time = 0.0;
+	this->flashFrequency = 4.0f;
+	this->mainFrequency = 4.0f;
+	this->flashConstTime = 0.1f;
+	this->flashRisingTime = 0.03f;
+
+	this->width = 700.0f;
+	this->height = 250.0f;
+	this->seedWidth = 50.0f;
+	this->seedHeight = 50.0f;
+	this->bNewCoordinate = false;
+  this->lighteningMove = false;
+
+	this->seedX = 500.f;
+	this->seedZ = 1000.0f;
+	this->seedTime = 2.0f;
+
+  this->mainPosX = 3000;
+  this->mainPosY = 900;
+  this->mainPosZ = 0;
+
+	// initialize lightening textures
+	this->billboard[0] = new Billboard(NULL);
+	this->billboard[0]->setTexture("maps/lightning_bolt1.png");
+	this->billboard[0]->setSize(this->width, this->height);
+	this->billboard[0]->setVisibiliy(false);
+
+	this->billboard[1] = new Billboard(NULL);
+	this->billboard[1]->setTexture("maps/lightning_bolt2.png");
+	this->billboard[1]->setSize(this->width, this->height);
+	this->billboard[1]->setVisibiliy(false);
+
+	this->billboard[2] = new Billboard(NULL);
+	this->billboard[2]->setTexture("maps/lightning_bolt3.png");
+	this->billboard[2]->setSize(this->width, this->height);
+	this->billboard[2]->setVisibiliy(false);
+
+	this->billboard[3] = new Billboard(NULL);
+	this->billboard[3]->setTexture("maps/lightning_bolt4.png");
+	this->billboard[3]->setSize(this->width, this->height);
+	this->billboard[3]->setVisibiliy(false);
+
+	if (this->lighteningMove) {
+		this->cameraCoor = State::getCameraNode()->getAbsCoor();
+		this->billboard[0]->setAbsCoor(this->cameraCoor.x+3000,900,this->cameraCoor.z+0);
+		this->billboard[1]->setAbsCoor(this->cameraCoor.x+3000,900,this->cameraCoor.z+0);
+		this->billboard[2]->setAbsCoor(this->cameraCoor.x+3000,900,this->cameraCoor.z+0);
+		this->billboard[3]->setAbsCoor(this->cameraCoor.x+3000,900,this->cameraCoor.z+0);
+	} else {
+		this->billboard[0]->setAbsCoor(3000,900,0);
+		this->billboard[1]->setAbsCoor(3000,900,0);
+		this->billboard[2]->setAbsCoor(3000,900,0);
+		this->billboard[3]->setAbsCoor(3000,900,0);
+	}
+
+	this->flashLight = new Light();
+	this->flashLight->setDiffuseColor(0,0,0);
+	this->flashLight->setSpecularColor(0,0,0);
+
+	/*
+	this->soundSource = NULL;
+	this->thunderBuffer = NULL;
+
+	this->soundSource.setSourceNode(this);
+
+	//load sound
+	if (this->thunderBuffer != NULL)
+	ResourceManager::getInstance()->unload(this->thunderBuffer);
+	this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/thunder.wav", WAV);*/
+
 }
 
 void LighteningEffect::coord(float x, float y, float z)
 {
-  this->billboard[0]->setAbsCoor(x, y, z);
-  this->billboard[1]->setAbsCoor(x, y, z);
-  this->billboard[2]->setAbsCoor(x, y, z);
-  this->billboard[3]->setAbsCoor(x, y, z);
-  this->mainPosX = x;
-  this->mainPosY = y;
-  this->mainPosZ = z;
+	if (this->lighteningMove) {
+		this->cameraCoor = State::getCameraNode()->getAbsCoor();
+		this->billboard[0]->setAbsCoor(this->cameraCoor.x+x, y, this->cameraCoor.z+z);
+		this->billboard[1]->setAbsCoor(this->cameraCoor.x+x, y, this->cameraCoor.z+z);
+		this->billboard[2]->setAbsCoor(this->cameraCoor.x+x, y, this->cameraCoor.z+z);
+		this->billboard[3]->setAbsCoor(this->cameraCoor.x+x, y, this->cameraCoor.z+z);
+	} else {
+		this->billboard[0]->setAbsCoor(x, y, z);
+		this->billboard[1]->setAbsCoor(x, y, z);
+		this->billboard[2]->setAbsCoor(x, y, z);
+		this->billboard[3]->setAbsCoor(x, y, z);
+	}
+
+	this->mainPosX = x;
+	this->mainPosY = y;
+	this->mainPosZ = z;
 }
 
@@ -135,108 +172,124 @@
 void LighteningEffect::setFlashSize(float width, float height, float seedWidth, float seedHeight)
 {
-  this->width = width;
-  this->height = height;
-  this->seedWidth = seedWidth;
-  this->seedHeight = seedHeight;
-  this->billboard[0]->setSize(this->width, this->height);
-  this->billboard[1]->setSize(this->width, this->height);
-  this->billboard[2]->setSize(this->width, this->height);
-  this->billboard[3]->setSize(this->width, this->height);
-}
-
-
-bool LighteningEffect::activate()
+	this->width = width;
+	this->height = height;
+	this->seedWidth = seedWidth;
+	this->seedHeight = seedHeight;
+
+	this->billboard[0]->setSize(this->width, this->height);
+	this->billboard[1]->setSize(this->width, this->height);
+	this->billboard[2]->setSize(this->width, this->height);
+	this->billboard[3]->setSize(this->width, this->height);
+}
+
+
+void LighteningEffect::activate()
 {
 	PRINTF(0)( "Activating LighteningEffect\n" );
-  this->time = 0;
-  lighteningActivate = true;
-
-  return true;
-}
-
-
-bool LighteningEffect::deactivate()
+	this->lighteningActivate = true;
+
+	this->time = 0;
+}
+
+
+void LighteningEffect::deactivate()
 {
 	PRINTF(0)("Deactivating LighteningEffect\n");
-  this->billboard[0]->setVisibiliy(false);
-  this->billboard[1]->setVisibiliy(false);
-  this->billboard[2]->setVisibiliy(false);
-  this->billboard[3]->setVisibiliy(false);
-  lighteningActivate = false;
-
-
-  return true;
+	this->lighteningActivate = false;
+
+	this->billboard[0]->setVisibiliy(false);
+	this->billboard[1]->setVisibiliy(false);
+	this->billboard[2]->setVisibiliy(false);
+	this->billboard[3]->setVisibiliy(false);
 }
 
 void LighteningEffect::tick (float dt)
 {
-  if(!lighteningActivate)
-    return;
-
-  this->time += dt;
-
-  /*if( flashLight != NULL)
-  {
-    if((int)(100*time)%2)
-      this->flashLight->setDiffuseColor(0,0,0);
-    else
-      this->flashLight->setDiffuseColor(100,100,100);
-
-    //PRINTF(0)("100*time: %f %i\n", 100*time, (int)(100*time));
-}*/
-
-  if( this->time > this->flashFrequency)
-  {
-    this->billboard[0]->setVisibiliy(true);
-    this->time = 0.0f;
-
-    this->flashLight = new Light();
-    this->flashLight->setAbsCoor(this->billboard[0]->getAbsCoor().x, this->billboard[0]->getAbsCoor().y, this->billboard[0]->getAbsCoor().z);
-    this->flashLight->setDiffuseColor(100,100,100);
-
-    //this->soundSource.play(this->thunderBuffer);
-  }
-  else if( this->billboard[3]->isVisible() && this->time > this->flashConstTime)
-  {
-    this->billboard[3]->setVisibiliy(false);
-    this->time = 0.0f;
-    this->bNewCoordinate = true;
-
-    if(flashLight != NULL)
-    {
-      delete this->flashLight;
-      flashLight = NULL;
-    }
-  }
-
-  if( this->billboard[2]->isVisible() && this->time > this->flashRisingTime)
-  {
-    this->billboard[2]->setVisibiliy(false);
-    this->billboard[3]->setVisibiliy(true);
-    this->flashLight->setDiffuseColor(100,100,100);
-  }
-  else if( this->billboard[1]->isVisible() && this->time > this->flashRisingTime*2/3 )
-  {
-    this->billboard[1]->setVisibiliy(false);
-    this->billboard[2]->setVisibiliy(true);
-    this->flashLight->setDiffuseColor(0,0,0);
-  }
-  else if( this->billboard[0]->isVisible() && this->time > this->flashRisingTime*1/3 )
-  {
-    this->billboard[0]->setVisibiliy(false);
-    this->billboard[1]->setVisibiliy(true);
-    this->flashLight->setDiffuseColor(100,100,100);
-  }
-
-  if( this->bNewCoordinate)
-  {
-    float posX = this->mainPosX - this->seedX * (float)rand()/(float)RAND_MAX;
-    float posZ = this->mainPosZ + this->seedZ * (float)rand()/(float)RAND_MAX;
-    this->billboard[0]->setAbsCoor(posX, this->mainPosY, posZ);
-    this->billboard[1]->setAbsCoor(posX, this->mainPosY, posZ);
-    this->billboard[2]->setAbsCoor(posX, this->mainPosY, posZ);
-    this->billboard[3]->setAbsCoor(posX, this->mainPosY, posZ);
-    this->bNewCoordinate = false;
-  }
+	if(!lighteningActivate)
+		return;
+
+	this->time += dt;
+
+	// TODO: Make random flashing with short light dingsda:)
+
+	if( this->time > this->flashFrequency) {
+
+		this->billboard[0]->setVisibiliy(true);
+		this->time = 0.0f;
+
+		this->flashLight->setAbsCoor(this->billboard[0]->getAbsCoor().x, this->billboard[0]->getAbsCoor().y, this->billboard[0]->getAbsCoor().z);
+
+		// flash environmental lightening
+		this->flashLight->setDiffuseColor(1,1,1);
+		this->flashLight->setSpecularColor(1,1,1);
+
+		//this->soundSource.play(this->thunderBuffer);
+
+	} else if( this->billboard[3]->isVisible() && this->time > this->flashConstTime) {
+
+		this->billboard[3]->setVisibiliy(false);
+		this->time = 0.0f;
+		this->flashLight->setDiffuseColor(0,0,0);
+		this->flashLight->setSpecularColor(0,0,0);
+		this->bNewCoordinate = true;
+
+	}
+
+	if( this->billboard[2]->isVisible() && this->time > this->flashRisingTime) {
+
+		this->billboard[2]->setVisibiliy(false);
+		this->billboard[3]->setVisibiliy(true);
+		// this->flashLight->setDiffuseColor(1,1,1);
+		// this->flashLight->setSpecularColor(1,1,1);
+
+	} else if( this->billboard[1]->isVisible() && this->time > this->flashRisingTime*2/3 ) {
+
+		this->billboard[1]->setVisibiliy(false);
+		this->billboard[2]->setVisibiliy(true);
+		//this->flashLight->setDiffuseColor(0,0,0);
+		//this->flashLight->setSpecularColor(0,0,0);
+
+	} else if( this->billboard[0]->isVisible() && this->time > this->flashRisingTime*1/3 ) {
+
+		this->billboard[0]->setVisibiliy(false);
+		this->billboard[1]->setVisibiliy(true);
+		//this->flashLight->setDiffuseColor(1,1,1);
+		//this->flashLight->setSpecularColor(1,1,1);
+
+	}
+
+	if( this->bNewCoordinate) {
+		float posX, posZ;
+
+		if(this->lighteningMove) {
+
+			this->cameraCoor = State::getCameraNode()->getAbsCoor();
+			posX = this->mainPosX - this->seedX * (float)rand()/(float)RAND_MAX + this->cameraCoor.x;
+			posZ = this->mainPosZ + this->seedZ * (float)rand()/(float)RAND_MAX + this->cameraCoor.z;
+
+		} else {
+
+			posX = this->mainPosX - this->seedX * (float)rand()/(float)RAND_MAX;
+			posZ = this->mainPosZ + this->seedZ * (float)rand()/(float)RAND_MAX;
+
+		}
+
+		this->billboard[0]->setAbsCoor(posX, this->mainPosY, posZ);
+		this->billboard[1]->setAbsCoor(posX, this->mainPosY, posZ);
+		this->billboard[2]->setAbsCoor(posX, this->mainPosY, posZ);
+		this->billboard[3]->setAbsCoor(posX, this->mainPosY, posZ);
+
+		this->flashFrequency = this->mainFrequency + this->seedTime * (float)rand()/(float)RAND_MAX;
+
+		float w = this->width + this->seedWidth * (float)rand()/(float)RAND_MAX;
+		float h = this->height + this->seedHeight * (float)rand()/(float)RAND_MAX;
+
+		this->billboard[0]->setSize(w, h);
+		this->billboard[1]->setSize(w, h);
+		this->billboard[2]->setSize(w, h);
+		this->billboard[3]->setSize(w, h);
+
+		this->bNewCoordinate = false;
+	}
 }
 
Index: /trunk/src/lib/graphics/effects/lightening_effect.h
===================================================================
--- /trunk/src/lib/graphics/effects/lightening_effect.h	(revision 8494)
+++ /trunk/src/lib/graphics/effects/lightening_effect.h	(revision 8495)
@@ -14,5 +14,4 @@
 #include "sound_source.h"
 
-
 class Billboard;
 class Light;
@@ -26,57 +25,76 @@
 		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;
-    virtual void tick(float dt);
-    
-    void coord(float x, float y, float z);
-    void setFlashSize(float width, float height, float seedWidth, float seedHeight);
-    
-    inline void setLighteningOption(const std::string& option) { if (option == "activate") this->lighteningActivate = true;}
-    inline void setFlashFrequency(float flashFrequency) { this->flashFrequency = flashFrequency; }
-    inline void setFlashConstTime(float flashConstTime) { this->flashConstTime = flashConstTime; }
-    inline void setFlashRisingTime(float flashRisingTime) { if(flashRisingTime > this->flashConstTime)
-                                                                                        this->flashRisingTime = this->flashConstTime/2;
-                                                                                      else
-                                                                                        this->flashRisingTime = flashRisingTime; }
-    inline void setFlashSeed(float seedX, float seedZ, float seedTime) { this->seedX = seedX;
-                                                                                                         this->seedZ = seedZ;
-                                                                                                         this->seedTime = seedTime; }
+		inline  void activateLightening() { this->activate(); }
+		inline  void deactivateLightening() { this->deactivate(); }
 
-    void activateLightening() { this->activate(); }
-    void deactivateLightening() { this->deactivate(); }
-    
+		virtual void draw() const;
+		virtual void tick(float dt);
+		
+		void coord(float x, float y, float z);
+		void setFlashSize(float width, float height, float seedWidth, float seedHeight);
+		
+		inline void setLighteningOption(const std::string& option) {
+			if (option == "activate") this->lighteningActivate = true;
+			if (option == "movelightening") this->lighteningMove = true;
+		}
+
+		inline void setFlashFrequency(float mainFrequency, float seedTime) {
+			this->mainFrequency = mainFrequency;
+			this->flashFrequency = mainFrequency;
+			this->seedTime = seedTime;
+		}
+		
+		inline void setFlashConstTime(float flashConstTime) { this->flashConstTime = flashConstTime; }
+
+		inline void setFlashRisingTime(float flashRisingTime) {
+			if(flashRisingTime > this->flashConstTime)
+				this->flashRisingTime = this->flashConstTime/2;
+			else
+				this->flashRisingTime = flashRisingTime;
+		}
+		
+		inline void setFlashSeed(float seedX, float seedZ) {
+			this->seedX = seedX;
+			this->seedZ = seedZ;
+		}
+		
+
 	private:
-    Billboard* billboard[4];
-    bool lighteningActivate;
-
-    float flashFrequency;
-    float flashConstTime;
-    float flashRisingTime;
-
-    float time;
-
-    bool  bNewCoordinate;
-    float width;
-    float height;
-    float seedWidth;
-    float seedHeight;
-
-    float seedX;
-    float seedZ;
-    float seedTime;
-    
-    float mainPosX;
-    float mainPosY;
-    float mainPosZ;
-
-    Light* flashLight;
-    
-    //OrxSound::SoundSource    soundSource;
-    //OrxSound::SoundBuffer*   thunderBuffer;
+		Billboard* billboard[4];
+		bool lighteningActivate;
+		bool lighteningMove;
+		
+		float flashFrequency;
+		float mainFrequency;
+		float flashConstTime;
+		float flashRisingTime;
+		
+		float time;
+		
+		bool  bNewCoordinate;
+		float width;
+		float height;
+		float seedWidth;
+		float seedHeight;
+		
+		float seedX;
+		float seedZ;
+		float seedTime;
+		
+		float mainPosX;
+		float mainPosY;
+		float mainPosZ;
+		
+		Vector cameraCoor;
+		
+		Light* flashLight;
+		
+		//OrxSound::SoundSource    soundSource;
+		//OrxSound::SoundBuffer*   thunderBuffer;
 
 };
Index: /trunk/src/lib/graphics/effects/rain_effect.cc
===================================================================
--- /trunk/src/lib/graphics/effects/rain_effect.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/rain_effect.cc	(revision 8495)
@@ -31,6 +31,6 @@
 SHELL_COMMAND(activate, RainEffect, activateRain);
 SHELL_COMMAND(deactivate, RainEffect, deactivateRain);
-
-SHELL_COMMAND(startRaining, RainEffect, startRaining);
+SHELL_COMMAND(startraining, RainEffect, startRaining);
+SHELL_COMMAND(stopraining, RainEffect, stopRaining);
 
 using namespace std;
@@ -38,85 +38,89 @@
 CREATE_FACTORY(RainEffect, CL_RAIN_EFFECT);
 
-// TODO: Dim Light with Rain, Finish preCaching, check out if multiple rain emitters work,  Think about what happens with building poss. to hang movewithcam off, benchmark, possible to activate lightening, turn off visibility when in a building, variable emitter size depending on playable, also rain velocity
-
-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/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/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, "startraining", this, RainEffect, setRainStart);
-
-	LOAD_PARAM_START_CYCLE(root, element);
-	{
-		LoadParam_CYCLE(element, "option", this, RainEffect, setRainOption);
-	}
-	LOAD_PARAM_END_CYCLE(element);
-
-}
-
-
-bool RainEffect::init()
-{
-	//Default values
-	this->rainActivate = false;
-	this->rainMove = false;
-	this->rainCoord = Vector(500, 500, 500);
-	this->rainSize = Vector2D(1000, 1000);
-	this->rainRate = 3000;
-	this->rainVelocity = -300;
-	this->rainLife = 4;
-	this->rainMaxParticles = this->rainRate * this->rainLife;
-	this->rainWindForce  = 0;
-	this->rainStartDuration = 0;
-	this->localTimer = 0;
-	this->soundRainVolume = 0.8f;
-
-	this->emitter = new PlaneEmitter(this->rainSize);
-
-	lightMan = LightManager::getInstance();
-	this->rainAmbient = lightMan->getAmbientColor();
-
-        return true;
+/* TODO:
+  - 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::rainParticles->precache((int)this->rainLife * 5); // TODO: Figure out the correct value
+    }
+}
+
+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();
 }
 
@@ -124,88 +128,106 @@
 SparkParticles* RainEffect::rainParticles = NULL;
 
-bool 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);
-		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);
-
-	lightMan->setAmbientColor(.1,.1,.1);
-
-        return true;
-}
-
-
-bool 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);
-
-        return true;
-}
-
-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->rainStartDuration != 0 && this->localTimer < this->rainStartDuration) {
-		this->localTimer += dt;
-		float progress = this->localTimer / this->rainStartDuration;
-
-		// Dim Light
-		lightMan->setAmbientColor(1.1 - progress, 1.1 - progress, 1.1 - progress);
-
-		// 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);
-	}
+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);
+
+    this->soundSource.play(this->rainBuffer, this->soundRainVolume, true);
+
+    if (this->rainWindForce != 0)
+        this->soundSource.play(this->windBuffer, 0.1f * this->rainWindForce, true);
+
+    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();
+    }
 
 }
@@ -213,10 +235,25 @@
 void RainEffect::startRaining() {
 
-	if (this->rainActivate)
-		this->deactivate();
-
-	this->rainStartDuration = 10;
-	this->localTimer = 0;
-	this->activate();
-
-}
+    if (this->rainActivate)
+        this->deactivate();
+
+    if (!this->rainFadeInDuration > 0)
+        this->rainFadeInDuration = 20;
+
+    this->localTimer = 0;
+
+    this->activate();
+
+}
+
+void RainEffect::stopRaining() {
+
+    if (!this->rainActivate)
+        this->activate();
+
+    if (!this->rainFadeOutDuration > 0)
+        this->rainFadeOutDuration = 20;
+
+    this->localTimer = 0;
+
+}
Index: /trunk/src/lib/graphics/effects/rain_effect.h
===================================================================
--- /trunk/src/lib/graphics/effects/rain_effect.h	(revision 8494)
+++ /trunk/src/lib/graphics/effects/rain_effect.h	(revision 8495)
@@ -22,62 +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 bool init();
+    virtual void init();
 
-		virtual bool activate();
-		virtual bool deactivate();
+    virtual void activate();
+    virtual void deactivate();
 
-		virtual void tick(float dt);
+    inline void activateRain() {
+        this->activate();
+    }
+    inline void deactivateRain() {
+        this->deactivate();
+    }
 
-		inline void activateRain() { this->activate(); }
-		inline void deactivateRain() { this->deactivate(); }
-		void startRaining();
+    virtual void tick(float dt);
 
-		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 setRainStart(float duration) { this->rainStartDuration = duration; }
+    void startRaining();
+    void stopRaining();
 
-		inline void setRainOption(const std::string& option) {
-			if (option == "moverain") this->rainMove = true;
-			if (option == "activate") this->rainActivate = true;
-		}
+    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 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;
 
-		float					localTimer;
+    GLfloat         rainFadeInDuration;
+    GLfloat         rainFadeOutDuration;
+    float           localTimer;
 
-		Vector					rainCoord;
-		Vector2D				rainSize;
-		GLfloat					rainRate;
-		GLfloat					rainVelocity;
-		GLfloat					rainLife;
-		GLfloat					rainMaxParticles;
-		int					rainWindForce;
-		GLfloat					rainStartDuration;
-		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: unk/src/lib/graphics/effects/sglmodel.h
===================================================================
--- /trunk/src/lib/graphics/effects/sglmodel.h	(revision 8494)
+++ 	(revision )
@@ -1,812 +1,0 @@
-/* File: sglmodel.h; Mode: C++; Tab-width: 3; Author: Simon Flannery;             */
-
-/*
-   The Silicon Graphic Library model format is a light weight, simple and
-   flexible format designed for the Open Graphics Library. The format allows
-   static models to be streamed promptly within the Open Graphics Library
-   framework. This is a high performance implementation and currently only
-   supports the GL_V3F, GL_N3F_V3F, GL_T2F_N3F_V3F vertex formats!
-
-   The binary file format is described:
-      - The number of elements.
-      - The format of the elements (for example GL_V3F), which determines the size of
-        each element.
-      - The mode of the elements (for example GL_TRIANGLES).
-      - The array of data.
-
-   This Implementation is Copyright (c) 2005 Simon Flannery.
- */
-
-#ifndef SGLMODEL_H
-#define SGLMODEL_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-enum {x, y, z, w};
-
-#pragma pack(push)
-#pragma pack(1)
-
-struct texture
-{
-   float u, v;
-};
-
-struct vertex
-{
-// GL_V3F
-   float m[3];
-
-   float& operator[](int i)
-   { 
-      return m[i];
-   }
-
-   float operator[](int i) const
-   { 
-      return m[i];
-   }
-};
-
-struct color_vertex
-{
-// GL_C4UB_V3F
-   unsigned char r, g, b, a;
-   vertex v;
-};
-
-struct normal_vertex
-{
-// GL_N3F_V3F
-   vertex n;
-   vertex v;
-};
-
-struct texture_vertex
-{
-// GL_T2F_N3F_V3F
-   texture t;
-   vertex n;
-   vertex v;
-};
-
-struct object_vertex
-{
-   vertex  position;
-   vertex  normal;
-   texture texcoord;
-};
-
-#pragma pack(pop)
-
-float my_max(float a, float b)
-{
-   return (a > b) ? a : b;
-}
-
-class Sglmodel
-{
-public:
-   virtual bool Load(char* szFileName) = 0;
-   virtual void GetDimensions(float& width, float& height, float& depth) = 0;
-   virtual void GetCenter(float& cx, float& cy, float& cz) = 0;
-   virtual void Unitize() = 0;
-   virtual void Scale(float scale) = 0;
-   virtual void Translate(float tx, float ty, float tz) = 0;
-
-   virtual void Render() const = 0;
-
-   virtual void Delete() = 0;
-};
-
-class Sglmodel_sgl : public Sglmodel
-{
-public:
-   typedef void (Sglmodel_sgl::*p_Sglmodel_sgl_member)();
-   typedef void (Sglmodel_sgl::*p_Sglmodel_sgl_member_1f)(float);
-   typedef void (Sglmodel_sgl::*p_Sglmodel_sgl_member_3f)(float, float, float);
-   typedef void (Sglmodel_sgl::*p_Sglmodel_sgl_member_3f_reference)(float&, float&, float&);
-   
-   virtual bool Load(char* szFileName);
-   virtual void GetDimensions(float& width, float& height, float& depth);
-   virtual void GetCenter(float& cx, float& cy, float& cz);
-   virtual void Unitize();
-   virtual void Scale(float scale);
-   virtual void Translate(float tx, float ty, float tz);
-
-   virtual void Render() const;
-
-           bool Save(char* szFileName) const;
-   virtual void Delete();
-
-   void SetTexture(unsigned int t) {   id = t; return;   }
-   unsigned int GetTexture() const {   return id;   }
-
-private:
-
-   void GL_V3F_Dimensions(float& width, float& height, float& depth);
-   void GL_N3F_V3F_Dimensions(float& width, float& height, float& depth);
-   void GL_T2F_N3F_V3F_Dimensions(float& width, float& height, float& depth);
-   void GL_V3F_Center(float& cx, float& cy, float& cz);
-   void GL_N3F_V3F_Center(float& cx, float& cy, float& cz);
-   void GL_T2F_N3F_V3F_Center(float& cx, float& cy, float& cz);
-   void GL_V3F_Unitize();
-   void GL_N3F_V3F_Unitize();
-   void GL_T2F_N3F_V3F_Unitize();
-   void GL_V3F_Scale(float scale);
-   void GL_N3F_V3F_Scale(float scale);
-   void GL_T2F_N3F_V3F_Scale(float scale);
-   void GL_V3F_Translate(float tx, float ty, float tz);
-   void GL_N3F_V3F_Translate(float tx, float tt, float tz);
-   void GL_T2F_N3F_V3F_Translate(float tx, float ty, float tz);
-
-   void* data;
-   int format, count, mode;
-   unsigned int id;
-
-   p_Sglmodel_sgl_member_3f_reference pDimensions;
-   p_Sglmodel_sgl_member_3f_reference pCenter;
-   p_Sglmodel_sgl_member pUnitize;
-   p_Sglmodel_sgl_member_1f pScale;
-   p_Sglmodel_sgl_member_3f pTranslate;
-};
-
-bool Sglmodel_sgl::Load(char* szFileName)
-{
-   data = NULL; format = count = mode = 0; id = 0;
-   pDimensions = NULL;
-   pCenter     = NULL;
-   pUnitize    = NULL;
-   pScale      = NULL;
-   pTranslate  = NULL;
-
-   FILE* file = fopen(szFileName, "rb");
-
-   if (file != NULL)
-   {
-      if (fread(&count, sizeof(int), 1, file) > 0 && count > 0)
-      {
-         if (fread(&format, sizeof(int), 1, file) > 0 && format > 0)
-         {
-            if (fread(&mode, sizeof(int), 1, file) > 0 && mode > 0)
-            {
-               size_t size = 0;
-
-               switch (format) /* Setup member function pointers. */
-               {
-               case GL_V3F:
-                  size = sizeof(vertex);
-                  pDimensions = &Sglmodel_sgl::GL_V3F_Dimensions;
-                  pCenter     = &Sglmodel_sgl::GL_V3F_Center;
-                  pScale      = &Sglmodel_sgl::GL_V3F_Scale;
-                  pUnitize    = &Sglmodel_sgl::GL_V3F_Unitize;
-                  pTranslate  = &Sglmodel_sgl::GL_V3F_Translate;
-                  break;
-
-               case GL_N3F_V3F:
-                  size = sizeof(normal_vertex);
-                  pDimensions = &Sglmodel_sgl::GL_N3F_V3F_Dimensions;
-                  pCenter     = &Sglmodel_sgl::GL_N3F_V3F_Center;
-                  pScale      = &Sglmodel_sgl::GL_N3F_V3F_Scale;
-                  pUnitize    = &Sglmodel_sgl::GL_N3F_V3F_Unitize;
-                  pTranslate  = &Sglmodel_sgl::GL_N3F_V3F_Translate;
-                  break;
-
-               case GL_T2F_N3F_V3F:
-                  size = sizeof(texture_vertex);
-                  pDimensions = &Sglmodel_sgl::GL_T2F_N3F_V3F_Dimensions;
-                  pCenter     = &Sglmodel_sgl::GL_T2F_N3F_V3F_Center;
-                  pScale      = &Sglmodel_sgl::GL_T2F_N3F_V3F_Scale;
-                  pUnitize    = &Sglmodel_sgl::GL_T2F_N3F_V3F_Unitize;
-                  pTranslate  = &Sglmodel_sgl::GL_T2F_N3F_V3F_Translate;
-                  break;
-               }
-
-               if (size != 0)
-               {
-                  if ((data = malloc(size * count)) != NULL)
-                  {
-                     if (fread(data, size, count, file) != count)
-                     {
-                        Delete();
-                     }
-                  }
-               }
-            }
-         }
-      }
-
-      fclose(file);
-   }
-
-   return data != NULL;
-}
-
-void Sglmodel_sgl::GetDimensions(float& width, float& height, float& depth)
-{
-   if (pDimensions != NULL)
-   {
-      (this->*pDimensions)(width, height, depth);
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GetCenter(float& cx, float& cy, float& cz)
-{
-   if (pCenter != NULL)
-   {
-      (this->*pCenter)(cx, cy, cz);
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::Unitize()
-{
-   if (pUnitize != NULL)
-   {
-      (this->*pUnitize)();
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::Scale(float scale)
-{
-   if (pScale != NULL)
-   {
-      (this->*pScale)(scale);
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::Translate(float tx, float ty, float tz)
-{
-   if (pTranslate != NULL)
-   {
-      (this->*pTranslate)(tx, ty, tz);
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::Render() const
-{
-   if (data != NULL)
-   {
-      glInterleavedArrays(format, 0, data);
-      glDrawArrays(mode, 0, count);
-   }
-
-   return;
-}
-
-bool Sglmodel_sgl::Save(char* szFileName) const
-{
-   if (data != NULL)
-   {
-      FILE* file = fopen(szFileName, "wb");
-
-      if (file != NULL)
-      {
-         fwrite(&count,  sizeof(int), 1, file);
-         fwrite(&format, sizeof(int), 1, file);
-         fwrite(&mode,   sizeof(int), 1, file);
-
-         size_t size = 0;
-
-         switch (format)
-         {
-         case GL_V3F:
-            size = sizeof(vertex);
-            break;
-
-         case GL_N3F_V3F:
-            size = sizeof(normal_vertex);
-            break;
-
-         case GL_T2F_N3F_V3F:
-            size = sizeof(texture_vertex);
-            break;
-         }
-
-         fwrite(data, size, count, file);
-
-         fclose(file);
-      }
-   }
-
-   return true;
-}
-
-void Sglmodel_sgl::Delete()
-{
-   free(data); data = NULL; format = count = mode = 0; id = 0;
-
-   pDimensions = NULL;
-   pCenter     = NULL;
-   pUnitize    = NULL;
-   pScale      = NULL;
-   pTranslate  = NULL;
-
-   return;
-}
-
-void Sglmodel_sgl::GL_V3F_Dimensions(float& width, float& height, float& depth)
-{
-   width = height = depth = 0.0f;
-   float maxx = 0.0f, minx = 0.0f, maxy = 0.0f, miny = 0.0f, maxz = 0.0f, minz = 0.0f;
-
-   if (data != NULL)
-   {
-   /* Get the maximum and minimum. */
-      vertex* v = (vertex*) data;
-
-      maxx = minx = v[0][x];
-      maxy = miny = v[0][y];
-      maxz = minz = v[0][z];
-      
-      for (int i = 0; i < count; ++i)
-      {
-         if (maxx < v[i][x]) {   maxx = v[i][x];   }
-         if (minx > v[i][x]) {   minx = v[i][x];   }
-         if (maxy < v[i][y]) {   maxy = v[i][y];   }
-         if (miny > v[i][y]) {   miny = v[i][y];   }
-         if (maxz < v[i][z]) {   maxz = v[i][z];   }
-         if (minz > v[i][z]) {   minz = v[i][z];   }
-      }
-
-   /* Calculate model width, height, and depth. */
-      width  = fabs(maxx) + fabs(minx);
-      height = fabs(maxy) + fabs(miny);
-      depth  = fabs(maxz) + fabs(minz);
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_N3F_V3F_Dimensions(float& width, float& height, float& depth)
-{
-   width = height = depth = 0.0f;
-
-   float maxx = 0.0f, minx = 0.0f, maxy = 0.0f, miny = 0.0f, maxz = 0.0f, minz = 0.0f;
-
-   if (data != NULL)
-   {
-   /* Get the maximum and minimum. */
-      normal_vertex* v = (normal_vertex*) data;
-      
-      maxx = minx = v[0].v[x];
-      maxy = miny = v[0].v[y];
-      maxz = minz = v[0].v[z];
-      
-      for (int i = 0; i < count; ++i)
-      {
-         if (maxx < v[i].v[x]) {   maxx = v[i].v[x];   }
-         if (minx > v[i].v[x]) {   minx = v[i].v[x];   }
-         if (maxy < v[i].v[y]) {   maxy = v[i].v[y];   }
-         if (miny > v[i].v[y]) {   miny = v[i].v[y];   }
-         if (maxz < v[i].v[z]) {   maxz = v[i].v[z];   }
-         if (minz > v[i].v[z]) {   minz = v[i].v[z];   }
-      }
-
-   /* Calculate model width, height, and depth. */
-      width  = fabs(maxx) + fabs(minx);
-      height = fabs(maxy) + fabs(miny);
-      depth  = fabs(maxz) + fabs(minz);
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_T2F_N3F_V3F_Dimensions(float& width, float& height, float& depth)
-{
-   width = height = depth = 0.0f;
-
-   float maxx = 0.0f, minx = 0.0f, maxy = 0.0f, miny = 0.0f, maxz = 0.0f, minz = 0.0f;
-
-   if (data != NULL)
-   {
-   /* Get the maximum and minimum. */
-      texture_vertex* v = (texture_vertex*) data;
-
-      maxx = minx = v[0].v[x];
-      maxy = miny = v[0].v[y];
-      maxz = minz = v[0].v[z];
-
-      for (int i = 0; i < count; ++i)
-      {
-         if (maxx < v[i].v[x]) {   maxx = v[i].v[x];   }
-         if (minx > v[i].v[x]) {   minx = v[i].v[x];   }
-         if (maxy < v[i].v[y]) {   maxy = v[i].v[y];   }
-         if (miny > v[i].v[y]) {   miny = v[i].v[y];   }
-         if (maxz < v[i].v[z]) {   maxz = v[i].v[z];   }
-         if (minz > v[i].v[z]) {   minz = v[i].v[z];   }
-      }
-
-   /* Calculate model width, height, and depth. */
-      width  = fabs(maxx) + fabs(minx);
-      height = fabs(maxy) + fabs(miny);
-      depth  = fabs(maxz) + fabs(minz);
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_V3F_Center(float& cx, float& cy, float& cz)
-{
-   float maxx = 0.0f, minx = 0.0f, maxy = 0.0f, miny = 0.0f, maxz = 0.0f, minz = 0.0f;
-
-   if (data != NULL)
-   {
-   /* Get the maximum and minimum. */
-      vertex* v = (vertex*) data;
-
-      maxx = minx = v[0][x];
-      maxy = miny = v[0][y];
-      maxz = minz = v[0][z];
-      
-      for (int i = 0; i < count; ++i)
-      {
-         if (maxx < v[i][x]) {   maxx = v[i][x];   }
-         if (minx > v[i][x]) {   minx = v[i][x];   }
-         if (maxy < v[i][y]) {   maxy = v[i][y];   }
-         if (miny > v[i][y]) {   miny = v[i][y];   }
-         if (maxz < v[i][z]) {   maxz = v[i][z];   }
-         if (minz > v[i][z]) {   minz = v[i][z];   }
-      }
-
-   /* Calculate model width, height, and depth. */
-      float width  = fabs(maxx) + fabs(minx);
-      float height = fabs(maxy) + fabs(miny);
-      float depth  = fabs(maxz) + fabs(minz);
-       
-   /* Calculate center of the model. */
-      cx = (maxx + minx) / 2.0f;
-      cy = (maxy + miny) / 2.0f;
-      cz = (maxz + minz) / 2.0f;
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_N3F_V3F_Center(float& cx, float& cy, float& cz)
-{
-   float maxx = 0.0f, minx = 0.0f, maxy = 0.0f, miny = 0.0f, maxz = 0.0f, minz = 0.0f;
-
-   if (data != NULL)
-   {
-   /* Get the maximum and minimum. */
-      normal_vertex* v = (normal_vertex*) data;
-
-      maxx = minx = v[0].v[x];
-      maxy = miny = v[0].v[y];
-      maxz = minz = v[0].v[z];
-      
-      for (int i = 0; i < count; ++i)
-      {
-         if (maxx < v[i].v[x]) {   maxx = v[i].v[x];   }
-         if (minx > v[i].v[x]) {   minx = v[i].v[x];   }
-         if (maxy < v[i].v[y]) {   maxy = v[i].v[y];   }
-         if (miny > v[i].v[y]) {   miny = v[i].v[y];   }
-         if (maxz < v[i].v[z]) {   maxz = v[i].v[z];   }
-         if (minz > v[i].v[z]) {   minz = v[i].v[z];   }
-      }
-
-   /* Calculate model width, height, and depth. */
-      float width  = fabs(maxx) + fabs(minx);
-      float height = fabs(maxy) + fabs(miny);
-      float depth  = fabs(maxz) + fabs(minz);
-       
-   /* Calculate center of the model. */
-      cx = (maxx + minx) / 2.0f;
-      cy = (maxy + miny) / 2.0f;
-      cz = (maxz + minz) / 2.0f;
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_T2F_N3F_V3F_Center(float& cx, float& cy, float& cz)
-{
-   float maxx = 0.0f, minx = 0.0f, maxy = 0.0f, miny = 0.0f, maxz = 0.0f, minz = 0.0f;
-
-   if (data != NULL)
-   {
-   /* Get the maximum and minimum. */
-      texture_vertex* v = (texture_vertex*) data;
-
-      maxx = minx = v[0].v[x];
-      maxy = miny = v[0].v[y];
-      maxz = minz = v[0].v[z];
-      
-      for (int i = 0; i < count; ++i)
-      {
-         if (maxx < v[i].v[x]) {   maxx = v[i].v[x];   }
-         if (minx > v[i].v[x]) {   minx = v[i].v[x];   }
-         if (maxy < v[i].v[y]) {   maxy = v[i].v[y];   }
-         if (miny > v[i].v[y]) {   miny = v[i].v[y];   }
-         if (maxz < v[i].v[z]) {   maxz = v[i].v[z];   }
-         if (minz > v[i].v[z]) {   minz = v[i].v[z];   }
-      }
-
-   /* Calculate model width, height, and depth. */
-      float width  = fabs(maxx) + fabs(minx);
-      float height = fabs(maxy) + fabs(miny);
-      float depth  = fabs(maxz) + fabs(minz);
-       
-   /* Calculate center of the model. */
-      cx = (maxx + minx) / 2.0f;
-      cy = (maxy + miny) / 2.0f;
-      cz = (maxz + minz) / 2.0f;
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_V3F_Unitize()
-{
-   float maxx = 0.0f, minx = 0.0f, maxy = 0.0f, miny = 0.0f, maxz = 0.0f, minz = 0.0f;
-
-   if (data != NULL)
-   {
-   /* Get the maximum and minimum. */
-      vertex* v = (vertex*) data;
-
-      maxx = minx = v[0][x];
-      maxy = miny = v[0][y];
-      maxz = minz = v[0][z];
-      
-      for (int i = 0; i < count; ++i)
-      {
-         if (maxx < v[i][x]) {   maxx = v[i][x];   }
-         if (minx > v[i][x]) {   minx = v[i][x];   }
-         if (maxy < v[i][y]) {   maxy = v[i][y];   }
-         if (miny > v[i][y]) {   miny = v[i][y];   }
-         if (maxz < v[i][z]) {   maxz = v[i][z];   }
-         if (minz > v[i][z]) {   minz = v[i][z];   }
-      }
-
-   /* Calculate model width, height, and depth. */
-      float width  = fabs(maxx) + fabs(minx);
-      float height = fabs(maxy) + fabs(miny);
-      float depth  = fabs(maxz) + fabs(minz);
-       
-   /* Calculate center of the model. */
-      float cx = (maxx + minx) / 2.0f;
-      float cy = (maxy + miny) / 2.0f;
-      float cz = (maxz + minz) / 2.0f;
-
-   /* Calculate unitizing scale factor. */
-      float scale = 2.0f / my_max(my_max(width, height), depth);
-
-   /* Translate around center then scale. */
-      v = (vertex*) data;
-      
-      for (int i = 0; i < count; ++i)
-      {
-         v[i][x] -= cx;
-         v[i][y] -= cy;
-         v[i][z] -= cz;
-         v[i][x] *= scale;
-         v[i][y] *= scale;
-         v[i][z] *= scale;
-      }
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_N3F_V3F_Unitize()
-{
-   float maxx = 0.0f, minx = 0.0f, maxy = 0.0f, miny = 0.0f, maxz = 0.0f, minz = 0.0f;
-
-   if (data != NULL)
-   {
-   /* Get the maximum and minimum. */
-      normal_vertex* v = (normal_vertex*) data;
-      
-      maxx = minx = v[0].v[x];
-      maxy = miny = v[0].v[y];
-      maxz = minz = v[0].v[z];
-      
-      for (int i = 0; i < count; ++i)
-      {
-         if (maxx < v[i].v[x]) {   maxx = v[i].v[x];   }
-         if (minx > v[i].v[x]) {   minx = v[i].v[x];   }
-         if (maxy < v[i].v[y]) {   maxy = v[i].v[y];   }
-         if (miny > v[i].v[y]) {   miny = v[i].v[y];   }
-         if (maxz < v[i].v[z]) {   maxz = v[i].v[z];   }
-         if (minz > v[i].v[z]) {   minz = v[i].v[z];   }
-      }
-
-   /* Calculate model width, height, and depth. */
-      float width  = fabs(maxx) + fabs(minx);
-      float height = fabs(maxy) + fabs(miny);
-      float depth  = fabs(maxz) + fabs(minz);
-       
-   /* Calculate center of the model. */
-      float cx = (maxx + minx) / 2.0f;
-      float cy = (maxy + miny) / 2.0f;
-      float cz = (maxz + minz) / 2.0f;
-
-   /* Calculate unitizing scale factor. */
-      float scale = 2.0f / my_max(my_max(width, height), depth);
-
-   /* Translate around center then scale. */
-      v = (normal_vertex*) data;
-      
-      for (int i = 0; i < count; ++i)
-      {
-         v[i].v[x] -= cx;
-         v[i].v[y] -= cy;
-         v[i].v[z] -= cz;
-         v[i].v[x] *= scale;
-         v[i].v[y] *= scale;
-         v[i].v[z] *= scale;
-      }
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_T2F_N3F_V3F_Unitize()
-{
-   float maxx = 0.0f, minx = 0.0f, maxy = 0.0f, miny = 0.0f, maxz = 0.0f, minz = 0.0f;
-
-   if (data != NULL)
-   {
-   /* Get the maximum and minimum. */
-      texture_vertex* v = (texture_vertex*) data;
-
-      maxx = minx = v[0].v[x];
-      maxy = miny = v[0].v[y];
-      maxz = minz = v[0].v[z];
-
-      for (int i = 0; i < count; ++i)
-      {
-         if (maxx < v[i].v[x]) {   maxx = v[i].v[x];   }
-         if (minx > v[i].v[x]) {   minx = v[i].v[x];   }
-         if (maxy < v[i].v[y]) {   maxy = v[i].v[y];   }
-         if (miny > v[i].v[y]) {   miny = v[i].v[y];   }
-         if (maxz < v[i].v[z]) {   maxz = v[i].v[z];   }
-         if (minz > v[i].v[z]) {   minz = v[i].v[z];   }
-      }
-
-   /* Calculate model width, height, and depth. */
-      float width  = fabs(maxx) + fabs(minx);
-      float height = fabs(maxy) + fabs(miny);
-      float depth  = fabs(maxz) + fabs(minz);
-       
-   /* Calculate center of the model. */
-      float cx = (maxx + minx) / 2.0f;
-      float cy = (maxy + miny) / 2.0f;
-      float cz = (maxz + minz) / 2.0f;
-
-   /* Calculate unitizing scale factor. */
-      float scale = 2.0f / my_max(my_max(width, height), depth);
-
-   /* Translate around center then scale. */
-      v = (texture_vertex*) data;
-      
-      for (int i = 0; i < count; ++i)
-      {
-         v[i].v[x] -= cx;
-         v[i].v[y] -= cy;
-         v[i].v[z] -= cz;
-         v[i].v[x] *= scale;
-         v[i].v[y] *= scale;
-         v[i].v[z] *= scale;
-      }
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_V3F_Scale(float scale)
-{
-   if (data != NULL)
-   {
-      vertex* v = (vertex*) data;
-      
-      for (int i = 0; i < count; ++i)
-      {
-         v[i][x] *= scale;
-         v[i][y] *= scale;
-         v[i][z] *= scale;
-      }
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_N3F_V3F_Scale(float scale)
-{
-   if (data != NULL)
-   {
-      normal_vertex* v = (normal_vertex*) data;
-      
-      for (int i = 0; i < count; ++i)
-      {
-         v[i].v[x] *= scale;
-         v[i].v[y] *= scale;
-         v[i].v[z] *= scale;
-      }
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_T2F_N3F_V3F_Scale(float scale)
-{
-   if (data != NULL)
-   {
-      texture_vertex* v = (texture_vertex*) data;
-      
-      for (int i = 0; i < count; ++i)
-      {
-         v[i].v[x] *= scale;
-         v[i].v[y] *= scale;
-         v[i].v[z] *= scale;
-      }
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_V3F_Translate(float tx, float ty, float tz)
-{
-   if (data != NULL)
-   {
-      vertex* v = (vertex*) data;
-      
-      for (int i = 0; i < count; ++i)
-      {
-         v[i][x] += tx;
-         v[i][y] += ty;
-         v[i][z] += tz;
-      }
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_N3F_V3F_Translate(float tx, float ty, float tz)
-{
-   if (data != NULL)
-   {
-      normal_vertex* v = (normal_vertex*) data;
-
-      for (int i = 0; i < count; ++i)
-      {
-         v[i].v[x] += tx;
-         v[i].v[y] += ty;
-         v[i].v[z] += tz;
-      }
-   }
-
-   return;
-}
-
-void Sglmodel_sgl::GL_T2F_N3F_V3F_Translate(float tx, float ty, float tz)
-{
-   if (data != NULL)
-   {
-      texture_vertex* v = (texture_vertex*) data;
-
-      for (int i = 0; i < count; ++i)
-      {
-         v[i].v[x] += tx;
-         v[i].v[y] += ty;
-         v[i].v[z] += tz;
-      }
-   }
-
-   return;
-}
-
-#endif
Index: /trunk/src/lib/graphics/effects/snow_effect.cc
===================================================================
--- /trunk/src/lib/graphics/effects/snow_effect.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/snow_effect.cc	(revision 8495)
@@ -50,9 +50,11 @@
 		if (this->windBuffer != NULL)
 			ResourceManager::getInstance()->unload(this->windBuffer);
-	       		this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV);
-	}
-
-	if(snowActivate)
+	       		this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
+	}
+
+  if(snowActivate) {
 		this->activate();
+    SnowEffect::snowParticles->precache((int) this->snowLife);
+  }  
 }
 
@@ -87,5 +89,5 @@
 }
 
-bool SnowEffect::init()
+void SnowEffect::init()
 {
 	this->emitter = new PlaneEmitter();
@@ -96,5 +98,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;
@@ -111,9 +113,7 @@
 	this->snowCoord = Vector(100,450,400);
 	this->snowWindForce = 1;
-
-        return true;
-}
-
-bool SnowEffect::activate()
+}
+
+void SnowEffect::activate()
 {
 	PRINTF(0)("Activating SnowEffect\n");
@@ -124,5 +124,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);
@@ -141,14 +141,11 @@
 	this->emitter->setSize(snowSize);
 
-	// SnowEffect::snowParticles->precache(8);
-
-	if (this->snowWindForce > 1)
-		this->soundSource.loop(this->windBuffer);
-
-        return true;
-}
-
-
-bool SnowEffect::deactivate()
+  if (this->snowWindForce != 0)
+    this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true);
+ 
+}
+
+
+void SnowEffect::deactivate()
 {
 	PRINTF(0)("Deactivating SnowEffect\n");
@@ -159,6 +156,4 @@
 	if (this->windBuffer != NULL)
 		ResourceManager::getInstance()->unload(this->windBuffer);
-
-        return true;
 }
 
Index: /trunk/src/lib/graphics/effects/snow_effect.h
===================================================================
--- /trunk/src/lib/graphics/effects/snow_effect.h	(revision 8494)
+++ /trunk/src/lib/graphics/effects/snow_effect.h	(revision 8495)
@@ -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 bool init();
+    virtual void init();
 
-		virtual bool activate();
-		virtual bool 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: /trunk/src/lib/graphics/effects/volfog_effect.cc
===================================================================
--- /trunk/src/lib/graphics/effects/volfog_effect.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/volfog_effect.cc	(revision 8495)
@@ -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
 */
 
@@ -21,4 +21,6 @@
 #include "state.h"
 
+#include "glincl.h"
+//#include "shell_command.h"
 
 #define GLX_GLXEXT_PROTOTYPES
@@ -49,96 +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);
 }
 
-bool 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");
-		return true;
-	}
-	else
-	{
-		PRINTF(0)("GL_EXT_fog_coord extension NOT found\n");
-		return false;
-	}
+    if (glewGetExtension("GL_EXT_fog_coord"))
+        PRINTF(0)("GL_EXT_fog_coord extension found\n");
 }
 
 
-bool VolFogEffect::activate()
-{
-	PRINTF(0)("Activating VolFogEffect\n");
-
-        return true;
+void VolFogEffect::activate() {
+    PRINTF(0)("Activating VolFogEffect\n");
 }
 
-bool VolFogEffect::deactivate()
-{
-	PRINTF(0)("Deactivating VolFogEffect\n");
+void VolFogEffect::deactivate() {
+    PRINTF(0)("Deactivating VolFogEffect\n");
 
-	glDisable(GL_FOG);
-
-        return true;
+    glDisable(GL_FOG);
 }
 
@@ -147,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();
 
 }
@@ -212,5 +194,3 @@
 * ticks the effect if there is any time dependancy
 */
-void VolFogEffect::tick(float dt)
-{
-}
+void VolFogEffect::tick(float dt) {}
Index: /trunk/src/lib/graphics/effects/volfog_effect.h
===================================================================
--- /trunk/src/lib/graphics/effects/volfog_effect.h	(revision 8494)
+++ /trunk/src/lib/graphics/effects/volfog_effect.h	(revision 8495)
@@ -11,22 +11,21 @@
 #include "glincl.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 bool init();
+    virtual void init();
 
-		virtual bool activate();
-		virtual bool 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: /trunk/src/lib/graphics/effects/weather_effect.cc
===================================================================
--- /trunk/src/lib/graphics/effects/weather_effect.cc	(revision 8494)
+++ /trunk/src/lib/graphics/effects/weather_effect.cc	(revision 8495)
@@ -55,7 +55,6 @@
  *  initializes the graphics effect
  */
-bool WeatherEffect::init()
+void WeatherEffect::init()
 {
-  return true;
 }
 
Index: /trunk/src/lib/graphics/effects/weather_effect.h
===================================================================
--- /trunk/src/lib/graphics/effects/weather_effect.h	(revision 8494)
+++ /trunk/src/lib/graphics/effects/weather_effect.h	(revision 8495)
@@ -1,5 +1,5 @@
 /*!
  * @file weather_effect.h
- *  
+ *
  */
 
@@ -18,13 +18,13 @@
     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; }
 
 
Index: /trunk/src/lib/gui/qt/gui_control.cc
===================================================================
--- /trunk/src/lib/gui/qt/gui_control.cc	(revision 8494)
+++ /trunk/src/lib/gui/qt/gui_control.cc	(revision 8495)
@@ -286,4 +286,7 @@
         return -1;
     }
+
+    return 0;
+
   }
 
Index: /trunk/src/lib/sound/sound_source.cc
===================================================================
--- /trunk/src/lib/sound/sound_source.cc	(revision 8494)
+++ /trunk/src/lib/sound/sound_source.cc	(revision 8495)
@@ -1,15 +1,15 @@
 /*
-	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: Benjamin Grauer
-	co-programmer: ...
+  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: Benjamin Grauer
+  co-programmer: ...
 */
 
@@ -85,5 +85,4 @@
     else
       this->stop();
-    return *this;
   }
 
@@ -190,73 +189,36 @@
       SoundEngine::checkError("Play Source", __LINE__);
   }
-
-
-  /**
-  * @brief Plays and loops back a SoundSource
-  */
-  void SoundSource::loop()
-  {
-    if (this->buffer && this->retrieveSource())
-    {
-      if (this->bPlay)
-        alSourceStop(this->sourceID);
-
+  
+   /**
+   * @brief Plays back buffer on this Source with gain and looping possibility
+   * @param buffer the buffer to play back on this Source
+    */
+  void SoundSource::play(const SoundBuffer* buffer, float gain, bool loop)
+  {
+    if (!this->retrieveSource())
+    {
+      PRINTF(3)("No more Free sources (You might consider raising the Source-Count).\n");
+      return;
+    }
+
+    alSourceStop(this->sourceID);
+    alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
+    
+    if (loop)
+        alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE);
+    else
+        alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE);
+    
+    alSourcef (this->sourceID, AL_GAIN, gain);
+
+    alSourcePlay(this->sourceID);
+
+    if (unlikely(this->buffer != NULL))
       alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
-      alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE);
-      alSourcef (this->sourceID, AL_GAIN, 1);
-      alSourcePlay(this->sourceID);
-
-      if (DEBUG_LEVEL >= 3)
-        SoundEngine::checkError("Play Source", __LINE__);
-      this->bPlay = true;
-    }
-  }
-
-  /**
-  * @brief Plays and loops buffer on this Source
-  * @param buffer the buffer to play back on this Source
-  */
-  void SoundSource::loop(const SoundBuffer* buffer)
-  {
-    if (this->buffer && this->retrieveSource())
-    {
-      if (this->bPlay)
-        alSourceStop(this->sourceID);
-
-      alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
-      alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE);
-      alSourcef (this->sourceID, AL_GAIN, 1);
-
-      alSourcePlay(this->sourceID);
-
-      if (DEBUG_LEVEL >= 3)
-        SoundEngine::checkError("Loop Source", __LINE__);
-      this->bPlay = true;
-    }
-  }
-
-
-  /**
-  * @brief Plays and loops buffer on this Source with gain control
-  * @param buffer the buffer to play back on this Source
-  */
-  void SoundSource::loop(const SoundBuffer* buffer, float gain)
-  {
-    if (this->buffer && this->retrieveSource())
-    {
-      if (this->bPlay)
-        alSourceStop(this->sourceID);
-
-      alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
-      alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE);
-      alSourcef (this->sourceID, AL_GAIN, gain);
-
-      alSourcePlay(this->sourceID);
-
-      if (DEBUG_LEVEL >= 3)
-        SoundEngine::checkError("Loop Source", __LINE__);
-      this->bPlay = true;
-    }
-  }
+    this->bPlay = true;
+
+    if (DEBUG_LEVEL >= 3)
+      SoundEngine::checkError("Play Source", __LINE__);
+  } 
 
 
@@ -381,9 +343,9 @@
     }
 
-    //	alSourcePlay(this->sourceID);
-
-    //	if (DEBUG_LEVEL >= 3)
-    //		SoundEngine::checkError("Loop Source", __LINE__);
-    //	this->bPlay = true;
+    //  alSourcePlay(this->sourceID);
+
+    //  if (DEBUG_LEVEL >= 3)
+    //    SoundEngine::checkError("Loop Source", __LINE__);
+    //  this->bPlay = true;
     //}
 
Index: /trunk/src/lib/sound/sound_source.h
===================================================================
--- /trunk/src/lib/sound/sound_source.h	(revision 8494)
+++ /trunk/src/lib/sound/sound_source.h	(revision 8495)
@@ -30,7 +30,6 @@
 			void play(const SoundBuffer* buffer);
 			void play(const SoundBuffer* buffer, float gain);
-			void loop();
-			void loop(const SoundBuffer* buffer);
-			void loop(const SoundBuffer* buffer, float gain);
+      void play(const SoundBuffer* buffer, float gain, bool loop);   
+
 			void stop();
 			void pause();
Index: /trunk/src/subprojects/benchmark.cc
===================================================================
--- /trunk/src/subprojects/benchmark.cc	(revision 8494)
+++ /trunk/src/subprojects/benchmark.cc	(revision 8495)
@@ -455,9 +455,7 @@
         }
       printf("\n");
-
-
-
     }
 
+    return 0;
 }
 
Index: /trunk/src/util/kill_target.cc
===================================================================
--- /trunk/src/util/kill_target.cc	(revision 8494)
+++ /trunk/src/util/kill_target.cc	(revision 8495)
@@ -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: /trunk/src/world_entities/effects/billboard.cc
===================================================================
--- /trunk/src/world_entities/effects/billboard.cc	(revision 8494)
+++ /trunk/src/world_entities/effects/billboard.cc	(revision 8495)
@@ -121,4 +121,8 @@
     return;
 
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_LIGHTING);
+  glDisable(GL_FOG);
+  
   glPushMatrix();
 
@@ -164,3 +168,5 @@
   
   glPopMatrix();
+  
+  glPopAttrib();
 }
Index: /trunk/src/world_entities/space_ships/helicopter.cc
===================================================================
--- /trunk/src/world_entities/space_ships/helicopter.cc	(revision 8494)
+++ /trunk/src/world_entities/space_ships/helicopter.cc	(revision 8495)
@@ -107,5 +107,5 @@
   if (this->chopperBuffer != NULL)
     ResourceManager::getInstance()->unload(this->chopperBuffer);
-  this->chopperBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/chopper.wav", WAV);
+  this->chopperBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/engine/chopper.wav", WAV);
 
 }
@@ -219,6 +219,5 @@
   State::getCameraTargetNode()->setParentSoft(this->getWeaponManager().getFixedTarget());
 
-  this->soundSource.loop(this->chopperBuffer, 0.8f);
-  // PRINTF(0)( "Playing ChopperSound\n" );
+  this->soundSource.play(this->chopperBuffer, 0.7f, true);
 }
 
