Index: code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/CMakeLists.txt	(revision 8329)
+++ code/trunk/src/orxonox/CMakeLists.txt	(revision 8351)
@@ -68,16 +68,14 @@
     OrxonoxPrecompiledHeaders.h
   LINK_LIBRARIES
-    ${Boost_FILESYSTEM_LIBRARY}
-    ${Boost_SYSTEM_LIBRARY} # Filesystem dependency
-    ${Boost_THREAD_LIBRARY}
-    ${Boost_DATE_TIME_LIBRARY} # Thread dependency
     ${OGRE_LIBRARY}
+    ${CEGUI}
+    ${LUA5.1_LIBRARY}
+    ${CEGUI_TOLUA_LIBRARY}
     ${OPENAL_LIBRARY}
     ${ALUT_LIBRARY}
+    ${OGG_LIBRARY}
+    ${VORBIS_LIBRARY}
     ${VORBISFILE_LIBRARY}
-    ${VORBIS_LIBRARY}
-    ${OGG_LIBRARY}
     tinyxml_orxonox
-    tolua_orxonox
     bullet_orxonox
     util
@@ -85,4 +83,5 @@
     network
     tools
-  SOURCE_FILES ${ORXONOX_SRC_FILES}
+  SOURCE_FILES
+    ${ORXONOX_SRC_FILES}
 )
Index: code/trunk/src/orxonox/MoodManager.cc
===================================================================
--- code/trunk/src/orxonox/MoodManager.cc	(revision 8329)
+++ code/trunk/src/orxonox/MoodManager.cc	(revision 8351)
@@ -56,4 +56,7 @@
             COUT(2) << "Mood Warning: Folder for default mood (" << MoodManager::defaultMood_ << ") does not exist!" << std::endl;
         }
+        
+        // @TODO
+        // Creating a vector of the available moods to enable easy mood selection by Lua/CEGUI        
     }
 
Index: code/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 8329)
+++ code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 8351)
@@ -53,8 +53,11 @@
 #    endif
 #  endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _OrxonoxPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
 #  define _OrxonoxExport  __attribute__ ((visibility("default")))
+#  define _OrxonoxPrivate __attribute__ ((visibility("hidden")))
 #else
 #  define _OrxonoxExport
+#  define _OrxonoxPrivate
 #endif
 
Index: code/trunk/src/orxonox/PawnManager.cc
===================================================================
--- code/trunk/src/orxonox/PawnManager.cc	(revision 8329)
+++ code/trunk/src/orxonox/PawnManager.cc	(revision 8351)
@@ -29,4 +29,5 @@
 #include "PawnManager.h"
 
+#include "util/ScopedSingletonManager.h"
 #include "core/CoreIncludes.h"
 #include "worldentities/pawns/Pawn.h"
@@ -34,5 +35,5 @@
 namespace orxonox
 {
-    PawnManager* PawnManager::singletonPtr_s = 0;
+    ManageScopedSingleton(PawnManager, ScopeID::Root, false);
 
     PawnManager::PawnManager()
@@ -43,16 +44,12 @@
     PawnManager::~PawnManager()
     {
+        // Be sure to delete all the pawns
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); )
+            (it++)->destroy();
     }
 
-    void PawnManager::touch()
+    void PawnManager::preUpdate(const Clock& time)
     {
-        if (!PawnManager::singletonPtr_s)
-            new PawnManager();
-    }
-
-    void PawnManager::tick(float dt)
-    {
-        unsigned int count = 0;
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++count)
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); )
         {
             if (!it->isAlive())
@@ -61,7 +58,4 @@
                 ++it;
         }
-
-        if (count == 0)
-            this->destroy();
     }
 }
