Index: /trunk/src/lib/lang/base_object.h
===================================================================
--- /trunk/src/lib/lang/base_object.h	(revision 8349)
+++ /trunk/src/lib/lang/base_object.h	(revision 8350)
@@ -21,8 +21,9 @@
 
 //! A class all other classes are derived from
-class BaseObject {
+class BaseObject
+{
 
- public:
-   BaseObject (const std::string& objectName = "");
+public:
+  BaseObject (const std::string& objectName = "");
 
   virtual ~BaseObject ();
@@ -49,16 +50,19 @@
   bool operator==(ClassID classID) { return this->isA(classID); };
 
- protected:
-   void setClassID(ClassID classID, const std::string& className);
-   std::string        objectName;        //!< The name of this object
+protected:
+  void setClassID(ClassID classID, const std::string& className);
 
- private:
-    std::string        className;        //!< the name of the class
-    long               classID;          //!< this is the id from the class_id.h enumeration
-    ClassID            leafClassID;      //!< The Leaf Class ID
+protected:
+  std::string        objectName;       //!< The name of this object
 
-    ClassList*         classList;        //!< Pointer to the ClassList this Object is inside of
+private:
 
-    TiXmlNode*         xmlElem;          //!< The XML Element with wich this Object was loaded(saved).
+  std::string        className;        //!< the name of the class
+  long               classID;          //!< this is the id from the class_id.h enumeration
+  ClassID            leafClassID;      //!< The Leaf Class ID
+
+  ClassList*         classList;        //!< Pointer to the ClassList this Object is inside of
+
+  TiXmlNode*         xmlElem;          //!< The XML Element with wich this Object was loaded(saved).
 };
 
Index: /trunk/src/lib/physics/physics_interface.cc
===================================================================
--- /trunk/src/lib/physics/physics_interface.cc	(revision 8349)
+++ /trunk/src/lib/physics/physics_interface.cc	(revision 8350)
@@ -100,5 +100,4 @@
 void PhysicsInterface::applyForce(const Vector& force)
 {
-  PNode* tmp = dynamic_cast<PNode*>((BaseObject*)this);
   this->forceSum += force;
   this->bForceApplied = true;
Index: /trunk/src/lib/shell/shell_buffer.cc
===================================================================
--- /trunk/src/lib/shell/shell_buffer.cc	(revision 8349)
+++ /trunk/src/lib/shell/shell_buffer.cc	(revision 8350)
@@ -99,6 +99,6 @@
     std::string inputBuffer = this->keepBuffer + line;
 
-    int lineBegin = 0;
-    int lineEnd = 0;
+    unsigned int lineBegin = 0;
+    unsigned int lineEnd = 0;
     // adding all the new Lines
     while (lineEnd < inputBuffer.size())
Index: /trunk/src/lib/shell/shell_command.cc
===================================================================
--- /trunk/src/lib/shell/shell_command.cc	(revision 8349)
+++ /trunk/src/lib/shell/shell_command.cc	(revision 8350)
@@ -149,5 +149,5 @@
   const ShellCommand* const ShellCommand::getCommandFromInput(const std::string& inputLine, unsigned int& paramBegin, std::vector<BaseObject*>* boList)
   {
-    ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin);
+    return ShellCommand::getCommandFromInput(SubString(inputLine, SubString::WhiteSpaces), paramBegin);
   }
 
@@ -194,5 +194,5 @@
     if (cmdClass != NULL)
     {
-      const ShellCommand* retCmd;
+      const ShellCommand* retCmd = NULL;
       // Function/Command right after Class
       if (strings.size() >= 1)
Index: /trunk/src/lib/sound/ogg_player.cc
===================================================================
--- /trunk/src/lib/sound/ogg_player.cc	(revision 8349)
+++ /trunk/src/lib/sound/ogg_player.cc	(revision 8350)
@@ -275,4 +275,5 @@
     }
     PRINTF(4)("End the AudioThread\n");
+    return 0;
   }
 
