Index: /trunk/src/lib/Makefile.am
===================================================================
--- /trunk/src/lib/Makefile.am	(revision 6073)
+++ /trunk/src/lib/Makefile.am	(revision 6074)
@@ -34,5 +34,4 @@
 
 libORXlibs_a_SOURCES =  coord/p_node.cc \
-                        coord/null_parent.cc \
                         lang/base_object.cc \
                         lang/class_list.cc \
@@ -47,5 +46,4 @@
 
 noinst_HEADERS =        coord/p_node.h \
-                        coord/null_parent.h \
                         lang/base_object.h \
                         graphics/render2D/element_2d.h \
Index: unk/src/lib/coord/null_parent.cc
===================================================================
--- /trunk/src/lib/coord/null_parent.cc	(revision 6073)
+++ 	(revision )
@@ -1,47 +1,0 @@
-
-
-/*
-   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: Patrick Boenzli
-   co-programmer: ...
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PARENT_NODE
-
-#include "null_parent.h"
-
-using namespace std;
-
-NullParent* NullParent::singletonRef = NULL;
-
-/**
- *  creates the one and only NullParent
- * @param absCoordinate the cordinate of the Parent (normally Vector(0,0,0))
-*/
-NullParent::NullParent (const Vector& absCoordinate) : PNode (absCoordinate, NULL)
-{
-  this->setClassID(CL_NULL_PARENT, "NullParent");
-  this->setName("NullParent");
-
-  this->setParentMode(PNODE_ALL);
-  NullParent::singletonRef = this;
-}
-
-
-/**
- *  standard deconstructor
-*/
-NullParent::~NullParent ()
-{
-  //delete singletonRef;
-  NullParent::singletonRef = NULL;
-}
Index: unk/src/lib/coord/null_parent.h
===================================================================
--- /trunk/src/lib/coord/null_parent.h	(revision 6073)
+++ 	(revision )
@@ -1,28 +1,0 @@
-/*!
- * @file null_parent.h
-  *  Definition of the NullParent, the higest PNode of them all.
-*/
-
-
-#ifndef _NULL_PARENT_H
-#define _NULL_PARENT_H
-
-#include "p_node.h"
-
-//! The top joint of all PNode's every PNode is somehow connected to this one.
-class NullParent : public PNode {
-
-  public:
-    /** @returns a Pointer to the only object of this Class */
-    inline static NullParent* getInstance() { if (!singletonRef) singletonRef = new NullParent();  return singletonRef; };
-    virtual ~NullParent ();
-
-  private:
-    NullParent (const Vector& absCoordinate = Vector(0.0, 0.0, 0.0));
-
-  private:
-    static NullParent* singletonRef;        //!< A reference to the NullParent
-
-};
-
-#endif /* _NULL_PARENT_H */
Index: /trunk/src/lib/coord/p_node.cc
===================================================================
--- /trunk/src/lib/coord/p_node.cc	(revision 6073)
+++ /trunk/src/lib/coord/p_node.cc	(revision 6074)
@@ -17,5 +17,4 @@
 
 #include "p_node.h"
-#include "null_parent.h"
 
 #include "load_param.h"
@@ -34,27 +33,33 @@
  * @brief standard constructor
  */