Index: code/trunk/src/orxonox/PawnManager.h
===================================================================
--- code/trunk/src/orxonox/PawnManager.h	(revision 8329)
+++ code/trunk/src/orxonox/PawnManager.h	(revision 8351)
@@ -37,15 +37,14 @@
 namespace orxonox
 {
-    class _OrxonoxExport PawnManager : protected Singleton<PawnManager>, public Tickable
+    class _OrxonoxExport PawnManager : public Singleton<PawnManager>, public Tickable
     {
             friend class Singleton<PawnManager>;
         public:
-            static void touch();
+            PawnManager();
+            virtual ~PawnManager();
 
-            virtual void tick(float dt);
+            virtual void preUpdate(const Clock& time);
 
         private:
-            PawnManager();
-            virtual ~PawnManager();
 
             static PawnManager* singletonPtr_s;
Index: code/trunk/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ArtificialController.cc	(revision 8329)
+++ code/trunk/src/orxonox/controllers/ArtificialController.cc	(revision 8351)
@@ -847,6 +847,6 @@
                 Vector3 distanceCurrent = this->targetPosition_ - this->getControllableEntity()->getPosition();
                 Vector3 distanceNew = it->getPosition() - this->getControllableEntity()->getPosition();
-                if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * math::pi))
-                        < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * math::pi)) + rnd(-250, 250))
+                if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi)
+                        < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / math::twoPi) + rnd(-250, 250))
                 {
                     this->target_ = (*it);
Index: code/trunk/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/NewHumanController.cc	(revision 8329)
+++ code/trunk/src/orxonox/controllers/NewHumanController.cc	(revision 8351)
@@ -544,20 +544,20 @@
             if (distance > 0.04f && distance <= 0.59f * arrowsSize_ / 2.0f )
             {
-                this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi) * 360.0f));
+                this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f));
                 this->arrowsOverlay1_->show();
             }
             else if (distance > 0.59f * arrowsSize_ / 2.0f && distance <= 0.77f * arrowsSize_ / 2.0f )
             {
-                this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi) * 360.0f));
+                this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f));
                 this->arrowsOverlay2_->show();
             }
             else if (distance > 0.77f * arrowsSize_ / 2.0f && distance <= arrowsSize_ / 2.0f)
             {
-                this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi) * 360.0f));
+                this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f));
                 this->arrowsOverlay3_->show();
             }
             else if (distance > arrowsSize_ / 2.0f)
             {
-                this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * math::pi) * 360.0f));
+                this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / math::twoPi * 360.0f));
                 this->arrowsOverlay4_->show();
             }
Index: code/trunk/src/orxonox/graphics/BlinkingBillboard.cc
===================================================================
--- code/trunk/src/orxonox/graphics/BlinkingBillboard.cc	(revision 8329)
+++ code/trunk/src/orxonox/graphics/BlinkingBillboard.cc	(revision 8351)
@@ -79,9 +79,11 @@
         if (this->isActive())
         {
-            this->time_ += dt;
+            // Wrap around to avoid loosing floating point precision
+            this->time_ = std::fmod(this->time_ + dt, 1.0f / this->frequency_);
+            float value = sin((math::twoPi * this->time_ + this->phase_.valueRadians()) * this->frequency_);
             if (this->bQuadratic_)
-                this->setScale(this->amplitude_ * static_cast<float>(square(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));
+                this->setScale(this->amplitude_ * square(value));
             else
-                this->setScale(this->amplitude_ * static_cast<float>(fabs(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));
+                this->setScale(this->amplitude_ * std::abs(value));
         }
     }
Index: code/trunk/src/orxonox/graphics/BlinkingBillboard.h
===================================================================
--- code/trunk/src/orxonox/graphics/BlinkingBillboard.h	(revision 8329)
+++ code/trunk/src/orxonox/graphics/BlinkingBillboard.h	(revision 8351)
@@ -75,5 +75,5 @@
             Degree phase_;
             bool bQuadratic_;
-            long double time_;
+            float time_;
     };
 }
Index: code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 8329)
+++ code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 8351)
@@ -284,5 +284,5 @@
             angle = -angle;
         angle -= math::pi * static_cast<int>(angle / (math::pi));
-        if (angle > math::pi * 0.5)
+        if (angle > math::pi_2)
             angle = math::pi - angle;
 
