Index: /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc	(revision 8178)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc	(revision 8179)
@@ -59,4 +59,5 @@
   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);
@@ -69,6 +70,7 @@
   
   this->time = 0.0;
-  this->flashFrequency = 0.6f;
-  this->flashConstTime = 0.07f;
+  this->flashFrequency = 1.4f;
+  this->flashConstTime = 0.8f;
+  this->flashRisingTime = 0.5f;
 
   this->width = 40.0f;
@@ -80,10 +82,27 @@
   this->seedTime = 4.0f;
 
-  this->billboard = new Billboard(NULL);
-  this->billboard->setTexture("maps/lightning_bolt.png");
-  this->billboard->setSize(this->width, this->height);
-  this->billboard->setAbsCoor(0.0f, 50.0f, 0.0f);
-  this->billboard->setVisibiliy(false);
-
+  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(0.0f, 50.0f, 0.0f);
+  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(0.0f, 50.0f, 0.0f);
+  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(0.0f, 50.0f, 0.0f);
+  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;
@@ -100,5 +119,8 @@
 void LighteningEffect::coord(float x, float y, float z)
 {
-  this->billboard->setAbsCoor(x, y, 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;
@@ -110,5 +132,5 @@
 {
 	PRINTF(0)( "Activating LighteningEffect\n" );
-  this->billboard->setVisibiliy(true);
+  this->time = 0;
   lighteningActivate = true;
 }
@@ -118,5 +140,8 @@
 {
 	PRINTF(0)("Deactivating LighteningEffect\n");
-  this->billboard->setVisibiliy(false);
+  this->billboard[0]->setVisibiliy(false);
+  this->billboard[1]->setVisibiliy(false);
+  this->billboard[2]->setVisibiliy(false);
+  this->billboard[3]->setVisibiliy(false);
   lighteningActivate = false;
 }
@@ -131,19 +156,39 @@
   if( this->time > this->flashFrequency)
   {
-    this->billboard->setVisibiliy(true);
+    this->billboard[0]->setVisibiliy(true);
     this->time = 0.0f;
     //this->soundSource.play(this->thunderBuffer);
   }
-  else if( this->billboard->isVisible() && this->time > this->flashConstTime)
-  {
-    this->billboard->setVisibiliy(false);
+  else if( this->billboard[3]->isVisible() && this->time > this->flashConstTime)
+  {
+    this->billboard[3]->setVisibiliy(false);
     this->time = 0.0f;
     this->bNewCoordinate = true;
   }
 
+  if( this->billboard[2]->isVisible() && this->time > this->flashRisingTime)
+  {
+    this->billboard[2]->setVisibiliy(false);
+    this->billboard[3]->setVisibiliy(true);
+  }
+  else if( this->billboard[1]->isVisible() && this->time > this->flashRisingTime*2/3 )
+  {
+    this->billboard[1]->setVisibiliy(false);
+    this->billboard[2]->setVisibiliy(true);
+  }
+  else if( this->billboard[0]->isVisible() && this->time > this->flashRisingTime*1/3 )
+  {
+    this->billboard[0]->setVisibiliy(false);
+    this->billboard[1]->setVisibiliy(true);
+  }
+
   if( this->bNewCoordinate)
   {
-    this->flashFrequency = this->seedTime * (float)rand()/(float)RAND_MAX + 0.1;
-    this->billboard->setAbsCoor(this->mainPosX - this->seedX * (float)rand()/(float)RAND_MAX, this->mainPosY, this->mainPosZ + this->seedZ * (float)rand()/(float)RAND_MAX);
+    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;
   }
Index: /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h	(revision 8178)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h	(revision 8179)
@@ -38,4 +38,8 @@
     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 setFlashSize(float width, float height) { this->width = width;
                                                           this->height = height; }
@@ -48,9 +52,10 @@
     
 	private:
-    Billboard* billboard;
+    Billboard* billboard[4];
     bool lighteningActivate;
 
     float flashFrequency;
     float flashConstTime;
+    float flashRisingTime;
 
     float time;
