Index: branches/proxy/src/lib/graphics/effects/snow_effect.cc
===================================================================
--- branches/proxy/src/lib/graphics/effects/snow_effect.cc	(revision 9346)
+++ branches/proxy/src/lib/graphics/effects/snow_effect.cc	(revision 9347)
@@ -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
 */
 
@@ -35,5 +35,4 @@
 SHELL_COMMAND(deactivate, SnowEffect, deactivateSnow);
 
-using namespace std;
 
 CREATE_SCRIPTABLE_CLASS(SnowEffect, CL_SNOW_EFFECT,
@@ -46,20 +45,19 @@
 SnowEffect::SnowEffect(const TiXmlElement* root)
 {
-	this->setClassID(CL_SNOW_EFFECT, "SnowEffect");
-
-	this->init();
-
-	if (root != NULL)
-		this->loadParams(root);
-
-	//load wind sound
-	if (this->snowWindForce >= 1) {
-		if (this->windBuffer != NULL)
-			ResourceManager::getInstance()->unload(this->windBuffer);
-	  this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
-	}
+        this->setClassID(CL_SNOW_EFFECT, "SnowEffect");
+
+        this->init();
+
+        if (root != NULL)
+                this->loadParams(root);
+
+        this->windBuffer = NULL;
+        //load wind sound
+        if (this->snowWindForce >= 1) {
+          this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
+        }
 
   if(snowActivate) {
-		this->activate();
+                this->activate();
     SnowEffect::snowParticles->precache((int) this->snowLife);
   }
@@ -69,5 +67,5 @@
 SnowEffect::~SnowEffect()
 {
-	this->deactivate();
+        this->deactivate();
 }
 
@@ -76,52 +74,52 @@
 void SnowEffect::loadParams(const TiXmlElement* root)
 {
-	WeatherEffect::loadParams(root);
-
-	LoadParam(root, "numParticles", this, SnowEffect, numParticles);
-	LoadParam(root, "materialTexture", this, SnowEffect, materialTexture);
-	LoadParam(root, "lifeSpans", this, SnowEffect, lifeSpan);
-	LoadParam(root, "radius", this, SnowEffect, radius);
-	LoadParam(root, "mass", this, SnowEffect, mass);
-	LoadParam(root, "emissionRate", this, SnowEffect, emissionRate);
-	LoadParam(root, "emissionVelocity", this, SnowEffect, emissionVelocity);
-	LoadParam(root, "wind", this, SnowEffect, wind);
-	LoadParam(root, "size", this, SnowEffect, size);
-	LoadParam(root, "coord", this, SnowEffect, coord);
+        WeatherEffect::loadParams(root);
+
+        LoadParam(root, "numParticles", this, SnowEffect, numParticles);
+        LoadParam(root, "materialTexture", this, SnowEffect, materialTexture);
+        LoadParam(root, "lifeSpans", this, SnowEffect, lifeSpan);
+        LoadParam(root, "radius", this, SnowEffect, radius);
+        LoadParam(root, "mass", this, SnowEffect, mass);
+        LoadParam(root, "emissionRate", this, SnowEffect, emissionRate);
+        LoadParam(root, "emissionVelocity", this, SnowEffect, emissionVelocity);
+        LoadParam(root, "wind", this, SnowEffect, wind);
+        LoadParam(root, "size", this, SnowEffect, size);
+        LoadParam(root, "coord", this, SnowEffect, coord);
   LoadParam(root, "cloudcolor", this, SnowEffect, setCloudColor);
   LoadParam(root, "skycolor", this, SnowEffect, setSkyColor);
   LoadParam(root, "fadetime", this, SnowEffect, setFadeTime);
 
-	LOAD_PARAM_START_CYCLE(root, element);
-	{
-		LoadParam_CYCLE(element, "option", this, SnowEffect, setSnowOption);
-	}
-	LOAD_PARAM_END_CYCLE(element);
+        LOAD_PARAM_START_CYCLE(root, element);
+        {
+                LoadParam_CYCLE(element, "option", this, SnowEffect, setSnowOption);
+        }
+        LOAD_PARAM_END_CYCLE(element);
 }
 
 void SnowEffect::init()
 {
-	this->emitter = new PlaneEmitter();
-
-	// Default values
-	this->snowActivate = false;
-	this->snowMove = false;
-	this->particles = 12000;
-	this->texture = "maps/snow_flake_01_32x32.png";
-	this->snowLife = 8;
-	this->randomLife = 2;
-	this->snowRadius = 3.5;
-	this->randomRadius = 1;
-	this->snowMass = 1.0;
-	this->randomMass = 0.3;
-	this->rate = 900;
-	this->velocity = -100;
-	this->randomVelocity = 5;
-	this->angle = 0.5;
-	this->randomAngle = 0.2;
-	this->alpha = 0.5;
-	this->snowSize = Vector2D(2500, 2500);
-	this->snowCoord = Vector(100,450,400);
-	this->snowWindForce = 1;
-  
+        this->emitter = new PlaneEmitter();
+
+        // Default values
+        this->snowActivate = false;
+        this->snowMove = false;
+        this->particles = 12000;
+        this->texture = "maps/snow_flake_01_32x32.png";
+        this->snowLife = 8;
+        this->randomLife = 2;
+        this->snowRadius = 3.5;
+        this->randomRadius = 1;
+        this->snowMass = 1.0;
+        this->randomMass = 0.3;
+        this->rate = 900;
+        this->velocity = -100;
+        this->randomVelocity = 5;
+        this->angle = 0.5;
+        this->randomAngle = 0.2;
+        this->alpha = 0.5;
+        this->snowSize = Vector2D(2500, 2500);
+        this->snowCoord = Vector(100,450,400);
+        this->snowWindForce = 1;
+
   this->fadeTime = 10;
   this->cloudColor = Vector(0.2f, 0.2f, 0.2f);
@@ -131,31 +129,31 @@
 void SnowEffect::activate()
 {
-	PRINTF(3)("Activating SnowEffect\n");
-
-	this->snowActivate = true;
-
-	SnowEffect::snowParticles = new SpriteParticles(particles);
-	SnowEffect::snowParticles->setName("SnowEffectTrailParticles");
-	SnowEffect::snowParticles->setMaterialTexture(texture);
-	SnowEffect::snowParticles->setLifeSpan(snowLife, randomLife);
-	SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius);
-	SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius*0.8);
-	SnowEffect::snowParticles->setRadius(1.0, snowRadius, randomRadius*0.5);
-	SnowEffect::snowParticles->setMass(0, snowMass, randomMass);
-	SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
-	SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
-	SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
-
-	this->emitter->setSystem(SnowEffect::snowParticles);
-
-	this->emitter->setRelCoor(snowCoord);
-	this->emitter->setEmissionRate(rate);
-	this->emitter->setEmissionVelocity(velocity, randomVelocity);
-	this->emitter->setSpread(angle * this->snowWindForce , randomAngle * this->snowWindForce);
-	this->emitter->setSize(snowSize);
+        PRINTF(3)("Activating SnowEffect\n");
+
+        this->snowActivate = true;
+
+        SnowEffect::snowParticles = new SpriteParticles(particles);
+        SnowEffect::snowParticles->setName("SnowEffectTrailParticles");
+        SnowEffect::snowParticles->setMaterialTexture(texture);
+        SnowEffect::snowParticles->setLifeSpan(snowLife, randomLife);
+        SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius);
+        SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius*0.8);
+        SnowEffect::snowParticles->setRadius(1.0, snowRadius, randomRadius*0.5);
+        SnowEffect::snowParticles->setMass(0, snowMass, randomMass);
+        SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
+        SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
+        SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
+
+        this->emitter->setSystem(SnowEffect::snowParticles);
+
+        this->emitter->setRelCoor(snowCoord);
+        this->emitter->setEmissionRate(rate);
+        this->emitter->setEmissionVelocity(velocity, randomVelocity);
+        this->emitter->setSpread(angle * this->snowWindForce , randomAngle * this->snowWindForce);
+        this->emitter->setSize(snowSize);
 
   if (this->snowWindForce != 0)
     this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true);