Index: code/trunk/src/orxonox/sound/AmbientSound.cc
===================================================================
--- code/trunk/src/orxonox/sound/AmbientSound.cc	(revision 8329)
+++ code/trunk/src/orxonox/sound/AmbientSound.cc	(revision 8351)
@@ -42,5 +42,5 @@
 
         // Ambient sounds always fade in
-        this->setVolume(0);
+        this->setVolume(0.0f);
     }
 
Index: code/trunk/src/orxonox/sound/SoundBuffer.cc
===================================================================
--- code/trunk/src/orxonox/sound/SoundBuffer.cc	(revision 8329)
+++ code/trunk/src/orxonox/sound/SoundBuffer.cc	(revision 8351)
@@ -30,5 +30,5 @@
 #include "SoundBuffer.h"
 
-#include <AL/alut.h>
+#include <alut.h>
 #include <vorbis/vorbisfile.h>
 
Index: code/trunk/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/trunk/src/orxonox/sound/SoundManager.cc	(revision 8329)
+++ code/trunk/src/orxonox/sound/SoundManager.cc	(revision 8351)
@@ -31,6 +31,6 @@
 #include "SoundManager.h"
 
-#include <AL/alut.h>
 #include <utility>
+#include <alut.h>
 #include <loki/ScopeGuard.h>
 
@@ -73,4 +73,8 @@
         this->bDestructorCalled_ = false;
 
+        // Clear error messages (might be problematic on some systems)
+        alGetError();
+        alutGetError();
+
         // See whether we even want to load
         bool bDisableSound_ = false;
@@ -78,5 +82,4 @@
         if (bDisableSound_)
             ThrowException(InitialisationAborted, "Sound: Not loading at all");
-
         if (!alutInitWithoutContext(NULL, NULL))
             ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError()));
@@ -107,11 +110,5 @@
         this->device_ = alcOpenDevice(NULL);
         if (this->device_ == NULL)
-        {
-            COUT(1) << "Sound: Could not open sound device. Have you installed OpenAL?" << std::endl;
-#ifdef ORXONOX_PLATFORM_WINDOWS
-            COUT(1) << "Sound: Just getting the DLL with the dependencies is not enough for Windows (esp. Windows 7)!" << std::endl;
-#endif
             ThrowException(InitialisationFailed, "Sound Error: Could not open sound device.");
-        }
         Loki::ScopeGuard closeDeviceGuard = Loki::MakeGuard(&alcCloseDevice, this->device_);
 
@@ -327,4 +324,5 @@
         ALenum error = alGetError();
         if (error == AL_INVALID_VALUE)
+            // @TODO: Follow this constantly appearing, nerve-racking warning
             COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl;
     }
Index: code/trunk/src/orxonox/sound/SoundManager.h
===================================================================
--- code/trunk/src/orxonox/sound/SoundManager.h	(revision 8329)
+++ code/trunk/src/orxonox/sound/SoundManager.h	(revision 8351)
@@ -72,4 +72,5 @@
         // tolua_begin
         static SoundManager& getInstance() { return Singleton<SoundManager>::getInstance(); }
+        static bool exists() { return Singleton<SoundManager>::exists(); }
 
         std::string getDeviceName(unsigned int index) const
Index: code/trunk/src/orxonox/sound/WorldSound.cc
===================================================================
--- code/trunk/src/orxonox/sound/WorldSound.cc	(revision 8329)
+++ code/trunk/src/orxonox/sound/WorldSound.cc	(revision 8351)
@@ -30,5 +30,6 @@
 #include "WorldSound.h"
 
-#include <AL/alut.h>
+#include <alut.h>
+
 #include "util/Math.h"
 #include "core/CoreIncludes.h"
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 8329)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 8351)
@@ -36,5 +36,4 @@
 #include "network/NetworkFunction.h"
 
-#include "PawnManager.h"
 #include "infos/PlayerInfo.h"
 #include "controllers/Controller.h"
@@ -59,5 +58,4 @@
         RegisterObject(Pawn);
 
-        PawnManager::touch();
         this->bAlive_ = true;
         this->bReload_ = false;
