Index: trunk/src/lib/particles/spark_particles.cc
===================================================================
--- trunk/src/lib/particles/sprite_particles.cc	(revision 6621)
+++ trunk/src/lib/particles/spark_particles.cc	(revision 6623)
@@ -16,5 +16,5 @@
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
 
-#include "sprite_particles.h"
+#include "spark_particles.h"
 
 #include "load_param.h"
@@ -28,8 +28,5 @@
 
 
-CREATE_FACTORY(SpriteParticles, CL_SPRITE_PARTICLES);
-
-SHELL_COMMAND(texture, SpriteParticles, setMaterialTexture)
-    ->defaultValues(1, "maps/evil-flower.png");
+CREATE_FACTORY(SparkParticles, CL_SPARK_PARTICLES);
 
 using namespace std;
@@ -38,8 +35,8 @@
  *  standard constructor
  * @param maxCount the Count of particles in the System
- * @param type The Type of the SpriteParticles
+ * @param type The Type of the SparkParticles
 */
-SpriteParticles::SpriteParticles (unsigned int maxCount)
-  : ParticleSystem(maxCount)
+SparkParticles::SparkParticles (unsigned int maxCount)
+    : ParticleSystem(maxCount)
 {
   this->init();
@@ -50,9 +47,10 @@
  * @param root: the XML-element to load from
  */
-SpriteParticles::SpriteParticles(const TiXmlElement* root)
+SparkParticles::SparkParticles(const TiXmlElement* root)
 {
   this->init();
 
-  this->loadParams(root);
+  if (root != NULL)
+    this->loadParams(root);
 }
 
@@ -60,5 +58,5 @@
  *  standard deconstructor
 */
-SpriteParticles::~SpriteParticles()
+SparkParticles::~SparkParticles()
 {
   // deleting all the living Particles
@@ -80,9 +78,9 @@
 
 /**
- * @brief initializes the SpriteParticles with default values
+ * @brief initializes the SparkParticles with default values
 */
-void SpriteParticles::init()
+void SparkParticles::init()
 {
-  this->setClassID(CL_SPRITE_PARTICLES, "SpriteParticles");
+  this->setClassID(CL_SPARK_PARTICLES, "SparkParticles");
 
   this->material = NULL;
@@ -94,26 +92,7 @@
  * @param root the XML-element to load from.
  */
-void SpriteParticles::loadParams(const TiXmlElement* root)
+void SparkParticles::loadParams(const TiXmlElement* root)
 {
-  SpriteParticles::loadParams(root);
-
-  LoadParam(root, "texture", this, SpriteParticles, setMaterialTexture);
-}
-
-// setting properties
-/**
- * @brief 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 SpriteParticles::setMaterial(Material* material)
-{
-  this->material = *material;
-}
-
-void SpriteParticles::setMaterialTexture(const char* textureFile)
-{
-  this->material.setDiffuseMap(textureFile);
+  ParticleSystem::loadParams(root);
 }
 
@@ -125,5 +104,5 @@
  * This is just the fastest Way to do this, but will most likely be changed in the future.
  */
-void SpriteParticles::draw() const
+void SparkParticles::draw() const
 {
   glPushAttrib(GL_ENABLE_BIT);
@@ -131,54 +110,22 @@
   Particle* drawPart = particles;
 
-  glDisable(GL_LIGHTING);
-  glMatrixMode(GL_MODELVIEW);
   glDepthMask(GL_FALSE);
 
-  material.select();
-  glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
+  glDisable(GL_LIGHTING);
+  glEnable(GL_LINE_SMOOTH);
+  glEnable(GL_BLEND);
 
-  //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
-
+  glBegin(GL_LINES);
   while (likely(drawPart != NULL))
   {
     glColor4fv(drawPart->color);
-    //! @todo implement a faster code for the look-at Camera algorithm.
-
-    const PNode* camera = State::getCamera();  //!< @todo MUST be different
-    Vector cameraPos = camera->getAbsCoor();
-    Vector cameraTargetPos = State::getCameraTarget()->getAbsCoor();
-    Vector view = cameraTargetPos - cameraPos;
-    Vector up = Vector(0, 1, 0);
-    up = camera->getAbsDir().apply(up);
-    Vector h = up.cross(view);
-    Vector v = h.cross(view);
-    h.normalize();
-    v.normalize();
-    v *= .5 * drawPart->radius;
-    h *= .5 * drawPart->radius;
-
-    glBegin(GL_TRIANGLE_STRIP);
-    glTexCoord2i(1, 1);
-    glVertex3f(drawPart->position.x - h.x - v.x,
-               drawPart->position.y - h.y - v.y,
-               drawPart->position.z - h.z - v.z);
-    glTexCoord2i(0, 1);
-    glVertex3f(drawPart->position.x - h.x + v.x,
-               drawPart->position.y - h.y + v.y,
-               drawPart->position.z - h.z + v.z);
-    glTexCoord2i(1, 0);
-    glVertex3f(drawPart->position.x + h.x - v.x,
-               drawPart->position.y + h.y - v.y,
-               drawPart->position.z + h.z - v.z);
-    glTexCoord2i(0, 0);
-    glVertex3f(drawPart->position.x + h.x + v.x,
-               drawPart->position.y + h.y + v.y,
-               drawPart->position.z + h.z + v.z);
-
-    glEnd();
-
+    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();