-  
+
   // Store cloud- and sky color before the snow
   this->oldCloudColor = CloudEffect::cloudColor;
@@ -171,12 +169,12 @@
 void SnowEffect::deactivate()
 {
-	PRINTF(3)("Deactivating SnowEffect\n");
-
-	this->snowActivate = false;
-	this->emitter->setSystem(NULL);
-
-	if (this->windBuffer != NULL)
-		ResourceManager::getInstance()->unload(this->windBuffer);
-  
+        PRINTF(3)("Deactivating SnowEffect\n");
+
+        this->snowActivate = false;
+        this->emitter->setSystem(NULL);
+
+        if (this->windBuffer != NULL)
+                ResourceManager::getInstance()->unload(this->windBuffer);
+
   // Restore the old cloud- and sky color
   CloudEffect::changeCloudColor(this->oldCloudColor, this->fadeTime);
@@ -186,50 +184,50 @@
 void SnowEffect::draw() const
 {
-	if (!this->snowActivate)
-		return;
+        if (!this->snowActivate)
+                return;
 }
 
 void SnowEffect::tick(float dt)
 {
-	if (!this->snowActivate)
-		return;
-
-	/*
-	float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len();
-
-	if(activated)
-	{
-	if(distance > 0.3*snowSize.x || distance > 0.3*snowSize.y)
-			this->deactivate();
-	else if(distance > 0.25*snowSize.x || distance > 0.25*snowSize.y)
-	this->alpha = 0.15;
-	else if(distance > 0.2*snowSize.x || distance > 0.2*snowSize.y)
-	this->alpha = 0.25;
-	else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y)
-	this->alpha = 0.4;
-
-	SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
-	SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
-	SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
-	}
-	else
-	{
-	if(distance < 0.3*snowSize.x || distance < 0.3*snowSize.y )
-	this->activate();
-	if( distance < 0.25*snowSize.x || distance < 0.25*snowSize.y )
-	this->alpha = 0.25;
-	else if( distance < 0.2*snowSize.x || distance < 0.2*snowSize.y )
-	this->alpha = 0.4;
-	else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y )
-	this->alpha = 0.5;
-
-	SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
-	SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
-	SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
-	}*/
-
-	if (this->snowMove) {
-		this->snowCoord = State::getCameraNode()->getAbsCoor();
-		this->emitter->setRelCoor(this->snowCoord.x , this->snowCoord.y+300, this->snowCoord.z);
-	}
-}
+        if (!this->snowActivate)
+                return;
+
+        /*
+        float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len();
+
+        if(activated)
+        {
+        if(distance > 0.3*snowSize.x || distance > 0.3*snowSize.y)
+                        this->deactivate();
+        else if(distance > 0.25*snowSize.x || distance > 0.25*snowSize.y)
+        this->alpha = 0.15;
+        else if(distance > 0.2*snowSize.x || distance > 0.2*snowSize.y)
+        this->alpha = 0.25;
+        else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y)
+        this->alpha = 0.4;
+
+        SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
+        SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
+        SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
+        }
+        else
+        {
+        if(distance < 0.3*snowSize.x || distance < 0.3*snowSize.y )
+        this->activate();
+        if( distance < 0.25*snowSize.x || distance < 0.25*snowSize.y )
+        this->alpha = 0.25;
+        else if( distance < 0.2*snowSize.x || distance < 0.2*snowSize.y )
+        this->alpha = 0.4;
+        else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y )
+        this->alpha = 0.5;
+
+        SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
+        SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
+        SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
+        }*/
+
+        if (this->snowMove) {
+                this->snowCoord = State::getCameraNode()->getAbsCoor();
+                this->emitter->setRelCoor(this->snowCoord.x , this->snowCoord.y+300, this->snowCoord.z);
+        }
+}
Index: branches/proxy/src/lib/graphics/effects/snow_effect.h
===================================================================
--- branches/proxy/src/lib/graphics/effects/snow_effect.h	(revision 9346)
+++ branches/proxy/src/lib/graphics/effects/snow_effect.h	(revision 9347)
@@ -101,31 +101,31 @@
 
 private:
