Index: orxonox/trunk/src/Makefile.am
===================================================================
--- orxonox/trunk/src/Makefile.am	(revision 3868)
+++ orxonox/trunk/src/Makefile.am	(revision 3869)
@@ -19,4 +19,5 @@
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/util
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/animation
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/common
 
 
@@ -32,5 +33,5 @@
 		 command_node.cc \
 		 keynames.cc \
-		 camera.cc \
+		 world_entities/camera.cc \
 		 track_manager.cc \
 		 track_node.cc \
@@ -71,6 +72,6 @@
 		 lib/lang/base_object.cc \
 		 lib/util/ini_parser.cc \
-		 lib/util/list.cc \
-		 lib/util/resource_manager.cc \
+		 util/common/list.cc \
+		 util/resource_manager.cc \
 		 lib/math/vector.cc \
 		 lib/math/curve.cc \
@@ -81,5 +82,5 @@
 		 track_manager.h \
                  ability.h \
-		 camera.h \
+		 world_entities/camera.h \
 		 keynames.h \
 		 command_node.h \
@@ -127,7 +128,7 @@
 		 lib/lang/base_entity.h \
 		 lib/lang/base_object.h \
-		 lib/util/list.h \
-		 lib/util/list_template.h \
-		 lib/util/resource_manager.h \
+		 util/common/list.h \
+		 util/common/list_template.h \
+		 util/resource_manager.h \
 		 lib/util/ini_parser.h \
 		 lib/math/vector.h \
Index: orxonox/trunk/src/Makefile.in
===================================================================
--- orxonox/trunk/src/Makefile.in	(revision 3868)
+++ orxonox/trunk/src/Makefile.in	(revision 3869)
@@ -237,5 +237,5 @@
 target_vendor = @target_vendor@
 MAINSRCDIR = .
-AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation
+AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common
 AM_LDFLAGS = $(MWINDOWS)
 orxonox_SOURCES = orxonox.cc \
@@ -243,5 +243,5 @@
 		 command_node.cc \
 		 keynames.cc \
-		 camera.cc \
+		 world_entities/camera.cc \
 		 track_manager.cc \
 		 track_node.cc \
@@ -282,6 +282,6 @@
 		 lib/lang/base_object.cc \
 		 lib/util/ini_parser.cc \
-		 lib/util/list.cc \
-		 lib/util/resource_manager.cc \
+		 util/common/list.cc \
+		 util/resource_manager.cc \
 		 lib/math/vector.cc \
 		 lib/math/curve.cc \
@@ -292,5 +292,5 @@
 		 track_manager.h \
                  ability.h \
-		 camera.h \
+		 world_entities/camera.h \
 		 keynames.h \
 		 command_node.h \
@@ -338,7 +338,7 @@
 		 lib/lang/base_entity.h \
 		 lib/lang/base_object.h \
-		 lib/util/list.h \
-		 lib/util/list_template.h \
-		 lib/util/resource_manager.h \
+		 util/common/list.h \
+		 util/common/list_template.h \
+		 util/resource_manager.h \
 		 lib/util/ini_parser.h \
 		 lib/math/vector.h \
@@ -490,4 +490,20 @@
 @am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