-PNode::PNode ()
+PNode::PNode (PNode* parent)
 {
   init();
-
-  NullParent::getInstance()->addChild(this);
-}
-
-
-/**
- * @brief constructor with coodinates
- * @param absCoordinate the Absolute coordinate of the Object
- * @param parent The parent-node of this node.
- */
-PNode::PNode (const Vector& absCoor, PNode* parent )
-{
-  this->init();
-
-  if (likely(parent != NULL))
-    parent->addChild (this);
-
-  this->setAbsCoor(absCoor);
-}
-
+  if (parent != NULL)
+    parent->addChild(this);
+}
+
+/**
+ * @brief initializes a PNode
+ * @param parent the parent for this PNode
+ */
+void PNode::init()
+{
+  this->setClassID(CL_PARENT_NODE, "PNode");
+
+  this->bRelCoorChanged = true;
+  this->bRelDirChanged = true;
+  this->parent = NULL;
+  this->parentMode = PNODE_PARENT_MODE_DEFAULT;
+  this->bActive = true;
+
+  // smooth-movers
+  this->toCoordinate = NULL;
+  this->toDirection = NULL;
+  this->bias = 1.0;
+}
+
+// NullParent Reference
+PNode* PNode::nullParent = NULL;
 
 /**
@@ -86,5 +91,5 @@
           ((*deleteNode)->parentMode & PNODE_PROHIBIT_DELETE_WITH_PARENT))
       {
-        if (this == NullParent::getInstance() && (*deleteNode)->parentMode & PNODE_REPARENT_TO_NULLPARENT)
+        if (this == PNode::getNullParent() && (*deleteNode)->parentMode & PNODE_REPARENT_TO_NULLPARENT)
           delete (*deleteNode);
         else
@@ -110,24 +115,4 @@
 
 /**
- * @brief initializes a PNode
- * @param parent the parent for this PNode
- */
-void PNode::init()
-{
-  this->setClassID(CL_PARENT_NODE, "PNode");
-
-  this->bRelCoorChanged = true;
-  this->bRelDirChanged = true;
-  this->parent = NULL;
-  this->parentMode = PNODE_PARENT_MODE_DEFAULT;
-  this->bActive = true;
-
-  // smooth-movers
-  this->toCoordinate = NULL;
-  this->toDirection = NULL;
-  this->bias = 1.0;
-}
-
-/**
  * @brief loads parameters of the PNode
  * @param root the XML-element to load the properties of
@@ -160,5 +145,5 @@
     LOAD_PARAM_START_CYCLE(root, element);
     {
-      LoadParam_CYCLE(element, "parent", this, PNode, addChild)
+      LoadParam_CYCLE(element, "child", this, PNode, addChild)
           .describe("adds a new Child to the current Node.");
 
@@ -506,9 +491,5 @@
 {
   if (child != NULL)
-  {
    child->removeNode();
-//   this->children->remove(child);
-//   child->parent = NULL;
-  }
 }
 
@@ -624,5 +605,5 @@
 {
   if (this->parentMode & PNODE_REPARENT_TO_NULLPARENT)
-    this->setParent(NullParent::getInstance());
+    this->setParent(PNode::getNullParent());
   else if (this->parentMode & PNODE_REPARENT_TO_PARENTS_PARENT && this->parent != NULL)
     this->setParent(this->parent->getParent());
@@ -881,5 +862,5 @@
     {
       // drawing the Dependency graph
-     if (this != NullParent::getInstance())
+     if (this != PNode::getNullParent())
       {
        glBegin(GL_LINES);
Index: /trunk/src/lib/coord/p_node.h
===================================================================
--- /trunk/src/lib/coord/p_node.h	(revision 6073)
+++ /trunk/src/lib/coord/p_node.h	(revision 6074)
@@ -72,6 +72,5 @@
 class PNode : virtual public BaseObject {
  public:
-  PNode ();
-  PNode (const Vector& absCoor, PNode* pNode);
+  PNode (PNode* parent = PNode::getNullParent());
   virtual ~PNode ();
 
@@ -155,4 +154,6 @@
   void removeNodeModeFlags(unsigned short nodeFlags);
 
+  /** @returns the NullParent, the (main) ROOT of the PNode Tree. If it does not yet exist, it will be created. */
+  static PNode* getNullParent()  { return (PNode::nullParent != NULL || (PNode::nullParent = new PNode(NULL)) != NULL)? PNode::nullParent : NULL; };
 
   void updateNode (float dt);
@@ -204,4 +205,7 @@
   bool               bActive;            //!< If the Node is Active (for cutting off the rest of the tree in update).
   unsigned short     parentMode;         //!< the mode of the binding
+
+
+  static PNode*      nullParent;         //!< The ROOT of the main PNode Tree.
 };
 
