Index: /orxonox/trunk/src/story_entities/world.cc
===================================================================
--- /orxonox/trunk/src/story_entities/world.cc	(revision 4977)
+++ /orxonox/trunk/src/story_entities/world.cc	(revision 4978)
@@ -74,5 +74,5 @@
 using namespace std;
 
-
+//! This creates a Factory to fabricate a World
 CREATE_FACTORY(World);
 
@@ -90,5 +90,5 @@
     This creates a new empty world!
 */
-World::World (char* name)
+World::World (const char* name)
 {
   this->path = NULL;
@@ -119,29 +119,25 @@
   ParticleEngine::getInstance()->debug();
 
+  // here everything that is alocated by the World is deleted
   delete this->entities;
   State::setWorldEntityList(NULL);
-//  delete NullParent::getInstance();
-
 
   delete LightManager::getInstance();
   delete TrackManager::getInstance();
   delete ParticleEngine::getInstance();
-
+  delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence.
+  delete PhysicsEngine::getInstance();
+
+  // external engines initialized by the orxonox-class get deleted
   TextEngine::getInstance()->flush();
   SoundEngine::getInstance()->flushAllBuffers();
   SoundEngine::getInstance()->flushAllSources();
-
-  delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence.
-  delete PhysicsEngine::getInstance();
-  //delete garbagecollecor
-  //delete animator
-
   FastFactory::flushAll();
+
+  // erease everything that is left.
   delete NullParent::getInstance();
-  EventHandler::getInstance()->debug();
-
-  LoadClassDescription::printAll();
-
-
+
+
+  // unload the resources !!
   ResourceManager::getInstance()->unload(this->music);
   ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL);
@@ -149,19 +145,19 @@
 
 /**
- *  initializes the world.
-
-   set all stuff here that is world generic and does not use to much memory
-   because the real init() function StoryEntity::init() will be called
-   shortly before start of the game.
-   since all worlds are initiated/referenced before they will be started.
-   NO LEVEL LOADING HERE - NEVER!
-*/
-void World::constuctorInit(char* name, int worldID)
+ * initializes the world.
+ * @param name the name of the world
+ * @param worldID the ID of this world
+ *
+ * set all stuff here that is world generic and does not use to much memory
+ * because the real init() function StoryEntity::init() will be called
+ * shortly before start of the game.
+ * since all worlds are initiated/referenced before they will be started.
+ * NO LEVEL LOADING HERE - NEVER!
+*/
+void World::constuctorInit(const char* name, int worldID)
 {
   this->setClassID(CL_WORLD, "World");
 
-  //this->worldName = name;
-  //this->worldName = new char[strlen(name)+1];
-  //strcpy(this->worldName, name);
+  this->setName(name);
   this->debugWorldNr = worldID;
 
@@ -169,10 +165,10 @@
 }
 
+/**
+ * loads the parameters of a World from an XML-element
+ * @param root the XML-element to load from
+ */
 void World::loadParams(const TiXmlElement* root)
 {
-  const char *string;
-  char *name;
-  int id;
-
   PRINTF(4)("Creating a World\n");
 
@@ -187,10 +183,9 @@
 }
 
-
-/**
- *  this is executed before load
-
-   since the load function sometimes needs data, that has been init before
-   the load and after the proceeding storyentity has finished
+/**
+ * this is executed just before load
+ *
+ * since the load function sometimes needs data, that has been initialized
+ * before the load and after the proceeding storyentity has finished
 */
 ErrorMessage World::preLoad()
@@ -199,10 +194,8 @@
   this->cycle = 0;
 
-
   /* init the world interface */
 
   LightManager::getInstance();
-  this->nullParent = NullParent::getInstance ();
-  this->nullParent->setName ("NullParent");
+  NullParent::getInstance ();
 
   AnimationPlayer::getInstance(); // initializes the animationPlayer
@@ -210,5 +203,5 @@
 
   this->localCamera = new Camera();
