Index: /code/trunk/bin/levels/sample.oxw
===================================================================
--- /code/trunk/bin/levels/sample.oxw	(revision 1088)
+++ /code/trunk/bin/levels/sample.oxw	(revision 1089)
@@ -1,39 +1,11 @@
-<Namespace name="test" />
-<Namespace name="blub" />
-<Namespace name="rofl" />
-
-<Namespace name="ns1">
-  <Namespace name="ns11">
-    <Namespace name="ns111">
-    </Namespace>
-    <Namespace name="ns112">
-    </Namespace>
-  </Namespace>
-  <Namespace name="ns12">
-    <Namespace name="ns121">
-    </Namespace>
-    <Namespace name="ns122">
-    </Namespace>
-  </Namespace>
-</Namespace>
-
-<Namespace name="ns1::ns12::ns121">
-  <Namespace name="ns1211">
-  </Namespace>
-</Namespace>
-<Namespace name="ns1::ns12::ns122::ns1221" />
-
-<!--
- <audio>
-		<ambient>
-			<ogg src="allgorythm-lift_up" />
-			<ogg src="allgorythm-resonance_blaster" />
-			<ogg src="luke_grey_-_hypermode" />
-			<ogg src="task_horizon_-_menu1" />
-			<ogg src="tha_silent_partner_-_void" />
-		</ambient>
-  </audio> 
-
--->
+ <!--audio>
+	<ambient>
+		<ogg src="allgorythm-lift_up" />
+		<ogg src="allgorythm-resonance_blaster" />
+		<ogg src="luke_grey_-_hypermode" />
+		<ogg src="task_horizon_-_menu1" />
+		<ogg src="tha_silent_partner_-_void" />
+	</ambient>
+  </audio--> 
 
 <Ambient colourvalue="1,1,1" />
@@ -48,6 +20,6 @@
 <NPC position="100,0,400" scale="1" mesh="razor.mesh"/>
 
-<!--Model name="starship" position="200,0,500" scale="10" mesh="starship.mesh" yawpitchroll="-90,-90,0" /-->
-<!--Model name="drone" position="-200,0,500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
+<!--Model name="starship" position="200,0,500" scale="10" mesh="starship.mesh" yawpitchroll="-90,-90,0" />
+<Model name="drone" position="-200,0,500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
   <attached>
     <Model name="drone2" position="200,-100,-500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
@@ -57,5 +29,5 @@
     </Model>
   </attached>
-</Model -->
+</Model-->
 
 <Model position="-200,1000,500" scale="10" mesh="hoover_body.mesh" yawpitchroll="-90,-90,0" />
@@ -66,52 +38,4 @@
 
 
-<Namespace name="test" />
-<Namespace name="blub">
-</Namespace>
-<Namespace name="rofl">
-  <Namespace name="lol">
-  </Namespace>
-</Namespace>
-
-<Namespace name="ns1">
-  <Namespace name="ns11">
-    <Namespace name="ns111">
-      <Namespace name="ns1111">
-      </Namespace>
-    </Namespace>
-  </Namespace>
-  <Namespace name="ns13">
-  </Namespace>
-</Namespace>
-
-<Namespace name="ns1 ns2">
-  <Namespace name="abc" />
-</Namespace>
-
-<Namespace name="ns1::ns11 ns1::ns12 ns1::ns12::ns121">
-  <Namespace name="muhahaha" />
-</Namespace>
-
-<Namespace name="test">
-  <Namespace name="test" />
-</Namespace>
-
-<Namespace name="ns1::ns13">
-  <Namespace name="..::ns14" />
-  <Namespace name="..::..::ns3" />
-</Namespace>
-
-<Namespace name="AAA::BBB::..::CCC::..::DDD::..::BBB::BBBBBB::..::BBBBBBBBBBBBBBBBBBB::..::..::EEE" />
-
-<Namespace name="..::justatest" />
-
-<Namespace name="@file.oxw::anothertest" />
-
-<Namespace name="justonemoretest::@file.oxw::gagagaga" />
-
-<Namespace name="AAA::BBB, AAA::CCC; AAA::DDD,AAA::EEE">
-  <Namespace name="hax" />
-</Namespace>
-
 <!--?lua
 for i = 1, 226, 1 