Index: /trunk/src/lib/sound/sound_engine.cc
===================================================================
--- /trunk/src/lib/sound/sound_engine.cc	(revision 6073)
+++ /trunk/src/lib/sound/sound_engine.cc	(revision 6074)
@@ -290,5 +290,5 @@
   // INITIALIZING THE DEVICE:
 
-#ifdef AL_VERSION_1_1
+#ifndef AL_VERSION_1_1
   ALubyte deviceName[] =
 #else
Index: /trunk/src/story_entities/world.cc
===================================================================
--- /trunk/src/story_entities/world.cc	(revision 6073)
+++ /trunk/src/story_entities/world.cc	(revision 6074)
@@ -24,5 +24,4 @@
 
 #include "p_node.h"
-#include "null_parent.h"
 #include "pilot_node.h"
 #include "world_entity.h"
@@ -144,5 +143,5 @@
 
   // erease everything that is left.
-  delete NullParent::getInstance();
+  delete PNode::getNullParent();
 
   //secondary cleanup of PNodes;
@@ -222,5 +221,5 @@
 
   LightManager::getInstance();
-  NullParent::getInstance ();
+  PNode::getNullParent();
 
   AnimationPlayer::getInstance(); // initializes the animationPlayer
@@ -508,6 +507,6 @@
 
   /* update the object position before game start - so there are no wrong coordinates used in the first processing */
-  NullParent::getInstance()->updateNode (0.001f);
-  NullParent::getInstance()->updateNode (0.001f);
+  PNode::getNullParent()->updateNode (0.001f);
+  PNode::getNullParent()->updateNode (0.001f);
 
 }
@@ -766,5 +765,5 @@
   GarbageCollector::getInstance()->update();
   GraphicsEngine::getInstance()->update(this->dtS);
-  NullParent::getInstance()->updateNode (this->dtS);
+  PNode::getNullParent()->updateNode (this->dtS);
 
   SoundEngine::getInstance()->update();
@@ -823,5 +822,5 @@
 
   if (unlikely(this->showPNodes))
-    NullParent::getInstance()->debugDraw(0);
+    PNode::getNullParent()->debugDraw(0);
 
   GraphicsEngine::getInstance()->draw();
Index: /trunk/src/subprojects/framework.cc
===================================================================
--- /trunk/src/subprojects/framework.cc	(revision 6073)
+++ /trunk/src/subprojects/framework.cc	(revision 6074)
@@ -18,5 +18,4 @@
 
 #include "p_node.h"
-#include "null_parent.h"
 #include "state.h"
 #include "debug.h"
@@ -80,5 +79,5 @@
       float dt = framework->tick();
 
-      NullParent::getInstance()->updateNode(dt);
+      PNode::getNullParent()->updateNode(dt);
 
       // Draw the scene
Index: /trunk/src/util/garbage_collector.cc
===================================================================
--- /trunk/src/util/garbage_collector.cc	(revision 6073)
+++ /trunk/src/util/garbage_collector.cc	(revision 6074)
@@ -20,5 +20,4 @@
 #include "state.h"
 #include "world_entity.h"
-#include "null_parent.h"
 #include "fast_factory.h"
 
Index: /trunk/src/util/track/track_node.cc
===================================================================
--- /trunk/src/util/track/track_node.cc	(revision 6073)
+++ /trunk/src/util/track/track_node.cc	(revision 6074)
@@ -19,6 +19,4 @@
 #include "track_node.h"
 
-#include "null_parent.h"
-
 #include "track_manager.h"
 
@@ -33,5 +31,5 @@
   this->setName("TrackNode");
 
-  NullParent::getInstance()->addChild(this);
+  PNode::getNullParent()->addChild(this);
   this->trackManager = TrackManager::getInstance();
   this->setParentMode(PNODE_ALL);
Index: /trunk/src/world_entities/weapons/aiming_turret.cc
===================================================================
--- /trunk/src/world_entities/weapons/aiming_turret.cc	(revision 6073)
+++ /trunk/src/world_entities/weapons/aiming_turret.cc	(revision 6074)
@@ -22,6 +22,4 @@
 
 #include "model.h"
