Index: /trunk/src/Makefile.am
===================================================================
--- /trunk/src/Makefile.am	(revision 5128)
+++ /trunk/src/Makefile.am	(revision 5129)
@@ -34,4 +34,5 @@
 orxonox_SOURCES = orxonox.cc \
                   util/shell.cc \
+                  util/shell_command.cc \
                   util/loading/game_loader.cc \
                   util/track/track_manager.cc \
@@ -101,4 +102,5 @@
                  util/state.h \
                  util/shell.h \
+                 util/shell_command.h \
                  util/user_control.h \
                  util/resource_manager.h \
Index: /trunk/src/Makefile.in
===================================================================
--- /trunk/src/Makefile.in	(revision 5128)
+++ /trunk/src/Makefile.in	(revision 5129)
@@ -54,7 +54,8 @@
 PROGRAMS = $(bin_PROGRAMS)
 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) \
-	orxonox-animation.$(OBJEXT) orxonox-animation3d.$(OBJEXT) \
+	orxonox-shell_command.$(OBJEXT) orxonox-game_loader.$(OBJEXT) \
+	orxonox-track_manager.$(OBJEXT) orxonox-track_node.$(OBJEXT) \
+	orxonox-pilot_node.$(OBJEXT) orxonox-animation.$(OBJEXT) \
+	orxonox-animation3d.$(OBJEXT) \
 	orxonox-animation_player.$(OBJEXT) \
 	orxonox-fast_factory.$(OBJEXT) \
@@ -122,4 +123,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox-satellite.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox-shell.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/orxonox-shell_command.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox-skybox.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/orxonox-skysphere.Po \
@@ -292,4 +294,5 @@
 orxonox_SOURCES = orxonox.cc \
                   util/shell.cc \
+                  util/shell_command.cc \
                   util/loading/game_loader.cc \
                   util/track/track_manager.cc \
@@ -359,4 +362,5 @@
                  util/state.h \
                  util/shell.h \
+                 util/shell_command.h \
                  util/user_control.h \
                  util/resource_manager.h \
@@ -528,4 +532,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-satellite.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-shell.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-shell_command.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-skybox.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-skysphere.Po@am__quote@
@@ -595,4 +600,20 @@
 @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-shell_command.o: util/shell_command.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell_command.o -MD -MP -MF "$(DEPDIR)/orxonox-shell_command.Tpo" -c -o orxonox-shell_command.o `test -f 'util/shell_command.cc' || echo '$(srcdir)/'`util/shell_command.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-shell_command.Tpo" "$(DEPDIR)/orxonox-shell_command.Po"; else rm -f "$(DEPDIR)/orxonox-shell_command.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/shell_command.cc' object='orxonox-shell_command.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/orxonox-shell_command.Po' tmpdepfile='$(DEPDIR)/orxonox-shell_command.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_command.o `test -f 'util/shell_command.cc' || echo '$(srcdir)/'`util/shell_command.cc