Index: /trunk/src/lib/sound/sound_engine.cc
===================================================================
--- /trunk/src/lib/sound/sound_engine.cc	(revision 8349)
+++ /trunk/src/lib/sound/sound_engine.cc	(revision 8350)
@@ -302,4 +302,6 @@
     this->allocateSources(this->maxSourceCount);
     this->checkError("Allocating Sources", __LINE__);
+
+    return true;
   }
 
@@ -336,4 +338,5 @@
     {
       PRINTF(2)("Failed to allocate %d of %d SoundSources\n", failCount, count);
+      return false;
     }
   }
@@ -388,16 +391,17 @@
     switch(err)
     {
-    case AL_NO_ERROR:
-      return ("AL_NO_ERROR");
-    case AL_INVALID_NAME:
-      return ("AL_INVALID_NAME");
-    case AL_INVALID_ENUM:
-      return ("AL_INVALID_ENUM");
-    case AL_INVALID_VALUE:
-      return ("AL_INVALID_VALUE");
-    case AL_INVALID_OPERATION:
-      return ("AL_INVALID_OPERATION");
-    case AL_OUT_OF_MEMORY:
-      return ("AL_OUT_OF_MEMORY");
+      default:
+      case AL_NO_ERROR:
+        return ("AL_NO_ERROR");
+      case AL_INVALID_NAME:
+        return ("AL_INVALID_NAME");
+      case AL_INVALID_ENUM:
+        return ("AL_INVALID_ENUM");
+      case AL_INVALID_VALUE:
+        return ("AL_INVALID_VALUE");
+      case AL_INVALID_OPERATION:
+        return ("AL_INVALID_OPERATION");
+      case AL_OUT_OF_MEMORY:
+        return ("AL_OUT_OF_MEMORY");
     };
   }
@@ -408,16 +412,17 @@
     switch(err)
     {
-    case ALC_NO_ERROR:
-      return ("AL_NO_ERROR");
-    case ALC_INVALID_DEVICE:
-      return ("ALC_INVALID_DEVICE");
-    case ALC_INVALID_CONTEXT:
-      return("ALC_INVALID_CONTEXT");
-    case ALC_INVALID_ENUM:
-      return("ALC_INVALID_ENUM");
-    case ALC_INVALID_VALUE:
-      return ("ALC_INVALID_VALUE");
-    case ALC_OUT_OF_MEMORY:
-      return("ALC_OUT_OF_MEMORY");
+      default:
+      case ALC_NO_ERROR:
+        return ("AL_NO_ERROR");
+      case ALC_INVALID_DEVICE:
+        return ("ALC_INVALID_DEVICE");
+      case ALC_INVALID_CONTEXT:
+        return("ALC_INVALID_CONTEXT");
+      case ALC_INVALID_ENUM:
+        return("ALC_INVALID_ENUM");
+      case ALC_INVALID_VALUE:
+        return ("ALC_INVALID_VALUE");
+      case ALC_OUT_OF_MEMORY:
+        return("ALC_OUT_OF_MEMORY");
     };
   }
