Index: orxonox/trunk/src/defs/globals.h
===================================================================
--- orxonox/trunk/src/defs/globals.h	(revision 4765)
+++ orxonox/trunk/src/defs/globals.h	(revision 4766)
@@ -2,5 +2,5 @@
   \file globals.h
   \brief This file defines some default values.
-  
+
   no Class is defined here.
 */
@@ -11,23 +11,24 @@
 #define ORXONOX_STAFF "Patrick Boenzli - Captain\n" \
                       "Benjamin Grauer - First Officer\n" \
-		      "Christian Meyer - Engeneer\n" \
-		      "Nico Bernold - Physics\n" \
-		      "David Gruetter - The ProtoType\n" \
-		      "many more\n" 
+                      "Christian Meyer - Engeneer\n" \
+                      "Nico Bernold - Physics\n" \
+                      "David Gruetter - The ProtoType\n" \
+                      "many more...\n"
 
-#define DEFAULT_CONFIG_FILE "~/.orxonox/orxonox.conf"
-#define DEFAULT_DATA_DIR "/usr/share/orxonox/data/"
-#define DEFAULT_DATA_DIR_CHECKFILE "data.oxd"
+#define   DEFAULT_CONFIG_FILE              "~/.orxonox/orxonox.conf"
+#define   DEFAULT_LOCK_FILE                "~/.orxonox/orxonox.lock"
+#define   DEFAULT_DATA_DIR                 "/usr/share/orxonox/data/"
+#define   DEFAULT_DATA_DIR_CHECKFILE       "data.oxd"
 
 // Defines all the Sections of the Config (in Gui and ORxonox)
 //! Name of Section Misc in the config-File
-#define CONFIG_SECTION_MISC "misc"
-#define CONFIG_SECTION_MISC_KEYS "miscKeys"
-#define CONFIG_SECTION_PLAYER "player"
-#define CONFIG_SECTION_VIDEO "video"
-#define CONFIG_SECTION_VIDEO_ADVANCED "video_advanced"
-#define CONFIG_SECTION_AUDIO "audio"
-#define CONFIG_SECTION_EXEC "exec"
-#define CONFIG_SECTION_DATA "data"
+#define   CONFIG_SECTION_MISC              "misc"
+#define   CONFIG_SECTION_MISC_KEYS         "miscKeys"
+#define   CONFIG_SECTION_PLAYER            "player"
+#define   CONFIG_SECTION_VIDEO             "video"
+#define   CONFIG_SECTION_VIDEO_ADVANCED    "video_advanced"
+#define   CONFIG_SECTION_AUDIO             "audio"
+#define   CONFIG_SECTION_EXEC              "exec"
+#define   CONFIG_SECTION_DATA              "data"
 
 /*
@@ -35,41 +36,42 @@
   Consider they may __not__ have any WhiteSpaces inside
 */
