Index: /trunk/src/lib/shell/shell.cc
===================================================================
--- /trunk/src/lib/shell/shell.cc	(revision 7761)
+++ /trunk/src/lib/shell/shell.cc	(revision 7762)
@@ -62,4 +62,6 @@
     this->setName("Shell");
 
+    this->shellBuffer = ShellBuffer::getInstance();
+
     // EVENT-Handler subscription of '`' to all States.
     EventHandler::getInstance()->subscribe(this, ES_ALL, SDLK_BACKQUOTE);
@@ -70,5 +72,5 @@
 
     // BUFFER
-    this->bufferIterator = ShellBuffer::getInstance()->getBuffer().begin();
+    this->bufferIterator = this->shellBuffer->getBuffer().begin();
 
     // INPUT LINE
@@ -91,6 +93,4 @@
 
     this->deactivate();
-    // register the shell at the ShellBuffer
-    ShellBuffer::getInstance()->registerShell(this);
   }
 
@@ -100,6 +100,4 @@
   Shell::~Shell ()
   {
-    ShellBuffer::getInstance()->unregisterShell(this);
-
     // delete the displayable Buffers
     while (!this->bufferText.empty())
@@ -120,4 +118,5 @@
       PRINTF(3)("The shell is already active\n");
     this->bActive = true;
+    this->activate2D();
 
     EventHandler::getInstance()->pushState(ES_SHELL);
@@ -126,9 +125,10 @@
     this->setRelCoorSoft2D(0, 0, 5);
 
-    std::list<std::string>::const_iterator textLine = ShellBuffer::getInstance()->getBuffer().begin();
+    this->linesProcessed = this->shellBuffer->getLineCount();
+    std::list<std::string>::const_iterator textLine = this->bufferIterator = this->shellBuffer->getBuffer().begin();
     for (std::list<MultiLineText*>::iterator text = this->bufferText.begin(); text != this->bufferText.end(); ++text)
     {
       (*text)->setVisibility(true);
-      if (textLine !=  ShellBuffer::getInstance()->getBuffer().end())
+      if (textLine !=  this->shellBuffer->getBuffer().end())
       {
         (*text)->setText((*textLine));
@@ -150,4 +150,5 @@
       PRINTF(3)("The shell is already inactive\n");
     this->bActive = false;
+    this->deactivate2D();
 
     EventHandler::getInstance()->withUNICODE(false);
@@ -159,5 +160,5 @@
       (*text)->setVisibility(false);
     // Go to the End again.
-    this->bufferIterator = ShellBuffer::getInstance()->getBuffer().begin();
+    this->bufferIterator = this->shellBuffer->getBuffer().begin();
   }
 
@@ -337,5 +338,5 @@
       (*textIt)->setText("");  // remove all chars from the BufferTexts.
     }
-    ShellBuffer::getInstance()->flush();
+    this->shellBuffer->flush();
     // BUFFER FLUSHING
   }
@@ -353,4 +354,5 @@
     // Set the new Text.
     this->bufferText.front()->setText(text);
+    this->bufferIterator = this->shellBuffer->getBuffer().begin();
 
     // The LineCount will be started here.
@@ -358,4 +360,5 @@
     // The First Line gets a special Animation
     this->bufferText.front()->setRelCoor2D(this->calculateLinePosition(0)- Vector2D(-1000,0));
+
 
     // Move all lines one Entry up.
