Index: /trunk/src/Makefile.am
===================================================================
--- /trunk/src/Makefile.am	(revision 5074)
+++ /trunk/src/Makefile.am	(revision 5075)
@@ -33,4 +33,5 @@
 
 orxonox_SOURCES = orxonox.cc \
+                  util/shell.cc \
                   util/loading/game_loader.cc \
                   util/track/track_manager.cc \
@@ -46,5 +47,4 @@
                   util/loading/load_param.cc \
                   util/state.cc \
-                  util/shell.cc \
                   util/user_control.cc \
                   story_entities/story_entity.cc \
Index: /trunk/src/Makefile.in
===================================================================
--- /trunk/src/Makefile.in	(revision 5074)
+++ /trunk/src/Makefile.in	(revision 5075)
@@ -53,5 +53,5 @@
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
-am_orxonox_OBJECTS = orxonox-orxonox.$(OBJEXT) \
+am_orxonox_OBJECTS = orxonox-orxonox.$(OBJEXT) orxonox-shell.$(OBJEXT) \
 	orxonox-game_loader.$(OBJEXT) orxonox-track_manager.$(OBJEXT) \
 	orxonox-track_node.$(OBJEXT) orxonox-pilot_node.$(OBJEXT) \
@@ -62,11 +62,11 @@
 	orxonox-resource_manager.$(OBJEXT) orxonox-factory.$(OBJEXT) \
 	orxonox-load_param.$(OBJEXT) orxonox-state.$(OBJEXT) \
-	orxonox-shell.$(OBJEXT) orxonox-user_control.$(OBJEXT) \
-	orxonox-story_entity.$(OBJEXT) orxonox-campaign.$(OBJEXT) \
-	orxonox-world.$(OBJEXT) orxonox-world_entity.$(OBJEXT) \
-	orxonox-camera.$(OBJEXT) orxonox-player.$(OBJEXT) \
-	orxonox-npc.$(OBJEXT) orxonox-environment.$(OBJEXT) \
-	orxonox-skysphere.$(OBJEXT) orxonox-skybox.$(OBJEXT) \
-	orxonox-terrain.$(OBJEXT) orxonox-satellite.$(OBJEXT) \
+	orxonox-user_control.$(OBJEXT) orxonox-story_entity.$(OBJEXT) \
+	orxonox-campaign.$(OBJEXT) orxonox-world.$(OBJEXT) \
+	orxonox-world_entity.$(OBJEXT) orxonox-camera.$(OBJEXT) \
+	orxonox-player.$(OBJEXT) orxonox-npc.$(OBJEXT) \
+	orxonox-environment.$(OBJEXT) orxonox-skysphere.$(OBJEXT) \
+	orxonox-skybox.$(OBJEXT) orxonox-terrain.$(OBJEXT) \
+	orxonox-satellite.$(OBJEXT) \
 	orxonox-character_attributes.$(OBJEXT) \
 	orxonox-test_entity.$(OBJEXT) orxonox-weapon_manager.$(OBJEXT) \
@@ -291,4 +291,5 @@
 
 orxonox_SOURCES = orxonox.cc \
+                  util/shell.cc \
                   util/loading/game_loader.cc \
                   util/track/track_manager.cc \
@@ -304,5 +305,4 @@
                   util/loading/load_param.cc \
                   util/state.cc \
-                  util/shell.cc \
                   util/user_control.cc \
                   story_entities/story_entity.cc \
@@ -579,4 +579,20 @@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-orxonox.obj `if test -f 'orxonox.cc'; then $(CYGPATH_W) 'orxonox.cc'; else $(CYGPATH_W) '$(srcdir)/orxonox.cc'; fi`
 
