Index: orxonox/trunk/ChangeLog
===================================================================
--- orxonox/trunk/ChangeLog	(revision 3789)
+++ orxonox/trunk/ChangeLog	(revision 3790)
@@ -1,2 +1,11 @@
+2005-03-31	Benjamin Grauer <bensch@orxonox.ethz.ch>
+	Added Text Engine
+
+2005-03-26	Benjamin Grauer <bensch@orxonox.ethz.ch>
+	Added ResourceManager
+
+2005-03-24	Patrick Boenzli <patrick@orxonox.ethz.ch>
+	Reimplemented shooting.
+
 2005-03-16	orxonox
 	Finished work on version 0.2.1-pre-alpha released 0.2.2-pre-alpha
Index: orxonox/trunk/config.h.in
===================================================================
--- orxonox/trunk/config.h.in	(revision 3789)
+++ orxonox/trunk/config.h.in	(revision 3790)
@@ -53,9 +53,12 @@
 #undef HAVE_PTHREAD_H
 
-/* Define to 1 if you have the <SDL/SDL.h> header file. */
-#undef HAVE_SDL_SDL_H
+/* Define to 1 if you have the <SDL.h> header file. */
+#undef HAVE_SDL_H
 
-/* Define to 1 if you have the <SDL/SDL_image.h> header file. */
-#undef HAVE_SDL_SDL_IMAGE_H
+/* Define to 1 if you have the <SDL_image.h> header file. */
+#undef HAVE_SDL_IMAGE_H
+
+/* Define to 1 if you have the <SDL_ttf.h> header file. */
+#undef HAVE_SDL_TTF_H
 
 /* Define to 1 if you have the `sqrt' function. */
Index: orxonox/trunk/configure
===================================================================
--- orxonox/trunk/configure	(revision 3789)
+++ orxonox/trunk/configure	(revision 3790)
@@ -4205,4 +4205,6 @@
 echo "mingw-WINDOWS detected"
 
+CPPFLAGS="-I/usr/include/SDL -I/mingw/include/SDL"
+
     mingw="yes"
     MSBITFIELDS="-mms-bitfields"
@@ -4811,5 +4813,5 @@
 # checking for SDL-headers
 
-for ac_header in SDL/SDL.h
+for ac_header in SDL.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5118,5 +5120,5 @@
  Linux="yes"
 
-CPPFLAGS="-I/usr/X11R6/include"
+CPPFLAGS="-I/usr/X11R6/include -I/usr/include/SDL"
 LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
 # checking gl header
@@ -5591,5 +5593,5 @@
 # checking for SDL-headers
 
-for ac_header in SDL/SDL.h
+for ac_header in SDL.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -6180,4 +6182,236 @@
 ###################################
 
+#---------#
+# SDL_ttf #
+#---------#
+# checking for SDL_ttf-headers
+
+for ac_header in SDL_ttf.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ---------------------------------------------- ##
+## Report this to orxonox-dev at mail.datacore.ch ##
+## ---------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { echo "$as_me:$LINENO: error: cannot find SDL_ttf header." >&5
+echo "$as_me: error: cannot find SDL_ttf header." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+#fi
+# checking for SDL_ttf-lib
+  echo "$as_me:$LINENO: checking for main in -lSDL_ttf" >&5
+echo $ECHO_N "checking for main in -lSDL_ttf... $ECHO_C" >&6
+if test "${ac_cv_lib_SDL_ttf_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lSDL_ttf  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_SDL_ttf_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_SDL_ttf_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_ttf_main" >&5
+echo "${ECHO_T}$ac_cv_lib_SDL_ttf_main" >&6
+if test $ac_cv_lib_SDL_ttf_main = yes; then
+  FOUND_SDL_ttf=yes
+fi
+
+     if test x$FOUND_SDL_ttf = xyes ; then
+       LIBS="$LIBS -lSDL_ttf"
+     else
+        echo "------------------"
+        echo "SDL_ttf library not found."
+	echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/"
+        echo "------------------"
+        exit -1
+     fi
+
 #-----------#
 # SDL_Image #
@@ -6186,5 +6420,5 @@
 # checking for SDL_image-headers
 
-for ac_header in SDL/SDL_image.h
+for ac_header in SDL_image.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
Index: orxonox/trunk/configure.ac
===================================================================
--- orxonox/trunk/configure.ac	(revision 3789)
+++ orxonox/trunk/configure.ac	(revision 3790)
@@ -235,4 +235,6 @@
 echo "mingw-WINDOWS detected"
 
+CPPFLAGS="-I/usr/include/SDL -I/mingw/include/SDL"
+
     mingw="yes"
     MSBITFIELDS="-mms-bitfields"
@@ -279,5 +281,5 @@
     fi
 # checking for SDL-headers