+
+orxonox-shell_command.obj: util/shell_command.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shell_command.obj -MD -MP -MF "$(DEPDIR)/orxonox-shell_command.Tpo" -c -o orxonox-shell_command.obj `if test -f 'util/shell_command.cc'; then $(CYGPATH_W) 'util/shell_command.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell_command.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/orxonox-shell_command.Tpo" "$(DEPDIR)/orxonox-shell_command.Po"; else rm -f "$(DEPDIR)/orxonox-shell_command.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/shell_command.cc' object='orxonox-shell_command.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/orxonox-shell_command.Po' tmpdepfile='$(DEPDIR)/orxonox-shell_command.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_command.obj `if test -f 'util/shell_command.cc'; then $(CYGPATH_W) 'util/shell_command.cc'; else $(CYGPATH_W) '$(srcdir)/util/shell_command.cc'; fi`
 
 orxonox-game_loader.o: util/loading/game_loader.cc
Index: /trunk/src/lib/graphics/light.cc
===================================================================
--- /trunk/src/lib/graphics/light.cc	(revision 5128)
+++ /trunk/src/lib/graphics/light.cc	(revision 5129)
@@ -22,8 +22,8 @@
 #include "glincl.h"
 #include "vector.h"
-#include "debug.h"
 #include "tinyxml.h"
 #include "load_param.h"
 #include "factory.h"
+#include "debug.h"
 
 using namespace std;
Index: /trunk/src/lib/physics/physics_engine.cc
===================================================================
--- /trunk/src/lib/physics/physics_engine.cc	(revision 5128)
+++ /trunk/src/lib/physics/physics_engine.cc	(revision 5129)
@@ -17,6 +17,4 @@
 
 #include "physics_engine.h"
-
-#include "debug.h"
 
 #include "list.h"
Index: /trunk/src/util/loading/load_param.h
===================================================================
--- /trunk/src/util/loading/load_param.h	(revision 5128)
+++ /trunk/src/util/loading/load_param.h	(revision 5129)
@@ -16,6 +16,6 @@
 /*!
  * @file load_param.h
-  *  A Class and macro-functions, that makes our lives easy to load-in parameters
-*/
+ * A Class and macro-functions, that makes our lives easy to load-in parameters
+ */
 
 #ifndef _LOAD_PARAM_H
@@ -23,5 +23,5 @@
 
 #include "base_object.h"
-#include "vector.h"
+
 #include "factory.h"
 #include "debug.h"
Index: /trunk/src/util/shell.cc
===================================================================
--- /trunk/src/util/shell.cc	(revision 5128)
+++ /trunk/src/util/shell.cc	(revision 5129)
@@ -17,4 +17,5 @@
 
 #include "shell.h"
+#include "shell_command.h"
 
 #include "text_engine.h"
@@ -22,10 +23,8 @@
 #include "graphics_engine.h"
 #include "event_handler.h"
-
-#include "load_param.h"
+#include "debug.h"
 #include "class_list.h"
 
 #include "key_names.h"
-#include "debug.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -48,4 +47,7 @@
   this->buffer = new tList<char>;
   this->bufferIterator = this->buffer->getIterator();
+
+  this->inputHistory = new tList<char>;
+  //this->commandList = new tList<ShellCommand>;
 
   this->textSize = 15;
@@ -73,4 +75,7 @@
   for (int i = 1; i < SDLK_LAST; i++)
     evh->subscribe(this, ES_SHELL, i);
+
+
+//  this->registerCommand("clear", Shell::)
 }
 
@@ -105,5 +110,4 @@
   Shell::singletonRef = NULL;
 }
-
 
 /**
@@ -448,4 +452,8 @@
   this->addBufferLineStatic("Execute Command: %s\n", this->inputLine);
 
+  char* newCommand = new char[strlen(this->inputLine)+1];
+  strcpy(newCommand, this->inputLine);
+  this->inputHistory->add(newCommand);
+
   if (!strcmp(this->inputLine, "clear"))
   {
@@ -501,4 +509,22 @@
     else if (event.type == SDLK_RETURN)
       this->executeCommand();
+    /*
+    else if (event.type == SDLK_UP)
+    {
+//      this->flushInputLine();
+      tIterator<char>* iterator = this->commandList->getIterator();
+      char* command = iterator->lastElement();
+      while (command)
+      {
+        if (!strcmp (command, inputLine))
+        {
+          inputLine = iterator->prevElement();
+          return;
+        }
+        command = iterator->prevElement();
+      }
+      inputLine = iterator->lastElement();
+    }
+    */
     else if (likely(event.type < 127))
     {
Index: /trunk/src/util/shell.h
===================================================================
--- /trunk/src/util/shell.h	(revision 5128)
+++ /trunk/src/util/shell.h	(revision 5129)
@@ -37,5 +37,4 @@
     /** @returns a Pointer to the only object of this Class */
     inline static Shell* getInstance() { if (!Shell::singletonRef) Shell::singletonRef = new Shell();  return Shell::singletonRef; };
-
 
     void activate();
@@ -82,6 +81,6 @@
     bool generalComplete(const tList<const char>* stringList, const char* begin, const char* displayAs = "%s", const char* addBack = NULL, const char* addFront = NULL);
 
-    const tList<const char>* Shell::createCompleteList(const tList<const char>* inputList, const char* classNameBegin);
-    const tList<const char>* Shell::createCompleteList(const tList<BaseObject>* inputList, const char* classNameBegin);
+    const tList<const char>* createCompleteList(const tList<const char>* inputList, const char* classNameBegin);
+    const tList<const char>* createCompleteList(const tList<BaseObject>* inputList, const char* classNameBegin);
 
     // helpers //
@@ -91,31 +90,33 @@
   private:
     Shell();
-    static Shell*          singletonRef;           //!< The singleton-reference to the only memeber of this class.
+    static Shell*            singletonRef;           //!< The singleton-reference to the only memeber of this class.
 
-    unsigned int           bufferSize;             //!< The Size of the buffer
-    unsigned int           bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters)
+    unsigned int             bufferSize;             //!< The Size of the buffer
+    unsigned int             bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters)
 
-    Text*                  inputLineText;          //!< The inputLine of the Shell
-    char*                  inputLine;              //!< the Char-Array of the Buffer
-    float                  repeatRate;             //!< The Repeat-Delay.
-    float                  repeatDelay;            //!< The delay of the first Character of a given Character.
-    float                  delayed;                //!< how much of the delay is remaining.
-    int                    pressedKey;             //!< the pressed key that will be repeated.
+    Text*                    inputLineText;          //!< The inputLine of the Shell
+    char*                    inputLine;              //!< the Char-Array of the Buffer
+    float                    repeatRate;             //!< The Repeat-Delay.
+    float                    repeatDelay;            //!< The delay of the first Character of a given Character.
+    float                    delayed;                //!< how much of the delay is remaining.
+    int                      pressedKey;             //!< the pressed key that will be repeated.
 
-    tList<char>*           buffer;                 //!< A list of stored char-arrays(strings) to store the history
-    tIterator<char>*       bufferIterator;         //!< An iterator for the Shells main buffer.
+    tList<char>*             buffer;                 //!< A list of stored char-arrays(strings) to store the history
+    tIterator<char>*         bufferIterator;         //!< An iterator for the Shells main buffer.
 
-    Text**                 bufferText;             //!< A list of stored bufferTexts for the display of the buffer
-    unsigned int           textSize;               //!< The size of the text.
-    unsigned int           lineSpacing;            //!< The Spacing between lines.
-    unsigned int           shellHeight;            //!< The hight of the Shell in Pixels
-    bool                   bActive;                //!< if the shell is active;
+    tList<char>*             inputHistory;           //!< The history of given commands.
 
-    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;
+    Text**                   bufferText;             //!< A list of stored bufferTexts for the display of the buffer
+    unsigned int             textSize;               //!< The size of the text.
+    unsigned int             lineSpacing;            //!< The Spacing between lines.
+    unsigned int             shellHeight;            //!< The hight of the Shell in Pixels
+    bool                     bActive;                //!< if the shell is active;
+
+    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;
 
     // completion
-    tList<const char>*    completionList;          //!< A list of completions, that are io.
+    tList<const char>*       completionList;          //!< A list of completions, that are io.
 };
 
Index: /trunk/src/util/shell_command.cc
===================================================================
--- /trunk/src/util/shell_command.cc	(revision 5129)
+++ /trunk/src/util/shell_command.cc	(revision 5129)
@@ -0,0 +1,67 @@
+/*
+   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: Benjamin Grauer
+   co-programmer: ...
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "shell_command.h"
+
+#include "list.h"
+#include "debug.h"
+#include "class_list.h"
+
+#include "key_names.h"
+#include <stdarg.h>
+#include <stdio.h>
+
+using namespace std;
+
+ShellCommandBase::ShellCommandBase(const char* commandName, ClassID classID)
+{
+  this->classID = classID;
+  this->commandName = new char[strlen(commandName)+1];
+  strcpy(this->commandName, commandName);
+
+  ShellCommandBase::commandList->add(this);
+}
+
+
+
+tList<ShellCommandBase>* ShellCommandBase::commandList = NULL;
+
+bool ShellCommandBase::isRegistered(const char* commandName, ClassID classID)
+{
+  if (ShellCommandBase::commandList == NULL)
+  {
+    ShellCommandBase::commandList = new tList<ShellCommandBase>;
+    return false;
+  }
+
+  tIterator<ShellCommandBase>* iterator = ShellCommandBase::commandList->getIterator();
+  ShellCommandBase* elem = iterator->firstElement();
+  while(elem != NULL)
+  {
+    if (classID == elem->classID && !strcmp(commandName, elem->commandName))
+    {
+//      PRINTF(2)("Command already registered\n");
+      delete iterator;
+      return true;
+    }
+    elem = iterator->nextElement();
+  }
+  delete iterator;
+  return true;
+}
+
+
Index: /trunk/src/util/shell_command.h
===================================================================
--- /trunk/src/util/shell_command.h	(revision 5129)
+++ /trunk/src/util/shell_command.h	(revision 5129)
@@ -0,0 +1,88 @@
+/*!
+ * @file shell_command.h
+ * Definition of a on-screen-shell
+*/
+
+#ifndef _SHELL_COMMAND_H
+#define _SHELL_COMMAND_H
+
+#include "base_object.h"
+
+#include <stdarg.h>
+
+typedef enum ShellParameterType
+{
+  ShellParameterNull,
+  ShellParameterChar,
+  ShellParameterString,
+  ShellParameterInt,
+  ShellParameterUInt,
+  ShellParameterFloat,
+  /* ... */
+};
+
+// FORWARD DECLARATION
+template<class T> class tList;
+template<class T> class tIterator;
+#define MAX_SHELL_COMMAND_SIZE
+
+class ShellCommandBase
+{
+  public:
+    static bool execute (const char* executionString);
+
+  protected:
+    ShellCommandBase(const char* commandName, ClassID classID);
+
+    static bool isRegistered(const char* commandName, ClassID classID);
+
+
+  private:
+    char*                            commandName;         //!< The name of the Command when executed
+    long                             classID;             //!< The ID of the Class asociated to this Command
+
+
+    static tList<ShellCommandBase>*  commandList;         //!< A list of availiable commands.
+};
+
+//! keeps information about a ShellCommand
+template<class T> class ShellCommand : public ShellCommandBase
+{
+  public:
+    static void registerCommand(const char* commandName, void* pointerToFunction, ClassID classID, ShellParameterType param1Type, void* Object = NULL);
+
+    static void unregisterCommand(const char* commandNaame, ClassID classID);
+
+  private:
+    ShellCommand(const char* command, void* pointerToFunction, ClassID classID, ShellParameterType param1Type, void* Object = NULL);
+
+
+  public:
+    void*                functionPointer;     //!< The pointer to the function of the Class (or static pointer if ClassID == CL_NULL )
+    T*                   Object;              //!< The pointer to the object to apply this function to (NULL if classID == CL_NULL )
+};
+
+template<class T>
+    ShellCommand<T>::ShellCommand(const char* commandName, void* pointerToFunction, ClassID classID, ShellParameterType param1Type, void* Object)
+  : ShellCommandBase (command, classID)
+{
+
+}
+
+template<class T>
+    void ShellCommand<T>::registerCommand(const char* commandName, void* pointerToFunction, ClassID classID, ShellParameterType param1Type, void* Object)
+{
+  if (isRegistered() == true)
+    return;
+  else
+  {
+    ShellCommand<T>* newCommand = new ShellCommand<T>(command);
+    elem->functionPointer = pointerToFunction;
+    elem->parameter1 = param1Type;
+    elem->Object = Object;
+
+
+  }
+}
+
+#endif /* _SHELL_COMMAND_H */
Index: /trunk/src/util/track/track_manager.cc
===================================================================
--- /trunk/src/util/track/track_manager.cc	(revision 5128)
+++ /trunk/src/util/track/track_manager.cc	(revision 5129)
@@ -19,4 +19,5 @@
 
 #include "base_object.h"
+#include "load_param.h"
 #include "p_node.h"
 #include "track_node.h"
@@ -25,5 +26,4 @@
 #include "text_engine.h"
 #include "t_animation.h"
-#include "load_param.h"
 
 
