Index: trunk/src/util/shell.cc
===================================================================
--- trunk/src/util/shell.cc	(revision 5105)
+++ trunk/src/util/shell.cc	(revision 5106)
@@ -25,4 +25,6 @@
 #include "load_param.h"
 #include "class_list.h"
+
+#include "key_names.h"
 #include "debug.h"
 #include <stdarg.h>
@@ -40,26 +42,28 @@
   this->setName("Shell");
 
+  this->shellHeight = 400;
   this->buffer = new tList<char>;
 
-  this->textSize = 10;
+  this->textSize = 15;
+  this->lineSpacing = 5;
 
   //this->bufferSize = 0;
   this->bufferText = NULL;
   this->setBufferSize(100);
+  this->bufferDisplaySize = 10;
   this->setBufferDisplaySize(10);
-  this->setAbsCoor2D(3, GraphicsEngine::getInstance()->getResolutionY());
+  this->setAbsCoor2D(3, -400);
   this->delayed = 0;
   this->setRepeatDelay(.3, .05);
   this->pressedKey = SDLK_FIRST;
 
-  this->inputLineText = TextEngine::getInstance()->createText("fonts/earth.ttf", 10, TEXT_DYNAMIC, 255, 0, 0);
-  this->inputLineText->setAlignment(TEXT_ALIGN_LEFT);
-  this->inputLineText->setText(NULL);
+  this->inputLineText = NULL;
   this->inputLine = new char[1];
   this->inputLine[0] = '\0';
-  this->inputLineText->setParent2D(this);
-
+
+  this->rebuildText();
   this->completionList = NULL;
 
+  // EVENT-Handler subscription of '`' to all States, and all other keyboard commands to ES_SEHLL
   EventHandler* evh = EventHandler::getInstance();
   evh->subscribe(this, ES_ALL, SDLK_BACKQUOTE);
@@ -78,5 +82,5 @@
   for (int i = 0; i < this->bufferDisplaySize; i++)
     delete this->bufferText[i];
-  delete this->bufferText;
+  delete[] this->bufferText;
 
   // delete the inputLine
@@ -100,4 +104,40 @@
 }
 
+
+void Shell::activate()
+{
+  EventHandler::getInstance()->setState(ES_SHELL);
+  this->setRelCoorSoft2D(0, 0, 1, 5);
+}
+
+void Shell::deactivate()
+{
+  EventHandler::getInstance()->setState(ES_GAME);
+  this->setRelCoorSoft2D(0, -400, 1, 5);
+}
+
+void Shell::setTextSize(unsigned int textSize, unsigned int lineSpacing)
+{
+  this->textSize = textSize;
+  this->lineSpacing = lineSpacing;
+
+  this->rebuildText();
+}
+
+void Shell::rebuildText()
+{
+  if (this->inputLineText == NULL)
+    delete this->inputLineText;
+  this->inputLineText = TextEngine::getInstance()->createText("fonts/Aniron_Bold.ttf", this->textSize, TEXT_DYNAMIC, 255, 0, 0);
+  this->inputLineText->setAlignment(TEXT_ALIGN_LEFT);
+  this->inputLineText->setText(NULL);
+  this->inputLineText->setParent2D(this);
+  this->inputLineText->setRelCoor2D(5, (this->textSize + this->lineSpacing)*this->bufferDisplaySize);
+
+  this->setBufferDisplaySize(this->bufferDisplaySize);
+}
+
+
+
 /**
  * sets The count of Lines to display in the buffer.
@@ -110,5 +150,5 @@
     for (unsigned int i = 0; i < this->bufferDisplaySize; i++)
       delete this->bufferText[i];
-    delete this->bufferText;
+    delete[] this->bufferText;
   }
 
@@ -116,13 +156,13 @@
   for (unsigned int i = 0; i < bufferDisplaySize; i++)
   {
-    this->bufferText[i] = TextEngine::getInstance()->createText("fonts/earth.ttf", this->textSize, TEXT_DYNAMIC, 255, 0, 0);
+    this->bufferText[i] = TextEngine::getInstance()->createText("fonts/Aniron_Bold.ttf", this->textSize, TEXT_DYNAMIC, 255, 0, 0);
     this->bufferText[i]->setAlignment(TEXT_ALIGN_LEFT);
-    this->bufferText[i]->setRelCoor2D(5, 12+12*i);
+    this->bufferText[i]->setRelCoor2D(5, (this->textSize + this->lineSpacing)*i);
     this->bufferText[i]->setText(NULL);
     this->bufferText[i]->setParent2D(this);
   }
-
-
   this->bufferDisplaySize = bufferDisplaySize;
+
+  this->shellHeight = (this->textSize + this->lineSpacing) * (bufferDisplaySize+1);
 }
 
@@ -157,6 +197,4 @@
  * @param line the Line as in the first argument in printf
  * @param args the arguments as a va_list
- *
- * @todo optimize
  */
 bool Shell::addBufferLineStatic(const char* line, ...)
@@ -178,5 +216,4 @@
   return true;
 }
-int curr = 0;
 
 /**
@@ -213,6 +250,4 @@
    }
    this->bufferText[0]->setText(newLine);
-   // this->bufferText->
-//  this->inputLineText->setText(newLine);
 }
 
@@ -250,5 +285,4 @@
 }
 
-
 /**
  * deletes the InputLine
@@ -262,5 +296,4 @@
   this->inputLine = new char[1];
   *this->inputLine = '\0';
-
 }
 
@@ -320,5 +353,4 @@
 bool Shell::executeCommand()
 {
-
   this->addBufferLineStatic("Execute Command: %s\n", this->inputLine);
   delete this->inputLine;
@@ -341,6 +373,4 @@
 }
 
-
-#include "key_names.h"
 /**
  * listens for some event
@@ -356,12 +386,10 @@
       if (EventHandler::getInstance()->getState() == ES_GAME)
       {
-        EventHandler::getInstance()->setState(ES_SHELL);
-        this->setRelCoorSoft2D(0, GraphicsEngine::getInstance()->getResolutionY()-150, 1, 5);
+        this->activate();
       }
 
       else
       {
-        EventHandler::getInstance()->setState(ES_GAME);
-        this->setRelCoorSoft2D(0, GraphicsEngine::getInstance()->getResolutionY()+10, 1, 5);
+        this->deactivate();
       }
     }
@@ -432,11 +460,11 @@
 
 //  glTexCoord2f(this->texCoord.maxU, this->texCoord.minV);
-  glVertex2f(this->getAbsCoor2D().x + 800, this->getAbsCoor2D().y  );
+  glVertex2f(GraphicsEngine::getInstance()->getResolutionX() - this->getAbsCoor2D().x, this->getAbsCoor2D().y  );
 
 //  glTexCoord2f(this->texCoord.maxU, this->texCoord.maxV);
-  glVertex2f(this->getAbsCoor2D().x + 800, this->getAbsCoor2D().y + 150);
+  glVertex2f(GraphicsEngine::getInstance()->getResolutionX() - this->getAbsCoor2D().x, this->getAbsCoor2D().y + this->shellHeight);
 
 //  glTexCoord2f(this->texCoord.minU, this->texCoord.maxV);
-  glVertex2f(this->getAbsCoor2D().x, this->getAbsCoor2D().y + 150);
+  glVertex2f(this->getAbsCoor2D().x, this->getAbsCoor2D().y + this->shellHeight);
 
   glEnd();
@@ -655,6 +683,4 @@
 }
 
-
-
 /**
  * displays some nice output from the Shell
