Index: trunk/src/lib/particles/Makefile.am
===================================================================
--- trunk/src/lib/particles/Makefile.am	(revision 6621)
+++ trunk/src/lib/particles/Makefile.am	(revision 6623)
@@ -9,4 +9,6 @@
 			particle_system.cc \
 			sprite_particles.cc \
+			spark_particles.cc \
+			\
 			quick_animation.cc
 
@@ -17,3 +19,5 @@
 			particle_system.h \
 			sprite_particles.h \
+			spark_particles.h \
+			\
 			quick_animation.h
Index: trunk/src/lib/particles/particle_emitter.cc
===================================================================
--- trunk/src/lib/particles/particle_emitter.cc	(revision 6621)
+++ trunk/src/lib/particles/particle_emitter.cc	(revision 6623)
@@ -64,8 +64,9 @@
 ParticleEmitter::~ParticleEmitter ()
 {
-}
-
-/**
-  \brief initializes default values of a ParitcleEmitter
+  this->setSystem(NULL);
+}
+
+/**
+  @brief initializes default values of a ParitcleEmitter
 */
 void ParticleEmitter::init()
Index: trunk/src/lib/particles/particle_system.cc
===================================================================
--- trunk/src/lib/particles/particle_system.cc	(revision 6621)
+++ trunk/src/lib/particles/particle_system.cc	(revision 6623)
@@ -44,15 +44,4 @@
 
   this->setMaxCount(maxCount);
-}
-
-/**
- * @brief creates a Particle System out of a XML-element
- * @param root: the XML-element to load from
- */
-ParticleSystem::ParticleSystem(const TiXmlElement* root)
-{
-  this->init();
-
-  this->loadParams(root);
 }
 
@@ -78,6 +67,9 @@
      }
 
-   if (this->material)
-     delete this->material;
+     while(!this->emitters.empty())
+     {
+       this->removeEmitter(this->emitters.front());
+     }
+
 }
 
@@ -89,5 +81,4 @@
   this->setClassID(CL_PARTICLE_SYSTEM, "ParticleSystem");
 
-  this->material = NULL;
   this->setMaxCount(PARTICLE_DEFAULT_MAX_COUNT);
   this->count = 0;
@@ -96,5 +87,4 @@
   this->setConserve(1);
   this->setLifeSpan(1);
-  this->glID = NULL;
 
   this->toList(OM_ENVIRON);
@@ -120,6 +110,5 @@
       .describe("sets the Conserve factor of the Particles (1.0: they keep all their energy, 0.0:they keep no energy)");
 
-  LoadParam(root, "texture", this, ParticleSystem, setMaterialTexture);
-  LoadParamXML(root, "emitter", this, ParticleSystem, addEmitterXML);
+  LoadParamXML(root, "emitters", this, ParticleSystem, loadEmitters);
 
   LOAD_PARAM_START_CYCLE(root, element);
@@ -140,4 +129,25 @@
 
 /**
+ * @brief loads the Emitters from An XML-Root
+ * @param root the XML-Element to load all emitters from
+ */
+void ParticleSystem::loadEmitters(const TiXmlElement* root)
+{
+  LOAD_PARAM_START_CYCLE(root, element);
+  {
+    BaseObject* emitter = Factory::fabricate(element);
+    if (emitter->isA(CL_PARTICLE_EMITTER))
+      this->addEmitter(dynamic_cast<ParticleEmitter*>(emitter));
+    else
+    {
+      PRINTF(2)("Tried to load an Element of type '%s' that should be a ParticleEmitter onto '%s::%s'.\n",
+                emitter->getClassName(), this->getClassName(), this->getName());
+      delete emitter;
+    }
+  }
+  LOAD_PARAM_END_CYCLE(element);
+}
+
+/**
 * @param maxCount the maximum count of particles that can be emitted
  */
@@ -148,21 +158,4 @@
 
 // setting properties