+orxonox-shell.o: util/shell.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell.o -MD -MP -MF "$(DEPDIR)/orxonox-shell.Tpo" -c -o orxonox-shell.o `test -f 'util/shell.cc' || echo '$(srcdir)/'`util/shell.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-shell.Tpo" "$(DEPDIR)/orxonox-shell.Po"; else rm -f "$(DEPDIR)/orxonox-shell.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/shell.cc' object='orxonox-shell.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/orxonox-shell.Po' tmpdepfile='$(DEPDIR)/orxonox-shell.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shell.o `test -f 'util/shell.cc' || echo '$(srcdir)/'`util/shell.cc
+
+orxonox-shell.obj: util/shell.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell.obj -MD -MP -MF "$(DEPDIR)/orxonox-shell.Tpo" -c -o orxonox-shell.obj `if test -f 'util/shell.cc'; then $(CYGPATH_W) 'util/shell.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-shell.Tpo" "$(DEPDIR)/orxonox-shell.Po"; else rm -f "$(DEPDIR)/orxonox-shell.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/shell.cc' object='orxonox-shell.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/orxonox-shell.Po' tmpdepfile='$(DEPDIR)/orxonox-shell.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shell.obj `if test -f 'util/shell.cc'; then $(CYGPATH_W) 'util/shell.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell.cc'; fi`
+
 orxonox-game_loader.o: util/loading/game_loader.cc
 @am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-game_loader.o -MD -MP -MF "$(DEPDIR)/orxonox-game_loader.Tpo" -c -o orxonox-game_loader.o `test -f 'util/loading/game_loader.cc' || echo '$(srcdir)/'`util/loading/game_loader.cc; \
@@ -786,20 +802,4 @@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-state.obj `if test -f 'util/state.cc'; then $(CYGPATH_W) 'util/state.cc'; else $(CYGPATH_W) '$(srcdir)/util/state.cc'; fi`
-
-orxonox-shell.o: util/shell.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell.o -MD -MP -MF "$(DEPDIR)/orxonox-shell.Tpo" -c -o orxonox-shell.o `test -f 'util/shell.cc' || echo '$(srcdir)/'`util/shell.cc; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-shell.Tpo" "$(DEPDIR)/orxonox-shell.Po"; else rm -f "$(DEPDIR)/orxonox-shell.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/shell.cc' object='orxonox-shell.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/orxonox-shell.Po' tmpdepfile='$(DEPDIR)/orxonox-shell.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shell.o `test -f 'util/shell.cc' || echo '$(srcdir)/'`util/shell.cc
-
-orxonox-shell.obj: util/shell.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell.obj -MD -MP -MF "$(DEPDIR)/orxonox-shell.Tpo" -c -o orxonox-shell.obj `if test -f 'util/shell.cc'; then $(CYGPATH_W) 'util/shell.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell.cc'; fi`; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-shell.Tpo" "$(DEPDIR)/orxonox-shell.Po"; else rm -f "$(DEPDIR)/orxonox-shell.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/shell.cc' object='orxonox-shell.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/orxonox-shell.Po' tmpdepfile='$(DEPDIR)/orxonox-shell.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shell.obj `if test -f 'util/shell.cc'; then $(CYGPATH_W) 'util/shell.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell.cc'; fi`
 
 orxonox-user_control.o: util/user_control.cc
Index: /trunk/src/defs/debug.h
===================================================================
--- /trunk/src/defs/debug.h	(revision 5074)
+++ /trunk/src/defs/debug.h	(revision 5075)
@@ -27,4 +27,5 @@
 
 #include "confincl.h"
+#include "shell.h"
 
 #include <stdio.h>
@@ -97,4 +98,8 @@
 #define PRINTFVDEBUG  PRINTF5
 
+//#ifdef
+//#define PRINTF(x)        PRINT(x)
+#define PRINT_EXEC       Shell::addBufferLineStatic
+
 #ifdef DEBUG
 
@@ -105,5 +110,5 @@
 #define PRINTF1 \
     if (SOFT_DEBUG_LEVEL >= ERR) \
-      printf("ERROR::%s:%d:", __FILE__, __LINE__) && printf
+      printf("ERROR::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
 #else
 #define PRINTF1 if (NO)
@@ -113,5 +118,5 @@
 #define PRINTF2 \
      if (SOFT_DEBUG_LEVEL >= WARN) \
-       printf("WARNING::%s:%d:", __FILE__, __LINE__) && printf
+       printf("WARNING::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
 
 #else
@@ -122,5 +127,5 @@
 #define PRINTF3 \
      if (SOFT_DEBUG_LEVEL >= INFO) \
-       printf("INFO::%s:%d:", __FILE__, __LINE__) && printf
+       printf("INFO::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
 #else
 #define PRINTF3 if (NO)
@@ -130,5 +135,5 @@
 #define PRINTF4 \
      if (SOFT_DEBUG_LEVEL >= DEBUG) \
-       printf("DEBUG::%s:%d:", __FILE__, __LINE__) && printf
+       printf("DEBUG::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
 #else
 #define PRINTF4 if (NO)
@@ -138,5 +143,5 @@
 #define PRINTF5 \
      if (SOFT_DEBUG_LEVEL >= vDEBUG) \
-       printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
+       printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
 #else
 #define PRINTF5 if (NO)
@@ -148,5 +153,5 @@
 
 #define PRINTF0 \
-    printf("%s:%d::", __FILE__, __LINE__) && printf
+    printf("%s:%d::", __FILE__, __LINE__) && PRINT_EXEC
 
 
@@ -168,5 +173,5 @@
 #define PRINT1  \
   if (SOFT_DEBUG_LEVEL >= ERR)  \
-    printf
+    PRINT_EXEC
 #else
 #define PRINT1 if (NO)
@@ -176,5 +181,5 @@
 #define PRINT2 \
   if (SOFT_DEBUG_LEVEL >= WARN) \
-    printf
+    PRINT_EXEC
 
 #else
@@ -185,5 +190,5 @@
 #define PRINT3 \
   if (SOFT_DEBUG_LEVEL >= INFO) \
-    printf
+    PRINT_EXEC
 #else
 #define PRINT3 if (NO)
@@ -193,5 +198,5 @@
 #define PRINT4 \
   if (SOFT_DEBUG_LEVEL >= DEBUG) \
-    printf
+    PRINT_EXEC
 #else
 #define PRINT4 if (NO)
@@ -201,5 +206,5 @@
 #define PRINT5 \
      if (SOFT_DEBUG_LEVEL >= vDEBUG) \
-       printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
+       PRINT_EXEC("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && PRINT_EXEC
 #else
 #define PRINT5 if (NO)
@@ -212,5 +217,5 @@
 
 #define PRINT0 \
-  printf
+  PRINT_EXEC
 
 #endif /* _DEBUG_H */
Index: /trunk/src/defs/stdincl.h
===================================================================
--- /trunk/src/defs/stdincl.h	(revision 5074)
+++ /trunk/src/defs/stdincl.h	(revision 5075)
@@ -2,5 +2,5 @@
   \file stdincl.h
   \brief This file includes default headers that nearly every Class needs.
-  
+
   no Class is defined here, but many headers to classes, and more general Headers like the openGL-header.
 */
@@ -23,5 +23,4 @@
 
 #include "error.h"
-#include "debug.h"
 #include "globals.h"
 
Index: /trunk/src/lib/event/key_mapper.cc
===================================================================
--- /trunk/src/lib/event/key_mapper.cc	(revision 5074)
+++ /trunk/src/lib/event/key_mapper.cc	(revision 5075)
@@ -24,4 +24,5 @@
 #include "ini_parser.h"
 #include "key_names.h"
+#include "debug.h"
 
 using namespace std;
Index: /trunk/src/lib/graphics/importer/md2Model.cc
===================================================================
--- /trunk/src/lib/graphics/importer/md2Model.cc	(revision 5074)
+++ /trunk/src/lib/graphics/importer/md2Model.cc	(revision 5075)
@@ -18,4 +18,5 @@
 #include "material.h"
 
+#include "debug.h"
 #include "resource_manager.h"
 
@@ -84,5 +85,5 @@
   if( unlikely(this->data == NULL))
     PRINTF(0)("The model was not found, MD2Model Loader finished abnormaly. Update the data-repos\n");
-  
+
   this->scaleFactor = this->data->scaleFactor;
   this->setAnim(BOOM);
@@ -381,5 +382,5 @@
   */
 
-  
+
 
 
Index: /trunk/src/lib/graphics/spatial_separation/quadtree.cc
===================================================================
--- /trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 5074)
+++ /trunk/src/lib/graphics/spatial_separation/quadtree.cc	(revision 5075)
@@ -22,5 +22,5 @@
 
 #include "material.h"
-
+#include "debug.h"
 
 using namespace std;
Index: /trunk/src/lib/graphics/spatial_separation/quadtree_node.cc
===================================================================
--- /trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 5074)
+++ /trunk/src/lib/graphics/spatial_separation/quadtree_node.cc	(revision 5075)
@@ -23,4 +23,5 @@
 #include "list.h"
 #include "vector.h"
+#include "debug.h"
 
 using namespace std;
Index: /trunk/src/lib/graphics/spatial_separation/spatial_separation.cc
===================================================================
--- /trunk/src/lib/graphics/spatial_separation/spatial_separation.cc	(revision 5074)
+++ /trunk/src/lib/graphics/spatial_separation/spatial_separation.cc	(revision 5075)
@@ -17,6 +17,8 @@
 
 #include "spatial_separation.h"
+
 #include "abstract_model.h"
 #include "quadtree.h"
+#include "debug.h"
 
 using namespace std;
Index: /trunk/src/lib/graphics/text_engine.cc
===================================================================
--- /trunk/src/lib/graphics/text_engine.cc	(revision 5074)
+++ /trunk/src/lib/graphics/text_engine.cc	(revision 5075)
@@ -103,10 +103,10 @@
   {
     this->text = new char[1];
-    strcpy(this->text, "");
+    *this->text = '\0';
   }
 
 
   // setting up the Text-Width if DYNAMIC
-  if (this->type == TEXT_DYNAMIC)
+  if (this->type == TEXT_DYNAMIC && this->alignment != TEXT_ALIGN_LEFT)
     {
       Glyph** glyphArray = this->font->getGlyphArray();
Index: /trunk/src/util/shell.cc
===================================================================
--- /trunk/src/util/shell.cc	(revision 5074)
+++ /trunk/src/util/shell.cc	(revision 5075)
@@ -21,4 +21,7 @@
 #include "list.h"
 
+#include <stdarg.h>
+#include <stdio.h>
+
 using namespace std;
 
@@ -41,6 +44,6 @@
 
 
-  this->addBufferLine("asjflksjdvklasmv", NULL);
-  TextEngine::getInstance()->debug();
+  //this->addBufferLineStatic("asjflksjdvklasmv %s", "doom");
+  //TextEngine::getInstance()->debug();
   //exit(-1);
 }
@@ -73,5 +76,5 @@
   while(bufferDisplaySize > this->bufferText->getSize())
   {
-    Text* newText = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);
+    Text* newText = TextEngine::getInstance()->createText("fonts/earth.ttf", 10, TEXT_DYNAMIC, 0, 255, 0);
     newText->setAlignment(TEXT_ALIGN_LEFT);
     newText->setPosition2D(5, 5);
@@ -120,22 +123,32 @@
  * @todo optimize
  */
-void Shell::addBufferLine(const char* line, va_list args)
-{
-  char tmp[1024];// = new char*
-  vsprintf(tmp, line, args);
-
-  char* newLine = new char[strlen(tmp)+1];
-  strcpy(newLine, tmp);
-
-  this->buffer->addAtBeginning(newLine);
-
-  if (this->buffer->getSize() > this->bufferSize)
-  {
-    delete this->buffer->firstElement();
-    this->buffer->remove(this->buffer->firstElement());
-  }
+bool Shell::addBufferLineStatic(const char* line, ...)
+{
+  va_list arguments;
+  va_start(arguments, line);
+
+  if (Shell::singletonRef == NULL)
+   vprintf(line, arguments);
+  else
+    Shell::singletonRef->addBufferLine(line, arguments);
+  return true;
+}
+
+void Shell::addBufferLine(const char* line, va_list arguments)
+{
+  vsprintf(this->bufferArray, line, arguments);
+
+  char* newLine = new char[strlen(this->bufferArray)+1];
+  strcpy(newLine, this->bufferArray);
+
+//  this->buffer->add(newLine);
+
+//    if (this->buffer->getSize() > this->bufferSize)
+//    {
+//      delete this->buffer->firstElement();
+//      this->buffer->remove(this->buffer->firstElement());
+//    }
 
   this->bufferText->firstElement()->setText(newLine);
-
 }
 
Index: /trunk/src/util/shell.h
===================================================================
--- /trunk/src/util/shell.h	(revision 5074)
+++ /trunk/src/util/shell.h	(revision 5075)
@@ -10,7 +10,5 @@
 #include "event_listener.h"
 
-#include <stdio.h>
 #include <stdarg.h>
-
 
 // FORWARD DECLARATION
@@ -44,5 +42,6 @@
     // BUFFER //
     void flushBuffers();
-    void addBufferLine(const char* Line, va_list args);
+    static bool addBufferLineStatic(const char* line, ...);
+    void addBufferLine(const char* line, va_list arg);
     void moveBuffer(int lineCount);
     const char* getBufferLine(unsigned int lineNumber);
@@ -81,4 +80,7 @@
     tList<Text>*           bufferText;             //!< A list of stored bufferTexts for the display of the buffer
     Text*                  inputLineText;          //!< The inputLine of the Shell
+
+    char                   bufferArray[10000];     //!< a BUFFER for fast writing
+
 };
 