Index: /code/trunk/src/audio/AudioManager.cc
===================================================================
--- /code/trunk/src/audio/AudioManager.cc	(revision 1088)
+++ /code/trunk/src/audio/AudioManager.cc	(revision 1089)
@@ -60,7 +60,7 @@
 	{
 // 		currentBgSound = 0;
-    currentBgSound = rand() % bgSounds.size();
 		if (bgSounds.size() > 0)
 		{
+      currentBgSound = rand() % bgSounds.size();
 			if(!bgSounds[currentBgSound]->playback())
 			{
@@ -72,5 +72,4 @@
 			}
 		}
-
 	}
 
Index: /code/trunk/src/core/Debug.h
===================================================================
--- /code/trunk/src/core/Debug.h	(revision 1088)
+++ /code/trunk/src/core/Debug.h	(revision 1089)
@@ -260,3 +260,71 @@
 #endif /* ifndef COUT */
 
+
+/////////////////////////////////////////////////////////////////////
+///  CCOUT: Prints output with std::cout and adds the classname   ///
+/////////////////////////////////////////////////////////////////////
+
+#define CCOUT_EXEC(x) \
+  orxonox::OutputHandler::getOutStream().setOutputLevel(x) \
+  << "*** " << this->getIdentifier()->getName() << ": "
+
+#ifndef CCOUT
+ #if ORX_PRINT_DEBUG_OUTPUT
+  #define CCOUT(x) \
+   CCOUT ## x
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
+   #define CCOUT1  \
+    if (getSoftDebugLevel() >= ORX_ERROR)  \
+     CCOUT_EXEC(1)
+  #else
+   #define CCOUT1 if (ORX_NONE)\
+    CCOUT_EXEC(1)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_WARNING
+   #define CCOUT2 \
+    if (getSoftDebugLevel() >= ORX_WARNING) \
+     CCOUT_EXEC(2)
+  #else
+   #define CCOUT2 if (ORX_NONE) \
+    CCOUT_EXEC(2)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_INFO
+   #define CCOUT3 \
+    if (getSoftDebugLevel() >= ORX_INFO) \
+     CCOUT_EXEC(3)
+  #else
+   #define CCOUT3 if (ORX_NONE) \
+    CCOUT_EXEC(3)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_DEBUG
+   #define CCOUT4 \
+    if (getSoftDebugLevel() >= ORX_DEBUG) \
+     CCOUT_EXEC(4)
+  #else
+   #define CCOUT4 if (ORX_NONE) \
+    CCOUT_EXEC(4)
+  #endif
+
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_vDEBUG
+   #define CCOUT5 \
+    if (getSoftDebugLevel() >= ORX_vDEBUG) \
+     CCOUT_EXEC(5)
+  #else
+   #define CCOUT5 if (ORX_NONE) \
+    CCOUT_EXEC(5)
+  #endif
+
+ #else /* if ORX_PRINT_DEBUG_OUTPUT */
+  #define CCOUT(x) if (ORX_NONE) \
+   CCOUT_EXEC(5)
+ #endif /* if ORX_PRINT_DEBUG_OUTPUT */
+
+ #define CCOUT0 \
+  CCOUT_EXEC(0)
+#endif /* ifndef CCOUT */
+
 #endif /* _Debug_H__ */
Index: /code/trunk/src/core/InputManager.cc
===================================================================
--- /code/trunk/src/core/InputManager.cc	(revision 1088)
+++ /code/trunk/src/core/InputManager.cc	(revision 1089)
@@ -53,4 +53,5 @@
       handlerGUI_(0), handlerBuffer_(0), handlerGame_(0)
   {
+    RegisterObject(InputManager);
   }
 
Index: /code/trunk/src/orxonox/Orxonox.cc
===================================================================
--- /code/trunk/src/orxonox/Orxonox.cc	(revision 1088)
+++ /code/trunk/src/orxonox/Orxonox.cc	(revision 1089)
@@ -75,5 +75,4 @@
 #include "tools/Timer.h"
 #include "hud/HUD.h"
-//#include "objects/weapon/BulletManager.h"
 
 // FIXME: is this really file scope?
@@ -140,5 +139,4 @@
     this->auMan_ = 0;
     this->inputHandler_ = 0;
-    //this->root_ = 0;
     // turn on frame smoothing by setting a value different from 0
     this->frameSmoothingTime_ = 0.0f;