@@ -378,5 +381,5 @@
       if (moves < lineCount)
       {
-        if(this->bufferIterator == --ShellBuffer::getInstance()->getBuffer().end())
+        if(this->bufferIterator == --this->shellBuffer->getBuffer().end())
           break;
         ++moves;
@@ -385,5 +388,5 @@
       else
       {
-        if (this->bufferIterator == ShellBuffer::getInstance()->getBuffer().begin())
+        if (this->bufferIterator == this->shellBuffer->getBuffer().begin())
           break;
         --moves;
@@ -414,5 +417,5 @@
     for (textIt = this->bufferText.begin(); textIt != this->bufferText.end(); ++textIt, ++it)
     {
-      if (it == ShellBuffer::getInstance()->getBuffer().end())
+      if (it == this->shellBuffer->getBuffer().end())
       {
         PRINTF(1)("LAST LINE REACHED\n");
@@ -473,4 +476,27 @@
   }
 
+  void Shell::tick(float dt)
+  {
+    if (this->linesProcessed < this->shellBuffer->getLineCount())
+    {
+      unsigned int pollLines = this->shellBuffer->getLineCount() - this->linesProcessed;
+      if (this->bufferText.size() < pollLines)
+        pollLines = this->bufferText.size();
+      if (unlikely(this->shellBuffer->getBuffer().size() < pollLines))
+        pollLines = this->shellBuffer->getBuffer().size();
+
+      std::list<std::string>::const_iterator line = this->shellBuffer->getBuffer().begin();
+      unsigned int i;
+      for(i = 0; i < pollLines; i++)
+        line ++;
+      for (i = 0; i < pollLines; i++)
+      {
+        this->printToDisplayBuffer((*--line));
+      }
+    }
+    this->linesProcessed = this->shellBuffer->getLineCount();
+  }
+
+
   /**
    * displays the Shell
@@ -527,5 +553,5 @@
 
 
-    ShellBuffer::getInstance()->debug();
+    this->shellBuffer->debug();
   }
 
Index: /trunk/src/lib/shell/shell.h
===================================================================
--- /trunk/src/lib/shell/shell.h	(revision 7761)
+++ /trunk/src/lib/shell/shell.h	(revision 7762)
@@ -14,4 +14,5 @@
 
 #include "shell_input.h"
+#include "shell_buffer.h"
 #include "material.h"
 
@@ -75,5 +76,7 @@
     virtual void process(const Event &event);
     // Element2D-functions
+    virtual void tick(float dt);
     virtual void draw() const;
+
 
     void debug() const;
@@ -90,4 +93,6 @@
   private:
     // GENERAL
+    ShellBuffer*                shellBuffer;            //!< The local ShellBuffer.
+
     bool                        bActive;                //!< If the shell is active.
     unsigned int                shellHeight;            //!< The hight of the Shell in Pixels.
@@ -104,4 +109,6 @@
     std::list<MultiLineText*>   bufferText;             //!< A list of stored bufferTexts for the display of the buffer.
 
+    unsigned long               linesProcessed;         //!< How many Lines have been processed.
+
     std::list<std::string>::const_iterator  bufferIterator;         //!< used to move through and print the Buffer
   };
Index: /trunk/src/lib/shell/shell_buffer.cc
===================================================================
--- /trunk/src/lib/shell/shell_buffer.cc	(revision 7761)
+++ /trunk/src/lib/shell/shell_buffer.cc	(revision 7762)
@@ -32,10 +32,9 @@
   {
     ShellBuffer::singletonRef = this;
-    this->shell = NULL;
 
     this->lineCount = 0;
     this->bufferArray[0] = '\0';
 
-    this->setBufferSize(100);
+    this->setMaxBufferSize(100);
   }
 
@@ -48,32 +47,5 @@
   ShellBuffer::~ShellBuffer ()
   {
-    if (this->shell != NULL)
-      delete this->shell;
-
     ShellBuffer::singletonRef = NULL;
-  }
-
-  /**
-   * @brief registers the Shell to the Buffer
-   * @param shell the Shell to register.
-   */
-  void ShellBuffer::registerShell(Shell* shell)
-  {
-    if (this->shell == NULL)
-      this->shell = shell;
-    else
-      PRINTF(1)("already registered a Shell to the ShellBuffer\n");
-  }
-
-  /**
-   * @brief unregisters the Shell from the Buffer
-   * @param shell the Shell to unregister.
-   */
-  void ShellBuffer::unregisterShell(Shell* shell)
-  {
-    if (this->shell == shell)
-      this->shell = NULL;
-    else
-      PRINTF(1)("cannot unregister shell, because it is not registered to the ShellBuffer\n");
   }
 
@@ -136,9 +108,5 @@
       {
         this->lineCount++;
-
-        printf("Test:: %s \n", inputBuffer.substr(lineBegin, lineEnd - lineBegin).c_str());
         this->buffer.push_front(inputBuffer.substr(lineBegin, lineEnd - lineBegin));
-        if (likely (this->shell != NULL) && unlikely (this->shell->isActive()))
-          this->shell->printToDisplayBuffer(this->buffer.front());
       }
       else      // No end of Line reached.
@@ -148,7 +116,5 @@
       }
 
-
-
-      if (this->buffer.size() > this->bufferSize)
+      if (this->buffer.size() > this->maxBufferSize)
         this->buffer.pop_back();
     }
Index: /trunk/src/lib/shell/shell_buffer.h
===================================================================
--- /trunk/src/lib/shell/shell_buffer.h	(revision 7761)
+++ /trunk/src/lib/shell/shell_buffer.h	(revision 7762)
@@ -16,7 +16,4 @@
 namespace OrxShell
 {
-  // FORWARD DECLARATION
-  class Shell;
-
   //! A class handling output from orxonox via debug.h
   /**
@@ -35,13 +32,10 @@
     inline static bool isInstanciated() { return (ShellBuffer::singletonRef == NULL)?false:true; };
 
-    void registerShell(Shell* shell);
-    void unregisterShell(Shell* shell);
-
     static bool addBufferLineStatic(const char* line, ...);
     void addBufferLine(const char* line, va_list arg);
 
-    // BUFFER //
+    /// BUFFER
     /** @param bufferSize the new Buffer-Size */
-    void setBufferSize(unsigned int bufferSize) { this->bufferSize = bufferSize; };
+    void setMaxBufferSize(unsigned int maxBufferSize) { this->maxBufferSize = maxBufferSize; };
     void flush();
 
@@ -50,4 +44,6 @@
     /** @returns the Count of lines processed by the Shell. */
     inline unsigned long getLineCount() const { return this->lineCount; };
+    /** @returns the Current Buffer Size. */
+    inline unsigned int getBufferSize() const { return this->buffer.size(); };
 
     void debug() const;
@@ -58,7 +54,6 @@
   private:
     static ShellBuffer*           singletonRef;                       //!< The singleton-reference to the only memeber of this class.
-    unsigned int                  bufferSize;                         //!< The Size of the buffer
+    unsigned int                  maxBufferSize;                         //!< The Size of the buffer
 
-    Shell*                        shell;                              //!< the Registered Shell.
     char                          bufferArray[SHELL_BUFFER_SIZE];     //!< a BUFFER for fast writing
     std::string                   keepBuffer;                         //!< a BUFFER to have multi-non-newLine commands be copied into the shell.
Index: /trunk/src/story_entities/game_world.h
===================================================================
--- /trunk/src/story_entities/game_world.h	(revision 7761)
+++ /trunk/src/story_entities/game_world.h	(revision 7762)
@@ -12,5 +12,5 @@
 #include "playable.h"
 
-class OrxShell::Shell;
+namespace OrxShell { class Shell; };
 class WorldEntity;
 class GameRules;