-    AC_CHECK_HEADERS([SDL/SDL.h] ,,
+    AC_CHECK_HEADERS([SDL.h] ,,
       [AC_MSG_ERROR([cannot find SDL headers]) ])
 
@@ -313,5 +315,5 @@
  Linux="yes"
 
-CPPFLAGS="-I/usr/X11R6/include"
+CPPFLAGS="-I/usr/X11R6/include -I/usr/include/SDL"
 LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
 # checking gl header
@@ -347,5 +349,5 @@
 
 # checking for SDL-headers
-    AC_CHECK_HEADERS([SDL/SDL.h] ,,
+    AC_CHECK_HEADERS([SDL.h] ,,
       [AC_MSG_ERROR([cannot find SDL headers]) ])
 
@@ -420,4 +422,23 @@
 ###################################
 
+#---------#
+# SDL_ttf #
+#---------#
+# checking for SDL_ttf-headers
+  AC_CHECK_HEADERS([SDL_ttf.h] ,,
+      [AC_MSG_ERROR([cannot find SDL_ttf header.])])
+#fi
+# checking for SDL_ttf-lib
+  AC_CHECK_LIB([SDL_ttf], [main], [FOUND_SDL_ttf=yes])
+     if test x$FOUND_SDL_ttf = xyes ; then
+       LIBS="$LIBS -lSDL_ttf"
+     else
+        echo "------------------"
+        echo "SDL_ttf library not found."
+	echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/"
+        echo "------------------"
+        exit -1
+     fi   
+
 #-----------#
 # SDL_Image #
@@ -425,5 +446,5 @@
 if test x$def_sdl_image = xyes; then
 # checking for SDL_image-headers
-  AC_CHECK_HEADERS([SDL/SDL_image.h] ,,
+  AC_CHECK_HEADERS([SDL_image.h] ,,
       [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
 fi
Index: orxonox/trunk/src/Makefile.am
===================================================================
--- orxonox/trunk/src/Makefile.am	(revision 3789)
+++ orxonox/trunk/src/Makefile.am	(revision 3790)
@@ -7,5 +7,4 @@
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics
-AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/font
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui
@@ -34,4 +33,5 @@
 		 track_manager.cc \
 		 track_node.cc \
+		 animation.cc \
 		 simple_animation.cc \
 		 garbage_collector.cc \
@@ -57,5 +57,5 @@
 		 lib/graphics/graphics_engine.cc \
 		 lib/graphics/light.cc \
-		 lib/graphics/font/fontset.cc \
+		 lib/graphics/text_engine.cc \
 		 lib/graphics/importer/array.cc \
 		 lib/graphics/importer/objModel.cc \
@@ -83,4 +83,5 @@
 		 track_manager.h \
 		 track_node.h \
+		 animation.h \
 		 simple_animation.h \
 		 garbage_collector.h \
@@ -114,5 +115,5 @@
 		 lib/graphics/graphics_engine.h \
 		 lib/graphics/light.h \
-		 lib/graphics/font/fontset.h \
+		 lib/graphics/text_engine.h \
 		 lib/data/data_tank.h \
 		 lib/lang/base_entity.h \
Index: orxonox/trunk/src/Makefile.in
===================================================================
--- orxonox/trunk/src/Makefile.in	(revision 3789)
+++ orxonox/trunk/src/Makefile.in	(revision 3790)
@@ -56,14 +56,14 @@
 	command_node.$(OBJEXT) keynames.$(OBJEXT) camera.$(OBJEXT) \
 	track_manager.$(OBJEXT) track_node.$(OBJEXT) \
-	simple_animation.$(OBJEXT) garbage_collector.$(OBJEXT) \
-	story_entity.$(OBJEXT) campaign.$(OBJEXT) world.$(OBJEXT) \
-	world_entity.$(OBJEXT) player.$(OBJEXT) environment.$(OBJEXT) \
-	skysphere.$(OBJEXT) terrain.$(OBJEXT) weapon.$(OBJEXT) \
-	projectile.$(OBJEXT) satellite.$(OBJEXT) \
-	character_attributes.$(OBJEXT) test_gun.$(OBJEXT) \
-	test_bullet.$(OBJEXT) ai.$(OBJEXT) p_node.$(OBJEXT) \
-	null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \
+	animation.$(OBJEXT) simple_animation.$(OBJEXT) \
+	garbage_collector.$(OBJEXT) story_entity.$(OBJEXT) \
+	campaign.$(OBJEXT) world.$(OBJEXT) world_entity.$(OBJEXT) \
+	player.$(OBJEXT) environment.$(OBJEXT) skysphere.$(OBJEXT) \
+	terrain.$(OBJEXT) weapon.$(OBJEXT) projectile.$(OBJEXT) \
+	satellite.$(OBJEXT) character_attributes.$(OBJEXT) \
+	test_gun.$(OBJEXT) test_bullet.$(OBJEXT) ai.$(OBJEXT) \
+	p_node.$(OBJEXT) null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \
 	data_tank.$(OBJEXT) graphics_engine.$(OBJEXT) light.$(OBJEXT) \
-	fontset.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \
+	text_engine.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \
 	primitive_model.$(OBJEXT) model.$(OBJEXT) material.$(OBJEXT) \
 	texture.$(OBJEXT) base_entity.$(OBJEXT) base_object.$(OBJEXT) \
@@ -75,6 +75,6 @@
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ai.Po ./$(DEPDIR)/array.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/base_entity.Po \
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ai.Po ./$(DEPDIR)/animation.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/array.Po ./$(DEPDIR)/base_entity.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/campaign.Po \
@@ -82,5 +82,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/command_node.Po ./$(DEPDIR)/curve.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/data_tank.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/environment.Po ./$(DEPDIR)/fontset.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/environment.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/game_loader.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/garbage_collector.Po \
@@ -102,5 +102,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/terrain.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/test_bullet.Po ./$(DEPDIR)/test_gun.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/texture.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/track_manager.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/track_node.Po ./$(DEPDIR)/vector.Po \
@@ -235,5 +235,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/font -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
+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
 AM_LDFLAGS = $(MWINDOWS)
 orxonox_SOURCES = orxonox.cc \
@@ -244,4 +244,5 @@
 		 track_manager.cc \
 		 track_node.cc \
+		 animation.cc \
 		 simple_animation.cc \
 		 garbage_collector.cc \
@@ -267,5 +268,5 @@
 		 lib/graphics/graphics_engine.cc \
 		 lib/graphics/light.cc \
-		 lib/graphics/font/fontset.cc \
+		 lib/graphics/text_engine.cc \
 		 lib/graphics/importer/array.cc \
 		 lib/graphics/importer/objModel.cc \
@@ -293,4 +294,5 @@
 		 track_manager.h \
 		 track_node.h \
+		 animation.h \
 		 simple_animation.h \
 		 garbage_collector.h \
@@ -324,5 +326,5 @@
 		 lib/graphics/graphics_engine.h \
 		 lib/graphics/light.h \
-		 lib/graphics/font/fontset.h \
+		 lib/graphics/text_engine.h \
 		 lib/data/data_tank.h \
 		 lib/lang/base_entity.h \
@@ -416,4 +418,5 @@
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ai.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@
@@ -426,5 +429,4 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_tank.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environment.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontset.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/game_loader.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/garbage_collector.Po@am__quote@
@@ -453,4 +455,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bullet.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gun.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text_engine.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@
@@ -813,19 +816,19 @@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o light.obj `if test -f 'lib/graphics/light.cc'; then $(CYGPATH_W) 'lib/graphics/light.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/light.cc'; fi`
 
-fontset.o: lib/graphics/font/fontset.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fontset.o -MD -MP -MF "$(DEPDIR)/fontset.Tpo" -c -o fontset.o `test -f 'lib/graphics/font/fontset.cc' || echo '$(srcdir)/'`lib/graphics/font/fontset.cc; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/fontset.Tpo" "$(DEPDIR)/fontset.Po"; else rm -f "$(DEPDIR)/fontset.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/graphics/font/fontset.cc' object='fontset.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/fontset.Po' tmpdepfile='$(DEPDIR)/fontset.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 fontset.o `test -f 'lib/graphics/font/fontset.cc' || echo '$(srcdir)/'`lib/graphics/font/fontset.cc
-
-fontset.obj: lib/graphics/font/fontset.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fontset.obj -MD -MP -MF "$(DEPDIR)/fontset.Tpo" -c -o fontset.obj `if test -f 'lib/graphics/font/fontset.cc'; then $(CYGPATH_W) 'lib/graphics/font/fontset.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/font/fontset.cc'; fi`; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/fontset.Tpo" "$(DEPDIR)/fontset.Po"; else rm -f "$(DEPDIR)/fontset.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/graphics/font/fontset.cc' object='fontset.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/fontset.Po' tmpdepfile='$(DEPDIR)/fontset.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 fontset.obj `if test -f 'lib/graphics/font/fontset.cc'; then $(CYGPATH_W) 'lib/graphics/font/fontset.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/font/fontset.cc'; fi`
+text_engine.o: lib/graphics/text_engine.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.o -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.o `test -f 'lib/graphics/text_engine.cc' || echo '$(srcdir)/'`lib/graphics/text_engine.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/graphics/text_engine.cc' object='text_engine.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.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 text_engine.o `test -f 'lib/graphics/text_engine.cc' || echo '$(srcdir)/'`lib/graphics/text_engine.cc
+
+text_engine.obj: lib/graphics/text_engine.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.obj -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.obj `if test -f 'lib/graphics/text_engine.cc'; then $(CYGPATH_W) 'lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/text_engine.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/graphics/text_engine.cc' object='text_engine.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.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 text_engine.obj `if test -f 'lib/graphics/text_engine.cc'; then $(CYGPATH_W) 'lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/text_engine.cc'; fi`
 
 array.o: lib/graphics/importer/array.cc
@@ -1175,5 +1178,5 @@
 
 distdir: $(DISTFILES)
-	$(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/font $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(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)/world_entities
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
Index: orxonox/trunk/src/animation.cc
===================================================================
--- orxonox/trunk/src/animation.cc	(revision 3790)
+++ orxonox/trunk/src/animation.cc	(revision 3790)
@@ -0,0 +1,137 @@
+/* 
+   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: ...
+*/
+
+
+#include "animation.h"
+#include "debug.h"
+#include "list.h"
+
+
+Anim::Anim(void)
+{
+  // create a new List
+  this->keyFrameList = new tList<AnimKeyFrame>();
+  
+  // initialize a beginning KeyFrame, that will be deleted afterwards
+  this->bHasKeys = false;
+  AnimKeyFrame* tmpKeyFrame = new AnimKeyFrame;
+  tmpKeyFrame->value = 0.0;
+  tmpKeyFrame->duration = 1.0;
+  keyFrameList->add(tmpKeyFrame);
+
+  // setting default values
+  this->localTime = 0.0;
+  this->bRunning = true;
+  this->animFunc = &Anim::linear;
+  this->currentKeyFrame = tmpKeyFrame;
+  this->nextKeyFrame = tmpKeyFrame;
+}
+
+
+Anim::~Anim(void)
+{
+  // delete all the KeyFrames
+  tIterator<AnimKeyFrame>* itKF = keyFrameList->getIterator();
+  AnimKeyFrame*  enumKF = itKF->nextElement();
+  while (enumKF)
+    {
+      delete enumKF;
+      enumKF = itKF->nextElement();
+    }
+  delete itKF;
+  delete this->keyFrameList;
+}
+
+tList<Anim>* Anim::animatorList = NULL;
+
+
+void Anim::addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc)
+{
+  // some small check
+  if (duration <= 0.0)
+    duration = 1.0;
+  
+
+  AnimKeyFrame* tmpKeyFrame;
+    
+  if (bHasKeys)
+    {
+      tmpKeyFrame = new AnimKeyFrame;
+      if (this->currentKeyFrame == this->nextKeyFrame)
+	this->nextKeyFrame = tmpKeyFrame;
+      this->keyFrameList->add(tmpKeyFrame);
+
+    }
+  else
+    {
+      tmpKeyFrame = this->keyFrameList->firstElement();
+      bHasKeys = true;
+    }
+  tmpKeyFrame->value = value;
+  tmpKeyFrame->duration = duration;
+  tmpKeyFrame->animFunc = animFunc;
+  
+}
+
+void Anim::setInfinity(ANIM_INFINITY preInfinity, ANIM_INFINITY postInfinity)
+{
+  this->preInfinity = preInfinity;
+  this->postInfinity = postInfinity;
+}
+
+void Anim::setAnimFunc(ANIM_FUNCTION animFunc)
+{
+  switch (animFunc)
+    {
+    default:
+    case ANIM_CONSTANT:
+      this->animFunc = &Anim::constant;
+      break;
+    case ANIM_LINEAR:
+      this->animFunc = &Anim::linear;
+      break;
+    case ANIM_RANDOM:
+      this->animFunc = &Anim::random;
+      break;
+    case ANIM_SINE:
+      this->animFunc = &Anim::sine;
+      break;
+    }
+}
+
+
+// animation functions
+float Anim::random(float timePassed) const
+{
+  return (float)rand()/(float)RAND_MAX;
+}
+
+float Anim::constant(float timePassed) const
+{
+  return this->currentKeyFrame->value;
+}
+
+float Anim::linear(float timePassed) const 
+{
+  return this->nextKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value) 
+    * (timePassed / this->currentKeyFrame->duration);
+  //  PRINTF(0)("value is %f, %p %p\n", val, this->currentKeyFrame, this->nextKeyFrame);
+  //  return val;
+}
+
+float Anim::sine(float timePassed) const
+{
+  
+}
Index: orxonox/trunk/src/animation.h
===================================================================
--- orxonox/trunk/src/animation.h	(revision 3790)
+++ orxonox/trunk/src/animation.h	(revision 3790)
@@ -0,0 +1,168 @@
+/* 
+   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: ...
+*/
+
+
+/*! 
+    \file animation.h
+    A Set of functions to animate some floats inside of an Object
+
+    We apologize, that most part of the Function-Definitions are located 
+    inside this h-file, but this must be like this because it is a template
+    function.
+*/
+
+#ifndef _ANIMATION_H
+#define _ANIMATION_H
+
+
+// FORWARD DEFINITION
+template<class T> class tList;
+
+typedef enum ANIM_FUNCTION {ANIM_CONSTANT,
+			    ANIM_LINEAR,
+			    ANIM_SINE,
+			    ANIM_RANDOM};
+
+typedef enum ANIM_INFINITY {ANIM_INF_CONSTANT,
+			    ANIM_INF_LINEAR,
+			    ANIM_INF_PINGPONG,
+			    ANIM_INF_REWIND};//, ANIM_DELETE}
+
+struct AnimKeyFrame
+{
+  float duration;
+  float value;
+  ANIM_FUNCTION animFunc;
+};
+
+class Anim
+{
+ public:
+  void addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc = ANIM_LINEAR);
+  void setInfinity(ANIM_INFINITY preInfinity = ANIM_INF_CONSTANT,
+		   ANIM_INFINITY postInfinity = ANIM_INF_CONSTANT);
+  void setAnimFunc(ANIM_FUNCTION animFunc);
+
+ protected:
+  Anim(void);
+  virtual ~Anim(void);
+
+  static tList<Anim>* animatorList;
+
+  virtual void tick(float time) = 0;
+
+
+
+  // animation functions
+  float random(float timePassed) const;
+  float constant(float timePassed) const;
+  float linear(float timePassed) const;
+  float sine(float timePassed) const;
+
+
+  // variables
+  //  ANIM_FUNCTION animFunc;
+  float (Anim::*animFunc)(float) const;
+  ANIM_INFINITY preInfinity;
+  ANIM_INFINITY postInfinity;
+
+  bool bHasKeys;
+  bool bRunning;
+
+  float localTime;
+  AnimKeyFrame* currentKeyFrame;
+  AnimKeyFrame* nextKeyFrame;
+  tList<AnimKeyFrame>* keyFrameList;
+};
+
+
+//! A Class to handle some animation for single floated values.
+template<class T> class Animation : public Anim
+{
+ public:
+  Animation(T* object = NULL, void (T::*funcToAnim)(float) = NULL);
+  virtual ~Animation();
+
+  void setFuncToAnim(T* object, void (T::*funcToAnim)(float));
+
+  virtual void tick(float time);
+
+ private:
+  T* object;
+  void (T::*funcToAnim)(float);
+};
+
+
+
+/**
+   \brief standard constructor
+
+*/
+template<class T>
+Animation<T>::Animation (T* object, void (T::*funcToAnim)(float)) 
+{
+  this->setFuncToAnim(object, funcToAnim);
+}
+
+
+/**
+   \brief standard deconstructor
+
+*/
+template<class T>
+Animation<T>::~Animation () 
+{
+  // delete what has to be deleted here
+}
+
+
+template<class T>
+void Animation<T>::setFuncToAnim(T* object, void (T::*funcToAnim)(float))
+{
+  this->object = object;
+  this->funcToAnim = funcToAnim;
+}
+
+
+template<class T>
+void Animation<T>::tick(float time)
+{
+  if (this->bRunning)
+    {
+      this->localTime += time;
+      if (localTime >= this->currentKeyFrame->duration)
+	{
+	  this->localTime = 0;
+	  if (this->currentKeyFrame == this->keyFrameList->lastElement())
+	    switch (this->postInfinity)
+	      {
+	      case ANIM_INF_CONSTANT:
+		this->bRunning = false;
+		break;
+	      case ANIM_INF_REWIND:
+		break;
+	      }
+	  this->currentKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame);
+	  this->nextKeyFrame = this->keyFrameList->nextElement(this->nextKeyFrame);
+	  printf("%p from:%f to:%f\n", this->currentKeyFrame,this->currentKeyFrame->value, this->nextKeyFrame->value);
+	  
+	  
+	}
+      
+      (this->object->*(funcToAnim))((this->*animFunc)(this->localTime));
+    }
+}
+
+#endif /* _ANIMATION_H */
Index: orxonox/trunk/src/defs/debug.h
===================================================================
--- orxonox/trunk/src/defs/debug.h	(revision 3789)
+++ orxonox/trunk/src/defs/debug.h	(revision 3790)
@@ -71,4 +71,5 @@
 #define DEBUG_MODULE_PLAYER             1
 #define DEBUG_MODULE_MATH               0
+#define DEBUG_MODULE_FONT               4
 
 #define DEBUG_MODULE_NULL_PARENT        0
Index: orxonox/trunk/src/defs/glincl.h
===================================================================
--- orxonox/trunk/src/defs/glincl.h	(revision 3789)
+++ orxonox/trunk/src/defs/glincl.h	(revision 3790)
@@ -9,10 +9,10 @@
 #define _GLINCL_H
 
+#include <SDL.h>
+
 #ifndef __APPLE__
-#include <SDL/SDL.h>
 #include <GL/gl.h>
 #include <GL/glu.h>
 #else
-#include <SDL.h>
 #include <OpenGL/gl.h>
 #include <OpenGL/glu.h>
Index: orxonox/trunk/src/lib/graphics/graphics_engine.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/graphics_engine.cc	(revision 3789)
+++ orxonox/trunk/src/lib/graphics/graphics_engine.cc	(revision 3790)
@@ -167,4 +167,54 @@
 
 
+/**
+   \brief entering 2D Mode
+   
+   this is a GL-Projection-mode, that is orthogonal, for placing the font in fron of everything else
+*/
+void GraphicsEngine::enter2DMode(void)
+{
+  SDL_Surface *screen = SDL_GetVideoSurface();
+  
+  /* Note, there may be other things you need to change,
+     depending on how you have your OpenGL state set up.
+  */
+  glPushAttrib(GL_ENABLE_BIT);
+  glDisable(GL_DEPTH_TEST);
+  glDisable(GL_CULL_FACE);
+  glDisable(GL_LIGHTING);  // will be set back when leaving 2D-mode
+  glEnable(GL_TEXTURE_2D);
+
+  /* This allows alpha blending of 2D textures with the scene */
+  glEnable(GL_BLEND);
+  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+  
+  glViewport(0, 0, screen->w, screen->h);
+  
+  glMatrixMode(GL_PROJECTION);
+  glPushMatrix();
+  glLoadIdentity();
+  
+  glOrtho(0.0, (GLdouble)screen->w, (GLdouble)screen->h, 0.0, 0.0, 1.0);
+  
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  glLoadIdentity();
+  
+  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+}
+
+/**
+   \brief leaves the 2DMode again also \see Font::enter2DMode(void)
+*/
+void GraphicsEngine::leave2DMode(void)
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPopMatrix();
+  
+  glMatrixMode(GL_PROJECTION);
+  glPopMatrix();
+  
+  glPopAttrib();
+}
 
 
Index: orxonox/trunk/src/lib/graphics/graphics_engine.h
===================================================================
--- orxonox/trunk/src/lib/graphics/graphics_engine.h	(revision 3789)
+++ orxonox/trunk/src/lib/graphics/graphics_engine.h	(revision 3790)
@@ -26,8 +26,17 @@
   int setGLattribs(void);
   int setResolution(int width, int height, int bpp);
+  /** \returns the x resolution */
+  inline int getResolutionX(void) {return this->resolutionX;}
+  /** \returns the y resolution */
+  inline int getResolutionY(void) {return this->resolutionY;}
+  /** \returns the Bits Per Pixel */
+  inline int getbbp(void) {return this->bitsPerPixel;}
   int resolutionChanged(SDL_ResizeEvent* resizeInfo);
   void listModes(void);
 
   static bool texturesEnabled;
+
+  static void enter2DMode(void);
+  static void leave2DMode(void);
 
  private:
Index: orxonox/trunk/src/lib/graphics/importer/material.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 3789)
+++ orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 3790)
@@ -30,16 +30,4 @@
 using namespace std;
 
-
-/**
-   \brief creates a default Material with no Name
-   normally you call this to create a material List (for an obj-file) and then append with addMaterial()
-*/
-Material::Material()
-{
-  this->init();
-  
-  this->setName ("");
-}
-
 /**
    \brief creates a Material.
@@ -48,7 +36,27 @@
 Material::Material (char* mtlName)
 {
-  this->init();
-  
-  this->setName (mtlName);
+   PRINTF(4)("initializing new Material.\n");
+  this->nextMat = NULL;
+  this->name ="";
+  this->setIllum(3);
+  this->setDiffuse(0,0,0);
+  this->setAmbient(0,0,0);
+  this->setSpecular(.5,.5,.5);
+  this->setShininess(2.0);
+  this->setTransparency(1.0);
+
+
+  this->diffuseTexture = NULL;
+  this->ambientTexture = NULL;
+  this->specularTexture = NULL;
+
+  this->diffuseTextureSet = false;
+  this->ambientTextureSet = false;
+  this->specularTextureSet = false;
+
+  if (mtlName)
+    this->setName (mtlName);
+  else
+    this->setName("");
 }
 
@@ -86,29 +94,4 @@
 
 /**
-   \brief initializes a new Material with its default Values
-*/
-void Material::init(void)
-{
-  PRINTF(4)("initializing new Material.\n");
-  this->nextMat = NULL;
-  this->name ="";
-  this->setIllum(3);
-  this->setDiffuse(0,0,0);
-  this->setAmbient(0,0,0);
-  this->setSpecular(.5,.5,.5);
-  this->setShininess(2.0);
-  this->setTransparency(0.0);
-
-
-  this->diffuseTexture = NULL;
-  this->ambientTexture = NULL;
-  this->specularTexture = NULL;
-
-  this->diffuseTextureSet = false;
-  this->ambientTextureSet = false;
-  this->specularTextureSet = false;
-}
-
-/**
    \brief Search for a Material called mtlName
    \param mtlName the Name of the Material to search for
@@ -151,4 +134,16 @@
   glMaterialf(GL_FRONT, GL_SHININESS, this->shininess);
   
+  // setting the transparency
+  if (this->transparency == 1.0)
+    {
+      glDisable(GL_BLEND);
+    }
+  else
+    {
+      glEnable(GL_BLEND);
+      glColor4f(1.0f, 1.0f, 1.0f, this->transparency);
+      glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+    }
+
   // setting illumination Model 
   if (this->illumModel == 1) //! \todo make this work, if no vertex-normals are read.
Index: orxonox/trunk/src/lib/graphics/importer/material.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/material.h	(revision 3789)
+++ orxonox/trunk/src/lib/graphics/importer/material.h	(revision 3790)
@@ -22,9 +22,7 @@
 {
  public:
-  Material ();
-  Material (char* mtlName);
+  Material (char* mtlName = "");
   Material* addMaterial(char* mtlName);
   ~Material ();
-  void init(void);
 
   Material* search(char* mtlName);
Index: orxonox/trunk/src/lib/graphics/importer/texture.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/texture.cc	(revision 3789)
+++ orxonox/trunk/src/lib/graphics/importer/texture.cc	(revision 3790)
@@ -98,5 +98,5 @@
 }
 
-#ifdef HAVE_SDL_SDL_IMAGE_H
+#ifdef HAVE_SDL_IMAGE_H
 bool Texture::loadImage(const char* imageName)
 {
@@ -118,6 +118,9 @@
 	    pImage->format = GL_RGB;
 	  else if (pImage->bpp == 4)
-	    pImage->format = GL_RGBA;
-	  
+	    {
+	      pImage->format = GL_RGBA;
+	      SDL_SetAlpha(this->map, 0, 0);
+	    }
+
 	  if( !IMG_isPNG(SDL_RWFromFile(imageName, "rb")) && !IMG_isJPG(SDL_RWFromFile(imageName, "rb")))
 	    for (int i=0;i<map->h * map->w *3;i+=3)
@@ -146,5 +149,5 @@
 
 
-#else /* HAVE_SDL_SDL_IMAGE_H */
+#else /* HAVE_SDL_IMAGE_H */
 /**
    \brief Makes the Programm ready to Read-in a texture-File
@@ -832,3 +835,3 @@
 
 }
-#endif /* HAVE_SDL_SDL_IMAGE_H */
+#endif /* HAVE_SDL_IMAGE_H */
Index: orxonox/trunk/src/lib/graphics/importer/texture.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/texture.h	(revision 3789)
+++ orxonox/trunk/src/lib/graphics/importer/texture.h	(revision 3790)
@@ -14,6 +14,6 @@
 #include "debug.h"
 
-#ifdef HAVE_SDL_SDL_IMAGE_H
-#include <SDL/SDL_image.h>
+#ifdef HAVE_SDL_IMAGE_H
+#include <SDL_image.h>
 #else
 // IMAGE LIBS //
@@ -26,5 +26,5 @@
 #include <png.h>
 #endif /* HAVE_PNG_H */
-#endif /* HAVE_SDL_SDL_IMAGE_H */
+#endif /* HAVE_SDL_IMAGE_H */
 
 //! A Class, that reads in Textures from different fileformats.
@@ -57,5 +57,5 @@
 
   bool loadImage(const char* imageName);
-#ifndef HAVE_SDL_SDL_IMAGE_H
+#ifndef HAVE_SDL_IMAGE_H
 
   bool loadBMP (char* bmpName);
@@ -74,6 +74,3 @@
 
 };
-
-
-
 #endif /* _TEXTURE_H */
Index: orxonox/trunk/src/lib/graphics/text_engine.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/text_engine.cc	(revision 3790)
+++ orxonox/trunk/src/lib/graphics/text_engine.cc	(revision 3790)
@@ -0,0 +1,958 @@
+/* 
+   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: ...
+
+   for some fonts and licenses visit: =http://www.dafont.com/en/font.php=
+
+   !! IMPORTANT !! When using ttf fonts clear the license issues prior to
+   adding them to orxonox. This is really important, because we do not 
+   want to offend anyone.
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_FONT
+
+#include "text_engine.h"
+
+using namespace std;
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "graphics_engine.h"
+#include "resource_manager.h"
+
+#include "p_node.h"
+#include "vector.h"
+#include "debug.h"
+
+
+////////////
+/// TEXT ///
+////////////
+/**
+   \brief creates a new Text Element
+   \param font the Font to render this text in
+   \param type The renderType to display this font in
+
+   this constructor is private, because the user should initialize 
+   a text with the TextEngine.
+*/
+Text::Text(Font* font, int type)
+{
+  // initialize this Text
+  this->bindNode = NULL;
+  this->font = font;
+  this->text = NULL;
+  this->texture = 0;
+  this->blending = 1.0f;
+  this->setType(type);
+  this->setPosition(0, 0);
+
+  this->setText(FONT_DEFAULT_TEXT);
+}
+
+/**
+   \brief deletes a Text out of memory
+   
+   This also ereases the text from the textList of the TextEngine
+*/
+Text::~Text(void)
+{
+  TextEngine::getInstance()->deleteText(this);
+}
+
+
+void Text::setBindNode(PNode* bindNode)
+{
+  this->bindNode = bindNode;
+}
+
+/**
+   \brief sets the Type of this Text
+   \param type the type to set.
+*/
+void Text::setType(int type)
+{
+  this->type = type;
+}
+
+
+/**
+   \brief Sets a new Text to the font
+   \param text the new text to set
+*/
+void Text::setText(const char* text)
+{
+  if (this->text)
+    delete []this->text;
+  this->text = new char[strlen(text)+1];
+  strcpy(this->text, text);
+}
+
+/**
+   \brief sets a Position.
+   \param x the x-position in pixels from the left border
+   \param y the y-position in pixels from the top border
+*/
+void Text::setPosition(int x, int y)
+{
+  this->posSize.x = x;
+  this->posSize.y = y;
+}
+
+/**
+   \brief sets a new color to the font
+   \param r Red
+   \param g Green
+   \param b Blue
+*/
+void Text::setColor(Uint8 r, Uint8 g, Uint8 b)
+{
+  this->color.r = r;
+  this->color.g = g;
+  this->color.b = b;
+}
+
+/**
+   \brief creates a texture out of the given parameters
+
+   this has to be called every time by the user, to if changes were made.
+*/
+void Text::createTexture(void)
+{
+  SDL_Surface* tmpSurf;
+  if (this->texture)
+    glDeleteTextures(1, &this->texture);
+  tmpSurf = TTF_RenderText_Blended(this->font->font,
+				   this->text,
+				   this->color);
+  if (tmpSurf)
+    this->texture = loadTexture(tmpSurf, &this->texCoord);
+
+  this->posSize.w = tmpSurf->w;
+  this->posSize.h = tmpSurf->h;
+  SDL_FreeSurface(tmpSurf);
+}
+
+/**
+   \brief draws the Font
+   \todo FIX this is to slow/static
+*/
+void Text::draw(void) const
+{
+  // storing all the Transformation Matrices.
+  GLdouble modMat[16];
+  GLdouble projMat[16];
+  GLint viewPort[4];
+  glGetDoublev(GL_PROJECTION_MATRIX, projMat);
+  glGetDoublev(GL_MODELVIEW_MATRIX, modMat);
+  glGetIntegerv(GL_VIEWPORT, viewPort);
+
+  GraphicsEngine::enter2DMode();
+
+
+  // setting the Position of this Text.
+  Vector pos;
+  if (this->bindNode)
+    {
+      GLdouble x = this->bindNode->getAbsCoor().x;
+      GLdouble y = this->bindNode->getAbsCoor().y;
+      GLdouble z = this->bindNode->getAbsCoor().z;
+      GLdouble tmp[3];
+      gluProject(x, y, z, modMat, projMat, viewPort, tmp, tmp+1, tmp+2);
+      pos.x = tmp[0] + this->posSize.x;
+      pos.y = GraphicsEngine::getInstance()->getResolutionY() - tmp[1] + this->posSize.y;
+      pos.z = tmp[2];
+    }
+  else 
+    {
+      pos.x = this->posSize.x;
+      pos.y = this->posSize.y;
+      pos.z = 0;
+    }
+
+  // setting the Blending effects
+  glColor4f(1.0f,1.0f,1.0f, this->blending);
+  glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+
+  // drawing this Text.
+  if(type == TEXT_STATIC)
+    {
+      glBindTexture(GL_TEXTURE_2D, this->texture);
+      glEnable(GL_TEXTURE_2D);
+      glBegin(GL_QUADS);
+      
+      glTexCoord2f(this->texCoord.minU, this->texCoord.minV);
+      glVertex2f(pos.x,   pos.y  );
+      
+      glTexCoord2f(this->texCoord.maxU, this->texCoord.minV);
+      glVertex2f(pos.x + this->posSize.w, pos.y  );
+      
+      glTexCoord2f(this->texCoord.maxU, this->texCoord.maxV);
+      glVertex2f(pos.x + this->posSize.w, pos.y + this->posSize.h);
+      
+      glTexCoord2f(this->texCoord.minU, this->texCoord.maxV);
+      glVertex2f(pos.x, pos.y + this->posSize.h);
+      
+      glEnd();
+    }
+  else //(if type == TEXT_DYNAMIC)
+    {
+      Glyph** glyphArray = this->font->getGlyphArray();
+      glBindTexture(GL_TEXTURE_2D, this->font->getFastTextureID());
+      //      glEnable(GL_TEXTURE_2D);
+      glTranslatef(pos.x, pos.y, 0);
+
+      //      printf("%d, %d\n", this->font->getFastTextureID(), glyphArray[65]->displayList);
+      char* tmpText = this->text;
+      while (*tmpText != '\0')
+	{
+	  if(glyphArray[*tmpText])
+	    {
+	      glCallList(glyphArray[*tmpText]->displayList);
+	      glTranslatef(glyphArray[*tmpText]->width, 0, 0);
+	    }
+	  tmpText++;
+	}
+    }
+  GraphicsEngine::leave2DMode();
+}
+
+/**
+   \brief prints out some nice debug information about this text
+*/
+void Text::debug(void) const
+{
+  PRINT(0)("=== TEXT: %s ===\n", this->text);
+  if (this->bindNode)
+    PRINT(0)("is bind to %s; ref=%p\n", this->bindNode->getName(), this->bindNode);
+  PRINT(0)("Relative Position: (%d::%d)\n", this->posSize.x, this->posSize.y);
+  PRINT(0)("Color: %d %d %d\n", this->color.r, this->color.g, this->color.b);
+}
+
+
+////////////
+/// FONT ///
+////////////
+/**
+   \brief constructs a Font
+   \param fontFile the File to load the font from
+   \param fontSize the Size of the Font in Pixels
+   \param r Red value of the Font.
+   \param g Green value of the Font.
+   \param b Blue value of the Font.
+*/
+Font::Font(const char* fontFile, unsigned int fontSize, Uint8 r, Uint8 g, Uint8 b)
+{
+  // setting default values.
+  this->font = NULL;
+  this->fontFile = NULL;
+  this->glyphArray = NULL;
+  this->fastTextureID = 0;  
+  
+  this->setSize(fontSize);
+  this->setStyle("c");//TTF_STYLE_NORMAL);
+
+  this->setFont(fontFile);
+
+
+  this->setFastColor(r, g, b);
+
+  this->fastTextureID = this->createFastTexture();
+}
+
+/**
+   \brief destructs a font
+*/
+Font::~Font(void)
+{
+  // deleting the List of all Texts
+
+  // deleting all Glyphs
+  if (this->glyphArray)
+    {
+      for (int i = 0; i < FONT_HIGHEST_KNOWN_CHAR; i++)
+	delete this->glyphArray[i];
+      delete []this->glyphArray;
+    }
+
+  // erease this font out of the memory.
+  if (this->font)
+    TTF_CloseFont(this->font);
+}
+
+/**
+   \brief sets The Font.
+   \param fontFile The file containing the font.
+   \returns true if loaded, false if something went wrong, or if a font was loaded before.
+*/
+bool Font::setFont(const char* fontFile)
+{
+  if (!this->fontFile)
+    {
+      this->fontFile = new char[strlen(fontFile)+1];
+      strcpy(this->fontFile, fontFile);
+      
+      this->font = TTF_OpenFont(this->fontFile, this->fontSize);
+      if(!this->font) 
+	{
+	  PRINTF(1)("TTF_OpenFont: %s\n", TTF_GetError());
+	  return false;
+      }
+      return true;
+    }
+  else
+    {
+      PRINTF(2)("Font already initialized, unable to change it now.\n");
+      return false;
+    }
+}
+
+/**
+   \brief sets a specific renderStyle
+   \param renderStyle the Style to render: a char-array containing:
+   i: italic, b: bold, u, underline
+*/
+void Font::setStyle(char* renderStyle)
+{
+  this->renderStyle = TTF_STYLE_NORMAL;
+  
+  for (int i = 0; i < strlen(renderStyle); i++)
+    if (strncmp(renderStyle+i, "b", 1) == 0) 
+      this->renderStyle |= TTF_STYLE_BOLD;
+    else if (strncmp(renderStyle+i, "i", 1) == 0)
+      this->renderStyle |= TTF_STYLE_ITALIC;
+    else if (strncmp(renderStyle+i, "u", 1) == 0) 
+      this->renderStyle |= TTF_STYLE_UNDERLINE;
+
+  if (this->font)
+    TTF_SetFontStyle(this->font, this->renderStyle);
+  else
+    PRINTF(2)("Font was not initialized, please do so before setting the Font-Style.\n");
+}
+
+
+
+/**
+   \brief Sets a new Size to the font
+   \param fontSize The new Size in pixels.
+*/
+void Font::setSize(unsigned int fontSize)
+{
+  this->fontSize = fontSize;
+}
+
+/**
+   \brief sets a new color to the font
+   \param r Red
+   \param g Green
+   \param b Blue
+*/
+void Font::setFastColor(Uint8 r, Uint8 g, Uint8 b)
+{
+  this->fastColor.r = r;
+  this->fastColor.g = g;
+  this->fastColor.b = b;
+}
+
+/**
+   \returns the maximum height of the Font, if the font was initialized, 0 otherwise
+*/
+int Font::getMaxHeight(void)
+{
+  if (this->font)
+    return TTF_FontHeight(this->font);
+  else
+    return 0;
+}
+
+/**
+   \returns the maximum ascent of the Font, if the font was initialized, 0 otherwise
+
+   the ascent is the pixels of the font above the baseline
+*/
+int Font::getMaxAscent(void)
+{
+  if (this->font)
+    return TTF_FontAscent(this->font);
+  else
+    return 0;
+}
+
+/**
+   \returns the maximum descent of the Font, if the font was initialized, 0 otherwise
+
+   the descent is the pixels of the font below the baseline
+*/
+int Font::getMaxDescent(void)
+{
+  if (this->font)
+    return TTF_FontDescent(this->font);
+  else
+    return 0;
+}
+
+/**
+   \param character The character to get info about.
+   \returns a Glyph struct of a character. This Glyph is a pointer,
+   and MUST be deleted by the user..
+
+   This only works for horizontal fonts. see 
+   http://freetype.sourceforge.net/freetype2/docs/tutorial/step2.html
+   for more info about vertical Fonts
+*/
+Glyph* Font::getGlyphMetrics(Uint16 character)
+{
+  Glyph* rg = new Glyph;
+  rg->character = character;
+  TTF_GlyphMetrics(this->font, rg->character,
+		   &rg->minX, &rg->maxX,
+		   &rg->minY, &rg->maxY,
+		   &rg->advance);
+  rg->height = rg->maxY - rg->minY;
+  rg->width = rg->maxX - rg->minX;
+  rg->bearingX = (rg->advance - rg->width) / 2;
+  rg->bearingY = rg->maxY;
+  return rg;
+}
+
+GLuint Font::createFastTexture(void)
+{
+  /* interesting GLYPHS: 
+   *  32: space
+   *  33-47: Special Characters.
+   *  48-57: 0-9
+   *  58-63: some more special chars (minor)
+   *  65-90: A-Z
+   *  97-122: a-z
+   */
+  int numberOfGlyphs = 91;
+
+  this->initGlyphs(32, numberOfGlyphs);
+  this->glyphArray[32]->width = fontSize/3; //!< \todo find out the real size of a Space
+
+  int rectSize = this->findOptimalFastTextureSize();
+
+  // setting default values. (maybe not needed afterwards)
+  SDL_Color tmpColor;  tmpColor.r = tmpColor.g = tmpColor.b = 0;
+  // Surface definition.
+  SDL_Rect tmpRect; // this represents a Rectangle for blitting.
+  SDL_Surface* tmpSurf =  SDL_CreateRGBSurface(SDL_SWSURFACE,
+					       rectSize, rectSize,
+					       32,
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
+					       0x000000FF, 
+					       0x0000FF00, 
+					       0x00FF0000, 
+					       0xFF000000
+#else
+					       0xFF000000,
+					       0x00FF0000, 
+					       0x0000FF00, 
+					       0x000000FF
+#endif
+					       );
+  tmpRect.x = 0; tmpRect.y = 0; tmpRect.w = tmpSurf->w; tmpRect.h = tmpSurf->h;
+  SDL_SetClipRect(tmpSurf, &tmpRect);
+  int maxLineHeight = 0;
+
+  // all the interessting Glyphs
+  for (int i = 32; i <= 122; i++)
+    {
+      SDL_Surface* glyphSurf = NULL;
+      Glyph* tmpGlyph;
+
+      if (tmpGlyph = this->glyphArray[i])
+	{
+	  if (tmpGlyph->height > maxLineHeight)
+	    maxLineHeight = tmpGlyph->height;
+	  
+	  if (tmpRect.x+tmpGlyph->width > tmpSurf->w)
+	    {
+	      tmpRect.x = 0;
+	      tmpRect.y = tmpRect.y + maxLineHeight + 1;
+	      maxLineHeight = 0;
+	    }
+	  if (tmpRect.y + maxLineHeight > tmpSurf->h)
+	    {
+	      PRINTF(1)("Protection, so font cannot write over the boundraries error (this should not heappen\n");
+	      break;
+	    }
+	  // reading in the new Glyph
+	  glyphSurf = TTF_RenderGlyph_Blended(this->font, i, this->fastColor);
+	  if( glyphSurf ) 
+	    {
+
+	      SDL_SetAlpha(glyphSurf, 0, 0);
+
+	      SDL_BlitSurface(glyphSurf, NULL, tmpSurf, &tmpRect);
+	      TexCoord tmpTexCoord;
+	      tmpTexCoord.minU = (float)tmpRect.x/(float)tmpSurf->w;
+	      tmpTexCoord.maxU = (float)(tmpRect.x+tmpGlyph->width)/(float)tmpSurf->w;
+	      tmpTexCoord.minV = (float)tmpRect.y/(float)tmpSurf->w;
+	      tmpTexCoord.maxV = (float)(tmpRect.y+tmpGlyph->height)/(float)tmpSurf->w;
+	      tmpGlyph->displayList = glGenLists(1);
+
+	      glNewList(tmpGlyph->displayList, GL_COMPILE);
+	      glBegin(GL_QUADS);
+	      glTexCoord2f(tmpTexCoord.minU, tmpTexCoord.minV);
+	      glVertex2d(0, 0);
+	      glTexCoord2f(tmpTexCoord.minU, tmpTexCoord.maxV);
+	      glVertex2d(0, tmpGlyph->height);
+	      glTexCoord2f(tmpTexCoord.maxU, tmpTexCoord.maxV);
+	      glVertex2d(tmpGlyph->width, tmpGlyph->height);
+	      glTexCoord2f(tmpTexCoord.maxU, tmpTexCoord.minV);
+	      glVertex2d(tmpGlyph->width, 0);
+	      glEnd();
+	      glEndList();
+	      SDL_FreeSurface(glyphSurf);
+
+	      tmpRect.x += tmpGlyph->width + 1;
+
+	      // Outputting Glyphs to BMP-files.
+	      /*
+		char outname[64];
+		if (i < 10)
+		sprintf( outname, "glyph-00%d.bmp", i );
+		else if (i <100)
+		sprintf( outname, "glyph-0%d.bmp", i );
+		else
+		sprintf( outname, "glyph-%d.bmp", i );
+		SDL_SaveBMP(tmpSurf, outname);
+	      */
+	    }
+	}
+    }
+
+  GLuint texture;
+  glGenTextures(1, &texture);
+  glBindTexture(GL_TEXTURE_2D, texture);
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+  glTexImage2D(GL_TEXTURE_2D,
+	       0,
+	       GL_RGBA,
+	       tmpSurf->w, tmpSurf->h,
+	       0,
+	       GL_RGBA,
+	       GL_UNSIGNED_BYTE,
+	       tmpSurf->pixels);
+  SDL_FreeSurface(tmpSurf);
+  return texture;
+}
+
+/**
+   \brief stores Glyph Metrics in an Array.
+   \param from The Glyph to start from.
+   \param count The number of Glyphs to start From.
+*/
+void Font::initGlyphs(Uint16 from, Uint16 count)
+{
+  /* initialize the Array, and set all its entries to NULL
+   *  only if the Glyph-array has not been initialized
+   */
+  if (!this->glyphArray)
+    {
+      this->glyphArray = new Glyph*[FONT_HIGHEST_KNOWN_CHAR];
+      for (int i = 0; i < FONT_HIGHEST_KNOWN_CHAR; i++)
+	this->glyphArray[i] = NULL;
+    }
+  
+  Uint16 lastGlyph = from + count;
+  
+  for (int i = from; i <= lastGlyph; i++)
+    {
+      // setting up all the Glyphs we like.
+      glyphArray[i] = getGlyphMetrics(i);
+    }
+  return;
+}
+
+/**
+   \returns the optimal size to use as the texture size
+
+   \todo: this algorithm can be a lot more faster, althought it does 
+   not really matter within the init-context, and 128 glyphs.
+
+   This function searches for a 2^n sizes texture-size, this is for 
+   openGL-version < 1.2 compatibility. and because it is realy easy like this.
+*/
+int Font::findOptimalFastTextureSize(void)
+{
+  int i;
+  int x,y; // the counters
+  int maxLineHeight;
+  int size = 32;      // starting Value, we have to start somewhere 32 seems reasonable.
+  bool sizeOK = false;
+  Glyph* tmpGlyph;
+
+  while (!sizeOK)
+    {
+      x = 0; y = 0;
+      maxLineHeight = 0;
+      for (i = 0; i < FONT_HIGHEST_KNOWN_CHAR; i++)
+	{
+	  if(tmpGlyph = this->glyphArray[i])
+	    {
+	      // getting the height of the highest Glyph in the Line.
+	      if (tmpGlyph->height > maxLineHeight)
+		maxLineHeight = tmpGlyph->height;
+
+	      if (x + tmpGlyph->width > size)
+		{
+		  x = 0;
+		  y = y + maxLineHeight;
+		  maxLineHeight = 0;
+		}
+	      if (y + maxLineHeight + 1 > size)
+		break;
+	      x += tmpGlyph->width + 1;
+
+	    }
+	}
+      if (i == FONT_HIGHEST_KNOWN_CHAR)
+	sizeOK = true;
+      else
+	size *= 2;
+    }
+  return size;
+  
+}
+
+
+/**
+   \brief a simple function to get some interesting information about this class
+*/
+void Font::debug(void)
+{
+
+  // print the loaded font's style
+  int style;
+  style = TTF_GetFontStyle(this->font);
+  PRINTF(0)("The font style is:");
+  if(style==TTF_STYLE_NORMAL)
+    PRINTF(0)(" normal");
+  else {
+    if(style&TTF_STYLE_BOLD)
+      PRINTF(0)(" bold");
+    if(style&TTF_STYLE_ITALIC)
+      PRINTF(0)(" italic");
+    if(style&TTF_STYLE_UNDERLINE)
+      PRINTF(0)(" underline");
+  }
+  PRINTF(0)("\n");
+
+
+}
+
+////////////
+/// UTIL ///
+////////////
+/**
+   \brief Loads a Font from an SDL_surface into a texture.
+   \param surface The surface to make the texture of
+   \param texCoord The texture coordinates of the 4 corners of the texture
+   \returns the ID of the texture
+*/
+GLuint loadTexture(SDL_Surface *surface, TexCoord* texCoord)
+{
+  GLuint texture;
+  int w, h;
+  SDL_Surface *image;
+  SDL_Rect area;
+  Uint32 saved_flags;
+  Uint8  saved_alpha;
+  
+  /* Use the surface width and height expanded to powers of 2 */
+  w = powerOfTwo(surface->w);
+  h = powerOfTwo(surface->h);
+  if (texCoord)
+    {
+      texCoord->minU = 0.0f;
+      texCoord->minV = 0.0f;
+      texCoord->maxU = (GLfloat)surface->w / w;
+      texCoord->maxV = (GLfloat)surface->h / h;
+    }
+  image = SDL_CreateRGBSurface(SDL_SWSURFACE,
+			       w, h,
+			       32,
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
+			       0x000000FF, 
+			       0x0000FF00, 
+			       0x00FF0000, 
+			       0xFF000000
+#else
+			       0xFF000000,
+			       0x00FF0000, 
+			       0x0000FF00, 
+			       0x000000FF
+#endif
+			       );
+  if ( image == NULL ) {
+    return 0;
+  }
+  
+  /* Save the alpha blending attributes */
+  saved_flags = surface->flags&(SDL_SRCALPHA|SDL_RLEACCELOK);
+  saved_alpha = surface->format->alpha;
+  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+    SDL_SetAlpha(surface, 0, 0);
+  }
+  
+  /* Copy the surface into the GL texture image */
+  area.x = 0;
+  area.y = 0;
+  area.w = surface->w;
+  area.h = surface->h;
+  SDL_BlitSurface(surface, &area, image, &area);
+  
+  /* Restore the alpha blending attributes */
+  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+    SDL_SetAlpha(surface, saved_flags, saved_alpha);
+  }
+  
+  /* Create an OpenGL texture for the image */
+  glGenTextures(1, &texture);
+  glBindTexture(GL_TEXTURE_2D, texture);
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+  glTexImage2D(GL_TEXTURE_2D,
+	       0,
+	       GL_RGBA,
+	       w, h,
+	       0,
+	       GL_RGBA,
+	       GL_UNSIGNED_BYTE,
+	       image->pixels);
+  SDL_FreeSurface(image); /* No longer needed */
+  
+  return texture;
+}
+
+/**
+   \brief Quick utility function for texture creation 
+   \param input an integer
+   \returns the next bigger 2^n-integer than input
+*/
+int powerOfTwo(int input)
+{
+  int value = 1;
+  
+  while ( value < input ) {
+    value <<= 1;
+  }
+  return value;
+}
+
+
+
+
+
+
+///////////////////
+/// TEXT-ENGINE ///
+///////////////////
+/**
+   \brief standard constructor
+*/
+TextEngine::TextEngine () 
+{
+   this->setClassName ("TextEngine");
+   this->enableFonts();
+
+   this->textList = new tList<Text>;
+}
+
+/**
+   \brief the singleton reference to this class
+*/
+TextEngine* TextEngine::singletonRef = NULL;
+
+/**
+   \returns a Pointer to this Class
+*/
+TextEngine* TextEngine::getInstance(void)
+{
+  if (!TextEngine::singletonRef)
+    TextEngine::singletonRef = new TextEngine();
+  return TextEngine::singletonRef;
+}
+
+/**
+   \brief standard deconstructor
+
+*/
+TextEngine::~TextEngine () 
+{
+  this->disableFonts();
+  
+  delete this->textList;
+
+  TextEngine::singletonRef = NULL;
+
+}
+
+/**
+   \brief function to enable TTF_Fonts
+*/
+void TextEngine::enableFonts(void)
+{
+  if (!TTF_WasInit())
+    {
+      if(TTF_Init()==-1)
+	PRINTF(1)("TTF_Init: %s\n", TTF_GetError());
+
+      TextEngine::checkVersion();
+    }
+  else
+    PRINTF(4)("Fonts already initialized\n");
+}
+
+/**
+   \brief function to disable TTF_fonts
+*/
+void TextEngine::disableFonts(void)
+{
+  if (TTF_WasInit())
+    {
+      TTF_Quit();
+    }
+  else
+    PRINTF(4)("Fonts were not initialized.\n");
+}
+
+/**
+   \brief creates a new Text with a certain font.
+   \see Font::Font
+   \see Text::Text
+*/
+Text* TextEngine::createText(const char* fontFile, unsigned int fontSize, int textType, Uint8 r, Uint8 g, Uint8 b)
+{
+  Font* tmpFont;
+  Text* newText;
+  Vector tmpVec;
+
+  tmpVec = Vector(r, g, b);
+  tmpFont = (Font*)ResourceManager::getInstance()->load(fontFile, TTF, RP_GAME, &fontSize, &tmpVec);
+  if (!tmpFont)
+    {
+      PRINTF(2)("Font %s could not be loaded, probably file not found\n", fontFile);
+      return NULL;
+    }
+
+  newText = new Text(tmpFont, TEXT_DYNAMIC);
+  textList->add(newText);
+
+  return newText;
+}
+
+/**
+   \brief removes a Text from the List
+   \param the text to delete
+
+   this only ereases allocated memory, and removes the text
+   The normal way to call it, is through "delete text;"
+   So you do not have to concetn yourselves with this.
+*/
+void TextEngine::deleteText(Text* text)
+{
+  ResourceManager::getInstance()->unload(text->font);
+  textList->remove(text);
+}
+
+/**
+   \brief deletes all the Text, and tries to delete all allocated fonts
+*/
+void TextEngine::flush(void)
+{
+  tIterator<Text>* textIterator = textList->getIterator();
+  Text* text = textIterator->nextElement();
+  while( text != NULL)
+    {
+      delete text;
+      text = textIterator->nextElement();
+    }
+  delete textIterator;
+}
+
+/**
+   \brief draws all the Texts that have been initialized
+*/
+void TextEngine::draw(void) const
+{
+  tIterator<Text>* textIterator = textList->getIterator();
+  Text* text = textIterator->nextElement();
+  while( text != NULL)
+    {
+      text->draw();
+      text = textIterator->nextElement();
+    }
+  delete textIterator;
+}
+
+/**
+   \brief outputs some nice Debug information
+   
+   \todo there should also be something outputted about Font
+*/
+void TextEngine::debug(void) const
+{
+  PRINT(0)("+-------------------------------+\n");
+  PRINT(0)("+ TEXT ENGINE DEBUG INFORMATION +\n");
+  PRINT(0)("+-------------------------------+\n");
+  PRINT(0)("Reference: %p; Text Counts: %d\n", this, this->textList->getSize());
+  
+  tIterator<Text>* textIterator = textList->getIterator();
+  Text* text = textIterator->nextElement();
+  while( text != NULL)
+    {
+      text->debug();
+      text = textIterator->nextElement();
+    }
+  delete textIterator;
+  PRINT(0)("+---------------------------TE--+\n");
+}
+
+
+/**
+   \brief checks if the compiled version and the local version of SDL_ttf match.
+   \returns true if match, false otherwise
+*/
+bool TextEngine::checkVersion(void)
+{
+  SDL_version compile_version;
+  SDL_version link_version;
+  TTF_VERSION(&compile_version);
+  link_version = *TTF_Linked_Version();
+
+  if (compile_version.major == link_version.major &&
+      compile_version.minor == link_version.minor &&
+      compile_version.patch == link_version.patch)
+    {
+      return true;
+    }
+  else
+    {
+      PRINTF(2)("compiled with SDL_ttf version: %d.%d.%d\n", 
+		compile_version.major,
+		compile_version.minor,
+		compile_version.patch);
+      
+      PRINTF(2)("running with SDL_ttf version: %d.%d.%d\n", 
+		link_version.major,
+		link_version.minor,
+		link_version.patch);
+      return false;
+    }
+}
Index: orxonox/trunk/src/lib/graphics/text_engine.h
===================================================================
--- orxonox/trunk/src/lib/graphics/text_engine.h	(revision 3790)
+++ orxonox/trunk/src/lib/graphics/text_engine.h	(revision 3790)
@@ -0,0 +1,226 @@
+/*! 
+    \file text_engine.h
+    \brief Definition of textEngine, the Font and the Text
+
+    Text is the text outputed.
+    Font is a class that loads a certain ttf-file with a specific height into memory
+    TextEngine is used to manage the all the different Fonts that might be included
+
+    for more information see the specific classes.
+
+    !! IMPORTANT !! When using ttf fonts clear the license issues prior to
+   adding them to orxonox. This is really important, because we do not want
+   to offend anyone.
+*/
+
+#ifndef _TEXT_ENGINE_H
+#define _TEXT_ENGINE_H
+
+
+#include "glincl.h"
+#include "SDL_ttf.h"
+
+#include "vector.h"
+#include "base_object.h"
+
+// FORWARD DECLARATION
+class PNode;
+class Font;
+template<class T> class tList;
+
+
+/* some default values */
+#define FONT_DEFAULT_SIZE       50                   //!< default size of the Text
+#define FONT_DEFAULT_TEXT	"orxonox 1234567890" //!< some default text to display
+#define FONT_DEFAULT_COLOR_R    255                  //!< the default red part (color) of the text
+#define FONT_DEFAULT_COLOR_G    255                  //!< the default red green (color) of the text
+#define FONT_DEFAULT_COLOR_B    255                  //!< the default red blue (color) of the text
+#define FONT_NUM_COLORS         256                  //!< The number of colors.
+
+#define FONT_HIGHEST_KNOWN_CHAR 128                  //!< The highest character known to the textEngine.
+
+#define TEXT_STATIC             0                    //!< Static Text
+#define TEXT_DYNAMIC            1                    //!< Dynamic Text
+/**
+ * STATIC means: a font, that is only one GL-face.
+ ** it is very fast, and can be used for all text
+ ** that does not have to be changed anymore, or if
+ ** the the text should look very nice
+ * DYNAMIC means: a very fast font, that will is build
+ ** from multiple quads.
+ ** Use this type, if you want to create fast changing
+ ** text like a counter.
+ */
+
+
+//! A Struct to handel Texture Coordinates for quads
+struct TexCoord
+{
+  float minU;                      //!< The minimum U-Coordinate
+  float maxU;                      //!< The maximum U-Coordinate
+  float minV;                      //!< The minimum V-Coordinate
+  float maxV;                      //!< The maximum V-Coordinate
+};
+
+//! A struct for handling glyphs
+/**
+   a Glyph is one letter of a certain font
+*/
+struct Glyph
+{
+  // Glyph-specific (size and so on)
+  Uint16 character;              //!< The character
+  int minX;                      //!< The minimum distance from the origin in X
+  int maxX;                      //!< The maximum distance from the origin in X
+  int minY;                      //!< The minimum distance from the origin in Y
+  int maxY;                      //!< The maximum distance from the origin in Y
+  int width;                     //!< The width of the Glyph
+  int height;                    //!< The height of the Glyph
+  int bearingX;                  //!< How much is right of the Origin
+  int bearingY;                  //!< How much is above the Origin
+  int advance;                   //!< How big a Glyph would be in monospace-mode
+  
+  // OpenGL-specific
+  //  TexCoord texCoord;         //!< A Texture Coordinate for this glyph.
+  GLuint displayList;            //!< DiplayList to render this Glyph.
+};
+
+////////////
+/// TEXT ///
+////////////
+//! Represents one textElement.
+class Text
+{
+  friend class TextEngine;
+ public:
+  ~Text(void);
+
+  void setBindNode(PNode* bindNode);
+
+  void setType(int type);
+  void setText(const char* text);
+  void setPosition(int x, int y);
+  /** \param blending the blending intensity to set (between 0.0 and 1.0) */
+  inline void setBlending(float blending) {this->blending = blending;}
+
+  // Static Text
+  void setColor(Uint8 r, Uint8 g, Uint8 b);
+  void setStyle(char* renderStyle);
+  void createTexture();
+
+  void draw(void) const;
+  
+  void debug(void) const;
+
+ private:
+  Text(Font* font, int type = TEXT_DYNAMIC);
+
+  Font* font;
+
+  int type;                      //!< The type of this Font.
+  char* text;                    //!< The text to display
+  SDL_Color color;               //!< The color of the font.
+  float blending;                //!< The blending intensity.
+  // placement in openGL
+  GLuint texture;                //!< A GL-texture to hold the text
+  TexCoord texCoord;             //!< Texture-coordinates \todo fix this to have a struct
+  SDL_Rect posSize;              //!< An SDL-Rectangle representing the position and size of the Text on the screen.
+  
+  PNode* bindNode;               //!< A node the Text is bind to. (if NULL thr node will not be bound to anything.)
+};
+
+////////////
+/// FONT ///
+////////////
+//! A class to handle a Font of a certain ttf-File, Size and Color.
+class Font
+{
+  friend class Text;
+ public:
+  Font(const char* fontFile, unsigned int fontSize = FONT_DEFAULT_SIZE,
+       Uint8 r = FONT_DEFAULT_COLOR_R, Uint8 g = FONT_DEFAULT_COLOR_G, Uint8 b = FONT_DEFAULT_COLOR_B);
+  virtual ~Font();
+
+  // font
+  bool setFont(const char* fontFile);
+  void setSize(unsigned int fontSize);
+  void setFastColor(Uint8 r, Uint8 g, Uint8 b);
+  void setStyle(char* renderStyle);
+
+  inline Glyph** getGlyphArray(void) {return glyphArray;}
+  inline GLuint getFastTextureID(void) {return fastTextureID;}
+  
+  
+ private:
+  // general purpose
+  GLdouble projMat[16];             //!< The Projection Matrix
+
+  // information about the Font
+  TTF_Font* font;                   //!< The font we use for this.
+  char* fontFile;                   //!< The fontfile from whitch the font was loaded.
+  unsigned int fontSize;            //!< The size of the font in pixels. each Font has one size.
+  int renderStyle;                  //!< The Renderstyle
+  
+  Glyph** glyphArray;               //!< An Array of all the Glyphs stored in the Array of Glyphs.
+  GLuint fastTextureID;             //!< The fast textureID.
+  SDL_Color fastColor;              //!< A Color for the fast Texture.
+
+  tList<Text>* textList;
+
+  int getMaxHeight(void);
+  int getMaxAscent(void);
+  int getMaxDescent(void);
+  Glyph* getGlyphMetrics(Uint16 character);
+
+  GLuint createFastTexture();
+
+  void initGlyphs(Uint16 from, Uint16 count);
+  int findOptimalFastTextureSize(void);
+
+  void debug(void);
+
+};
+GLuint loadTexture(SDL_Surface* surface, TexCoord* texCoord);
+int powerOfTwo(int input);
+
+
+///////////////////
+/// TEXT-ENGINE ///
+///////////////////
+//! A singleton Class that operates as a Handler for generating and rendering Text in 2D
+class TextEngine : public BaseObject 
+{
+ public:
+  static TextEngine* getInstance(void);
+  virtual ~TextEngine(void);
+
+  Text* createText(const char* fontFile,
+		   unsigned int fontSize = FONT_DEFAULT_SIZE,
+		   int textType = TEXT_DYNAMIC,
+		   Uint8 r = FONT_DEFAULT_COLOR_R,
+		   Uint8 g = FONT_DEFAULT_COLOR_G,
+		   Uint8 b = FONT_DEFAULT_COLOR_B);
+  
+  void deleteText(Text* text);
+  void flush(void);
+
+  void draw(void) const;
+ 
+  void debug(void) const;
+
+ private:
+  TextEngine(void);
+  static TextEngine* singletonRef;
+
+  // general
+  static void enableFonts(void);
+  static void disableFonts(void);
+  static bool checkVersion(void);
+
+
+  //  tList<Font>* fontList;
+  tList<Text>* textList;
+
+};
+
+#endif /* _TEXT_ENGINE_H */
Index: orxonox/trunk/src/lib/util/list.h
===================================================================
--- orxonox/trunk/src/lib/util/list.h	(revision 3789)
+++ orxonox/trunk/src/lib/util/list.h	(revision 3790)
@@ -107,4 +107,5 @@
   void destroy();
   T* firstElement();
+  T* lastElement();
   bool isEmpty();
   int getSize();
@@ -217,4 +218,10 @@
 }
 
+template<class T>
+T* tList<T>::lastElement()
+{
+  return this->last->curr;
+}
+
 
 template<class T>
Index: orxonox/trunk/src/lib/util/resource_manager.cc
===================================================================
--- orxonox/trunk/src/lib/util/resource_manager.cc	(revision 3789)
+++ orxonox/trunk/src/lib/util/resource_manager.cc	(revision 3790)
@@ -22,4 +22,5 @@
 #include "primitive_model.h"
 #include "texture.h"
+#include "text_engine.h"
 
 #include "list.h"
@@ -141,5 +142,5 @@
    \returns a pointer to a desired Resource.
 */
-void* ResourceManager::load(const char* fileName, ResourcePriority prio)
+void* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
 {
   ResourceType tmpType;
@@ -158,8 +159,10 @@
            !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);
+  return this->load(fileName, tmpType, prio, param1, param2, param3);
 }
 
@@ -171,8 +174,8 @@
    \returns a pointer to a desired Resource.
 */
-void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio)
+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->locateResourceByName(fileName);
+  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3);
   if (tmpResource) // if the resource was not loaded before.
     {
@@ -201,23 +204,61 @@
 	{
 	case OBJ:
+	  if (param1)
+	    tmpResource->modelSize = *(float*)param1;
+	  else
+	    tmpResource->modelSize = 1.0;
+
 	  if(isFile(fullName))
-	    tmpResource->pointer = new OBJModel(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);
+	      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->pointer = new PrimitiveModel(CUBE, tmpResource->modelSize);
 	  else if (!strcmp(tmpResource->name, "sphere"))
-	    tmpResource->pointer = new PrimitiveModel(SPHERE);
+	    tmpResource->pointer = new PrimitiveModel(SPHERE, tmpResource->modelSize);
 	  else if (!strcmp(tmpResource->name, "plane"))
-	    tmpResource->pointer = new PrimitiveModel(PLANE);
+	    tmpResource->pointer = new PrimitiveModel(PLANE, tmpResource->modelSize);
 	  else if (!strcmp(tmpResource->name, "cylinder"))
-	    tmpResource->pointer = new PrimitiveModel(CYLINDER);
+	    tmpResource->pointer = new PrimitiveModel(CYLINDER, tmpResource->modelSize);
 	  else if (!strcmp(tmpResource->name, "cone"))
-	    tmpResource->pointer = new PrimitiveModel(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:
@@ -259,6 +300,12 @@
       delete []fullName;
     }
-
-  return tmpResource->pointer;
+  if (tmpResource->pointer)
+    return tmpResource->pointer;
+  else 
+    {
+      PRINTF(2)("Resource %s could not be loaded\n", fileName);
+      delete tmpResource;
+      return NULL;
+    }
 }
 
@@ -299,4 +346,7 @@
 	    case IMAGE:
 	      delete (Texture*)resource->pointer;
+	      break;
+	    case TTF:
+	      delete (Font*)resource->pointer;
 	      break;
 	    default:
@@ -342,9 +392,9 @@
 
 /**
-   \brief Searches for a Resource by Name
+   \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::locateResourceByName(const char* fileName)
+Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3)
 {
   //  Resource* enumRes = resourceList->enumerate();
@@ -353,8 +403,54 @@
   while (enumRes)
     {
-      if (!strcmp(fileName, enumRes->name))
-	{
-	  delete iterator;
-	  return 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();
@@ -396,5 +492,9 @@
   struct stat status;
   stat(directoryName, &status);
-  if (status.st_mode & (S_IFDIR | S_IFLNK))
+  if (status.st_mode & (S_IFDIR 
+#ifndef __WIN32__
+			| S_IFLNK
+#endif
+			))
     return true;
   else
@@ -411,5 +511,9 @@
   struct stat status;
   stat(fileName, &status);
-  if (status.st_mode & (S_IFREG | S_IFLNK))
+  if (status.st_mode & (S_IFREG 
+#ifndef __WIN32__
+			| S_IFLNK
+#endif
+			))
     return true;
   else
Index: orxonox/trunk/src/lib/util/resource_manager.h
===================================================================
--- orxonox/trunk/src/lib/util/resource_manager.h	(revision 3789)
+++ orxonox/trunk/src/lib/util/resource_manager.h	(revision 3790)
@@ -19,5 +19,5 @@
 
 //! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support
-enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, IMAGE};
+enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, TTF, IMAGE};
 //! An enumerator for different UNLOAD-types. 
 /**
@@ -33,9 +33,16 @@
 {
   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)
-  int count;                 //!< How many times this Resource has been loaded.
+
+  // more specific
+  float modelSize;
+  unsigned int ttfSize;
+  unsigned char ttfColorR;
+  unsigned char ttfColorG;
+  unsigned char ttfColorB;
 };
 
@@ -49,4 +56,6 @@
 
    It does it by looking, if a desired file has already been loaded.
+
+   \todo loading also dependant by parameters.
 */
 class ResourceManager : public BaseObject 
@@ -58,6 +67,8 @@
   bool setDataDir(char* dataDir);
   bool addImageDir(char* imageDir);
-  void* load(const char* fileName, ResourcePriority prio = RP_NO);
-  void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO);
+  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);
@@ -74,5 +85,5 @@
 
 
-  Resource* locateResourceByName(const char* fileName);
+  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3);
   Resource* locateResourceByPointer(const void* pointer);
   
Index: orxonox/trunk/src/orxonox.cc
===================================================================
--- orxonox/trunk/src/orxonox.cc	(revision 3789)
+++ orxonox/trunk/src/orxonox.cc	(revision 3790)
@@ -33,4 +33,5 @@
 #include "graphics_engine.h"
 #include "resource_manager.h"
+#include "text_engine.h"
 
 #include <string.h>
@@ -58,4 +59,5 @@
   delete GraphicsEngine::getInstance(); // deleting the Graphics
   delete ResourceManager::getInstance(); // deletes the Resource Manager
+  delete TextEngine::getInstance();
 }
 
@@ -167,4 +169,6 @@
   resourceManager->setDataDir("../data/");
   return 0;
+  PRINT(3)("initializing TextEngine\n");
+  TextEngine::getInstance();
 }
 
Index: orxonox/trunk/src/story_entities/world.cc
===================================================================
--- orxonox/trunk/src/story_entities/world.cc	(revision 3789)
+++ orxonox/trunk/src/story_entities/world.cc	(revision 3790)
@@ -33,4 +33,5 @@
 #include "terrain.h"
 #include "light.h"
+#include "text_engine.h"
 
 #include "track_manager.h"
@@ -40,5 +41,4 @@
 #include "command_node.h"
 #include "glmenu_imagescreen.h"
-#include "fontset.h"
 #include "list.h"
 
@@ -157,8 +157,11 @@
   delete this->lightMan;
   delete this->trackManager;
+  TextEngine::getInstance()->flush();
 
   delete this->simpleAnimation;
   //delete garbagecollecor
   //delete animator
+
+
 }
 
@@ -207,8 +210,5 @@
     {
       // initializing Font
-      testFont = new FontSet();
-      testFont->buildFont("../data/pictures/font.tga");
       this->glmis->step();
-
       // initializing the TrackManager
       trackManager = TrackManager::getInstance();
@@ -309,5 +309,5 @@
 	    this->spawn (this->localPlayer);
 	    /*monitor progress*/
-	    //this->glmis->step();	    
+	    //this->glmis->step();
 	    this->glmis->step();
 
@@ -363,4 +363,17 @@
 	    this->glmis->step();
 
+	    this->testText = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);
+	    testText->setText("TEXT  rocks");
+	    testText->setBlending(1.0);
+	    testText->setBindNode(tn);
+
+	    /*	    
+		   tmpAnim = new Animation<Text>(testText, &Text::setBlending);
+		   tmpAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR);
+		   tmpAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR);
+		   tmpAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR);
+		   tmpAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR);
+		   tmpAnim->setInfinity(ANIM_INF_CONSTANT, ANIM_INF_REWIND);
+	    */
 	    break;
 	  }
@@ -553,5 +566,5 @@
   glNewList (objectList, GL_COMPILE);
  
-  trackManager->drawGraph(.01);
+  //  trackManager->drawGraph(.01);
   trackManager->debug(2);
   glEndList();
@@ -740,6 +753,5 @@
   glCallList (objectList);
 
-  testFont->printText(0, 0, 1, "orxonox_" PACKAGE_VERSION);
-
+  TextEngine::getInstance()->draw();
   lightMan->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes //
 }
@@ -892,5 +904,8 @@
 	{
 	  float fps = 1000/dt;
-	  PRINTF(3)("fps = %f\n", fps);
+
+	  // temporary, only for showing how fast the text-engine is
+	  char tmpChar[20];
+	  sprintf(tmpChar, "fps: %4.0f", fps);
 	}
       else
@@ -924,4 +939,5 @@
       this->garbageCollector->tick(seconds);
       this->simpleAnimation->tick(seconds);
+
     }
   this->lastFrame = currentFrame;
Index: orxonox/trunk/src/story_entities/world.h
===================================================================
--- orxonox/trunk/src/story_entities/world.h	(revision 3789)
+++ orxonox/trunk/src/story_entities/world.h	(revision 3790)
@@ -21,8 +21,9 @@
 class Skysphere;
 class LightManager;
-class FontSet;
 class Terrain;
 class GarbageCollector;
 class SimpleAnimation;
+
+class Text;
 
 //! The game world Interface
@@ -96,6 +97,7 @@
   bool bPause;                        //!< pause mode
 
-  FontSet* testFont;                  //!< A test Font. \todo fix this, so it is for real.
   GLMenuImageScreen* glmis;           //!< The Level-Loader Display
+
+  Text* testText;                     //!< A text to Test the TextEngine;
 
   char* worldName;                    //!< The name of this World