@@ -153,6 +151,4 @@
   {
     // keep in mind: the order of deletion is very important!
-//    if (this->bulletMgr_)
-//      delete this->bulletMgr_;
     if (this->orxonoxHUD_)
       delete this->orxonoxHUD_;
@@ -172,9 +168,10 @@
 
   /**
-   * error kills orxonox
-   */
-  void Orxonox::abortImmediate(/* some error code */)
-  {
-    //TODO: destroy and destruct everything and print nice error msg
+    @brief Immediately deletes the orxonox object.
+    Never use if you can help it while rendering!
+  */
+  void Orxonox::abortImmediateForce()
+  {
+    COUT(1) << "*** Orxonox Error: Orxonox object was unexpectedly destroyed." << std::endl;
     delete this;
   }
@@ -185,4 +182,5 @@
   void Orxonox::abortRequest()
   {
+    COUT(3) << "*** Orxonox: Abort requested." << std::endl;
     bAbort_ = true;
   }
@@ -225,5 +223,5 @@
     ar.checkArgument("data", this->dataPath_, false);
     ar.checkArgument("ip", serverIp_, false);
-    if(ar.errorHandling()) abortImmediate();
+    if(ar.errorHandling()) abortImmediateForce();
     if(mode == std::string("client"))
     {
@@ -248,5 +246,5 @@
     ogre_->setup();
     //root_ = ogre_->getRoot();
-    if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
+    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
 
     server_g = new network::Server();
@@ -263,5 +261,5 @@
     else
       client_g = new network::Client(serverIp_, NETWORK_PORT);
-    if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
+    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
   }
 
@@ -272,6 +270,5 @@
     ogre_->setConfigPath(path);
     ogre_->setup();
-    //root_ = ogre_->getRoot();
-    if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
+    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
   }
 
@@ -301,6 +298,4 @@
     auMan_ = new audio::AudioManager();
 
-    //bulletMgr_ = new BulletManager();
-
     Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
     HUD* orxonoxHud;
@@ -350,6 +345,4 @@
     auMan_ = new audio::AudioManager();
 
-    //bulletMgr_ = new BulletManager();
-
     // load this file from config
     Level* startlevel = new Level("levels/sample.oxw");
@@ -380,5 +373,5 @@
     if (!inputHandler_->initialise(ogre_->getWindowHandle(),
           ogre_->getWindowWidth(), ogre_->getWindowHeight()))
-      abortImmediate();
+      abortImmediateForce();
     inputHandler_->setInputMode(IM_INGAME);
   }
@@ -414,5 +407,5 @@
     if (Ogre::Root::getSingletonPtr() == 0)
     {
-      COUT(2) << "Error: Could not start rendering. No Ogre root object found" << std::endl;
+      COUT(2) << "*** Orxonox Error: Could not start rendering. No Ogre root object found" << std::endl;
       return;
     }
Index: /code/trunk/src/orxonox/Orxonox.h
===================================================================
--- /code/trunk/src/orxonox/Orxonox.h	(revision 1088)
+++ /code/trunk/src/orxonox/Orxonox.h	(revision 1089)
@@ -61,6 +61,5 @@
       void init(int argc, char **argv, std::string path);
       void start();
-      // not sure if this should be private
-      void abortImmediate(/* some error code */);
+      void abortImmediateForce();
       void abortRequest();
       inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
Index: /code/trunk/visual_studio/base_properties_debug.vsprops
===================================================================
--- /code/trunk/visual_studio/base_properties_debug.vsprops	(revision 1088)
+++ /code/trunk/visual_studio/base_properties_debug.vsprops	(revision 1089)
@@ -13,5 +13,5 @@
 		BasicRuntimeChecks="3"
 		RuntimeLibrary="3"
-		DebugInformationFormat="3"
+		DebugInformationFormat="4"
 	/>
 	<Tool
Index: /code/trunk/visual_studio/vc8/tolua++.vcproj
===================================================================
--- /code/trunk/visual_studio/vc8/tolua++.vcproj	(revision 1088)
+++ /code/trunk/visual_studio/vc8/tolua++.vcproj	(revision 1089)
@@ -131,16 +131,4 @@
 			>
 			<File
-				RelativePath="..\..\src\util\tolua\tolua.c"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
 				RelativePath="..\..\src\util\tolua\tolua_event.c"
 				>
@@ -162,16 +150,4 @@
 				>
 			</File>
-			<File
-				RelativePath="..\..\src\util\tolua\toluabind.c"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-			</File>
 		</Filter>
 		<Filter
@@ -188,12 +164,4 @@
 				>
 			</File>
-			<File
-				RelativePath="..\..\src\util\tolua\toluabind.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\util\tolua\toluabind_default.h"
-				>
-			</File>
 		</Filter>
 	</Files>