Index: /trunk/src/lib/sound/sound_source.cc
===================================================================
--- /trunk/src/lib/sound/sound_source.cc	(revision 8349)
+++ /trunk/src/lib/sound/sound_source.cc	(revision 8350)
@@ -24,367 +24,368 @@
 namespace OrxSound
 {
-	/**
-	* @brief creates a SoundSource at position sourceNode with the SoundBuffer buffer
-	*/
-	SoundSource::SoundSource(const PNode* sourceNode, const SoundBuffer* buffer)
-	{
-		this->setClassID(CL_SOUND_SOURCE, "SoundSource");
-
-		// adding the Source to the SourcesList of the SoundEngine
-		this->buffer = buffer;
-		this->sourceNode = sourceNode;
-		this->resident = false;
-
-		this->sourceID = 0;
-		this->bPlay = false;
-	}
-
-
-	/**
-	* @brief construct a SoundSource out of the another soundSource
-	* @param source the Source to create this source from.
-	*
-	* Copies the buffer from source to this Source.
-	* Acquires a new SourceID if source is Playing.
-	*/
-	SoundSource::SoundSource(const SoundSource& source)
-	{
-		this->setClassID(CL_SOUND_SOURCE, "SoundSource");
-
-		// adding the Source to the SourcesList of the SoundEngine
-		this->buffer = source.buffer;
-		this->sourceNode = source.sourceNode;
-		this->resident = source.resident;
-
-		this->sourceID = 0;
-		if (source.bPlay == true)
-		{
-			this->bPlay = true;
-			SoundEngine::getInstance()->popALSource(this->sourceID);
-		}
-		else
-			this->bPlay = false;
-	}
-
-
-	/**
-	* @brief paste a copy of the source into this Source.
-	* @param source the SoundSource to paste into this one.
-	* @returns a Reference to this Source.
-	*
-	*/
-	SoundSource& SoundSource::operator=(const SoundSource& source)
-	{
-		this->buffer = source.buffer;
-		this->sourceNode = sourceNode;
-		this->resident = source.resident;
-
-		if (source.bPlay)
-			this->play();
-		else
-			this->stop();
-	}
-
-
-	/**
-	* @brief compares two Sources with each other.
-	* @param source the Source to compare against this One.
-	* Two Sources are the same, if the PNodes match, and the Sound Played are the same.
-	* The alSource must not match, because no two Sources can have the same alSource.
-	*/
-	bool SoundSource::operator==(const SoundSource& source)
-	{
-		return (this->buffer == source.buffer &&
-						this->bPlay == source.bPlay &&
-						this->sourceNode == source.sourceNode);
-	}
-
-
-	/**
-	* @brief deletes a SoundSource
-	*/
-	SoundSource::~SoundSource()
-	{
-		this->stop();
-		if (this->sourceID != 0)
-			SoundEngine::getInstance()->pushALSource(this->sourceID);
-	}
-
-
-	/**
-	* @brief Plays back a SoundSource
-	*/
-	void SoundSource::play()
-	{
-		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_FALSE);
-			alSourcef (this->sourceID, AL_GAIN, 1);
-			alSourcePlay(this->sourceID);
-
-			if (DEBUG_LEVEL >= 3)
-				SoundEngine::checkError("Play Source", __LINE__);
-			this->bPlay = true;
-		}
-	}
-
-
-	/**
-	* @brief Plays back buffer on this Source
-	* @param buffer the buffer to play back on this Source
-	*/
-	void SoundSource::play(const SoundBuffer* buffer)
-	{
-		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());
-		alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE);
-		alSourcef (this->sourceID, AL_GAIN, 1);
-
-		alSourcePlay(this->sourceID);
-
-		if (unlikely(this->buffer != NULL))
-			alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
-		this->bPlay = true;
-
-		if (DEBUG_LEVEL >= 3)
-			SoundEngine::checkError("Play Source", __LINE__);
-	}
-
-
-	/**
-	* @brief Plays back buffer on this Source with gain
-	* @param buffer the buffer to play back on this Source
-	*/
-	void SoundSource::play(const SoundBuffer* buffer, float gain)
-	{
-		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());
-		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());
-		this->bPlay = true;
-
-		if (DEBUG_LEVEL >= 3)
-			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);
-			
-			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;
-		}
-	}
-	
-	
-	/**
-	* @brief Stops playback of a SoundSource
-	*/
-	void SoundSource::stop()
-	{
-		this->bPlay = false;
-		if (this->sourceID != 0)
-		{
-			this->bPlay = false;
-			if (this->sourceID != 0)
-			{
-				alSourceStop(this->sourceID);
-				if (DEBUG_LEVEL >= 3)
-					SoundEngine::checkError("StopSource", __LINE__);
-				alSourcei(this->sourceID, AL_BUFFER, 0);
-				if (!this->resident)
-					SoundEngine::getInstance()->pushALSource(this->sourceID);
-				this->sourceID = 0;
-			}
-		}
-	}
-
-	/**
-	* @brief Pauses Playback of a SoundSource
-	*/
-	void SoundSource::pause()
-	{
-		alSourcePause(this->sourceID);
-		if (DEBUG_LEVEL >= 3)
-			SoundEngine::checkError("Pause Source", __LINE__);
-	}
-
-
-	/**
-	* @brief Rewinds Playback of a SoundSource
-	*/
-	void SoundSource::rewind()
-	{
-		alSourceRewind(this->sourceID);
-
-		if (DEBUG_LEVEL >= 3)
-			SoundEngine::checkError("Rewind Source", __LINE__);
-	}
-
-
-	/**
-	* @brief sets the RolloffFactor of the Sound emitted from the SoundSource
-	* @param rolloffFactor The Factor described
-	*
-	* this tells openAL how fast the Sounds decay outward from the Source
-	*/
-	void SoundSource::setRolloffFactor(ALfloat rolloffFactor)
-	{
-		alSourcef(this->sourceID, AL_ROLLOFF_FACTOR, rolloffFactor);
-
-		if (DEBUG_LEVEL >= 3)
-			SoundEngine::checkError("Set Source Rolloff-factor", __LINE__);
-	}
-
-
-	/**
-	* @brief sets the Positional this Source should be attached to.
-	* @param sourceNode the Source this is attached to.
-	* If sourceNode == NULL then the Source will be centered, and Audio will be played on all channels.
-	*/
-	void SoundSource::setSourceNode(const PNode* sourceNode)
-	{
-		this->sourceNode = sourceNode;
-	}
-
-	/**
-	* @brief retrieve a Source.
-	*/
-	bool SoundSource::retrieveSource()
-	{
-		if (this->sourceID != 0)
-			return true;
-		else
-		{
-			SoundEngine::getInstance()->popALSource(this->sourceID);
-			if (this->sourceID != 0)
-			{
-				if (unlikely(this->sourceNode == NULL))
-					resetSource(this->sourceID);
-				return true;
-			}
-		}
-		return false;
-	}
-
-
-	/**
-	* @brief reset an alSource to its default Values.
-	*/
-	void SoundSource::resetSource(ALuint sourceID)
-	{
-		alSource3f(sourceID, AL_POSITION,        0.0, 0.0, 0.0);
-		alSource3f(sourceID, AL_VELOCITY,        0.0, 0.0, 0.0);
-		alSource3f(sourceID, AL_DIRECTION,       0.0, 0.0, 0.0);
-		alSourcef (sourceID, AL_ROLLOFF_FACTOR,  0.0          );
-		//alSourcei (sourceID, AL_SOURCE_RELATIVE, AL_TRUE      );
-		alSourcef (sourceID, AL_GAIN,            SoundEngine::getInstance()->getEffectsVolume());
-	}
-
-
-	/**
-	* @brief Fades in a Source over a time period
-	* @param duration time perios to fade in
-	*/
-	void SoundSource::fadein(const SoundBuffer* buffer, ALfloat duration)
-	{
-		//if (this->buffer && this->retrieveSource())
-		//{
-
-		for (ALfloat n = 0.0; n < 1.0; n+=.01)
-		{
-			alSourcef(this->sourceID, AL_GAIN, n);
-			// sleep(1);
-		}
-
-		//	alSourcePlay(this->sourceID);
-	
-		//	if (DEBUG_LEVEL >= 3)
-		//		SoundEngine::checkError("Loop Source", __LINE__);
-		//	this->bPlay = true;
-		//}
-
-	}
+  /**
+  * @brief creates a SoundSource at position sourceNode with the SoundBuffer buffer
+  */
+  SoundSource::SoundSource(const PNode* sourceNode, const SoundBuffer* buffer)
+  {
+    this->setClassID(CL_SOUND_SOURCE, "SoundSource");
+
+    // adding the Source to the SourcesList of the SoundEngine
+    this->buffer = buffer;
+    this->sourceNode = sourceNode;
+    this->resident = false;
+
+    this->sourceID = 0;
+    this->bPlay = false;
+  }
+
+
+  /**
+  * @brief construct a SoundSource out of the another soundSource
+  * @param source the Source to create this source from.
+  *
+  * Copies the buffer from source to this Source.
+  * Acquires a new SourceID if source is Playing.
+  */
+  SoundSource::SoundSource(const SoundSource& source)
+  {
+    this->setClassID(CL_SOUND_SOURCE, "SoundSource");
+
+    // adding the Source to the SourcesList of the SoundEngine
+    this->buffer = source.buffer;
+    this->sourceNode = source.sourceNode;
+    this->resident = source.resident;
+
+    this->sourceID = 0;
+    if (source.bPlay == true)
+    {
+      this->bPlay = true;
+      SoundEngine::getInstance()->popALSource(this->sourceID);
+    }
+    else
+      this->bPlay = false;
+  }
+
+
+  /**
+  * @brief paste a copy of the source into this Source.
+  * @param source the SoundSource to paste into this one.
+  * @returns a Reference to this Source.
+  *
+  */
+  SoundSource& SoundSource::operator=(const SoundSource& source)
+  {
+    this->buffer = source.buffer;
+    this->sourceNode = sourceNode;
+    this->resident = source.resident;
+
+    if (source.bPlay)
+      this->play();
+    else
+      this->stop();
+    return *this;
+  }
+
+
+  /**
+  * @brief compares two Sources with each other.
+  * @param source the Source to compare against this One.
+  * Two Sources are the same, if the PNodes match, and the Sound Played are the same.
+  * The alSource must not match, because no two Sources can have the same alSource.
+  */
+  bool SoundSource::operator==(const SoundSource& source)
+  {
+    return (this->buffer == source.buffer &&
+            this->bPlay == source.bPlay &&
+            this->sourceNode == source.sourceNode);
+  }
+
+
+  /**
+  * @brief deletes a SoundSource
+  */
+  SoundSource::~SoundSource()
+  {
+    this->stop();
+    if (this->sourceID != 0)
+      SoundEngine::getInstance()->pushALSource(this->sourceID);
+  }
+
+
+  /**
+  * @brief Plays back a SoundSource
+  */
+  void SoundSource::play()
+  {
+    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_FALSE);
+      alSourcef (this->sourceID, AL_GAIN, 1);
+      alSourcePlay(this->sourceID);
+
+      if (DEBUG_LEVEL >= 3)
+        SoundEngine::checkError("Play Source", __LINE__);
+      this->bPlay = true;
+    }
+  }
+
+
+  /**
+  * @brief Plays back buffer on this Source
+  * @param buffer the buffer to play back on this Source
+  */
+  void SoundSource::play(const SoundBuffer* buffer)
+  {
+    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());
+    alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE);
+    alSourcef (this->sourceID, AL_GAIN, 1);
+
+    alSourcePlay(this->sourceID);
+
+    if (unlikely(this->buffer != NULL))
+      alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
+    this->bPlay = true;
+
+    if (DEBUG_LEVEL >= 3)
+      SoundEngine::checkError("Play Source", __LINE__);
+  }
+
+
+  /**
+  * @brief Plays back buffer on this Source with gain
+  * @param buffer the buffer to play back on this Source
+  */
+  void SoundSource::play(const SoundBuffer* buffer, float gain)
+  {
+    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());
+    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());
+    this->bPlay = true;
+
+    if (DEBUG_LEVEL >= 3)
+      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);
+
+      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;
+    }
+  }
+
+
+  /**
+  * @brief Stops playback of a SoundSource
+  */
+  void SoundSource::stop()
+  {
+    this->bPlay = false;
+    if (this->sourceID != 0)
+    {
+      this->bPlay = false;
+      if (this->sourceID != 0)
+      {
+        alSourceStop(this->sourceID);
+        if (DEBUG_LEVEL >= 3)
+          SoundEngine::checkError("StopSource", __LINE__);
+        alSourcei(this->sourceID, AL_BUFFER, 0);
+        if (!this->resident)
+          SoundEngine::getInstance()->pushALSource(this->sourceID);
+        this->sourceID = 0;
+      }
+    }
+  }
+
+  /**
+  * @brief Pauses Playback of a SoundSource
+  */
+  void SoundSource::pause()
+  {
+    alSourcePause(this->sourceID);
+    if (DEBUG_LEVEL >= 3)
+      SoundEngine::checkError("Pause Source", __LINE__);
+  }
+
+
+  /**
+  * @brief Rewinds Playback of a SoundSource
+  */
+  void SoundSource::rewind()
+  {
+    alSourceRewind(this->sourceID);
+
+    if (DEBUG_LEVEL >= 3)
+      SoundEngine::checkError("Rewind Source", __LINE__);
+  }
+
+
+  /**
+  * @brief sets the RolloffFactor of the Sound emitted from the SoundSource
+  * @param rolloffFactor The Factor described
+  *
+  * this tells openAL how fast the Sounds decay outward from the Source
+  */
+  void SoundSource::setRolloffFactor(ALfloat rolloffFactor)
+  {
+    alSourcef(this->sourceID, AL_ROLLOFF_FACTOR, rolloffFactor);
+
+    if (DEBUG_LEVEL >= 3)
+      SoundEngine::checkError("Set Source Rolloff-factor", __LINE__);
+  }
+
+
+  /**
+  * @brief sets the Positional this Source should be attached to.
+  * @param sourceNode the Source this is attached to.
+  * If sourceNode == NULL then the Source will be centered, and Audio will be played on all channels.
+  */
+  void SoundSource::setSourceNode(const PNode* sourceNode)
+  {
+    this->sourceNode = sourceNode;
+  }
+
+  /**
+  * @brief retrieve a Source.
+  */
+  bool SoundSource::retrieveSource()
+  {
+    if (this->sourceID != 0)
+      return true;
+    else
+    {
+      SoundEngine::getInstance()->popALSource(this->sourceID);
+      if (this->sourceID != 0)
+      {
+        if (unlikely(this->sourceNode == NULL))
+          resetSource(this->sourceID);
+        return true;
+      }
+    }
+    return false;
+  }
+
+
+  /**
+  * @brief reset an alSource to its default Values.
+  */
+  void SoundSource::resetSource(ALuint sourceID)
+  {
+    alSource3f(sourceID, AL_POSITION,        0.0, 0.0, 0.0);
+    alSource3f(sourceID, AL_VELOCITY,        0.0, 0.0, 0.0);
+    alSource3f(sourceID, AL_DIRECTION,       0.0, 0.0, 0.0);
+    alSourcef (sourceID, AL_ROLLOFF_FACTOR,  0.0          );
+    //alSourcei (sourceID, AL_SOURCE_RELATIVE, AL_TRUE      );
+    alSourcef (sourceID, AL_GAIN,            SoundEngine::getInstance()->getEffectsVolume());
+  }
+
+
+  /**
+  * @brief Fades in a Source over a time period
+  * @param duration time perios to fade in
+  */
+  void SoundSource::fadein(const SoundBuffer* buffer, ALfloat duration)
+  {
+    //if (this->buffer && this->retrieveSource())
+    //{
+
+    for (ALfloat n = 0.0; n < 1.0; n+=.01)
+    {
+      alSourcef(this->sourceID, AL_GAIN, n);
+      // sleep(1);
+    }
+
+    //	alSourcePlay(this->sourceID);
+
+    //	if (DEBUG_LEVEL >= 3)
+    //		SoundEngine::checkError("Loop Source", __LINE__);
+    //	this->bPlay = true;
+    //}
+
+  }
 
 
Index: /trunk/src/util/fast_factory.cc
===================================================================
--- /trunk/src/util/fast_factory.cc	(revision 8349)
+++ /trunk/src/util/fast_factory.cc	(revision 8350)
@@ -190,5 +190,5 @@
   PRINTF(3)("not creating new Objects for class %s, because the requested count already exists\n", this->getClassName());
 }*/
-  for (int i = this->storedDeadObjects; i < count; i++)
+  for (unsigned int i = this->storedDeadObjects; i < count; i++)
   {
     this->fabricate();
Index: /trunk/src/world_entities/power_ups/power_up.cc
===================================================================
--- /trunk/src/world_entities/power_ups/power_up.cc	(revision 8349)
+++ /trunk/src/world_entities/power_ups/power_up.cc	(revision 8350)
@@ -137,4 +137,7 @@
         this->respawnTime = this->respawnStart;
         break;
+        default:
+          /* NOT HANDLED */
+          break;
       }
     }