-#define CONFIG_NAME_DATADIR "DataDir"
-#define CONFIG_NAME_AUTO_UPDATE "Auto-Update"
-#define CONFIG_NAME_FULLSCREEN "Fullscreen-mode"
-#define CONFIG_NAME_RESOLUTION "Resolution"
-#define CONFIG_NAME_WIREFRAME "WireFrame-mode"
-#define CONFIG_NAME_SHADOWS "Shadows"
-#define CONFIG_NAME_FOG "Fog"
-#define CONFIG_NAME_REFLECTIONS "Reflections"
-#define CONFIG_NAME_TEXTURES "TEXTURES"
-#define CONFIG_NAME_TEXTURE_DETAIL "Texture-Detail"
-#define CONFIG_NAME_MODEL_DETAIL "Model-Detail"
-#define CONFIG_NAME_PARTICLES_ENABLED "Particles Enabled"
-#define CONFIG_NAME_ANTI_ALIASING "Anti-Aliasing"
-#define CONFIG_NAME_FILTER_METHOD "Filtering-Method"
-#define CONFIG_NAME_DISABLE_AUDIO "Disable-Audio"
-#define CONFIG_NAME_MUSIC_VOLUME "Music-Volume"
-#define CONFIG_NAME_EFFECTS_VOLUME "Effects-Volume"
-#define CONFIG_NAME_SAVE_SETTINGS "Save-Settings"
-#define CONFIG_NAME_VERBOSE_MODE "Verbose-Mode"
-#define CONFIG_NAME_ALWAYS_SHOW_GUI "Always-Show-The-Gui"
-#define CONFIG_NAME_PLAYER_UP "Up"
-#define CONFIG_NAME_PLAYER_DOWN "Down"
-#define CONFIG_NAME_PLAYER_LEFT "Left"
-#define CONFIG_NAME_PLAYER_RIGHT "Right"
-#define CONFIG_NAME_PLAYER_FIRE "Fire"
-#define CONFIG_NAME_PLAYER_NEXT_WEAPON "Next"
-#define CONFIG_NAME_PLAYER_PREV_WEAPON "Prev"
-#define CONFIG_NAME_QUIT "Quit"
-#define CONFIG_NAME_PAUSE "Pause"
-#define CONFIG_NAME_NEXT_WORLD "Next-World"
-#define CONFIG_NAME_PREV_WORLD "Prev-World"
-#define CONFIG_NAME_VIEW0 "view0"
-#define CONFIG_NAME_VIEW1 "view1"
-#define CONFIG_NAME_VIEW2 "view2"
-#define CONFIG_NAME_VIEW3 "view3"
-#define CONFIG_NAME_VIEW4 "view4"
-#define CONFIG_NAME_VIEW5 "view5"
+#define   CONFIG_NAME_DATADIR              "DataDir"
+#define   CONFIG_NAME_AUTO_UPDATE          "Auto-Update"
+#define   CONFIG_NAME_FULLSCREEN           "Fullscreen-mode"
+#define   CONFIG_NAME_RESOLUTION           "Resolution"
+#define   CONFIG_NAME_WIREFRAME            "WireFrame-mode"
+#define   CONFIG_NAME_SHADOWS              "Shadows"
+#define   CONFIG_NAME_FOG                  "Fog"
+#define   CONFIG_NAME_REFLECTIONS          "Reflections"
+#define   CONFIG_NAME_TEXTURES             "TEXTURES"
+#define   CONFIG_NAME_TEXTURE_DETAIL       "Texture-Detail"
+#define   CONFIG_NAME_MODEL_DETAIL         "Model-Detail"
+#define   CONFIG_NAME_PARTICLES_ENABLED    "Particles Enabled"
+#define   CONFIG_NAME_ANTI_ALIASING        "Anti-Aliasing"
+#define   CONFIG_NAME_FILTER_METHOD        "Filtering-Method"
+#define   CONFIG_NAME_DISABLE_AUDIO        "Disable-Audio"
+#define   CONFIG_NAME_MUSIC_VOLUME         "Music-Volume"
+#define   CONFIG_NAME_EFFECTS_VOLUME       "Effects-Volume"
+#define   CONFIG_NAME_SAVE_SETTINGS        "Save-Settings"
+#define   CONFIG_NAME_VERBOSE_MODE         "Verbose-Mode"
+#define   CONFIG_NAME_ALWAYS_SHOW_GUI      "Always-Show-The-Gui"
+// evenets
+#define   CONFIG_NAME_PLAYER_UP            "Up"
+#define   CONFIG_NAME_PLAYER_DOWN          "Down"
+#define   CONFIG_NAME_PLAYER_LEFT          "Left"
+#define   CONFIG_NAME_PLAYER_RIGHT         "Right"
+#define   CONFIG_NAME_PLAYER_FIRE          "Fire"
+#define   CONFIG_NAME_PLAYER_NEXT_WEAPON   "Next"
+#define   CONFIG_NAME_PLAYER_PREV_WEAPON   "Prev"
+#define   CONFIG_NAME_QUIT                 "Quit"
+#define   CONFIG_NAME_PAUSE                "Pause"
+#define   CONFIG_NAME_NEXT_WORLD           "Next-World"
+#define   CONFIG_NAME_PREV_WORLD           "Prev-World"
+#define   CONFIG_NAME_VIEW0                "view0"
+#define   CONFIG_NAME_VIEW1                "view1"
+#define   CONFIG_NAME_VIEW2                "view2"
+#define   CONFIG_NAME_VIEW3                "view3"
+#define   CONFIG_NAME_VIEW4                "view4"
+#define   CONFIG_NAME_VIEW5                "view5"
 
 
Index: orxonox/trunk/src/lib/graphics/graphics_engine.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/graphics_engine.cc	(revision 4765)
+++ orxonox/trunk/src/lib/graphics/graphics_engine.cc	(revision 4766)
@@ -92,5 +92,5 @@
   */
     // setting up the Resolution