-/**
- *  sets the material to an external material
- * @param material: the material to set this material to.
-
-   !! important if the extern material gets deleted it MUST be unregistered here or segfault !!
-*/
-void ParticleSystem::setMaterial(Material* material)
-{
-  this->material = material;
-}
-
-void ParticleSystem::setMaterialTexture(const char* textureFile)
-{
-  if (this->material != NULL)
-    this->material->setDiffuseMap(textureFile);
-}
-
 /**
  *  Sets the lifespan of newly created particles
@@ -237,10 +230,4 @@
     emitter->getSystem()->removeEmitter(emitter);
   this->emitters.push_back(emitter);
-}
-
-void ParticleSystem::addEmitterXML(const TiXmlElement* emitterRoot)
-{
-  ParticleEmitter* emitter = new ParticleEmitter(emitterRoot);
-  this->addEmitter(emitter);
 }
 
Index: trunk/src/lib/particles/particle_system.h
===================================================================
--- trunk/src/lib/particles/particle_system.h	(revision 6621)
+++ trunk/src/lib/particles/particle_system.h	(revision 6623)
@@ -58,13 +58,10 @@
  public:
   ParticleSystem(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT);
-  ParticleSystem(const TiXmlElement* root);
   virtual ~ParticleSystem();
 
   void init();
   virtual void loadParams(const TiXmlElement* root);
+  void loadEmitters(const TiXmlElement* root);
 
-  void setMaterial(Material* material);
-  void setMaterialTexture(const char* textureFile);
-  void setModel(const char* modelName = NULL);
   void setLifeSpan(float lifeSpan, float randomLifeSpan = 0.0);
   void setConserve(float conserve);
@@ -76,6 +73,4 @@
   void setColor(float lifeCycleTime, float red, float green, float blue, float alpha);
 
-  /** @returns the Material that lies on this particles */
-  inline const Material* getMaterial() const { return this->material; };
   /** @returns the lifespan of the particles */
   inline float getLifeSpan() const { return this->lifeSpan; };
@@ -92,5 +87,4 @@
 
   void addEmitter(ParticleEmitter* emitter);
-  void addEmitterXML(const TiXmlElement* emitterRoot);
   void removeEmitter(ParticleEmitter* emitter);
 
@@ -115,10 +109,6 @@
   int               maxCount;            //!< The maximum count of Particles.
   int               count;               //!< The current count of Particles.
-  Material*         material;            //!< A Material for all the Particles.
   Particle*         particles;           //!< A list of particles of this System.
   Particle*         deadList;            //!< A list of dead Particles in the System.
-
-  GLuint*           glID;                //!< A List of different gl-List-ID's
-  GLuint            dialectCount;        //!< How many different types of particles are there in the Particle System
 
   std::list<ParticleEmitter*> emitters;  //!< The Emitters that do emit into this System.