-    int         particles;
+    int               particles;
     std::string       texture;
-    float       snowLife, randomLife;
-    float       snowRadius, randomRadius;
-    float       snowMass, randomMass;
-    float         rate;
-    float         velocity, randomVelocity;
-    float         angle, randomAngle;
-    float         alpha;
-    float         fadeTime;
-    Vector        snowCoord;
-    Vector2D      snowSize;
-    int       snowWindForce;
+    float             snowLife, randomLife;
+    float             snowRadius, randomRadius;
+    float             snowMass, randomMass;
+    float             rate;
+    float             velocity, randomVelocity;
+    float             angle, randomAngle;
+    float             alpha;
+    float             fadeTime;
+    Vector            snowCoord;
+    Vector2D          snowSize;
+    int               snowWindForce;
 
-    bool        snowMove;
-    bool        snowActivate;
+    bool              snowMove;
+    bool              snowActivate;
 
     PlaneEmitter*     emitter;
 
     static SpriteParticles*   snowParticles;
-    OrxSound::SoundSource   soundSource;
+    OrxSound::SoundSource     soundSource;
     OrxSound::SoundBuffer*    windBuffer;
 
-    Vector oldSkyColor;
-    Vector oldCloudColor;
-    Vector skyColor;
-    Vector cloudColor;
+    Vector            oldSkyColor;
+    Vector            oldCloudColor;
+    Vector            skyColor;
+    Vector            cloudColor;
 };
 
