Index: branches/preferences/src/Makefile.am
===================================================================
--- branches/preferences/src/Makefile.am	(revision 6381)
+++ branches/preferences/src/Makefile.am	(revision 6383)
@@ -40,4 +40,5 @@
                 lib/parser/tinyxml/libtinyxml.a \
                 lib/parser/ini_parser/libIniParser.a \
+                lib/parser/preferences/libPrefsParser.a \
                 lib/gui/gl_gui/libORXglgui.a \
                 lib/shell/libORXshell.a \
Index: branches/preferences/src/lib/Makefile.am
===================================================================
--- branches/preferences/src/lib/Makefile.am	(revision 6381)
+++ branches/preferences/src/lib/Makefile.am	(revision 6383)
@@ -72,5 +72,5 @@
           particles \
           collision_detection \
-	  network \
+	  			network \
           parser \
           shell \
Index: branches/preferences/src/lib/parser/Makefile.am
===================================================================
--- branches/preferences/src/lib/parser/Makefile.am	(revision 6381)
+++ branches/preferences/src/lib/parser/Makefile.am	(revision 6383)
@@ -1,5 +1,6 @@
 SUBDIRS = \
           tinyxml \
-	  ini_parser
+	  			ini_parser \
+	  			preferences
 
 
Index: branches/preferences/src/lib/parser/preferences/Makefile.am
===================================================================
--- branches/preferences/src/lib/parser/preferences/Makefile.am	(revision 6383)
+++ branches/preferences/src/lib/parser/preferences/Makefile.am	(revision 6383)
@@ -0,0 +1,14 @@
+
+noinst_LIBRARIES = libPrefsParser.a
+
+libPrefsParser_a_SOURCES = \
+								cmd_line_prefs_reader.cc \
+								ini_file_prefs_reader.cc
+
+
+noinst_HEADERS = \
+								cmd_line_prefs_reader.h \
+								ini_file_prefs_reader.h
+
+
+
Index: branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.cc
===================================================================
--- branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.cc	(revision 6383)
+++ branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.cc	(revision 6383)
@@ -0,0 +1,44 @@
+/*
+   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: Christoph Renner
+   co-programmer: ...
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "cmd_line_prefs_reader.h"
+
+using namespace std;
+
+
+/**
+ * standard constructor
+*/
+CmdLinePrefsReader::CmdLinePrefsReader ()
+{
+}
+
+
+/**
+ * standard deconstructor
+*/
+CmdLinePrefsReader::~CmdLinePrefsReader ()
+{
+}
+
+/**
+ * reads the commandline arguments and stores them in Preferences
+ * @return true if commanline arguments have been interpreted correctly
+ */
+bool CmdLinePrefsReader::readCmdLine()
+{
+}
Index: branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.h
===================================================================
--- branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.h	(revision 6383)
+++ branches/preferences/src/lib/parser/preferences/cmd_line_prefs_reader.h	(revision 6383)
@@ -0,0 +1,22 @@
+/*!
+ * @file proto_class.h
+ * @brief Definition of CmdLinePrefsReader
+*/
+
+#ifndef _CMD_LINE_PREFS_READER_H
+#define _CMD_LINE_PREFS_READER_H
+
+//! A class for reading commandline arguments into Preferences
+class CmdLinePrefsReader {
+
+ public:
+   CmdLinePrefsReader();
+   virtual ~CmdLinePrefsReader();
+
+   bool readCmdLine();
+
+ private:
+
+};
+
+#endif /* _PROTO_CLASS_H */
Index: branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.cc
===================================================================
--- branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.cc	(revision 6383)
+++ branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.cc	(revision 6383)
@@ -0,0 +1,60 @@
+/*
+   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: Christoph Renner
+   co-programmer: ...
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "ini_file_prefs_reader.h"
+
+using namespace std;
+
+
+/**
+ * standard constructor
+*/
+IniFilePrefsReader::IniFilePrefsReader ()
+{
+}
+
+
+/**
+ * standard deconstructor
+*/
+IniFilePrefsReader::~IniFilePrefsReader ()
+{
+}
+
+/**
+ * reads entries from inifile fileName into Preferences
+ * @param fileName filename of inifile to read
+ * @return true on success
+ */
+bool IniFilePrefsReader::readIniFile( const char * fileName )
+{
+  IniParser iniParser;
+
+  if ( !iniParser.readFile( fileName ) )
+    return false;
+
+  iniParser.firstVar();
+
+  Preferences* prefs = Preferences::getInstance();
+
+  while ( iniParser.nextVar() )
+  {
+    prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue() );
+  }
+
+  return true;
+}
Index: branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.h
===================================================================
--- branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.h	(revision 6383)
+++ branches/preferences/src/lib/parser/preferences/ini_file_prefs_reader.h	(revision 6383)
@@ -0,0 +1,26 @@
+/*!
+ * @file ini_file_prefs_reader.h
+ * @brief Definition of IniFilePrefsReader
+*/
+
+#ifndef _INI_FILE_PREFS_READER_H
+#define _INI_FILE_PREFS_READER_H
+
+#include "src/lib/parser/ini_parser/ini_parser.h"
+#include "src/lib/util/preferences.h"
+
+
+//! A class for reading inifiles into Preferences
+class IniFilePrefsReader {
+
+ public:
+   IniFilePrefsReader();
+   virtual ~IniFilePrefsReader();
+
+   bool readIniFile(const char* fileName);
+
+ private:
+
+};
+
+#endif /* _INI_FILE_PREFS_READER_H */
Index: branches/preferences/src/lib/util/preferences.cc
===================================================================
--- branches/preferences/src/lib/util/preferences.cc	(revision 6381)
+++ branches/preferences/src/lib/util/preferences.cc	(revision 6383)
@@ -59,5 +59,5 @@
       std::list<prefItem>::const_iterator it2 = it->items.begin();
 
-      for ( ; it2!=it->items.begin(); it2++)
+      for ( ; it2!=it->items.end(); it2++)
       {
         if ( strcmp(it2->name, name) == 0 )
@@ -157,5 +157,5 @@
       std::list<prefItem>::iterator it2 = it->items.begin();
 
-      for ( ; it2!=it->items.begin(); it2++)
+      for ( ; it2!=it->items.end(); it2++)
       {
         if ( strcmp(it2->name, name) == 0 )
@@ -203,5 +203,5 @@
       std::list<prefItem>::const_iterator it2 = it->items.begin();
 
-      for ( ; it2!=it->items.begin(); it2++)
+      for ( ; it2!=it->items.end(); it2++)
       {
         if ( strcmp(it2->name, name) == 0 )
@@ -230,5 +230,5 @@
     std::list<prefItem>::iterator it2 = it->items.begin();
 
-    for ( ; it2!=it->items.begin(); it2++)
+    for ( ; it2!=it->items.end(); it2++)
     {
       PRINTF(0)("--> %s = '%s'\n", it2->name, it2->value.getString());