Index: trunk/src/lib/particles/spark_particles.cc
===================================================================
--- trunk/src/lib/particles/spark_particles.cc	(revision 6623)
+++ trunk/src/lib/particles/spark_particles.cc	(revision 6623)
@@ -0,0 +1,132 @@
+/*
+   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: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
+
+#include "spark_particles.h"
+
+#include "load_param.h"
+#include "factory.h"
+#include "material.h"
+#include "state.h"
+#include "shell_command.h"
+
+#include "parser/tinyxml/tinyxml.h"
+#include <algorithm>
+
+
+CREATE_FACTORY(SparkParticles, CL_SPARK_PARTICLES);
+
+using namespace std;
+
+/**
+ *  standard constructor
+ * @param maxCount the Count of particles in the System
+ * @param type The Type of the SparkParticles
+*/
+SparkParticles::SparkParticles (unsigned int maxCount)
+    : ParticleSystem(maxCount)
+{
+  this->init();
+}
+
+/**
+ * @brief creates a Particle System out of a XML-element
+ * @param root: the XML-element to load from
+ */
+SparkParticles::SparkParticles(const TiXmlElement* root)
+{
+  this->init();
+
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+/**
+ *  standard deconstructor
+*/
+SparkParticles::~SparkParticles()
+{
+  // deleting all the living Particles
+  while (this->particles)
+  {
+    Particle* tmpDelPart = this->particles;
+    this->particles = this->particles->next;
+    delete tmpDelPart;
+  }
+
+  // deleting all the dead particles
+  while (this->deadList)
+  {
+    Particle* tmpDelPart = this->deadList;
+    this->deadList = this->deadList->next;
+    delete tmpDelPart;
+  }
+}
+
+/**
+ * @brief initializes the SparkParticles with default values
+*/
+void SparkParticles::init()
+{
+  this->setClassID(CL_SPARK_PARTICLES, "SparkParticles");
+
+  this->material = NULL;
+}
+
+
+/**
+ * loads Parameters from a TiXmlElement
+ * @param root the XML-element to load from.
+ */
+void SparkParticles::loadParams(const TiXmlElement* root)
+{
+  ParticleSystem::loadParams(root);
+}
+
+/**
+ * @brief draws all the Particles of this System
+ *
+ * The Cases in this Function all do the same:
+ * Drawing all the particles with the appropriate Type.
+ * This is just the fastest Way to do this, but will most likely be changed in the future.
+ */
+void SparkParticles::draw() const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+
+  Particle* drawPart = particles;
+
+  glDepthMask(GL_FALSE);
+
+  glDisable(GL_LIGHTING);
+  glEnable(GL_LINE_SMOOTH);
+  glEnable(GL_BLEND);
+
+  glBegin(GL_LINES);
+  while (likely(drawPart != NULL))
+  {
+    glColor4fv(drawPart->color);
+    glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z);
+    glVertex3f(drawPart->position.x - drawPart->velocity.x * drawPart->radius,
+               drawPart->position.y - drawPart->velocity.y * drawPart->radius,
+               drawPart->position.z - drawPart->velocity.z * drawPart->radius);
+    drawPart = drawPart->next;
+  }
+  glEnd();
+
+  glDepthMask(GL_TRUE);
+  glPopAttrib();
+}
Index: trunk/src/lib/particles/spark_particles.h
===================================================================
--- trunk/src/lib/particles/spark_particles.h	(revision 6623)
+++ trunk/src/lib/particles/spark_particles.h	(revision 6623)
@@ -0,0 +1,32 @@
+/*!
+ * @file spark_particles.h
+
+*/
+
+#ifndef _SPARK_PARTICLE_SYSTEM_H
+#define _SPARK_PARTICLE_SYSTEM_H
+
+#include "particle_system.h"
+#include "material.h"
+
+//! A class to handle ParticleSystems
+class SparkParticles : public ParticleSystem
+{
+
+public:
+  SparkParticles(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT);
+  SparkParticles(const TiXmlElement* root);
+  virtual ~SparkParticles();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  virtual void draw() const;
+
+private:
+  void init();
+
+private:
+  Material          material;            //!< A Material for all the Particles.
+};
+
+#endif /* _SPARK_PARTICLE_SYSTEM_H */
Index: trunk/src/lib/particles/sprite_particles.cc
===================================================================
--- trunk/src/lib/particles/sprite_particles.cc	(revision 6621)
+++ trunk/src/lib/particles/sprite_particles.cc	(revision 6623)
@@ -53,6 +53,6 @@
 {
   this->init();
-
-  this->loadParams(root);
+  if (root != NULL)
+    this->loadParams(root);
 }
 
@@ -96,5 +96,5 @@
 void SpriteParticles::loadParams(const TiXmlElement* root)
 {
-  SpriteParticles::loadParams(root);
+  ParticleSystem::loadParams(root);
 
   LoadParam(root, "texture", this, SpriteParticles, setMaterialTexture);
Index: trunk/src/lib/particles/sprite_particles.h
===================================================================
--- trunk/src/lib/particles/sprite_particles.h	(revision 6621)
+++ trunk/src/lib/particles/sprite_particles.h	(revision 6623)
@@ -1,4 +1,4 @@
 /*!
- * @file particle_system.h
+ * @file sprite_particles.h
 
 */
@@ -29,6 +29,4 @@
   virtual void draw() const;
 
-  void debug() const;
-
 private:
   void init();