-  this->setResolution(1000, 1000, 16);
+  this->setResolution(550, 400, 16);
 
   // TO DO: Create a cool icon and use it here
Index: orxonox/trunk/src/orxonox.cc
===================================================================
--- orxonox/trunk/src/orxonox.cc	(revision 4765)
+++ orxonox/trunk/src/orxonox.cc	(revision 4766)
@@ -43,4 +43,5 @@
 #include "cd_engine.h"
 
+#include "substring.h"
 #include "class_list.h"
 
@@ -59,9 +60,10 @@
 {
   this->setClassID(CL_ORXONOX, "Orxonox");
-  this->setName("orxonox");
+  this->setName("orxonox-main");
 
   this->resourceManager = NULL;
   this->objectManager = NULL;
   this->eventHandler = NULL;
+  this->iniParser = NULL;
 
   this->argc = 0;
@@ -74,6 +76,6 @@
 Orxonox::~Orxonox ()
 {
-  int i = 0;
-  Orxonox::singletonRef = NULL;
+  delete this->iniParser;
+
   delete GraphicsEngine::getInstance(); // deleting the Graphics
   delete TextEngine::getInstance();
@@ -84,31 +86,32 @@
   delete EventHandler::getInstance();
   delete Factory::getFirst();
+  delete SoundEngine::getInstance();
 
   ClassList::debug(0);
-}
-
-/** \brief this is a singleton class to prevent duplicates */
-Orxonox* Orxonox::singletonRef = 0;
-
-/**
-   \returns reference or new Object of Orxonox if not existent.
-*/
-Orxonox* Orxonox::getInstance ()
-{
-  if (singletonRef == NULL)
-    singletonRef = new Orxonox();
-  return singletonRef;
-}
-
-/**
-   \brief this finds the config file
-
-   Since the config file varies from user to user and since one may want to specify different config files
-   for certain occasions or platforms this function finds the right config file for every occasion and stores
-   it's path and name into configfilename
-*/
-void Orxonox::getConfigFile (int argc, char** argv)
-{
-  strcpy (configfilename, "~/.orxonox/orxonox.conf");
+
+  PRINT(3)("===================================================\n" \
+      "Thanks for playing orxonox.\n" \
+      "visit: http://www.orxonox.ethz.ch for new versions.\n" \
+      "===================================================\n");
+
+  Orxonox::singletonRef = NULL;
+}
+
+/**
+ * @brief this is a singleton class to prevent duplicates
+ */
+Orxonox* Orxonox::singletonRef = NULL;
+
+/**
+ * @brief this finds the config file
+ * @returns the new config-fileName
+ * Since the config file varies from user to user and since one may want to specify different config files
+ * for certain occasions or platforms this function finds the right config file for every occasion and stores
+ * it's path and name into configfilename
+*/
+const char* Orxonox::getConfigFile (int argc, char** argv)
+{
+  strcpy (this->configFileName, DEFAULT_CONFIG_FILE);
+  this->iniParser = new IniParser(this->configFileName);
 }
 
@@ -123,15 +126,14 @@
   // config file
 
-  getConfigFile (argc, argv);
+  // initialize the Config-file
+  this->getConfigFile(argc, argv);
+
+
   SDL_Init (SDL_INIT_TIMER);
   // initialize everything
-  printf("> Initializing resources\n");
   if( initResources () == -1) return -1;
-
   if( initVideo() == -1) return -1;
   if( initSound() == -1) return -1;
-  PRINT(3)("> Initializing input\n");
   if( initInput() == -1) return -1;
-  PRINT(3)("> Initializing networking\n");
   if( initNetworking () == -1) return -1;
   //printf("> Initializing world\n");
@@ -149,9 +151,15 @@
 
   GraphicsEngine::getInstance();
-  GraphicsEngine::getInstance()->setWindowName("orxonox " PACKAGE_VERSION, "orxonox " PACKAGE_VERSION);
-
-  return 0;
-}
-
+  GraphicsEngine::getInstance()->setWindowName(PACKAGE_NAME " " PACKAGE_VERSION, PACKAGE_NAME " " PACKAGE_VERSION);
+
+
+  SubString resolution(this->iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480"), 'x');
+  GraphicsEngine::getInstance()->setResolution(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16);
+
+//  const char* fullscreen = this->iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, 0);
+//  GraphicsEngine::getInstance()->setFullscreen(false);
+
+  return 0;
+}
 
 /**
@@ -168,8 +176,10 @@
 
 /**
-   \brief initializes input functions
+ * @brief initializes input functions
 */
 int Orxonox::initInput()
 {
+  PRINT(3)("> Initializing input\n");
+
   this->eventHandler = EventHandler::getInstance();
   this->eventHandler->init();
@@ -180,75 +190,76 @@
 
 /**
-   \brief initializes network system
+* @brief initializes network system
 */
 int Orxonox::initNetworking()
 {
-  printf("Not yet implemented\n");
-  return 0;
-}
-
-
-/**
-   \brief initializes and loads resource files
-*/
-int Orxonox::initResources()
-{
-   PRINT(3)("initializing ResourceManager\n");
-   resourceManager = ResourceManager::getInstance();
+  PRINT(3)("> Initializing networking\n");
+
+  printf("  ---Not yet implemented-FIXME--\n");
+  return 0;
+}
+
+
+/**
+ * @brief initializes and loads resource files
+ */
+ int Orxonox::initResources()
+{
+  PRINTF(3)("> Initializing resources\n");
+
+  PRINT(3)("initializing ResourceManager\n");
+  resourceManager = ResourceManager::getInstance();
 
   // create parser
-   IniParser parser (DEFAULT_CONFIG_FILE);
-   if( parser.getSection (CONFIG_SECTION_DATA) == -1)
-   {
-     PRINTF(1)("Could not find Section %s in %s\n", CONFIG_SECTION_DATA, DEFAULT_CONFIG_FILE);
-     return -1;
-   }
-   char namebuf[256];
-   char valuebuf[256];
-   memset (namebuf, 0, 256);
-   memset (valuebuf, 0, 256);
-
-   while( parser.nextVar (namebuf, valuebuf) != -1)
-   {
-     if (!strcmp(namebuf, CONFIG_NAME_DATADIR))
-     {
+  if( this->iniParser->getSection (CONFIG_SECTION_DATA) == -1)
+  {
+    PRINTF(1)("Could not find Section %s in %s\n", CONFIG_SECTION_DATA, DEFAULT_CONFIG_FILE);
+    return -1;
+  }
+  char namebuf[256];
+  char valuebuf[256];
+  memset (namebuf, 0, 256);
+  memset (valuebuf, 0, 256);
+
+  while( this->iniParser->nextVar (namebuf, valuebuf) != -1)
+  {
+    if (!strcmp(namebuf, CONFIG_NAME_DATADIR))
+    {
           //  printf("Not yet implemented\n");
-       if (!resourceManager->setDataDir(valuebuf))
-       {
-         PRINTF(1)("Data Could not be located\n");
-         exit(-1);
-       }
-     }
-
-     memset (namebuf, 0, 256);
-     memset (valuebuf, 0, 256);
-   }
-
-   if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
-   {
-     PRINTF(1)("The DataDirectory %s could not be verified\nPlease Change in File %s Section %s Entry %s to a suitable value\n",
-     resourceManager->getDataDir(),
-     DEFAULT_CONFIG_FILE,
-     CONFIG_SECTION_DATA,
-     CONFIG_NAME_DATADIR);
-     exit(-1);
-   }
+      if (!resourceManager->setDataDir(valuebuf))
+      {
+        PRINTF(1)("Data Could not be located\n");
+        exit(-1);
+      }
+    }
+
+    memset (namebuf, 0, 256);
+    memset (valuebuf, 0, 256);
+  }
+
+  if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
+  {
+    PRINTF(1)("The DataDirectory %s could not be verified\n" \
+              "  Please Change in File %s Section %s Entry %s to a suitable value\n",
+              resourceManager->getDataDir(),
+              DEFAULT_CONFIG_FILE,
+              CONFIG_SECTION_DATA,
+              CONFIG_NAME_DATADIR);
+    exit(-1);
+  }
    //! \todo this is a hack and should be loadable
-   resourceManager->addImageDir(ResourceManager::getInstance()->getFullName("maps/"));
-   resourceManager->debug();
-
-   PRINT(3)("initializing TextEngine\n");
-   TextEngine::getInstance();
-
-   PRINT(3)("initializing ObjectManager\n");
-   this->objectManager = ObjectManager::getInstance();
-
-   CDEngine::getInstance();
-
-   return 0;
-}
-
-
-
+  resourceManager->addImageDir(ResourceManager::getInstance()->getFullName("maps/"));
+  resourceManager->debug();
+
+  PRINT(3)("initializing TextEngine\n");
+  TextEngine::getInstance();
+
+  PRINT(3)("initializing ObjectManager\n");
+  this->objectManager = ObjectManager::getInstance();
+
+  CDEngine::getInstance();
+
+  return 0;
+}
 
 /**
@@ -299,4 +310,9 @@
 bool showGui = false;
 
+
+
+/**********************************
+*** ORXONOX MAIN STARTING POINT ***
+**********************************/
 /**
    \brief main function
@@ -306,5 +322,4 @@
 int main(int argc, char** argv)
 {
-
   // here the pre-arguments are loaded, these are needed to go either to orxonx itself, Help, or Benchmark.
   int i;
@@ -337,13 +352,19 @@
 
 
+
+/**
+ * starts orxonox
+ * @param argc parameters count given to orxonox
+ * @param argv parameters given to orxonox
+ */
 int startOrxonox(int argc, char** argv)
 {
   // checking for existence of the configuration-files
   if (showGui ||
-      !ResourceManager::isFile("~/.orxonox/orxonox.conf") ||
-      ResourceManager::isFile("~/.orxonox/orxonox.lock"))
-    {
-      if (ResourceManager::isFile("~/.orxonox/orxonox.lock"))
-        ResourceManager::deleteFile("~/.orxonox/orxonox.lock");
+      !ResourceManager::isFile(DEFAULT_CONFIG_FILE) ||
+      ResourceManager::isFile(DEFAULT_LOCK_FILE))
+    {
+      if (ResourceManager::isFile(DEFAULT_LOCK_FILE))
+        ResourceManager::deleteFile(DEFAULT_LOCK_FILE);
 
       // starting the GUI
@@ -359,5 +380,5 @@
   PRINT(0)(">>> Starting Orxonox <<<\n");
 
-  ResourceManager::touchFile("~/.orxonox/orxonox.lock");
+  ResourceManager::touchFile(DEFAULT_LOCK_FILE);
 
   Orxonox *orx = Orxonox::getInstance();
Index: orxonox/trunk/src/orxonox.h
===================================================================
--- orxonox/trunk/src/orxonox.h	(revision 4765)
+++ orxonox/trunk/src/orxonox.h	(revision 4766)
@@ -1,6 +1,6 @@
-/*! 
+/*!
     \file orxonox.h
     \brief Orxonox core functions
-*/ 
+*/
 
 #ifndef _ORXONOX_H
@@ -15,4 +15,5 @@
 class EventHandler;
 class Event;
+class IniParser;
 
 //! Orxonox core singleton class
@@ -22,6 +23,8 @@
 
  public:
-  static Orxonox* getInstance ();
   virtual ~Orxonox ();
+  /** \returns a Pointer to the only object of this Class */
+  inline static Orxonox* getInstance() { if (!singletonRef) singletonRef = new Orxonox();  return singletonRef; };
+
   int init (int argc, char** argv);
 
@@ -34,4 +37,6 @@
   Orxonox ();
 
+  void parseIniFile(const char* fileName);
+
   int initVideo ();
   int initSound ();
@@ -40,15 +45,16 @@
   int initResources ();
 
-  void getConfigFile (int argc, char** argv);
+  const char* getConfigFile (int argc, char** argv);
 
  private:
   static Orxonox*   singletonRef;            //!< singleton reference to orxonox
 
-  char              configfilename[256];     //!< Filename of the configuration-file.
+  IniParser*        iniParser;               //!< Reference to the ini-parser used in orxonox
+  char              configFileName[256];     //!< Filename of the configuration-file.
   GameLoader*       gameLoader;              //!< The gameLoader
   ResourceManager*  resourceManager;         //!< The ResourceManager
   ObjectManager*    objectManager;           //!< the object manager of the game
   EventHandler*     eventHandler;            //!< the eventhandler of orxonox is created here
-  
+
   unsigned int      argc;                    //!< Count of Arguments of orxonox
   char**            argv;                    //!< Values of th Arguments of orxonox.
