Index: trunk/src/lib/shell/shell.cc
===================================================================
--- trunk/src/lib/shell/shell.cc	(revision 7729)
+++ trunk/src/lib/shell/shell.cc	(revision 7737)
@@ -21,15 +21,9 @@
 #include "shell_input.h"
 
-
-#include "text.h"
+#include "multi_line_text.h"
+
 #include "graphics_engine.h"
 #include "material.h"
 #include "event_handler.h"
-#include "debug.h"
-#include "class_list.h"
-
-#include "key_names.h"
-#include <stdarg.h>
-#include <stdio.h>
 
 namespace OrxShell
@@ -137,5 +131,5 @@
     std::list<std::string>::const_iterator textLine = --ShellBuffer::getInstance()->getBuffer().end();
     bool top = false;
-    for (std::list<Text*>::iterator text = this->bufferText.begin(); text != this->bufferText.end(); ++text)
+    for (std::list<MultiLineText*>::iterator text = this->bufferText.begin(); text != this->bufferText.end(); ++text)
     {
       (*text)->setVisibility(true);
@@ -164,5 +158,5 @@
     this->setRelCoorSoft2D(0, -(int)this->shellHeight, 5);
 
-    for (std::list<Text*>::iterator text = this->bufferText.begin(); text != this->bufferText.end(); ++text)
+    for (std::list<MultiLineText*>::iterator text = this->bufferText.begin(); text != this->bufferText.end(); ++text)
       (*text)->setVisibility(false);
     this->bufferOffset = 0;
@@ -257,6 +251,6 @@
      * output is routed from Some other Thread or by Changing any Values.
      */
-    std::list<Text*> bufferTextCopy = this->bufferText;
-    for (std::list<Text*>::iterator text = bufferTextCopy.begin(); text != bufferTextCopy.end(); ++text, ++i)
+    std::list<MultiLineText*> bufferTextCopy = this->bufferText;
+    for (std::list<MultiLineText*>::iterator text = bufferTextCopy.begin(); text != bufferTextCopy.end(); ++text, ++i)
     {
       this->resetText(*text, i);
@@ -296,5 +290,7 @@
       for (unsigned int i = oldSize; i <= bufferDisplaySize; i++)
       {
-        this->bufferText.push_back(new Text);
+        this->bufferText.push_back(new MultiLineText);
+        this->bufferText.back()->setLineWidth(this->getSizeX2D() * GraphicsEngine::getInstance()->getResolutionX());
+        this->bufferText.back()->setLineSpacing(0);
       }
     }
@@ -308,5 +304,5 @@
   void Shell::flush()
   {
-    for (std::list<Text*>::iterator text = this->bufferText.begin(); text != this->bufferText.end(); ++text)
+    for (std::list<MultiLineText*>::iterator text = this->bufferText.begin(); text != this->bufferText.end(); ++text)
     {
       (*text)->setText("");  // remove all chars from the BufferTexts.
@@ -322,16 +318,24 @@
   void Shell::printToDisplayBuffer(const std::string& text)
   {
+    // Remove Last Entry and prepend it to the front.
     this->bufferText.push_front(this->bufferText.back());
     this->bufferText.pop_back();
 
-
-    unsigned int i = 0;
-    for (std::list<Text*>::iterator textIt = ++this->bufferText.begin(); textIt != this->bufferText.end(); ++textIt, i++)
-    {
-      (*textIt)->setRelCoorSoft2D(this->calculateLinePosition(i+1), 5);
-    }
-
-    this->bufferText.front()->setRelCoor2D(this->calculateLinePosition(0)- Vector2D(-1000,0));
-    this->bufferText.front()->setRelCoorSoft2D(this->calculateLinePosition(0),10);
+    // Set the new Text.
+    this->bufferText.front()->setText(text);
+
+    // The LineCount will be started here.
+    int linePos = -1;
+
+    // The First Line gets a special Animation
+    this->bufferText.front()->setRelCoor2D(this->calculateLinePosition(linePos)- Vector2D(-1000,0));
+
+    // Move all lines one Entry up.
+    for (std::list<MultiLineText*>::iterator textIt = this->bufferText.begin(); textIt != this->bufferText.end(); ++textIt)
+    {
+      linePos += (*textIt)->getLineCount();
+      (*textIt)->setRelCoorSoft2D(this->calculateLinePosition(linePos), 8);
+    }
+
 
     /*  FANCY EFFECTS :)
@@ -344,5 +348,4 @@
     */
 
-    this->bufferText.front()->setText(text);
   }
 
@@ -389,8 +392,8 @@
     {
       /// FIXME
-      PRINTF(1)("Should not heappen\n");
+      PRINTF(1)("Should not happen\n");
       it--;
     }
-    for (std::list<Text*>::iterator textIt = this->bufferText.begin(); textIt != this->bufferText.end(); ++textIt)
+    for (std::list<MultiLineText*>::iterator textIt = this->bufferText.begin(); textIt != this->bufferText.end(); ++textIt)
     {
       (*textIt)->setText((*it));
@@ -398,5 +401,5 @@
       {
         /// FIXME
-        PRINTF(1)("Should not heappen\n");
+        PRINTF(1)("Should not happen\n");
         break;
       }
@@ -478,5 +481,7 @@
   Vector2D Shell::calculateLinePosition(unsigned int lineNumber)
   {
-    return Vector2D(5, (this->textSize + this->lineSpacing)*(this->bufferDisplaySize - lineNumber - 2) + this->textSize);
+    Vector2D val(5, (int)(this->textSize + this->lineSpacing)*(int)((int)this->bufferDisplaySize - (int)lineNumber - (int)2) + (int)this->textSize);
+     val.debug();
+     return val;
   }
 
Index: trunk/src/lib/shell/shell.h
===================================================================
--- trunk/src/lib/shell/shell.h	(revision 7729)
+++ trunk/src/lib/shell/shell.h	(revision 7737)
@@ -20,5 +20,5 @@
 
 // FORWARD DECLARATION
-class Text;
+class MultiLineText;
 class ShellInput;
 class Material;
@@ -104,5 +104,5 @@
     // BUFFER
     unsigned int                bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters).
-    std::list<Text*>            bufferText;             //!< A list of stored bufferTexts for the display of the buffer.
+    std::list<MultiLineText*>   bufferText;             //!< A list of stored bufferTexts for the display of the buffer.
     int                         bufferOffset;           //!< how many lines from the bottom up we display the Buffer.
     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 7729)
+++ trunk/src/lib/shell/shell_buffer.cc	(revision 7737)
@@ -17,6 +17,10 @@
 
 #include "shell_buffer.h"
+
+#include <stdarg.h>
+
 #include "debug.h"
 #include "shell.h"
+#include "lib/util/threading.h"
 
 namespace OrxShell
@@ -39,5 +43,5 @@
 
   ShellBuffer* ShellBuffer::singletonRef = NULL;
-  SDL_mutex* ShellBuffer::bufferMutex = NULL;
+  std::list<std::string> ShellBuffer::buffer;
 
   /**
@@ -48,10 +52,4 @@
     if (this->shell != NULL)
       delete this->shell;
-
-    this->flush();
-
-    if (ShellBuffer::bufferMutex != NULL)
-      SDL_DestroyMutex(ShellBuffer::bufferMutex);
-    ShellBuffer::bufferMutex = NULL;
 
     ShellBuffer::singletonRef = NULL;
@@ -99,8 +97,7 @@
     va_start(arguments, line);
 
-    if (ShellBuffer::bufferMutex == NULL)
-      ShellBuffer::bufferMutex = SDL_CreateMutex();
+    static OrxThread::Mutex ShellBuffer__bufferMutex;
 
-    SDL_mutexP(ShellBuffer::bufferMutex);
+    OrxThread::MutexLock bufferLock(&ShellBuffer__bufferMutex);
 #if DEBUG_LEVEL < 3
     if (ShellBuffer::singletonRef == NULL)
@@ -113,5 +110,4 @@
 #endif
       ShellBuffer::singletonRef->addBufferLine(line, arguments);
-    SDL_mutexV(ShellBuffer::bufferMutex);
     return true;
   }
Index: trunk/src/lib/shell/shell_buffer.h
===================================================================
--- trunk/src/lib/shell/shell_buffer.h	(revision 7729)
+++ trunk/src/lib/shell/shell_buffer.h	(revision 7737)
@@ -8,7 +8,5 @@
 #define _SHELL_BUFFER_H
 
-#include <stdarg.h>
 #include <list>
-#include "lib/util/threading.h"
 
 #define      SHELL_BUFFER_SIZE       16384         //!< The Size of the input-buffers (should be large enough to carry any kind of input)
@@ -50,16 +48,15 @@
 
   private:
-    static ShellBuffer*      singletonRef;                       //!< The singleton-reference to the only memeber of this class.
-    unsigned int             bufferSize;                         //!< The Size of the buffer
-    std::list<std::string>   buffer;                             //!< A list of stored char-arrays(strings) to store the history
+    static ShellBuffer*           singletonRef;                       //!< The singleton-reference to the only memeber of this class.
+    unsigned int                  bufferSize;                         //!< The Size of the buffer
 
-    Shell*                   shell;                              //!< the Registered Shell.
-    char                     bufferArray[SHELL_BUFFER_SIZE];     //!< a BUFFER for fast writing
-    char                     keepBufferArray[SHELL_BUFFER_SIZE]; //!< a BUFFER to have multi-non-newLine commands be copied into the shell.
-    bool                     keepBuffer;                         //!< if the keepbuffer contains unfinished lines.
+    Shell*                        shell;                              //!< the Registered Shell.
+    char                          bufferArray[SHELL_BUFFER_SIZE];     //!< a BUFFER for fast writing
+    char                          keepBufferArray[SHELL_BUFFER_SIZE]; //!< a BUFFER to have multi-non-newLine commands be copied into the shell.
+    bool                          keepBuffer;                         //!< if the keepbuffer contains unfinished lines.
 
-    unsigned long            lineCount;                          //!< how many Lines have been written out so far.
+    unsigned long                 lineCount;                          //!< how many Lines have been written out so far.
 
-    static SDL_mutex*        bufferMutex;                        //!< Only one thread may write into the ShellBuffer at a time.
+    static std::list<std::string> buffer;                             //!< A list of stored char-arrays(strings) to store the history
   };
 