-  this->localCamera->setName ("Camera");
+  this->localCamera->setName ("World-Camera");
 
   State::setCamera(this->localCamera, this->localCamera->getTarget());
@@ -268,5 +261,5 @@
       temp = new char[strlen(string + 2)];
       strcpy( temp, string);
-      this->worldName = temp;
+      this->setName(temp);
     }
   else
@@ -274,6 +267,7 @@
       temp = new char[strlen(string + 2)];
       strcpy( temp, string);
-      this->worldName = temp;
-    }
+      this->setName(temp);
+    }
+
   ////////////////
   // LOADSCREEN //
@@ -376,16 +370,4 @@
 
 
-//   lightMan->setAmbientColor(.1,.1,.1);
-//   lightMan->addLight();
-//   //      lightMan->setAttenuation(1.0, .01, 0.0);
-//   //      lightMan->setDiffuseColor(1,1,1);
-//   //  lightMan->addLight(1);
-//   //  lightMan->setPosition(20, 10, -20);
-//   //  lightMan->setDiffuseColor(0,0,0);
-//   //lightMan->debug();
-//   lightMan->setPosition(-5.0, 50.0, -40.0);
-//   lightMan->addLight();
-//   lightMan->setPosition(100, 80, 60);
-
   //        TrackManager::getInstance()->setBindSlave(env);
   PNode* tn = TrackManager::getInstance()->getTrackNode();
@@ -415,5 +397,4 @@
 
 
-
   ////////////
   // STATIC //
@@ -454,4 +435,6 @@
   PhysicsEngine::getInstance()->debug();
 
+
+
   for(int i = 0; i < 100; i++)
   {
@@ -474,5 +457,5 @@
 
 /**
- *  loads the debug world: only for experimental stuff
+ * creates a debug world: only for experimental stuff
 */
 void World::loadDebugWorld(int worldID)
@@ -637,11 +620,9 @@
 }
 
-
-
 /**
  *  initializes a new World shortly before start
-
-   this is the function, that will be loaded shortly before the world is
-   started
+ *
+ * this is the function, that will be loaded shortly before the world is
+ * started
 */
 ErrorMessage World::init()
@@ -899,8 +880,8 @@
 {
   GarbageCollector::getInstance()->update();
-  this->nullParent->update (this->dtS);
+  NullParent::getInstance()->update (this->dtS);
 
   SoundEngine::getInstance()->update();
-  music->update();
+  //music->update();
 }
 
@@ -998,5 +979,5 @@
                   Vector* relCoor, Quaternion* relDir)
 {
-  this->nullParent = NullParent::getInstance();
+  NullParent::getInstance();
   if( parentNode != NULL)
     {
Index: /orxonox/trunk/src/story_entities/world.h
===================================================================
--- /orxonox/trunk/src/story_entities/world.h	(revision 4977)
+++ /orxonox/trunk/src/story_entities/world.h	(revision 4978)
@@ -34,5 +34,5 @@
 
  public:
-  World (char* name);
+  World (const char* name);
   World (int worldID);
   World (const TiXmlElement* root = NULL);
@@ -74,5 +74,5 @@
 
  private:
-  void constuctorInit(char* name, int worldID);
+  void constuctorInit(const char* name, int worldID);
 
   Uint32 lastFrame;                   //!< last time of frame
@@ -87,5 +87,4 @@
   GLMenuImageScreen* glmis;           //!< The Level-Loader Display
 
-  char* worldName;                    //!< The name of this World
   int debugWorldNr;                   //!< The Debug Nr. needed, if something goes wrong
   char* path;                         //!< The file from which this world is loaded
@@ -95,5 +94,4 @@
 
   // IMPORTANT WORLD-ENTITIES
-  PNode* nullParent;                  //!< The zero-point, that everything has as its parent.
   Camera* localCamera;                //!< The current Camera
   WorldEntity* sky;                   //!< The Environmental Heaven of orxonox @todo insert this to environment insted