-
-#include "null_parent.h"
 
 #include "animation3d.h"
@@ -145,5 +143,5 @@
 
   pj->setTarget(this->target->getParent());
-  pj->setParent(NullParent::getInstance());
+  pj->setParent(PNode::getNullParent());
   pj->setAbsCoor(this->getEmissionPoint());
   pj->setAbsDir(this->getAbsDir());
Index: /trunk/src/world_entities/weapons/cannon.cc
===================================================================
--- /trunk/src/world_entities/weapons/cannon.cc	(revision 6073)
+++ /trunk/src/world_entities/weapons/cannon.cc	(revision 6074)
@@ -32,6 +32,4 @@
 #include "list.h"
 #include "animation3d.h"
-
-#include "null_parent.h"
 
 #include "fast_factory.h"
@@ -161,5 +159,5 @@
     return;
 
-  pj->setParent(NullParent::getInstance());
+  pj->setParent(PNode::getNullParent());
 
   pj->setVelocity(this->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*15+VECTOR_RAND(5));
Index: /trunk/src/world_entities/weapons/guided_missile.cc
===================================================================
--- /trunk/src/world_entities/weapons/guided_missile.cc	(revision 6073)
+++ /trunk/src/world_entities/weapons/guided_missile.cc	(revision 6074)
@@ -28,7 +28,4 @@
 #include "particle_emitter.h"
 #include "particle_system.h"
-
-
-#include "null_parent.h"
 
 using namespace std;
@@ -153,5 +150,5 @@
 {
   //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
-  if (target.getParent() != NullParent::getInstance())
+  if (target.getParent() != PNode::getNullParent())
    {
      velocity += ((target.getAbsCoor() - this->getAbsCoor()).getNormalized())*agility;
Index: /trunk/src/world_entities/weapons/projectile.cc
===================================================================
--- /trunk/src/world_entities/weapons/projectile.cc	(revision 6073)
+++ /trunk/src/world_entities/weapons/projectile.cc	(revision 6074)
@@ -21,5 +21,4 @@
 #include "world_entity.h"
 #include "weapon.h"
-#include "null_parent.h"
 #include "model.h"
 
Index: /trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- /trunk/src/world_entities/weapons/test_gun.cc	(revision 6073)
+++ /trunk/src/world_entities/weapons/test_gun.cc	(revision 6074)
@@ -32,6 +32,4 @@
 #include "list.h"
 #include "animation3d.h"
-
-#include "null_parent.h"
 
 #include "fast_factory.h"
@@ -184,5 +182,5 @@
     return;
 
-  pj->setParent(NullParent::getInstance());
+  pj->setParent(PNode::getNullParent());
 
   pj->setVelocity(this->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*50+VECTOR_RAND(5));
Index: /trunk/src/world_entities/weapons/turret.cc
===================================================================
--- /trunk/src/world_entities/weapons/turret.cc	(revision 6073)
+++ /trunk/src/world_entities/weapons/turret.cc	(revision 6074)
@@ -22,5 +22,4 @@
 #include "model.h"
 
-#include "null_parent.h"
 #include "state.h"
 #include "list.h"
@@ -139,5 +138,5 @@
 
 
-  pj->setParent(NullParent::getInstance());
+  pj->setParent(PNode::getNullParent());
   pj->setAbsCoor(this->getEmissionPoint());
   pj->setAbsDir(this->getAbsDir());
Index: /trunk/src/world_entities/weapons/weapon_manager.cc
===================================================================
--- /trunk/src/world_entities/weapons/weapon_manager.cc	(revision 6073)
+++ /trunk/src/world_entities/weapons/weapon_manager.cc	(revision 6074)
@@ -27,6 +27,4 @@
 
 #include "t_animation.h"
-#include "null_parent.h"
-
 
 using namespace std;
@@ -160,5 +158,5 @@
 {
   if (parent == NULL)
-    parent = NullParent::getInstance();
+    parent = PNode::getNullParent();
   this->parent = parent;
   if (this->parent != NULL)