Index: branches/proxy/src/lib/graphics/importer/md3/md3_animation_cfg.cc
===================================================================
--- branches/proxy/src/lib/graphics/importer/md3/md3_animation_cfg.cc	(revision 9346)
+++ branches/proxy/src/lib/graphics/importer/md3/md3_animation_cfg.cc	(revision 9347)
@@ -19,11 +19,9 @@
 #include "md3_animation.h"
 
-#include "tokenizer.h"
+#include "substring.h"
 #include "helper_functions.h"
 
 #include "debug.h"
 
-#include <stdio.h>
-#include <stdlib.h>
 
 
@@ -98,6 +96,5 @@
         if( inHeader && line.find("sex") == 0) {
           //parse line: sex [m | f | ...]
-          std::vector<std::string> tokens;
-          Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
+          SubString tokens(line, " \t\n\r\f/");
 
           std::string sexStr = tokens.back();
@@ -115,6 +112,5 @@
         else if( inHeader && line.find("headoffset") == 0) {
           // parse line: headoffset X Y Z
-          std::vector<std::string> tokens;
-          Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
+          SubString tokens(line, " \t\n\r\f/");
 
           float z = atof(tokens.back().c_str()); tokens.pop_back();
@@ -128,6 +124,5 @@
         else if( inHeader && line.find("footsteps") == 0) {
           //parse line: footsteps [normal | mech | ...]
-          std::vector<std::string> tokens;
-          Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
+          SubString tokens (line, " \t\n\r\f/");
 
           this->footsteps = tokens.back();
@@ -187,6 +182,5 @@
     // parse the line:
     // first frame, num frames, looping frames, frames per second (fps)
-    std::vector<std::string> tokens;
-    Tokenizer::tokenize(line, tokens, " \t\n\r\f/");
+    SubString tokens(line, " \t\n\r\f/");
 
     anim->fps = atoi(tokens.back().c_str()); tokens.pop_back();