+camera.o: world_entities/camera.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT camera.o -MD -MP -MF "$(DEPDIR)/camera.Tpo" -c -o camera.o `test -f 'world_entities/camera.cc' || echo '$(srcdir)/'`world_entities/camera.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/camera.Tpo" "$(DEPDIR)/camera.Po"; else rm -f "$(DEPDIR)/camera.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/camera.cc' object='camera.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/camera.Po' tmpdepfile='$(DEPDIR)/camera.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o camera.o `test -f 'world_entities/camera.cc' || echo '$(srcdir)/'`world_entities/camera.cc
+
+camera.obj: world_entities/camera.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT camera.obj -MD -MP -MF "$(DEPDIR)/camera.Tpo" -c -o camera.obj `if test -f 'world_entities/camera.cc'; then $(CYGPATH_W) 'world_entities/camera.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/camera.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/camera.Tpo" "$(DEPDIR)/camera.Po"; else rm -f "$(DEPDIR)/camera.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/camera.cc' object='camera.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/camera.Po' tmpdepfile='$(DEPDIR)/camera.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o camera.obj `if test -f 'world_entities/camera.cc'; then $(CYGPATH_W) 'world_entities/camera.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/camera.cc'; fi`
+
 animation.o: util/animation/animation.cc
 @am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT animation.o -MD -MP -MF "$(DEPDIR)/animation.Tpo" -c -o animation.o `test -f 'util/animation/animation.cc' || echo '$(srcdir)/'`util/animation/animation.cc; \
@@ -1050,35 +1066,35 @@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ini_parser.obj `if test -f 'lib/util/ini_parser.cc'; then $(CYGPATH_W) 'lib/util/ini_parser.cc'; else $(CYGPATH_W) '$(srcdir)/lib/util/ini_parser.cc'; fi`
 
-list.o: lib/util/list.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT list.o -MD -MP -MF "$(DEPDIR)/list.Tpo" -c -o list.o `test -f 'lib/util/list.cc' || echo '$(srcdir)/'`lib/util/list.cc; \
+list.o: util/common/list.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT list.o -MD -MP -MF "$(DEPDIR)/list.Tpo" -c -o list.o `test -f 'util/common/list.cc' || echo '$(srcdir)/'`util/common/list.cc; \
 @am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/list.Tpo" "$(DEPDIR)/list.Po"; else rm -f "$(DEPDIR)/list.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/util/list.cc' object='list.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/common/list.cc' object='list.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/list.Po' tmpdepfile='$(DEPDIR)/list.TPo' @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o list.o `test -f 'lib/util/list.cc' || echo '$(srcdir)/'`lib/util/list.cc
-
-list.obj: lib/util/list.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT list.obj -MD -MP -MF "$(DEPDIR)/list.Tpo" -c -o list.obj `if test -f 'lib/util/list.cc'; then $(CYGPATH_W) 'lib/util/list.cc'; else $(CYGPATH_W) '$(srcdir)/lib/util/list.cc'; fi`; \
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o list.o `test -f 'util/common/list.cc' || echo '$(srcdir)/'`util/common/list.cc
+
+list.obj: util/common/list.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT list.obj -MD -MP -MF "$(DEPDIR)/list.Tpo" -c -o list.obj `if test -f 'util/common/list.cc'; then $(CYGPATH_W) 'util/common/list.cc'; else $(CYGPATH_W) '$(srcdir)/util/common/list.cc'; fi`; \
 @am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/list.Tpo" "$(DEPDIR)/list.Po"; else rm -f "$(DEPDIR)/list.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/util/list.cc' object='list.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/common/list.cc' object='list.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/list.Po' tmpdepfile='$(DEPDIR)/list.TPo' @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o list.obj `if test -f 'lib/util/list.cc'; then $(CYGPATH_W) 'lib/util/list.cc'; else $(CYGPATH_W) '$(srcdir)/lib/util/list.cc'; fi`
-
-resource_manager.o: lib/util/resource_manager.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.o -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.o `test -f 'lib/util/resource_manager.cc' || echo '$(srcdir)/'`lib/util/resource_manager.cc; \
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o list.obj `if test -f 'util/common/list.cc'; then $(CYGPATH_W) 'util/common/list.cc'; else $(CYGPATH_W) '$(srcdir)/util/common/list.cc'; fi`
+
+resource_manager.o: util/resource_manager.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.o -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.o `test -f 'util/resource_manager.cc' || echo '$(srcdir)/'`util/resource_manager.cc; \
 @am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/util/resource_manager.cc' object='resource_manager.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/resource_manager.cc' object='resource_manager.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.o `test -f 'lib/util/resource_manager.cc' || echo '$(srcdir)/'`lib/util/resource_manager.cc
-
-resource_manager.obj: lib/util/resource_manager.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.obj -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.obj `if test -f 'lib/util/resource_manager.cc'; then $(CYGPATH_W) 'lib/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/lib/util/resource_manager.cc'; fi`; \
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.o `test -f 'util/resource_manager.cc' || echo '$(srcdir)/'`util/resource_manager.cc
+
+resource_manager.obj: util/resource_manager.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.obj -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.obj `if test -f 'util/resource_manager.cc'; then $(CYGPATH_W) 'util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/util/resource_manager.cc'; fi`; \
 @am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/util/resource_manager.cc' object='resource_manager.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='util/resource_manager.cc' object='resource_manager.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.obj `if test -f 'lib/util/resource_manager.cc'; then $(CYGPATH_W) 'lib/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/lib/util/resource_manager.cc'; fi`
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.obj `if test -f 'util/resource_manager.cc'; then $(CYGPATH_W) 'util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/util/resource_manager.cc'; fi`
 
 vector.o: lib/math/vector.cc
@@ -1252,5 +1268,5 @@
 
 distdir: $(DISTFILES)
-	$(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/util/animation $(distdir)/world_entities
+	$(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
Index: orxonox/trunk/src/camera.cc
===================================================================
--- orxonox/trunk/src/camera.cc	(revision 3868)
+++ 	(revision )
@@ -1,199 +1,0 @@
-
-
-/* 
-   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: Christian Meyer
-   co-programmer: ...
-*/
-
-#include "camera.h"
-
-#include "world.h"
-#include "world_entity.h"
-#include "vector.h"
-
-using namespace std;
-
-////////////
-// CAMERA //
-////////////
-
-/**
-   \brief creates a Camera
-*/
-Camera::Camera(void)
-{
-  this->setClassName("Camera");
-  this->target = new CameraTarget();
-
-  this->setFovy(90);
-  this->setAspectRatio(1.2f);
-  this->setClipRegion(.1, 2000);
-
-  this->setViewMode(VIEW_NORMAL);
-}
-
-/**
-   \brief default destructor
-*/
-Camera::~Camera(void)
-{
-}
-
-/**
-   \brief focuses the Camera onto a Target
-   \param target the new PNode the Camera should look at.
-*/
-void Camera::lookAt(PNode* target)
-{
-  this->target->setParent(target);
-}
-
-/**
-   \returns The PNode of the Target (from there you can get position and so on
-*/
-PNode* Camera::getTarget(void)
-{
-  return (PNode*)this->target;
-}
-
-
-/**
-   \brief sets a new AspectRatio
-   \param aspectRatio the new aspect ratio to set (width / height)
-*/
-void Camera::setAspectRatio(float aspectRatio)
-{
-  this->aspectRatio = aspectRatio;
-}
-
-/**
-   \brief sets the Field of View to fofy
-   \param fovy new field of view factor (in degrees)
-*/
-void Camera::setFovy(float fovy)
-{
-  this->fovy = fovy;
-}
-
-/**
-  \brief Sets a new clipping region
-  \param nearClip The near clip plane
-  \param farClip The far clip plane
-*/
-void Camera::setClipRegion(float nearClip, float farClip)
-{
-  this->nearClip = nearClip;
-  this->farClip = farClip;
-}
-
-void Camera::setViewMode(ViewMode mode)
-{
-  switch (mode)
-    {
-    default:
-    case VIEW_NORMAL:
-      this->toFovy = 60.0;
-      this->toRelCoor = Vector(-10, 5, 0);
-      break;
-    case VIEW_BEHIND:
-      this->toFovy = 120.0;
-      this->toRelCoor = Vector(-7, 0, 0);
-      break;
-    case VIEW_FRONT:
-      this->toFovy = 95.0;
-      this->toRelCoor = Vector(12, 5, 0);
-      break;
-    case VIEW_LEFT: 
-      this->toFovy = 90;
-      this->toRelCoor = Vector(0, 2, -10);
-      break;
-    case VIEW_RIGHT:
-      this->toFovy = 90;
-      this->toRelCoor = Vector(0, 2, 10);
-      break;
-    case VIEW_TOP:
-      this->toFovy= 120;
-      this->toRelCoor = Vector(0, 4, 0);
-    }
-}
-
-
-/**
-   \brief Updates the position of the camera.
-   \param dt The time that elapsed.
-*/
-void Camera::tick(float dt)
-{
-  dt /= 500;
-  float tmpFovy = (this->toFovy - this->fovy) * dt;
-  if (tmpFovy > .001)
-    this->fovy += (this->toFovy - this->fovy) * dt;
-  Vector tmpPos = (this->toRelCoor - *this->getRelCoor()) * dt;
-  if (tmpPos.len() >= .001)
-    {
-      tmpPos = tmpPos + *this->getRelCoor();
-      this->setRelCoor(tmpPos);
-    }
-}
-
-
-/**
-   \brief initialize rendering perspective according to this camera
-   
-   This is called immediately before the rendering cycle starts, it sets all global
-   rendering options as well as the GL_PROJECTION matrix according to the camera.
-*/
-void Camera::apply ()
-{
-  // switching to Projection Matrix
-  glMatrixMode (GL_PROJECTION);
-  glLoadIdentity ();
-
-  // setting up the perspective
-  gluPerspective(this->fovy,
-		 this->aspectRatio,
-		 this->nearClip,
-		 this->farClip);
-
-  // speed-up feature
-  Vector cameraPosition = this->getAbsCoor();
-  Vector targetPosition = this->target->getAbsCoor();
-  Vector up = Vector(0, 1, 0);
-  up = this->getAbsDir().apply(up);
-
-  // Setting the Camera Eye, lookAt and up Vectors
-  gluLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z,
-	    targetPosition.x, targetPosition.y, targetPosition.z,
-	    up.x, up.y, up.z);
-
-  // switching back to Modeling Matrix
-  glMatrixMode (GL_MODELVIEW);
-}
-
-
-
-///////////////////
-// CAMERA-TARGET //
-///////////////////
-
-
-CameraTarget::CameraTarget()
-{
-  this->setClassName("CameraTarget");
-  this->setMode(PNODE_MOVEMENT);
-}
-
-CameraTarget::~CameraTarget()
-{
-
-}
Index: orxonox/trunk/src/camera.h
===================================================================
--- orxonox/trunk/src/camera.h	(revision 3868)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*! 
-    \file camera.h
-    \brief Viewpoint controlling class definitions
-*/ 
-
-#ifndef _CAMERA_H
-#define _CAMERA_H
-
-#include "p_node.h"
-#include "vector.h"
-
-class World;
-class CameraTarget;
-
-enum ViewMode{VIEW_NORMAL, VIEW_BEHIND, VIEW_FRONT, VIEW_LEFT, VIEW_RIGHT, VIEW_TOP};
-
-//! Camera
-/**
-   This class controls the viewpoint from which the World is rendered.
-*/
-class Camera : public PNode 
-{
- private:
-  CameraTarget* target;            //!< The Target of the Camera (where this Camera Looks at)
-
-  float fovy;                      //!< The field of view Angle (in degrees).
-  float aspectRatio;               //!< The aspect ratio (width / height).
-  float nearClip;                  //!< The near clipping plane.
-  float farClip;                   //!< The far clipping plane.
-
-  Vector toRelCoor;
-  float toFovy;
-  
- public:
-  Camera(void);
-  virtual ~Camera(void);
-
-  void lookAt(PNode* target);
-  PNode* getTarget();
-
-  void setAspectRatio(float aspectRatio);
-  void setFovy(float fovy);
-  void setClipRegion(float nearClip, float farClip);
-
-  void setViewMode(ViewMode mode);
-  void tick(float dt);
-  void apply (void);
-};
-
-//! A CameraTarget is where the Camera is looking at.
-class CameraTarget : public PNode 
-{
-  friend class Camera;             //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it.
-  
- private:
-  CameraTarget(void);
-  
- public:
-  virtual ~CameraTarget(void);
-};
-
-
-#endif /* _CAMERA_H */
Index: orxonox/trunk/src/lib/util/list.cc
===================================================================
--- orxonox/trunk/src/lib/util/list.cc	(revision 3868)
+++ 	(revision )
@@ -1,148 +1,0 @@
-
-
-/* 
-   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: Patrick Boenzli
-   co-programmer: ...
-*/
-
-
-#include "list.h"
-#include "world_entity.h"
-
-using namespace std;
-
-
-
-List::List () 
-{
-  this->first = NULL;
-  this->last = NULL;
-  this->size = 0;
-}
-
-List::~List () 
-{}
-
-
-void List::add(WorldEntity* entity)
-{
-  printf("List::add() \n");
-  listElement* el = new listElement;
-  el->prev = this->last;
-  el->curr = entity;
-  el->next = NULL;
-
-  this->last = el;
-
-  if(this->size == 0) this->first = el;
-  else el->prev->next = el;
-  this->size++;
-}
-
-
-void List::remove(WorldEntity* entity)
-{
-  this->currentEl = this->first;
-  listElement* te;
-  while( this->currentEl != NULL)
-    {
-      if( this->currentEl->curr == entity)
-	{
-	  printf("List::remove() - object found\n");
-	  
-	  if( this->currentEl->prev  == NULL ) this->first = this->currentEl->next;
-	  else this->currentEl->prev->next = this->currentEl->next;
-
-	  if( this->currentEl->next == NULL) this->last = this->currentEl->prev;
-	  else this->currentEl->next->prev = this->currentEl->prev;
-
-	  te = this->currentEl->next;
-	  delete this->currentEl;
-	  this->currentEl = te;
-	  return;
-	}
-      this->currentEl = this->currentEl->next;
-    }
-}
-
-
-void List::destroy()
-{
-  printf("List::clear() - clearing all world objects, releasing mem\n");
-  this->currentEl = this->first;
-  listElement* le = NULL;
-  while(this->currentEl != NULL)
-    {
-      le = this->currentEl->next;
-      delete this->currentEl->curr;
-      delete this->currentEl;
-      this->currentEl = le;
-    }
-  this->first = NULL;
-  this->last = NULL;
-  this->size = 0;
-}
-
-
-WorldEntity* List::firstElement()
-{
-  return this->first->curr;
-}
-
-
-bool List::isEmpty()
-{
-  return (this->size==0)?true:false;
-}
-
-
-int List::getSize()
-{
-  return this->size;
-}
-
-
-WorldEntity* List::enumerate()
-{
-  if(this->size == 0) return NULL;
-  this->currentEl = this->first;
-  return this->currentEl->curr;
-}
-
-
-WorldEntity* List::nextElement()
-{
-  if(this->size == 0) return NULL;
-  this->currentEl = this->currentEl->next;
-  if(this->currentEl == NULL) return NULL;
-  return this->currentEl->curr;
-}
-
-
-WorldEntity* List::toArray()
-{}
-
-
-void List::debug()
-{
-  int counter = 1;
-  this->currentEl = this->first;
-  printf("List:debug() =====================\n");
-  while(this->currentEl != NULL)
-    {
-      printf("element: nr %d/%d\n", counter, size);
-      this->currentEl = this->currentEl->next;
-      counter++;
-    }
-  printf("List:debug()END =====================\n");
-}
Index: orxonox/trunk/src/lib/util/list.h
===================================================================
--- orxonox/trunk/src/lib/util/list.h	(revision 3868)
+++ 	(revision )
@@ -1,297 +1,0 @@
-
-#ifndef _LIST_H
-#define _LIST_H
-
-#include "compiler.h"
-#ifndef NULL
-#define NULL 0
-#endif
-
-//! An enum to list all the modes available when adding an object to a List
-//enum ADDMODE {LIST_ADD_FIRST, LIST_ADD_LAST};
-//! An enum to list the two searching directions available when removing an object from a List
-//enum FINDMODE {LIST_FIND_BW, LIST_FIND_FW};
-
-
-
-class WorldEntity;
-
-class List {
-
- public:
-  List ();
-  ~List ();
-
-  void add(WorldEntity* entity);
-  void remove(WorldEntity* entity);
-  void destroy();
-  WorldEntity* firstElement();
-  bool isEmpty();
-  int getSize();
-  WorldEntity* enumerate();
-  WorldEntity* nextElement();
-  WorldEntity* toArray();
-  void debug();
-
- private:
-  struct listElement
-  {
-    listElement* prev;
-    WorldEntity* curr;
-    listElement* next;
-  };
-  unsigned int size;
-  listElement* first;
-  listElement* last;
-  listElement* currentEl;
-
-
-};
-
-
-
-template<class T> struct listElement
-{
-  listElement* prev;
-  T* curr;
-  listElement* next;
-};
-
-template<class T> class tIterator
-{
- public:
-  tIterator(listElement<T>* startElement);
-  ~tIterator();
-  
-  T* nextElement();
-
- private:
-  listElement<T>* currentEl;
-  listElement<T>* tmpEl;
-};
-
-
-template<class T>
-inline tIterator<T>::tIterator (listElement<T>* startElement) 
-{
-  this->currentEl = startElement;
-  this->tmpEl = NULL;
-}
-
-
-template<class T>
-inline tIterator<T>::~tIterator ()
-{
-  this->currentEl = NULL;
-}
-
-
-template<class T>
-inline T* tIterator<T>::nextElement ()
-{
-  if( this->currentEl == NULL)
-    return NULL;
-
-  this->tmpEl = this->currentEl;
-  this->currentEl = this->currentEl->next;
-  return this->tmpEl->curr;
-}
-
-
-
-template<class T> class tList 
-{
- public:
-  tList ();
-  ~tList ();
-
-  void add(T* entity);
-  void remove(T* entity);
-  void destroy();
-  T* firstElement();
-  T* lastElement();
-  bool isEmpty();
-  int getSize();
-  //T* enumerate();
-  tIterator<T>* getIterator();
-  T* nextElement();
-  T* nextElement(T* toEntity);
-  T* toArray();
-  void debug();
-
- private:
-  unsigned int size;
-  listElement<T>* first;
-  listElement<T>* last;
-  listElement<T>* currentEl;
-};
-
-
-template<class T>
-inline tList<T>::tList () 
-{
-  this->first = NULL;
-  this->last = NULL;
-  this->size = 0;
-}
-
-template<class T>
-inline tList<T>::~tList () 
-{
-  this->currentEl = this->first;
-  while(this->currentEl != NULL)
-    {
-      listElement<T>* le = this->currentEl->next;
-      //delete this->currentEl->curr;
-      delete this->currentEl;
-      this->currentEl = le;
-    }
-  this->first = NULL;
-  this->last = NULL;
-  this->size = 0;
-}
-
-
-template<class T>
-inline void tList<T>::add(T* entity)
-{
-  if( unlikely(entity == NULL)) return;
-  listElement<T>* el = new listElement<T>;
-  el->prev = this->last;
-  el->curr = entity;
-  el->next = NULL;
-
-  this->last = el;
-
-  if( unlikely(el->prev == NULL)) this->first = el; /* if first element */
-  else el->prev->next = el;
-  this->size++;
-}
-
-
-template<class T>
-inline void tList<T>::remove(T* entity)
-{
-  this->currentEl = this->first;
-  listElement<T>* te;
-  while( this->currentEl != NULL)
-    {
-      if( unlikely(this->currentEl->curr == entity))
-	{ 
-	  if( unlikely(this->currentEl->prev  == NULL)) this->first = this->currentEl->next;
-	  else this->currentEl->prev->next = this->currentEl->next;
-
-	  if( unlikely(this->currentEl->next == NULL)) this->last = this->currentEl->prev;
-	  else this->currentEl->next->prev = this->currentEl->prev;
-
-	  delete this->currentEl;
-	  this->size--;
-	  return;
-	}
-      this->currentEl = this->currentEl->next;
-    }
-}
-
-
-template<class T>
-inline void tList<T>::destroy()
-{
-  this->currentEl = this->first;
-  while(this->currentEl != NULL)
-    {
-      listElement<T>* le = this->currentEl->next;
-      //delete this->currentEl->curr;
-      delete this->currentEl;
-      this->currentEl = le;
-    }
-  this->first = NULL;
-  this->last = NULL;
-  this->size = 0;
-}
-
-
-template<class T>
-inline T* tList<T>::firstElement()
-{
-  return this->first->curr;
-}
-
-
-template<class T>
-inline T* tList<T>::lastElement()
-{
-  return this->last->curr;
-}
-
-
-template<class T>
-inline bool tList<T>::isEmpty()
-{
-  return (this->size==0)?true:false;
-}
-
-
-template<class T>
-inline int tList<T>::getSize()
-{
-  return this->size;
-}
-
-
-/* deprecated */
-/*
-template<class T>
-T* tList<T>::enumerate()
-{
-  //if( this->last == this->first == NULL) return NULL;
-  if( this->size == 0) return NULL;
-  this->currentEl = this->first;
-  return this->currentEl->curr;
-}
-*/
-
-template<class T>
-inline tIterator<T>* tList<T>::getIterator()
-{
-  tIterator<T>* iterator = new tIterator<T>(this->first);
-  return iterator;
-}
-
-
-/* deprecated */
-template<class T>
-T* tList<T>::nextElement()
-{
-  // if( this->last == this->first == NULL) return NULL;
-  if( this->size == 0) return NULL;
-  this->currentEl = this->currentEl->next;
-  if( this->currentEl == NULL) return NULL;
-  return this->currentEl->curr;
-}
-
-
-/**
-   \brief this returns the next element after toEntity or the first if toEntity is last
-*/
-template<class T>
-inline T* tList<T>::nextElement(T* toEntity)
-{
-  //if( this->last == this->first == NULL) return NULL;
-  if(this->size == 0) return NULL;
-  if( toEntity == NULL) return this->first->curr;
-  if( toEntity == this->last->curr ) return this->first->curr;
-  this->currentEl = this->first;
-  while(this->currentEl->curr != toEntity && this->currentEl->next != NULL)
-    {
-      this->currentEl = this->currentEl->next;
-    }
-  if(this->currentEl == NULL) return NULL;
-  return this->currentEl->next->curr;
-}
-
-
-template<class T>
-T* tList<T>::toArray()
-{}
-
-#endif /* _LIST_H */
Index: orxonox/trunk/src/lib/util/list_template.h
===================================================================
--- orxonox/trunk/src/lib/util/list_template.h	(revision 3868)
+++ 	(revision )
@@ -1,308 +1,0 @@
-/* 
-   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: Christian Meyer
-
-   ADDONS/FIXES:
-  
-   Patrick Boenzli     :          Implemented getSize() function
-*/
-
-
-/*!
-  \file list.h
-  \brief Contains a template for a doubly linked list
-*/
-
-#ifndef _LIST_TEMPLATE_H
-#define _LIST_TEMPLATE_H
-
-#include "stdincl.h"
-
-//! An enum to list all the modes available when adding an object to a List
-enum ADDMODE {LIST_ADD_NEXT, LIST_ADD_PREV, LIST_ADD_FIRST, LIST_ADD_LAST};
-//! An enum to list the two searching directions available when removing an object from a List
-enum FINDMODE {LIST_FIND_BW, LIST_FIND_FW};
-
-//! A generic doubly linked list
-template<class T> class ListTemplate 
-{
-  T* object;
-  ListTemplate<T>* next;
-  ListTemplate<T>* prev;
-  bool bReference;
-  int size;
-  
- public:
-  ListTemplate (T* obj, ListTemplate<T>* n, ListTemplate<T>* p, bool bRef);
-  ~ListTemplate ();
-  
-  int add(T* obj, ADDMODE mode, bool bRef);
-  T* getObject();
-  ListTemplate<T>* getNext();
-  ListTemplate<T>* getPrevious();
-  ListTemplate<T>* getLast();
-  ListTemplate<T>* getFirst();
-  void setNext(ListTemplate<T>* ptr);
-  void setPrev(ListTemplate<T>* ptr);
-  int remove (T* obj, FINDMODE mode);
-  int getSize();
-  void destroy();
-};
-
-
-/**
-  \brief Standard constructor
-  
-  Call this without any parameters to generate a new ListTemplate which can be filled with content.
-  DO NOT create a ListTemplate element that contains an object on your own, you'll lose the data
-  contained in that object and will have trouble removing the list from your memory.
-*/
-template<class T>
-ListTemplate<T>::ListTemplate (T* obj = NULL, ListTemplate<T>* n = NULL, ListTemplate<T>* p = NULL, bool bRef = false)
-{
-  object = obj;
-  next = n;
-  prev = p;
-  bReference = bRef;
-  if(obj != NULL)
-    ++size;
-}
-
-/**
-  \brief Standard destructor
-  
-  Call this on the initially generated base ListTemplate element to remove the whole ListTemplate from the memory.
-  You can safely do this to any ListTemplate element you want without messing up the rest of the ListTemplate, but keep in mind
-  that the contained object will be deleted as well when bRef had been set to false.
-*/
-template<class T>
-ListTemplate<T>::~ListTemplate ()
-{
-  if (object == NULL) // deleted foot node => disband the list
-  {
-    while( next != NULL)
-    {
-      delete next;
-    }
-    while( prev != NULL)
-    {
-      delete prev;
-    }
-  }
-  else
-  {
-    if (prev != NULL) prev->setNext (next);
-    if (next != NULL) next->setPrev (prev);
-    if (!bReference) delete object;
-  }
-}
- 
-/**
-  \brief Add an object to the ListTemplate
-  \param obj: A pointer to an allocated object
-  \param mode: A Value of ADDMODE (default: LIST_ADD_NEXT)
-  \param bRef: Sets whether the element is serving as a storage point or a simple listing (default: false)
-  \return 0 if the operation succeded, -1 if the element could not be added
-  
-  This adds a new ListTemplate element to the chain. The mode parameter can be used to specify
-  the location where the element should be added. LIST_ADD_NEXT will add the new element directly
-  after the base element. LIST_ADD_PREV will add the new element directly before the base element.
-  LIST_ADD_FIRST will add the element at the beginning of the ListTemplate whereas LIST_ADD_LAST will add
-  it to the end of the chain. If the bRef parameter is set to true, the object pointer will not be deleted
-  when the element containing that object is deleted, thus the ListTemplate can be used for temporary listings as
-  well as permanent data storage.
-*/
-template<class T> 
-int ListTemplate<T>::add (T* obj, ADDMODE mode = LIST_ADD_NEXT, bool bRef = false)
-{
-  ListTemplate<T>* p;
-  if( obj == NULL) return -1;
-  switch (mode)
-  {
-    case LIST_ADD_NEXT:
-      p = new ListTemplate<T>( obj, next, this, bRef);
-      if( next != NULL) next->setPrev (p);
-      next = p;
-      break;
-    case LIST_ADD_PREV:
-      p = new ListTemplate<T>( obj, this, prev, bRef);
-      if( prev != NULL) prev->setNext (p);
-      prev = p;
-      break;
-    case LIST_ADD_FIRST:
-      if (prev == NULL) prev = new ListTemplate<T> (obj, this, NULL, bRef);
-      else return prev->add (obj, mode, bRef);
-      break;
-    case LIST_ADD_LAST:
-      if (next == NULL) next = new ListTemplate<T> (obj, NULL, this, bRef);
-      else return next->add (obj, mode, bRef);
-      break;
-    default:
-        return -1;
-      break;
-  }
-  ++size;
-  return 0;
-}
-
-/**
-  \brief Get the next element of the ListTemplate
-  \return The ListTemplate element after the current ListTemplate element
-*/
-template<class T>
-ListTemplate<T>* ListTemplate<T>::getNext ()
-{
-  return next;
-}
- 
-/**
-  \brief Get the previous element of the ListTemplate
-  \return The ListTemplate element before the current ListTemplate element
-*/
-template<class T>
-ListTemplate<T>* ListTemplate<T>::getPrevious ()
-{
-  return prev;
-}
-
-/**
-  \brief Get the last element of the ListTemplate
-  \return The last ListTemplate element
-*/
-template<class T>
-ListTemplate<T>* ListTemplate<T>::getLast ()
-{
-  if (next == NULL) return this;
-  else return next->getLast();
-}
-
-/**
-  \brief Get the first element of the ListTemplate
-  \return The first ListTemplate element
-*/
-template<class T>
-ListTemplate<T>* ListTemplate<T>::getFirst ()
-{
-  if (prev == NULL) return this;
-  else return prev->getFirst();
-}
-
-/**
-  \brief Removes a certain element from the ListTemplate
-  \param obj: A pointer to the object that should be removed
-  \param mode: A value of FINDMODE
-  \return 0 if the element was found and removed, -1 if the element was not found
-  
-  This searches the part of the ListTemplate specified with mode for the object in question.
-  When the object is found it is deleted and the ListTemplate element is removed from the chain.
-  If mode is LIST_FIND_FW all elements AFTER the base element are searched, if mode is
-  LIST_FIND_BW all elements BEFORE the base element are searched. Note that the object
-  contained within the ListTemplate element is NOT deleted when bRef was set to true.
-*/
-template<class T>
-int ListTemplate<T>::remove (T* obj, FINDMODE mode = LIST_FIND_FW)
-{
-  if (obj == NULL) return -1;
-  else
-  {
-    switch (mode)
-    {
-      case LIST_FIND_BW:
-        if (prev == NULL) return -1;
-        else
-        {
-          if( prev->getObject() == obj)
-          {
-            delete prev;
-          }
-          else
-          {
-            return prev->remove( obj, mode);
-          }
-        }
-        break;
-      case LIST_FIND_FW:
-        if (next == NULL) return -1;
-        else
-        {
-          if( next->getObject() == obj)
-          {
-            delete next;
-          }
-          else
-          {
-            return next->remove( obj, mode);
-          }
-        }
-        break;
-      default:
-        return -1;
-    }
-  }
-  --size;
-  return 0;
-}
-
-/**
-  \brief Set the next element of a ListTemplate element
-  \param ptr: A pointer to the new next element
-    
-  Sets the next element of a ListTemplate element... Better not touch this, it can really mess up a ListTemplate.
-*/
-template<class T>
-void ListTemplate<T>::setNext (ListTemplate<T>* ptr)
-{
-  next = ptr;
-}
-
-/**
-  \brief Set the prev element of a ListTemplate element
-  \param ptr: A pointer to the new previous element
-    
-  Sets the previous element of a ListTemplate element... Better not touch this, it can really mess up a ListTemplate.
-*/
-template<class T>
-void ListTemplate<T>::setPrev (ListTemplate<T>* ptr)
-{
-  prev = ptr;
-}
-
-/**
-  \brief Get the pointer to the object the element is containing
-  \return The contained object (will be NULL if called on the base element).
-*/
-template<class T>
-T* ListTemplate<T>::getObject()
-{
-  return object;
-}
-
-
-/**
-  \brief Returns the current size of the ListTemplate
-  \return Size of ListTemplate
-*/
-template<class T>
-int ListTemplate<T>::getSize()
-{
-  return this->size;
-}
-
-
-template<class T>
-void ListTemplate<T>::destroy()
-{
-  /* \todo at the moment - doing nothing. should delete everything */
-}
-
-#endif /* _LIST_TENMPLATE_H */
-
Index: orxonox/trunk/src/lib/util/resource_manager.cc
===================================================================
--- orxonox/trunk/src/lib/util/resource_manager.cc	(revision 3868)
+++ 	(revision )
@@ -1,591 +1,0 @@
-/* 
-   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: Patrick Boenzli
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD
-
-#include "resource_manager.h"
-
-// different resource Types
-#include "objModel.h"
-#include "primitive_model.h"
-#include "texture.h"
-#include "text_engine.h"
-
-#include "list.h"
-
-// File Handling Includes
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-using namespace std;
-
-/**
-   \brief standard constructor
-*/
-ResourceManager::ResourceManager () 
-{
-   this->setClassName ("ResourceManager");
-   this->dataDir = "./";
-   this->imageDirs = new tList<char>();
-   this->resourceList = new tList<Resource>();
-}
-
-/**
-   \returns the Instance to this ResourceManager
-*/
-ResourceManager* ResourceManager::getInstance(void)
-{
-  if (!ResourceManager::singletonRef)
-    ResourceManager::singletonRef = new ResourceManager();
-  return ResourceManager::singletonRef;
-}
-
-//! Singleton Reference to the ResourceManager
-ResourceManager* ResourceManager::singletonRef = NULL;
-
-/**
-   \brief standard destructor
-*/
-ResourceManager::~ResourceManager (void) 
-{
-  // deleting the Resources-List
-  this->unloadAllByPriority(RP_GAME);
-  delete this->resourceList;
-  // deleting the Directorie Lists
-  tIterator<char>* tmpIt = imageDirs->getIterator();
-  char* tmpDir = tmpIt->nextElement();
-  while(tmpDir)
-    {
-      delete []tmpDir;
-      tmpDir = tmpIt->nextElement();
-    }
-  delete tmpIt;
-
-  delete this->imageDirs;
-
-  ResourceManager::singletonRef = NULL;
-}
-
-/**
-   \brief sets the data main directory
-   \param dataDir the DataDirectory.
-*/
-bool ResourceManager::setDataDir(char* dataDir)
-{
-  if (isDir(dataDir))
-    {
-      this->dataDir = new char[strlen(dataDir)+1];
-      strcpy(this->dataDir, dataDir);
-    }
-  else
-    {
-      PRINTF(1)("%s is not a Directory, and can not be the Data Directory\n", dataDir);
-    }
-}
-
-/**
-   \brief adds a new Path for Images
-   \param imageDir The path to insert
-   \returns true, if the Path was well and injected (or already existent within the list)
-   false otherwise
-*/
-bool ResourceManager::addImageDir(char* imageDir)
-{
-  // check if the param is a Directory
-  if (isDir(imageDir))
-    {
-      // check if the Directory has been added before
-      tIterator<char>* tmpImageDirs = imageDirs->getIterator();
-      char* tmpDir = tmpImageDirs->nextElement();
-      while(tmpDir)
-	{
-	  if (!strcmp(tmpDir, imageDir))
-	    {
-	      PRINTF(4)("Path %s already loaded\n", imageDir);
-	      delete tmpImageDirs;
-	      return true;
-	    }
-	  tmpDir = tmpImageDirs->nextElement();
-	}
-      delete tmpImageDirs;
-
-      // adding the directory to the List
-      tmpDir  = new char[strlen(imageDir)+1];
-      strcpy(tmpDir, imageDir);
-      this->imageDirs->add(tmpDir);
-      return true;
-    }
-  else
-    {
-      PRINTF(1)("%s is not a Directory, and can not be added to the Paths of Images\n", dataDir);
-      return false;
-    }
-}
-
-/**
-   \brief loads resources
-   \param fileName The fileName of the resource to load
-   \param prio The ResourcePriority of this resource (will only be increased)
-   \returns a pointer to a desired Resource.
-*/
-void* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
-{
-  ResourceType tmpType;
-  if (!strncmp(fileName+(strlen(fileName)-4), ".obj", 4))
-    tmpType = OBJ;
-  else if (!strncmp(fileName+(strlen(fileName)-4), ".wav", 4))
-    tmpType = WAV;
-  else if (!strncmp(fileName+(strlen(fileName)-4), ".mp3", 4))
-    tmpType = MP3;
-  else if (!strncmp(fileName+(strlen(fileName)-4), ".ogg", 4))
-    tmpType = OGG;
-  else if (!strcmp(fileName, "cube") ||
-           !strcmp(fileName, "sphere") ||
-	   !strcmp(fileName, "plane") ||
-           !strcmp(fileName, "cylinder") ||
-           !strcmp(fileName, "cone"))
-    tmpType = PRIM;
-  else if (!strncmp(fileName+(strlen(fileName)-4), ".ttf", 4))
-    tmpType = TTF;
-  else 
-    tmpType = IMAGE;
-
-  return this->load(fileName, tmpType, prio, param1, param2, param3);
-}
-
-/**
-   \brief loads resources
-   \param fileName The fileName of the resource to load
-   \param type The Type of Resource to load (\see ResourceType)
-   \param prio The ResourcePriority of this resource (will only be increased)
-   \returns a pointer to a desired Resource.
-*/
-void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio, void* param1, void* param2, void* param3)
-{
-  // searching if the resource was loaded before.
-  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3);
-  if (tmpResource) // if the resource was not loaded before.
-    {
-      PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
-      tmpResource->count++;
-      if(tmpResource->prio < prio)
-	tmpResource->prio = prio;
-    }
-  else
-    {
-      char* tmpDir;
-      // Setting up the new Resource
-      tmpResource = new Resource;
-      tmpResource->count = 1;
-      tmpResource->type = type;
-      tmpResource->prio = prio;
-      tmpResource->name = new char[strlen(fileName)+1];
-      strcpy(tmpResource->name, fileName);
-
-      // creating the full name. (directoryName + FileName)
-      char* fullName = new char[strlen(dataDir)+strlen(fileName)+1];
-      sprintf(fullName, "%s%s", this->dataDir, fileName);
-      
-      // Checking for the type of resource \see ResourceType
-      switch(type)
-	{
-	case OBJ:
-	  if (param1)
-	    tmpResource->modelSize = *(float*)param1;
-	  else
-	    tmpResource->modelSize = 1.0;
-
-	  if(isFile(fullName))
-	    tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
-	  else
-	    {
-	      PRINTF(2)("Sorry, %s does not exist. Loading a cube-Model instead\n", fullName);
-	      tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
-	    }
-	  break;
-	case PRIM:
-	  if (param1)
-	    tmpResource->modelSize = *(float*)param1;
-	  else
-	    tmpResource->modelSize = 1.0;
-
-	  if (!strcmp(tmpResource->name, "cube"))
-	    tmpResource->pointer = new PrimitiveModel(CUBE, tmpResource->modelSize);
-	  else if (!strcmp(tmpResource->name, "sphere"))
-	    tmpResource->pointer = new PrimitiveModel(SPHERE, tmpResource->modelSize);
-	  else if (!strcmp(tmpResource->name, "plane"))
-	    tmpResource->pointer = new PrimitiveModel(PLANE, tmpResource->modelSize);
-	  else if (!strcmp(tmpResource->name, "cylinder"))
-	    tmpResource->pointer = new PrimitiveModel(CYLINDER, tmpResource->modelSize);
-	  else if (!strcmp(tmpResource->name, "cone"))
-	    tmpResource->pointer = new PrimitiveModel(CONE, tmpResource->modelSize);
-	  break;
-	case TTF:
-	    if (param1)
-	      tmpResource->ttfSize = *(int*)param1;
-	    else
-	      tmpResource->ttfSize = FONT_DEFAULT_SIZE;
-	    if (param2)
-	      {
-		Vector* tmpVec = (Vector*)param2;
-		tmpResource->ttfColorR = (int)tmpVec->x;
-		tmpResource->ttfColorG = (int)tmpVec->y;
-		tmpResource->ttfColorB = (int)tmpVec->z;
-	      }
-	    else
-	      {
-		tmpResource->ttfColorR = FONT_DEFAULT_COLOR_R;
-		tmpResource->ttfColorG = FONT_DEFAULT_COLOR_G;
-		tmpResource->ttfColorB = FONT_DEFAULT_COLOR_B;
-	      }
-	    
-	  if(isFile(fullName))
-	    tmpResource->pointer = new Font(fullName,
-					    tmpResource->ttfSize,
-					    tmpResource->ttfColorR,
-					    tmpResource->ttfColorG,
-					    tmpResource->ttfColorB);
-	  else
-	    PRINTF(2)("Sorry, %s does not exist. Not loading Font\n", fullName);
-	  break;
-	case IMAGE:
-	  if(isFile(fullName))
-	    {
-	      PRINTF(4)("Image %s resides to %s\n", fileName, fullName);
-	      tmpResource->pointer = new Texture(fullName);
-	    }
-	  else
-	    {
-	      tIterator<char>* iterator = imageDirs->getIterator();
-	      tmpDir = iterator->nextElement();
-	      //tmpDir = imageDirs->enumerate();
-	      while(tmpDir)
-		{
-		  char* imgName = new char[strlen(tmpDir)+strlen(fileName)+1];
-		  sprintf(imgName, "%s%s", tmpDir, fileName);
-		  if(isFile(imgName))
-		    {
-		      PRINTF(4)("Image %s resides to %s\n", fileName, imgName);
-		      tmpResource->pointer = new Texture(imgName);
-		      delete []imgName;
-		      break;
-		    }
-		  delete []imgName;
-		  tmpDir = iterator->nextElement();
-		}
-	      delete iterator;
-	    }
-	  if(!tmpResource)
-	     PRINTF(2)("!!Image %s not Found!!\n", fileName);
-	  break;
-	default:
-	  tmpResource->pointer = NULL;
-	  PRINTF(1)("No type found for %s.\n   !!This should not happen unless the Type is not supported yet.!!\n", tmpResource->name);
-	  break;
-	}
-      this->resourceList->add(tmpResource);
-      delete []fullName;
-    }
-  if (tmpResource->pointer)
-    return tmpResource->pointer;
-  else 
-    {
-      PRINTF(2)("Resource %s could not be loaded\n", fileName);
-      delete tmpResource;
-      return NULL;
-    }
-}
-
-/**
-   \brief unloads a Resource
-   \param pointer The pointer to free
-   \returns true if successful (pointer found, and deleted), false otherwise
-   
-*/
-bool ResourceManager::unload(void* pointer, ResourcePriority prio)
-{
-  // if pointer is existent. and only one resource of this type exists.
-  Resource* tmpResource = this->locateResourceByPointer(pointer);
-  if (!tmpResource)
-    {
-      PRINTF(2)("Resource not Found %p\n", pointer);
-      return false;
-    }
-  else
-    unload(tmpResource, prio);
-}
-
-bool ResourceManager::unload(Resource* resource, ResourcePriority prio)
-{
-  if (resource->count > 0)
-    resource->count--;
-  if (resource->prio <= prio)
-    {
-      if (resource->count <= 0)
-	{
-	  // deleting the Resource
-	  switch(resource->type)
-	    {
-	    case OBJ:
-	    case PRIM:
-	      delete (Model*)resource->pointer;
-	      break;
-	    case IMAGE:
-	      delete (Texture*)resource->pointer;
-	      break;
-	    case TTF:
-	      delete (Font*)resource->pointer;
-	      break;
-	    default:
-	      PRINTF(1)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
-	      return false;
-	      break;
-	    }
-	  // deleting the List Entry:
-	  PRINTF(4)("Resource %s safely removed.\n", resource->name);
-	  delete []resource->name;
-	  this->resourceList->remove(resource);
-	}
-      else
-	PRINTF(4)("Resource %s not removed, because there are still %d References to it.\n", resource->name, resource->count);
-    }
-  else
-    PRINTF(4)("not deleting resource %s because DeleteLevel to high\n", resource->name);
-  return true;
-}
-
-
-/**
-   \brief unloads all alocated Memory of Resources with a pririty lower than prio
-   \param prio The priority to delete
-*/
-bool ResourceManager::unloadAllByPriority(ResourcePriority prio)
-{
-  tIterator<Resource>* iterator = resourceList->getIterator();
-  Resource* enumRes = iterator->nextElement();
-  while (enumRes)
-    {
-      if (enumRes->prio <= prio)
-	if (enumRes->count == 0)
-	  unload(enumRes, prio);
-	else
-	  PRINTF(2)("unable to unload %s because there are still %d references to it\n",
-		   enumRes->name, enumRes->count);
-      //enumRes = resourceList->nextElement();
-      enumRes = iterator->nextElement();
-    }
-  delete iterator;
-}
-
-/**
-   \brief Searches for a Resource by some information
-   \param fileName The name to look for
-   \returns a Pointer to the Resource if found, NULL otherwise.
-*/
-Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3)
-{
-  //  Resource* enumRes = resourceList->enumerate();
-  tIterator<Resource>* iterator = resourceList->getIterator();
-  Resource* enumRes = iterator->nextElement();
-  while (enumRes)
-    {
-      if (enumRes->type == type && !strcmp(fileName, enumRes->name))
-	{
-	  bool match = false;
-	  bool subMatch = false;
-	  switch (type)
-	    {
-	    case PRIM:
-	    case OBJ:
-	      if (!param1)
-		{
-		  if (enumRes->modelSize == 1.0)
-		    match = true;
-		}
-	      else if (enumRes->modelSize == *(float*)param1)
-		match = true;
-	      break;
-	    case TTF:
-	      if (!param1)
-		{
-		  if (enumRes->ttfSize == FONT_DEFAULT_SIZE)
-		    subMatch = true;
-		}
-	      else if (enumRes->modelSize =- *(int*)param1)
-		subMatch = true;
-	      if(subMatch)
-		{
-		  Vector* tmpVec = (Vector*)param2;
-		  if (!param2)
-		    {
-		      if(enumRes->ttfColorR == FONT_DEFAULT_COLOR_R &&
-			 enumRes->ttfColorG == FONT_DEFAULT_COLOR_G &&
-			 enumRes->ttfColorB == FONT_DEFAULT_COLOR_B )
-			match = true;
-		    }
-		  else if (enumRes->ttfColorR == (int)tmpVec->x &&
-			   enumRes->ttfColorG == (int)tmpVec->y &&
-			   enumRes->ttfColorB == (int)tmpVec->z )
-		    match = true;
-		}
-
-	      break;
-	    default:
-	      match = true;
-	      break;
-	    }
-	  if (match)
-	    {
-	      delete iterator;
-	      return enumRes;
-	    }
-	}
-      enumRes = iterator->nextElement();
-    }
-  delete iterator;
-  return NULL;
-}
-
-/**
-   \brief Searches for a Resource by Pointer
-   \param pointer the Pointer to search for
-   \returns a Pointer to the Resource if found, NULL otherwise.
-*/
-Resource* ResourceManager::locateResourceByPointer(const void* pointer)
-{
-  //  Resource* enumRes = resourceList->enumerate();
-  tIterator<Resource>* iterator = resourceList->getIterator();
-  Resource* enumRes = iterator->nextElement();
-  while (enumRes)
-    {
-      if (pointer == enumRes->pointer)
-	{
-	  delete iterator;
-	  return enumRes;
-	}
-      enumRes = iterator->nextElement();
-    }
-  delete iterator;
-  return NULL;
-}
-
-/**
-   \brief Checks if it is a Directory
-   \param directoryName the Directory to check for
-   \returns true if it is a directory/symlink false otherwise
-*/
-bool ResourceManager::isDir(const char* directoryName)
-{
-  struct stat status;
-  stat(directoryName, &status);
-  if (status.st_mode & (S_IFDIR 
-#ifndef __WIN32__
-			| S_IFLNK
-#endif
-			))
-    return true;
-  else
-    return false;
-}
-
-/**
-   \brief Checks if the file is either a Regular file or a Symlink
-   \param fileName the File to check for
-   \returns true if it is a regular file/symlink, false otherwise
-*/
-bool ResourceManager::isFile(const char* fileName)
-{
-  struct stat status;
-  stat(fileName, &status);
-  if (status.st_mode & (S_IFREG 
-#ifndef __WIN32__
-			| S_IFLNK
-#endif
-			))
-    return true;
-  else
-    return false;
-}
-
-/**
-   \brief outputs debug information about the ResourceManager
-*/
-void ResourceManager::debug(void)
-{
-  PRINT(0)("=RM===================================\n");
-  PRINT(0)("= RESOURCE-MANAGER DEBUG INFORMATION =\n");
-  PRINT(0)("======================================\n");
-  // if it is not initialized
-  PRINT(0)(" Reference is: %p\n", ResourceManager::singletonRef);
-  PRINT(0)(" Data-Directory is: %s\n", this->dataDir);
-  PRINT(0)(" List of Image-Directories: ");
-  tIterator<char>* tmpIt = imageDirs->getIterator();
-  char* tmpDir = tmpIt->nextElement();
-  while(tmpDir)
-    {
-      PRINT(0)("%s ",tmpDir);
-      tmpDir = tmpIt->nextElement();
-    }
-  delete tmpIt;
-  PRINT(0)("\n");
-
-  PRINT(0)("List of all stored Resources:\n");
-  tIterator<Resource>* iterator = resourceList->getIterator();
-  Resource* enumRes = iterator->nextElement();
-  while (enumRes)
-    {
-      PRINT(0)("-----------------------------------------\n");
-      PRINT(0)("Name: %s; References: %d; Type:", enumRes->name, enumRes->count);
-      switch (enumRes->type)
-	{
-	case OBJ:
-	  PRINT(0)("ObjectModel\n");
-	  break;
-	case PRIM:
-	  PRINT(0)("PrimitiveModel\n");
-	  break;
-	case IMAGE:
-	  PRINT(0)("ImageFile (Texture)\n");
-	  break;
-	default:
-	  PRINT(0)("SoundFile\n");
-	  break;
-	}
-      PRINT(0)("gets deleted at ");
-      switch(enumRes->prio)
-	{
-	default:
-	case RP_NO:
-	  PRINT(0)("first posibility (0)\n");
-	  break;
-	case RP_LEVEL:
-	  PRINT(0)("the end of the Level (1)\n");
-	  break;
-	case RP_CAMPAIGN:
-	  PRINT(0)("the end of the campaign (2)\n");
-	  break;
-	case RP_GAME:
-	  PRINT(0)("when leaving the game (3)\n");
-	  break;
-	}
-      enumRes = iterator->nextElement();
-    }
-  delete iterator;
-
-
-
-  PRINT(0)("==================================RM==\n");
-}
Index: orxonox/trunk/src/lib/util/resource_manager.h
===================================================================
--- orxonox/trunk/src/lib/util/resource_manager.h	(revision 3868)
+++ 	(revision )
@@ -1,95 +1,0 @@
-/*! 
-    \file resource_manager.h
-    \brief The Resource Manager checks if a file/resource is loaded.
-
-    If a file/resource was already loaded the resourceManager will 
-    return a void pointer to the desired resource.
-    Otherwise it will instruct the coresponding resource-loader to load,
-    and receive a pointer to it.
-*/
-
-#ifndef _RESOURCE_MANAGER_H
-#define _RESOURCE_MANAGER_H
-
-#include "base_object.h"
-
-// FORWARD DEFINITION \\
-//template<class T> class tList;
-#include "list.h"                //! \todo do this by forward definition (ask Patrick)
-
-//! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support
-enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, TTF, IMAGE};
-//! An enumerator for different UNLOAD-types. 
-/**
-   RP_NO: will be unloaded on request
-   RP_LEVEL: will be unloaded at the end of a Level
-   RP_CAMPAIGN: will be unloaded at the end of a Campaign
-   RP_GAME: will be unloaded at the end of the whole Game (when closing orxonox)
-*/
-enum ResourcePriority {RP_NO = 0, RP_LEVEL = 1, RP_CAMPAIGN = 2, RP_GAME = 3};
-
-//! A Struct that keeps track about A resource its name its Type, and so on
-struct Resource
-{
-  void* pointer;             //!< Pointer to the Resource.
-  int count;                 //!< How many times this Resource has been loaded.
-  
-  char* name;                //!< Name of the Resource.
-  ResourceType type;         //!< ResourceType of this Resource.
-  ResourcePriority prio;     //!< The Priority of this resource. (This will only be increased)
-
-  // more specific
-  float modelSize;
-  unsigned int ttfSize;
-  unsigned char ttfColorR;
-  unsigned char ttfColorG;
-  unsigned char ttfColorB;
-};
-
-
-//! The ResourceManager is a class, that decides if a file/resource should be loaded
-/**
-   If a file/resource was already loaded the resourceManager will 
-   return a void pointer to the desired resource.
-   Otherwise it will instruct the corresponding resource-loader to load,
-   and receive the pointer to it.
-
-   It does it by looking, if a desired file has already been loaded.
-
-   \todo loading also dependant by parameters.
-*/
-class ResourceManager : public BaseObject 
-{
- public:
-  static ResourceManager* getInstance();
-  virtual ~ResourceManager();
-
-  bool setDataDir(char* dataDir);
-  bool addImageDir(char* imageDir);
-  void* load(const char* fileName, ResourcePriority prio = RP_NO,
-	     void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
-  void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
-	     void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
-  bool unload(void* pointer, ResourcePriority prio = RP_NO);
-  bool unload(Resource* resource, ResourcePriority = RP_NO);
-  bool unloadAllByPriority(ResourcePriority prio);
-  void debug(void);
-
- private:
-  ResourceManager();
-  static ResourceManager* singletonRef;
-
-  tList<Resource>* resourceList;       //!< The List of Resources, that has already been loaded.
-  char* dataDir;                       //!< The Data Directory, where all relevant Data is stored.
-  tList<char>* imageDirs;              //!< A list of directories in which images are stored.
-
-
-  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3);
-  Resource* locateResourceByPointer(const void* pointer);
-  
-  bool isDir(const char* directory);
-  bool isFile(const char* directory);
-
-};
-
-#endif /* _RESOURCE_MANAGER_H */
Index: orxonox/trunk/src/util/common/list.cc
===================================================================
--- orxonox/trunk/src/util/common/list.cc	(revision 3869)
+++ orxonox/trunk/src/util/common/list.cc	(revision 3869)
@@ -0,0 +1,148 @@
+
+
+/* 
+   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: Patrick Boenzli
+   co-programmer: ...
+*/
+
+
+#include "list.h"
+#include "world_entity.h"
+
+using namespace std;
+
+
+
+List::List () 
+{
+  this->first = NULL;
+  this->last = NULL;
+  this->size = 0;
+}
+
+List::~List () 
+{}
+
+
+void List::add(WorldEntity* entity)
+{
+  printf("List::add() \n");
+  listElement* el = new listElement;
+  el->prev = this->last;
+  el->curr = entity;
+  el->next = NULL;
+
+  this->last = el;
+
+  if(this->size == 0) this->first = el;
+  else el->prev->next = el;
+  this->size++;
+}
+
+
+void List::remove(WorldEntity* entity)
+{
+  this->currentEl = this->first;
+  listElement* te;
+  while( this->currentEl != NULL)
+    {
+      if( this->currentEl->curr == entity)
+	{
+	  printf("List::remove() - object found\n");
+	  
+	  if( this->currentEl->prev  == NULL ) this->first = this->currentEl->next;
+	  else this->currentEl->prev->next = this->currentEl->next;
+
+	  if( this->currentEl->next == NULL) this->last = this->currentEl->prev;
+	  else this->currentEl->next->prev = this->currentEl->prev;
+
+	  te = this->currentEl->next;
+	  delete this->currentEl;
+	  this->currentEl = te;
+	  return;
+	}
+      this->currentEl = this->currentEl->next;
+    }
+}
+
+
+void List::destroy()
+{
+  printf("List::clear() - clearing all world objects, releasing mem\n");
+  this->currentEl = this->first;
+  listElement* le = NULL;
+  while(this->currentEl != NULL)
+    {
+      le = this->currentEl->next;
+      delete this->currentEl->curr;
+      delete this->currentEl;
+      this->currentEl = le;
+    }
+  this->first = NULL;
+  this->last = NULL;
+  this->size = 0;
+}
+
+
+WorldEntity* List::firstElement()
+{
+  return this->first->curr;
+}
+
+
+bool List::isEmpty()
+{
+  return (this->size==0)?true:false;
+}
+
+
+int List::getSize()
+{
+  return this->size;
+}
+
+
+WorldEntity* List::enumerate()
+{
+  if(this->size == 0) return NULL;
+  this->currentEl = this->first;
+  return this->currentEl->curr;
+}
+
+
+WorldEntity* List::nextElement()
+{
+  if(this->size == 0) return NULL;
+  this->currentEl = this->currentEl->next;
+  if(this->currentEl == NULL) return NULL;
+  return this->currentEl->curr;
+}
+
+
+WorldEntity* List::toArray()
+{}
+
+
+void List::debug()
+{
+  int counter = 1;
+  this->currentEl = this->first;
+  printf("List:debug() =====================\n");
+  while(this->currentEl != NULL)
+    {
+      printf("element: nr %d/%d\n", counter, size);
+      this->currentEl = this->currentEl->next;
+      counter++;
+    }
+  printf("List:debug()END =====================\n");
+}
Index: orxonox/trunk/src/util/common/list.h
===================================================================
--- orxonox/trunk/src/util/common/list.h	(revision 3869)
+++ orxonox/trunk/src/util/common/list.h	(revision 3869)
@@ -0,0 +1,297 @@
+
+#ifndef _LIST_H
+#define _LIST_H
+
+#include "compiler.h"
+#ifndef NULL
+#define NULL 0
+#endif
+
+//! An enum to list all the modes available when adding an object to a List
+//enum ADDMODE {LIST_ADD_FIRST, LIST_ADD_LAST};
+//! An enum to list the two searching directions available when removing an object from a List
+//enum FINDMODE {LIST_FIND_BW, LIST_FIND_FW};
+
+
+
+class WorldEntity;
+
+class List {
+
+ public:
+  List ();
+  ~List ();
+
+  void add(WorldEntity* entity);
+  void remove(WorldEntity* entity);
+  void destroy();
+  WorldEntity* firstElement();
+  bool isEmpty();
+  int getSize();
+  WorldEntity* enumerate();
+  WorldEntity* nextElement();
+  WorldEntity* toArray();
+  void debug();
+
+ private:
+  struct listElement
+  {
+    listElement* prev;
+    WorldEntity* curr;
+    listElement* next;
+  };
+  unsigned int size;
+  listElement* first;
+  listElement* last;
+  listElement* currentEl;
+
+
+};
+
+
+
+template<class T> struct listElement
+{
+  listElement* prev;
+  T* curr;
+  listElement* next;
+};
+
+template<class T> class tIterator
+{
+ public:
+  tIterator(listElement<T>* startElement);
+  ~tIterator();
+  
+  T* nextElement();
+
+ private:
+  listElement<T>* currentEl;
+  listElement<T>* tmpEl;
+};
+
+
+template<class T>
+inline tIterator<T>::tIterator (listElement<T>* startElement) 
+{
+  this->currentEl = startElement;
+  this->tmpEl = NULL;
+}
+
+
+template<class T>
+inline tIterator<T>::~tIterator ()
+{
+  this->currentEl = NULL;
+}
+
+
+template<class T>
+inline T* tIterator<T>::nextElement ()
+{
+  if( this->currentEl == NULL)
+    return NULL;
+
+  this->tmpEl = this->currentEl;
+  this->currentEl = this->currentEl->next;
+  return this->tmpEl->curr;
+}
+
+
+
+template<class T> class tList 
+{
+ public:
+  tList ();
+  ~tList ();
+
+  void add(T* entity);
+  void remove(T* entity);
+  void destroy();
+  T* firstElement();
+  T* lastElement();
+  bool isEmpty();
+  int getSize();
+  //T* enumerate();
+  tIterator<T>* getIterator();
+  T* nextElement();
+  T* nextElement(T* toEntity);
+  T* toArray();
+  void debug();
+
+ private:
+  unsigned int size;
+  listElement<T>* first;
+  listElement<T>* last;
+  listElement<T>* currentEl;
+};
+
+
+template<class T>
+inline tList<T>::tList () 
+{
+  this->first = NULL;
+  this->last = NULL;
+  this->size = 0;
+}
+
+template<class T>
+inline tList<T>::~tList () 
+{
+  this->currentEl = this->first;
+  while(this->currentEl != NULL)
+    {
+      listElement<T>* le = this->currentEl->next;
+      //delete this->currentEl->curr;
+      delete this->currentEl;
+      this->currentEl = le;
+    }
+  this->first = NULL;
+  this->last = NULL;
+  this->size = 0;
+}
+
+
+template<class T>
+inline void tList<T>::add(T* entity)
+{
+  if( unlikely(entity == NULL)) return;
+  listElement<T>* el = new listElement<T>;
+  el->prev = this->last;
+  el->curr = entity;
+  el->next = NULL;
+
+  this->last = el;
+
+  if( unlikely(el->prev == NULL)) this->first = el; /* if first element */
+  else el->prev->next = el;
+  this->size++;
+}
+
+
+template<class T>
+inline void tList<T>::remove(T* entity)
+{
+  this->currentEl = this->first;
+  listElement<T>* te;
+  while( this->currentEl != NULL)
+    {
+      if( unlikely(this->currentEl->curr == entity))
+	{ 
+	  if( unlikely(this->currentEl->prev  == NULL)) this->first = this->currentEl->next;
+	  else this->currentEl->prev->next = this->currentEl->next;
+
+	  if( unlikely(this->currentEl->next == NULL)) this->last = this->currentEl->prev;
+	  else this->currentEl->next->prev = this->currentEl->prev;
+
+	  delete this->currentEl;
+	  this->size--;
+	  return;
+	}
+      this->currentEl = this->currentEl->next;
+    }
+}
+
+
+template<class T>
+inline void tList<T>::destroy()
+{
+  this->currentEl = this->first;
+  while(this->currentEl != NULL)
+    {
+      listElement<T>* le = this->currentEl->next;
+      //delete this->currentEl->curr;
+      delete this->currentEl;
+      this->currentEl = le;
+    }
+  this->first = NULL;
+  this->last = NULL;
+  this->size = 0;
+}
+
+
+template<class T>
+inline T* tList<T>::firstElement()
+{
+  return this->first->curr;
+}
+
+
+template<class T>
+inline T* tList<T>::lastElement()
+{
+  return this->last->curr;
+}
+
+
+template<class T>
+inline bool tList<T>::isEmpty()
+{
+  return (this->size==0)?true:false;
+}
+
+
+template<class T>
+inline int tList<T>::getSize()
+{
+  return this->size;
+}
+
+
+/* deprecated */
+/*
+template<class T>
+T* tList<T>::enumerate()
+{
+  //if( this->last == this->first == NULL) return NULL;
+  if( this->size == 0) return NULL;
+  this->currentEl = this->first;
+  return this->currentEl->curr;
+}
+*/
+
+template<class T>
+inline tIterator<T>* tList<T>::getIterator()
+{
+  tIterator<T>* iterator = new tIterator<T>(this->first);
+  return iterator;
+}
+
+
+/* deprecated */
+template<class T>
+T* tList<T>::nextElement()
+{
+  // if( this->last == this->first == NULL) return NULL;
+  if( this->size == 0) return NULL;
+  this->currentEl = this->currentEl->next;
+  if( this->currentEl == NULL) return NULL;
+  return this->currentEl->curr;
+}
+
+
+/**
+   \brief this returns the next element after toEntity or the first if toEntity is last
+*/
+template<class T>
+inline T* tList<T>::nextElement(T* toEntity)
+{
+  //if( this->last == this->first == NULL) return NULL;
+  if(this->size == 0) return NULL;
+  if( toEntity == NULL) return this->first->curr;
+  if( toEntity == this->last->curr ) return this->first->curr;
+  this->currentEl = this->first;
+  while(this->currentEl->curr != toEntity && this->currentEl->next != NULL)
+    {
+      this->currentEl = this->currentEl->next;
+    }
+  if(this->currentEl == NULL) return NULL;
+  return this->currentEl->next->curr;
+}
+
+
+template<class T>
+T* tList<T>::toArray()
+{}
+
+#endif /* _LIST_H */
Index: orxonox/trunk/src/util/common/list_template.h
===================================================================
--- orxonox/trunk/src/util/common/list_template.h	(revision 3869)
+++ orxonox/trunk/src/util/common/list_template.h	(revision 3869)
@@ -0,0 +1,308 @@
+/* 
+   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: Christian Meyer
+
+   ADDONS/FIXES:
+  
+   Patrick Boenzli     :          Implemented getSize() function
+*/
+
+
+/*!
+  \file list.h
+  \brief Contains a template for a doubly linked list
+*/
+
+#ifndef _LIST_TEMPLATE_H
+#define _LIST_TEMPLATE_H
+
+#include "stdincl.h"
+
+//! An enum to list all the modes available when adding an object to a List
+enum ADDMODE {LIST_ADD_NEXT, LIST_ADD_PREV, LIST_ADD_FIRST, LIST_ADD_LAST};
+//! An enum to list the two searching directions available when removing an object from a List
+enum FINDMODE {LIST_FIND_BW, LIST_FIND_FW};
+
+//! A generic doubly linked list
+template<class T> class ListTemplate 
+{
+  T* object;
+  ListTemplate<T>* next;
+  ListTemplate<T>* prev;
+  bool bReference;
+  int size;
+  
+ public:
+  ListTemplate (T* obj, ListTemplate<T>* n, ListTemplate<T>* p, bool bRef);
+  ~ListTemplate ();
+  
+  int add(T* obj, ADDMODE mode, bool bRef);
+  T* getObject();
+  ListTemplate<T>* getNext();
+  ListTemplate<T>* getPrevious();
+  ListTemplate<T>* getLast();
+  ListTemplate<T>* getFirst();
+  void setNext(ListTemplate<T>* ptr);
+  void setPrev(ListTemplate<T>* ptr);
+  int remove (T* obj, FINDMODE mode);
+  int getSize();
+  void destroy();
+};
+
+
+/**
+  \brief Standard constructor
+  
+  Call this without any parameters to generate a new ListTemplate which can be filled with content.
+  DO NOT create a ListTemplate element that contains an object on your own, you'll lose the data
+  contained in that object and will have trouble removing the list from your memory.
+*/
+template<class T>
+ListTemplate<T>::ListTemplate (T* obj = NULL, ListTemplate<T>* n = NULL, ListTemplate<T>* p = NULL, bool bRef = false)
+{
+  object = obj;
+  next = n;
+  prev = p;
+  bReference = bRef;
+  if(obj != NULL)
+    ++size;
+}
+
+/**
+  \brief Standard destructor
+  
+  Call this on the initially generated base ListTemplate element to remove the whole ListTemplate from the memory.
+  You can safely do this to any ListTemplate element you want without messing up the rest of the ListTemplate, but keep in mind
+  that the contained object will be deleted as well when bRef had been set to false.
+*/
+template<class T>
+ListTemplate<T>::~ListTemplate ()
+{
+  if (object == NULL) // deleted foot node => disband the list
+  {
+    while( next != NULL)
+    {
+      delete next;
+    }
+    while( prev != NULL)
+    {
+      delete prev;
+    }
+  }
+  else
+  {
+    if (prev != NULL) prev->setNext (next);
+    if (next != NULL) next->setPrev (prev);
+    if (!bReference) delete object;
+  }
+}
+ 
+/**
+  \brief Add an object to the ListTemplate
+  \param obj: A pointer to an allocated object
+  \param mode: A Value of ADDMODE (default: LIST_ADD_NEXT)
+  \param bRef: Sets whether the element is serving as a storage point or a simple listing (default: false)
+  \return 0 if the operation succeded, -1 if the element could not be added
+  
+  This adds a new ListTemplate element to the chain. The mode parameter can be used to specify
+  the location where the element should be added. LIST_ADD_NEXT will add the new element directly
+  after the base element. LIST_ADD_PREV will add the new element directly before the base element.
+  LIST_ADD_FIRST will add the element at the beginning of the ListTemplate whereas LIST_ADD_LAST will add
+  it to the end of the chain. If the bRef parameter is set to true, the object pointer will not be deleted
+  when the element containing that object is deleted, thus the ListTemplate can be used for temporary listings as
+  well as permanent data storage.
+*/
+template<class T> 
+int ListTemplate<T>::add (T* obj, ADDMODE mode = LIST_ADD_NEXT, bool bRef = false)
+{
+  ListTemplate<T>* p;
+  if( obj == NULL) return -1;
+  switch (mode)
+  {
+    case LIST_ADD_NEXT:
+      p = new ListTemplate<T>( obj, next, this, bRef);
+      if( next != NULL) next->setPrev (p);
+      next = p;
+      break;
+    case LIST_ADD_PREV:
+      p = new ListTemplate<T>( obj, this, prev, bRef);
+      if( prev != NULL) prev->setNext (p);
+      prev = p;
+      break;
+    case LIST_ADD_FIRST:
+      if (prev == NULL) prev = new ListTemplate<T> (obj, this, NULL, bRef);
+      else return prev->add (obj, mode, bRef);
+      break;
+    case LIST_ADD_LAST:
+      if (next == NULL) next = new ListTemplate<T> (obj, NULL, this, bRef);
+      else return next->add (obj, mode, bRef);
+      break;
+    default:
+        return -1;
+      break;
+  }
+  ++size;
+  return 0;
+}
+
+/**
+  \brief Get the next element of the ListTemplate
+  \return The ListTemplate element after the current ListTemplate element
+*/
+template<class T>
+ListTemplate<T>* ListTemplate<T>::getNext ()
+{
+  return next;
+}
+ 
+/**
+  \brief Get the previous element of the ListTemplate
+  \return The ListTemplate element before the current ListTemplate element
+*/
+template<class T>
+ListTemplate<T>* ListTemplate<T>::getPrevious ()
+{
+  return prev;
+}
+
+/**
+  \brief Get the last element of the ListTemplate
+  \return The last ListTemplate element
+*/
+template<class T>
+ListTemplate<T>* ListTemplate<T>::getLast ()
+{
+  if (next == NULL) return this;
+  else return next->getLast();
+}
+
+/**
+  \brief Get the first element of the ListTemplate
+  \return The first ListTemplate element
+*/
+template<class T>
+ListTemplate<T>* ListTemplate<T>::getFirst ()
+{
+  if (prev == NULL) return this;
+  else return prev->getFirst();
+}
+
+/**
+  \brief Removes a certain element from the ListTemplate
+  \param obj: A pointer to the object that should be removed
+  \param mode: A value of FINDMODE
+  \return 0 if the element was found and removed, -1 if the element was not found
+  
+  This searches the part of the ListTemplate specified with mode for the object in question.
+  When the object is found it is deleted and the ListTemplate element is removed from the chain.
+  If mode is LIST_FIND_FW all elements AFTER the base element are searched, if mode is
+  LIST_FIND_BW all elements BEFORE the base element are searched. Note that the object
+  contained within the ListTemplate element is NOT deleted when bRef was set to true.
+*/
+template<class T>
+int ListTemplate<T>::remove (T* obj, FINDMODE mode = LIST_FIND_FW)
+{
+  if (obj == NULL) return -1;
+  else
+  {
+    switch (mode)
+    {
+      case LIST_FIND_BW:
+        if (prev == NULL) return -1;
+        else
+        {
+          if( prev->getObject() == obj)
+          {
+            delete prev;
+          }
+          else
+          {
+            return prev->remove( obj, mode);
+          }
+        }
+        break;
+      case LIST_FIND_FW:
+        if (next == NULL) return -1;
+        else
+        {
+          if( next->getObject() == obj)
+          {
+            delete next;
+          }
+          else
+          {
+            return next->remove( obj, mode);
+          }
+        }
+        break;
+      default:
+        return -1;
+    }
+  }
+  --size;
+  return 0;
+}
+
+/**
+  \brief Set the next element of a ListTemplate element
+  \param ptr: A pointer to the new next element
+    
+  Sets the next element of a ListTemplate element... Better not touch this, it can really mess up a ListTemplate.
+*/
+template<class T>
+void ListTemplate<T>::setNext (ListTemplate<T>* ptr)
+{
+  next = ptr;
+}
+
+/**
+  \brief Set the prev element of a ListTemplate element
+  \param ptr: A pointer to the new previous element
+    
+  Sets the previous element of a ListTemplate element... Better not touch this, it can really mess up a ListTemplate.
+*/
+template<class T>
+void ListTemplate<T>::setPrev (ListTemplate<T>* ptr)
+{
+  prev = ptr;
+}
+
+/**
+  \brief Get the pointer to the object the element is containing
+  \return The contained object (will be NULL if called on the base element).
+*/
+template<class T>
+T* ListTemplate<T>::getObject()
+{
+  return object;
+}
+
+
+/**
+  \brief Returns the current size of the ListTemplate
+  \return Size of ListTemplate
+*/
+template<class T>
+int ListTemplate<T>::getSize()
+{
+  return this->size;
+}
+
+
+template<class T>
+void ListTemplate<T>::destroy()
+{
+  /* \todo at the moment - doing nothing. should delete everything */
+}
+
+#endif /* _LIST_TENMPLATE_H */
+
Index: orxonox/trunk/src/util/resource_manager.cc
===================================================================
--- orxonox/trunk/src/util/resource_manager.cc	(revision 3869)
+++ orxonox/trunk/src/util/resource_manager.cc	(revision 3869)
@@ -0,0 +1,591 @@
+/* 
+   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: Patrick Boenzli
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD
+
+#include "resource_manager.h"
+
+// different resource Types
+#include "objModel.h"
+#include "primitive_model.h"
+#include "texture.h"
+#include "text_engine.h"
+
+#include "list.h"
+
+// File Handling Includes
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+using namespace std;
+
+/**
+   \brief standard constructor
+*/
+ResourceManager::ResourceManager () 
+{
+   this->setClassName ("ResourceManager");
+   this->dataDir = "./";
+   this->imageDirs = new tList<char>();
+   this->resourceList = new tList<Resource>();
+}
+
+/**
+   \returns the Instance to this ResourceManager
+*/
+ResourceManager* ResourceManager::getInstance(void)
+{
+  if (!ResourceManager::singletonRef)
+    ResourceManager::singletonRef = new ResourceManager();
+  return ResourceManager::singletonRef;
+}
+
+//! Singleton Reference to the ResourceManager
+ResourceManager* ResourceManager::singletonRef = NULL;
+
+/**
+   \brief standard destructor
+*/
+ResourceManager::~ResourceManager (void) 
+{
+  // deleting the Resources-List
+  this->unloadAllByPriority(RP_GAME);
+  delete this->resourceList;
+  // deleting the Directorie Lists
+  tIterator<char>* tmpIt = imageDirs->getIterator();
+  char* tmpDir = tmpIt->nextElement();
+  while(tmpDir)
+    {
+      delete []tmpDir;
+      tmpDir = tmpIt->nextElement();
+    }
+  delete tmpIt;
+
+  delete this->imageDirs;
+
+  ResourceManager::singletonRef = NULL;
+}
+
+/**
+   \brief sets the data main directory
+   \param dataDir the DataDirectory.
+*/
+bool ResourceManager::setDataDir(char* dataDir)
+{
+  if (isDir(dataDir))
+    {
+      this->dataDir = new char[strlen(dataDir)+1];
+      strcpy(this->dataDir, dataDir);
+    }
+  else
+    {
+      PRINTF(1)("%s is not a Directory, and can not be the Data Directory\n", dataDir);
+    }
+}
+
+/**
+   \brief adds a new Path for Images
+   \param imageDir The path to insert
+   \returns true, if the Path was well and injected (or already existent within the list)
+   false otherwise
+*/
+bool ResourceManager::addImageDir(char* imageDir)
+{
+  // check if the param is a Directory
+  if (isDir(imageDir))
+    {
+      // check if the Directory has been added before
+      tIterator<char>* tmpImageDirs = imageDirs->getIterator();
+      char* tmpDir = tmpImageDirs->nextElement();
+      while(tmpDir)
+	{
+	  if (!strcmp(tmpDir, imageDir))
+	    {
+	      PRINTF(4)("Path %s already loaded\n", imageDir);
+	      delete tmpImageDirs;
+	      return true;
+	    }
+	  tmpDir = tmpImageDirs->nextElement();
+	}
+      delete tmpImageDirs;
+
+      // adding the directory to the List
+      tmpDir  = new char[strlen(imageDir)+1];
+      strcpy(tmpDir, imageDir);
+      this->imageDirs->add(tmpDir);
+      return true;
+    }
+  else
+    {
+      PRINTF(1)("%s is not a Directory, and can not be added to the Paths of Images\n", dataDir);
+      return false;
+    }
+}
+
+/**
+   \brief loads resources
+   \param fileName The fileName of the resource to load
+   \param prio The ResourcePriority of this resource (will only be increased)
+   \returns a pointer to a desired Resource.
+*/
+void* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
+{
+  ResourceType tmpType;
+  if (!strncmp(fileName+(strlen(fileName)-4), ".obj", 4))
+    tmpType = OBJ;
+  else if (!strncmp(fileName+(strlen(fileName)-4), ".wav", 4))
+    tmpType = WAV;
+  else if (!strncmp(fileName+(strlen(fileName)-4), ".mp3", 4))
+    tmpType = MP3;
+  else if (!strncmp(fileName+(strlen(fileName)-4), ".ogg", 4))
+    tmpType = OGG;
+  else if (!strcmp(fileName, "cube") ||
+           !strcmp(fileName, "sphere") ||
+	   !strcmp(fileName, "plane") ||
+           !strcmp(fileName, "cylinder") ||
+           !strcmp(fileName, "cone"))
+    tmpType = PRIM;
+  else if (!strncmp(fileName+(strlen(fileName)-4), ".ttf", 4))
+    tmpType = TTF;
+  else 
+    tmpType = IMAGE;
+
+  return this->load(fileName, tmpType, prio, param1, param2, param3);
+}
+
+/**
+   \brief loads resources
+   \param fileName The fileName of the resource to load
+   \param type The Type of Resource to load (\see ResourceType)
+   \param prio The ResourcePriority of this resource (will only be increased)
+   \returns a pointer to a desired Resource.
+*/
+void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio, void* param1, void* param2, void* param3)
+{
+  // searching if the resource was loaded before.
+  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3);
+  if (tmpResource) // if the resource was not loaded before.
+    {
+      PRINTF(4)("not loading cached resource %s\n", tmpResource->name);
+      tmpResource->count++;
+      if(tmpResource->prio < prio)
+	tmpResource->prio = prio;
+    }
+  else
+    {
+      char* tmpDir;
+      // Setting up the new Resource
+      tmpResource = new Resource;
+      tmpResource->count = 1;
+      tmpResource->type = type;
+      tmpResource->prio = prio;
+      tmpResource->name = new char[strlen(fileName)+1];
+      strcpy(tmpResource->name, fileName);
+
+      // creating the full name. (directoryName + FileName)
+      char* fullName = new char[strlen(dataDir)+strlen(fileName)+1];
+      sprintf(fullName, "%s%s", this->dataDir, fileName);
+      
+      // Checking for the type of resource \see ResourceType
+      switch(type)
+	{
+	case OBJ:
+	  if (param1)
+	    tmpResource->modelSize = *(float*)param1;
+	  else
+	    tmpResource->modelSize = 1.0;
+
+	  if(isFile(fullName))
+	    tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
+	  else
+	    {
+	      PRINTF(2)("Sorry, %s does not exist. Loading a cube-Model instead\n", fullName);
+	      tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
+	    }
+	  break;
+	case PRIM:
+	  if (param1)
+	    tmpResource->modelSize = *(float*)param1;
+	  else
+	    tmpResource->modelSize = 1.0;
+
+	  if (!strcmp(tmpResource->name, "cube"))
+	    tmpResource->pointer = new PrimitiveModel(CUBE, tmpResource->modelSize);
+	  else if (!strcmp(tmpResource->name, "sphere"))
+	    tmpResource->pointer = new PrimitiveModel(SPHERE, tmpResource->modelSize);
+	  else if (!strcmp(tmpResource->name, "plane"))
+	    tmpResource->pointer = new PrimitiveModel(PLANE, tmpResource->modelSize);
+	  else if (!strcmp(tmpResource->name, "cylinder"))
+	    tmpResource->pointer = new PrimitiveModel(CYLINDER, tmpResource->modelSize);
+	  else if (!strcmp(tmpResource->name, "cone"))
+	    tmpResource->pointer = new PrimitiveModel(CONE, tmpResource->modelSize);
+	  break;
+	case TTF:
+	    if (param1)
+	      tmpResource->ttfSize = *(int*)param1;
+	    else
+	      tmpResource->ttfSize = FONT_DEFAULT_SIZE;
+	    if (param2)
+	      {
+		Vector* tmpVec = (Vector*)param2;
+		tmpResource->ttfColorR = (int)tmpVec->x;
+		tmpResource->ttfColorG = (int)tmpVec->y;
+		tmpResource->ttfColorB = (int)tmpVec->z;
+	      }
+	    else
+	      {
+		tmpResource->ttfColorR = FONT_DEFAULT_COLOR_R;
+		tmpResource->ttfColorG = FONT_DEFAULT_COLOR_G;
+		tmpResource->ttfColorB = FONT_DEFAULT_COLOR_B;
+	      }
+	    
+	  if(isFile(fullName))
+	    tmpResource->pointer = new Font(fullName,
+					    tmpResource->ttfSize,
+					    tmpResource->ttfColorR,
+					    tmpResource->ttfColorG,
+					    tmpResource->ttfColorB);
+	  else
+	    PRINTF(2)("Sorry, %s does not exist. Not loading Font\n", fullName);
+	  break;
+	case IMAGE:
+	  if(isFile(fullName))
+	    {
+	      PRINTF(4)("Image %s resides to %s\n", fileName, fullName);
+	      tmpResource->pointer = new Texture(fullName);
+	    }
+	  else
+	    {
+	      tIterator<char>* iterator = imageDirs->getIterator();
+	      tmpDir = iterator->nextElement();
+	      //tmpDir = imageDirs->enumerate();
+	      while(tmpDir)
+		{
+		  char* imgName = new char[strlen(tmpDir)+strlen(fileName)+1];
+		  sprintf(imgName, "%s%s", tmpDir, fileName);
+		  if(isFile(imgName))
+		    {
+		      PRINTF(4)("Image %s resides to %s\n", fileName, imgName);
+		      tmpResource->pointer = new Texture(imgName);
+		      delete []imgName;
+		      break;
+		    }
+		  delete []imgName;
+		  tmpDir = iterator->nextElement();
+		}
+	      delete iterator;
+	    }
+	  if(!tmpResource)
+	     PRINTF(2)("!!Image %s not Found!!\n", fileName);
+	  break;
+	default:
+	  tmpResource->pointer = NULL;
+	  PRINTF(1)("No type found for %s.\n   !!This should not happen unless the Type is not supported yet.!!\n", tmpResource->name);
+	  break;
+	}
+      this->resourceList->add(tmpResource);
+      delete []fullName;
+    }
+  if (tmpResource->pointer)
+    return tmpResource->pointer;
+  else 
+    {
+      PRINTF(2)("Resource %s could not be loaded\n", fileName);
+      delete tmpResource;
+      return NULL;
+    }
+}
+
+/**
+   \brief unloads a Resource
+   \param pointer The pointer to free
+   \returns true if successful (pointer found, and deleted), false otherwise
+   
+*/
+bool ResourceManager::unload(void* pointer, ResourcePriority prio)
+{
+  // if pointer is existent. and only one resource of this type exists.
+  Resource* tmpResource = this->locateResourceByPointer(pointer);
+  if (!tmpResource)
+    {
+      PRINTF(2)("Resource not Found %p\n", pointer);
+      return false;
+    }
+  else
+    unload(tmpResource, prio);
+}
+
+bool ResourceManager::unload(Resource* resource, ResourcePriority prio)
+{
+  if (resource->count > 0)
+    resource->count--;
+  if (resource->prio <= prio)
+    {
+      if (resource->count <= 0)
+	{
+	  // deleting the Resource
+	  switch(resource->type)
+	    {
+	    case OBJ:
+	    case PRIM:
+	      delete (Model*)resource->pointer;
+	      break;
+	    case IMAGE:
+	      delete (Texture*)resource->pointer;
+	      break;
+	    case TTF:
+	      delete (Font*)resource->pointer;
+	      break;
+	    default:
+	      PRINTF(1)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
+	      return false;
+	      break;
+	    }
+	  // deleting the List Entry:
+	  PRINTF(4)("Resource %s safely removed.\n", resource->name);
+	  delete []resource->name;
+	  this->resourceList->remove(resource);
+	}
+      else
+	PRINTF(4)("Resource %s not removed, because there are still %d References to it.\n", resource->name, resource->count);
+    }
+  else
+    PRINTF(4)("not deleting resource %s because DeleteLevel to high\n", resource->name);
+  return true;
+}
+
+
+/**
+   \brief unloads all alocated Memory of Resources with a pririty lower than prio
+   \param prio The priority to delete
+*/
+bool ResourceManager::unloadAllByPriority(ResourcePriority prio)
+{
+  tIterator<Resource>* iterator = resourceList->getIterator();
+  Resource* enumRes = iterator->nextElement();
+  while (enumRes)
+    {
+      if (enumRes->prio <= prio)
+	if (enumRes->count == 0)
+	  unload(enumRes, prio);
+	else
+	  PRINTF(2)("unable to unload %s because there are still %d references to it\n",
+		   enumRes->name, enumRes->count);
+      //enumRes = resourceList->nextElement();
+      enumRes = iterator->nextElement();
+    }
+  delete iterator;
+}
+
+/**
+   \brief Searches for a Resource by some information
+   \param fileName The name to look for
+   \returns a Pointer to the Resource if found, NULL otherwise.
+*/
+Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3)
+{
+  //  Resource* enumRes = resourceList->enumerate();
+  tIterator<Resource>* iterator = resourceList->getIterator();
+  Resource* enumRes = iterator->nextElement();
+  while (enumRes)
+    {
+      if (enumRes->type == type && !strcmp(fileName, enumRes->name))
+	{
+	  bool match = false;
+	  bool subMatch = false;
+	  switch (type)
+	    {
+	    case PRIM:
+	    case OBJ:
+	      if (!param1)
+		{
+		  if (enumRes->modelSize == 1.0)
+		    match = true;
+		}
+	      else if (enumRes->modelSize == *(float*)param1)
+		match = true;
+	      break;
+	    case TTF:
+	      if (!param1)
+		{
+		  if (enumRes->ttfSize == FONT_DEFAULT_SIZE)
+		    subMatch = true;
+		}
+	      else if (enumRes->modelSize =- *(int*)param1)
+		subMatch = true;
+	      if(subMatch)
+		{
+		  Vector* tmpVec = (Vector*)param2;
+		  if (!param2)
+		    {
+		      if(enumRes->ttfColorR == FONT_DEFAULT_COLOR_R &&
+			 enumRes->ttfColorG == FONT_DEFAULT_COLOR_G &&
+			 enumRes->ttfColorB == FONT_DEFAULT_COLOR_B )
+			match = true;
+		    }
+		  else if (enumRes->ttfColorR == (int)tmpVec->x &&
+			   enumRes->ttfColorG == (int)tmpVec->y &&
+			   enumRes->ttfColorB == (int)tmpVec->z )
+		    match = true;
+		}
+
+	      break;
+	    default:
+	      match = true;
+	      break;
+	    }
+	  if (match)
+	    {
+	      delete iterator;
+	      return enumRes;
+	    }
+	}
+      enumRes = iterator->nextElement();
+    }
+  delete iterator;
+  return NULL;
+}
+
+/**
+   \brief Searches for a Resource by Pointer
+   \param pointer the Pointer to search for
+   \returns a Pointer to the Resource if found, NULL otherwise.
+*/
+Resource* ResourceManager::locateResourceByPointer(const void* pointer)
+{
+  //  Resource* enumRes = resourceList->enumerate();
+  tIterator<Resource>* iterator = resourceList->getIterator();
+  Resource* enumRes = iterator->nextElement();
+  while (enumRes)
+    {
+      if (pointer == enumRes->pointer)
+	{
+	  delete iterator;
+	  return enumRes;
+	}
+      enumRes = iterator->nextElement();
+    }
+  delete iterator;
+  return NULL;
+}
+
+/**
+   \brief Checks if it is a Directory
+   \param directoryName the Directory to check for
+   \returns true if it is a directory/symlink false otherwise
+*/
+bool ResourceManager::isDir(const char* directoryName)
+{
+  struct stat status;
+  stat(directoryName, &status);
+  if (status.st_mode & (S_IFDIR 
+#ifndef __WIN32__
+			| S_IFLNK
+#endif
+			))
+    return true;
+  else
+    return false;
+}
+
+/**
+   \brief Checks if the file is either a Regular file or a Symlink
+   \param fileName the File to check for
+   \returns true if it is a regular file/symlink, false otherwise
+*/
+bool ResourceManager::isFile(const char* fileName)
+{
+  struct stat status;
+  stat(fileName, &status);
+  if (status.st_mode & (S_IFREG 
+#ifndef __WIN32__
+			| S_IFLNK
+#endif
+			))
+    return true;
+  else
+    return false;
+}
+
+/**
+   \brief outputs debug information about the ResourceManager
+*/
+void ResourceManager::debug(void)
+{
+  PRINT(0)("=RM===================================\n");
+  PRINT(0)("= RESOURCE-MANAGER DEBUG INFORMATION =\n");
+  PRINT(0)("======================================\n");
+  // if it is not initialized
+  PRINT(0)(" Reference is: %p\n", ResourceManager::singletonRef);
+  PRINT(0)(" Data-Directory is: %s\n", this->dataDir);
+  PRINT(0)(" List of Image-Directories: ");
+  tIterator<char>* tmpIt = imageDirs->getIterator();
+  char* tmpDir = tmpIt->nextElement();
+  while(tmpDir)
+    {
+      PRINT(0)("%s ",tmpDir);
+      tmpDir = tmpIt->nextElement();
+    }
+  delete tmpIt;
+  PRINT(0)("\n");
+
+  PRINT(0)("List of all stored Resources:\n");
+  tIterator<Resource>* iterator = resourceList->getIterator();
+  Resource* enumRes = iterator->nextElement();
+  while (enumRes)
+    {
+      PRINT(0)("-----------------------------------------\n");
+      PRINT(0)("Name: %s; References: %d; Type:", enumRes->name, enumRes->count);
+      switch (enumRes->type)
+	{
+	case OBJ:
+	  PRINT(0)("ObjectModel\n");
+	  break;
+	case PRIM:
+	  PRINT(0)("PrimitiveModel\n");
+	  break;
+	case IMAGE:
+	  PRINT(0)("ImageFile (Texture)\n");
+	  break;
+	default:
+	  PRINT(0)("SoundFile\n");
+	  break;
+	}
+      PRINT(0)("gets deleted at ");
+      switch(enumRes->prio)
+	{
+	default:
+	case RP_NO:
+	  PRINT(0)("first posibility (0)\n");
+	  break;
+	case RP_LEVEL:
+	  PRINT(0)("the end of the Level (1)\n");
+	  break;
+	case RP_CAMPAIGN:
+	  PRINT(0)("the end of the campaign (2)\n");
+	  break;
+	case RP_GAME:
+	  PRINT(0)("when leaving the game (3)\n");
+	  break;
+	}
+      enumRes = iterator->nextElement();
+    }
+  delete iterator;
+
+
+
+  PRINT(0)("==================================RM==\n");
+}
Index: orxonox/trunk/src/util/resource_manager.h
===================================================================
--- orxonox/trunk/src/util/resource_manager.h	(revision 3869)
+++ orxonox/trunk/src/util/resource_manager.h	(revision 3869)
@@ -0,0 +1,95 @@
+/*! 
+    \file resource_manager.h
+    \brief The Resource Manager checks if a file/resource is loaded.
+
+    If a file/resource was already loaded the resourceManager will 
+    return a void pointer to the desired resource.
+    Otherwise it will instruct the coresponding resource-loader to load,
+    and receive a pointer to it.
+*/
+
+#ifndef _RESOURCE_MANAGER_H
+#define _RESOURCE_MANAGER_H
+
+#include "base_object.h"
+
+// FORWARD DEFINITION \\
+//template<class T> class tList;
+#include "list.h"                //! \todo do this by forward definition (ask Patrick)
+
+//! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support
+enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, TTF, IMAGE};
+//! An enumerator for different UNLOAD-types. 
+/**
+   RP_NO: will be unloaded on request
+   RP_LEVEL: will be unloaded at the end of a Level
+   RP_CAMPAIGN: will be unloaded at the end of a Campaign
+   RP_GAME: will be unloaded at the end of the whole Game (when closing orxonox)
+*/
+enum ResourcePriority {RP_NO = 0, RP_LEVEL = 1, RP_CAMPAIGN = 2, RP_GAME = 3};
+
+//! A Struct that keeps track about A resource its name its Type, and so on
+struct Resource
+{
+  void* pointer;             //!< Pointer to the Resource.
+  int count;                 //!< How many times this Resource has been loaded.
+  
+  char* name;                //!< Name of the Resource.
+  ResourceType type;         //!< ResourceType of this Resource.
+  ResourcePriority prio;     //!< The Priority of this resource. (This will only be increased)
+
+  // more specific
+  float modelSize;
+  unsigned int ttfSize;
+  unsigned char ttfColorR;
+  unsigned char ttfColorG;
+  unsigned char ttfColorB;
+};
+
+
+//! The ResourceManager is a class, that decides if a file/resource should be loaded
+/**
+   If a file/resource was already loaded the resourceManager will 
+   return a void pointer to the desired resource.
+   Otherwise it will instruct the corresponding resource-loader to load,
+   and receive the pointer to it.
+
+   It does it by looking, if a desired file has already been loaded.
+
+   \todo loading also dependant by parameters.
+*/
+class ResourceManager : public BaseObject 
+{
+ public:
+  static ResourceManager* getInstance();
+  virtual ~ResourceManager();
+
+  bool setDataDir(char* dataDir);
+  bool addImageDir(char* imageDir);
+  void* load(const char* fileName, ResourcePriority prio = RP_NO,
+	     void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+  void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
+	     void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
+  bool unload(void* pointer, ResourcePriority prio = RP_NO);
+  bool unload(Resource* resource, ResourcePriority = RP_NO);
+  bool unloadAllByPriority(ResourcePriority prio);
+  void debug(void);
+
+ private:
+  ResourceManager();
+  static ResourceManager* singletonRef;
+
+  tList<Resource>* resourceList;       //!< The List of Resources, that has already been loaded.
+  char* dataDir;                       //!< The Data Directory, where all relevant Data is stored.
+  tList<char>* imageDirs;              //!< A list of directories in which images are stored.
+
+
+  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3);
+  Resource* locateResourceByPointer(const void* pointer);
+  
+  bool isDir(const char* directory);
+  bool isFile(const char* directory);
+
+};
+
+#endif /* _RESOURCE_MANAGER_H */
Index: orxonox/trunk/src/world_entities/camera.cc
===================================================================
--- orxonox/trunk/src/world_entities/camera.cc	(revision 3869)
+++ orxonox/trunk/src/world_entities/camera.cc	(revision 3869)
@@ -0,0 +1,199 @@
+
+
+/* 
+   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: Christian Meyer
+   co-programmer: ...
+*/
+
+#include "camera.h"
+
+#include "world.h"
+#include "world_entity.h"
+#include "vector.h"
+
+using namespace std;
+
+////////////
+// CAMERA //
+////////////
+
+/**
+   \brief creates a Camera
+*/
+Camera::Camera(void)
+{
+  this->setClassName("Camera");
+  this->target = new CameraTarget();
+
+  this->setFovy(90);
+  this->setAspectRatio(1.2f);
+  this->setClipRegion(.1, 2000);
+
+  this->setViewMode(VIEW_NORMAL);
+}
+
+/**
+   \brief default destructor
+*/
+Camera::~Camera(void)
+{
+}
+
+/**
+   \brief focuses the Camera onto a Target
+   \param target the new PNode the Camera should look at.
+*/
+void Camera::lookAt(PNode* target)
+{
+  this->target->setParent(target);
+}
+
+/**
+   \returns The PNode of the Target (from there you can get position and so on
+*/
+PNode* Camera::getTarget(void)
+{
+  return (PNode*)this->target;
+}
+
+
+/**
+   \brief sets a new AspectRatio
+   \param aspectRatio the new aspect ratio to set (width / height)
+*/
+void Camera::setAspectRatio(float aspectRatio)
+{
+  this->aspectRatio = aspectRatio;
+}
+
+/**
+   \brief sets the Field of View to fofy
+   \param fovy new field of view factor (in degrees)
+*/
+void Camera::setFovy(float fovy)
+{
+  this->fovy = fovy;
+}
+
+/**
+  \brief Sets a new clipping region
+  \param nearClip The near clip plane
+  \param farClip The far clip plane
+*/
+void Camera::setClipRegion(float nearClip, float farClip)
+{
+  this->nearClip = nearClip;
+  this->farClip = farClip;
+}
+
+void Camera::setViewMode(ViewMode mode)
+{
+  switch (mode)
+    {
+    default:
+    case VIEW_NORMAL:
+      this->toFovy = 60.0;
+      this->toRelCoor = Vector(-10, 5, 0);
+      break;
+    case VIEW_BEHIND:
+      this->toFovy = 120.0;
+      this->toRelCoor = Vector(-7, 0, 0);
+      break;
+    case VIEW_FRONT:
+      this->toFovy = 95.0;
+      this->toRelCoor = Vector(12, 5, 0);
+      break;
+    case VIEW_LEFT: 
+      this->toFovy = 90;
+      this->toRelCoor = Vector(0, 2, -10);
+      break;
+    case VIEW_RIGHT:
+      this->toFovy = 90;
+      this->toRelCoor = Vector(0, 2, 10);
+      break;
+    case VIEW_TOP:
+      this->toFovy= 120;
+      this->toRelCoor = Vector(0, 4, 0);
+    }
+}
+
+
+/**
+   \brief Updates the position of the camera.
+   \param dt The time that elapsed.
+*/
+void Camera::tick(float dt)
+{
+  dt /= 500;
+  float tmpFovy = (this->toFovy - this->fovy) * dt;
+  if (tmpFovy > .001)
+    this->fovy += (this->toFovy - this->fovy) * dt;
+  Vector tmpPos = (this->toRelCoor - *this->getRelCoor()) * dt;
+  if (tmpPos.len() >= .001)
+    {
+      tmpPos = tmpPos + *this->getRelCoor();
+      this->setRelCoor(tmpPos);
+    }
+}
+
+
+/**
+   \brief initialize rendering perspective according to this camera
+   
+   This is called immediately before the rendering cycle starts, it sets all global
+   rendering options as well as the GL_PROJECTION matrix according to the camera.
+*/
+void Camera::apply ()
+{
+  // switching to Projection Matrix
+  glMatrixMode (GL_PROJECTION);
+  glLoadIdentity ();
+
+  // setting up the perspective
+  gluPerspective(this->fovy,
+		 this->aspectRatio,
+		 this->nearClip,
+		 this->farClip);
+
+  // speed-up feature
+  Vector cameraPosition = this->getAbsCoor();
+  Vector targetPosition = this->target->getAbsCoor();
+  Vector up = Vector(0, 1, 0);
+  up = this->getAbsDir().apply(up);
+
+  // Setting the Camera Eye, lookAt and up Vectors
+  gluLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z,
+	    targetPosition.x, targetPosition.y, targetPosition.z,
+	    up.x, up.y, up.z);
+
+  // switching back to Modeling Matrix
+  glMatrixMode (GL_MODELVIEW);
+}
+
+
+
+///////////////////
+// CAMERA-TARGET //
+///////////////////
+
+
+CameraTarget::CameraTarget()
+{
+  this->setClassName("CameraTarget");
+  this->setMode(PNODE_MOVEMENT);
+}
+
+CameraTarget::~CameraTarget()
+{
+
+}
Index: orxonox/trunk/src/world_entities/camera.h
===================================================================
--- orxonox/trunk/src/world_entities/camera.h	(revision 3869)
+++ orxonox/trunk/src/world_entities/camera.h	(revision 3869)
@@ -0,0 +1,63 @@
+/*! 
+    \file camera.h
+    \brief Viewpoint controlling class definitions
+*/ 
+
+#ifndef _CAMERA_H
+#define _CAMERA_H
+
+#include "p_node.h"
+#include "vector.h"
+
+class World;
+class CameraTarget;
+
+enum ViewMode{VIEW_NORMAL, VIEW_BEHIND, VIEW_FRONT, VIEW_LEFT, VIEW_RIGHT, VIEW_TOP};
+
+//! Camera
+/**
+   This class controls the viewpoint from which the World is rendered.
+*/
+class Camera : public PNode 
+{
+ private:
+  CameraTarget* target;            //!< The Target of the Camera (where this Camera Looks at)
+
+  float fovy;                      //!< The field of view Angle (in degrees).
+  float aspectRatio;               //!< The aspect ratio (width / height).
+  float nearClip;                  //!< The near clipping plane.
+  float farClip;                   //!< The far clipping plane.
+
+  Vector toRelCoor;
+  float toFovy;
+  
+ public:
+  Camera(void);
+  virtual ~Camera(void);
+
+  void lookAt(PNode* target);
+  PNode* getTarget();
+
+  void setAspectRatio(float aspectRatio);
+  void setFovy(float fovy);
+  void setClipRegion(float nearClip, float farClip);
+
+  void setViewMode(ViewMode mode);
+  void tick(float dt);
+  void apply (void);
+};
+
+//! A CameraTarget is where the Camera is looking at.
+class CameraTarget : public PNode 
+{
+  friend class Camera;             //! The CameraTarget is a friend of Camera. noone else needs a CameraTarget, so noone else can create it.
+  
+ private:
+  CameraTarget(void);
+  
+ public:
+  virtual ~CameraTarget(void);
+};
+
+
+#endif /* _CAMERA_H */
