Index: orxonox/trunk/config.h.in
===================================================================
--- orxonox/trunk/config.h.in	(revision 4661)
+++ orxonox/trunk/config.h.in	(revision 4662)
@@ -47,9 +47,15 @@
 #undef HAVE_OPENGL_GL_H
 
-/* Define to 1 if you have the <SDL.h> header file. */
-#undef HAVE_SDL_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/SDL.h> header file. */
+#undef HAVE_SDL_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/SDL_ttf.h> header file. */
+#undef HAVE_SDL_SDL_TTF_H
 
 /* Define to 1 if you have the <SDL_ttf.h> header file. */
Index: orxonox/trunk/configure
===================================================================
--- orxonox/trunk/configure	(revision 4661)
+++ orxonox/trunk/configure	(revision 4662)
@@ -4278,5 +4278,5 @@
 echo "mingw-WINDOWS detected"
 
-CPPFLAGS="-I/usr/include/SDL -I/mingw/include/SDL"
+CPPFLAGS="-I/usr/include -I/mingw/include"
 
     mingw="yes"
@@ -4886,5 +4886,5 @@
 # checking for SDL-headers
 
-for ac_header in SDL.h
+for ac_header in SDL/SDL.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5193,5 +5193,5 @@
  Linux="yes"
 
-CPPFLAGS="-I/usr/X11R6/include -I/usr/include/SDL"
+CPPFLAGS="-I/usr/X11R6/include -I/usr/include"
 LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
 # checking gl header
@@ -5666,5 +5666,5 @@
 # checking for SDL-headers
 
-for ac_header in SDL.h
+for ac_header in SDL/SDL.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5911,5 +5911,5 @@
  osX="yes"
 
- CPPFLAGS="-I/sw/include -I/sw/include/SDL $CPPFLAGS"
+ CPPFLAGS="-I/sw/include -I/sw/include $CPPFLAGS"
 # checking gl header
 
@@ -6225,4 +6225,6 @@
    LIBS="$LIBS -framework OpenGL"
 
+
+## SDL-check
        SDL_CFLAGS=`sdl-config --cflags`
        SDL_LIBS=`sdl-config --libs`
@@ -7029,5 +7031,5 @@
 # checking for SDL_ttf-headers
 
-for ac_header in SDL_ttf.h
+for ac_header in SDL/SDL_ttf.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -7175,92 +7177,6 @@
 
 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 #
-#-----------#
-# checking for SDL_image-headers
-
-for ac_header in SDL_image.h
+
+for ac_header in SDL_ttf.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -7408,5 +7324,395 @@
 
 else
-  echo "sdl_image header not found."; def_sdl_image=no; exit -1
+  { { 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
+
+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 #
+#-----------#
+# checking for SDL_image-headers
+
+for ac_header in SDL_image.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
+
+for ac_header in SDL/SDL_image.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: sdl_image header not found." >&5
+echo "$as_me: error: sdl_image header not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
 fi
 
Index: orxonox/trunk/configure.ac
===================================================================
--- orxonox/trunk/configure.ac	(revision 4661)
+++ orxonox/trunk/configure.ac	(revision 4662)
@@ -215,5 +215,5 @@
 echo "mingw-WINDOWS detected"
 
-CPPFLAGS="-I/usr/include/SDL -I/mingw/include/SDL"
+CPPFLAGS="-I/usr/include -I/mingw/include"
 
     mingw="yes"
@@ -261,5 +261,5 @@
     fi
 # checking for SDL-headers
-    AC_CHECK_HEADERS([SDL.h] ,,
+    AC_CHECK_HEADERS([SDL/SDL.h] ,,
       [AC_MSG_ERROR([cannot find SDL headers]) ])
 
@@ -295,5 +295,5 @@
  Linux="yes"
 
-CPPFLAGS="-I/usr/X11R6/include -I/usr/include/SDL"
+CPPFLAGS="-I/usr/X11R6/include -I/usr/include"
 LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
 # checking gl header
@@ -329,5 +329,5 @@
 
 # checking for SDL-headers
-    AC_CHECK_HEADERS([SDL.h] ,,
+    AC_CHECK_HEADERS([SDL/SDL.h] ,,
       [AC_MSG_ERROR([cannot find SDL headers]) ])
 
@@ -362,5 +362,5 @@
  osX="yes"
 
- CPPFLAGS="-I/sw/include -I/sw/include/SDL $CPPFLAGS"
+ CPPFLAGS="-I/sw/include -I/sw/include $CPPFLAGS"
 # checking gl header
    AC_CHECK_HEADERS([OpenGL/gl.h] ,,
@@ -372,4 +372,6 @@
    LIBS="$LIBS -framework OpenGL"
 
+
+## SDL-check
        SDL_CFLAGS=`sdl-config --cflags`
        SDL_LIBS=`sdl-config --libs`
@@ -475,6 +477,6 @@
 #---------#
 # checking for SDL_ttf-headers
-  AC_CHECK_HEADERS([SDL_ttf.h] ,,
-      [AC_MSG_ERROR([cannot find SDL_ttf header.])])
+  AC_CHECK_HEADERS([SDL/SDL_ttf.h] ,,
+      [AC_CHECK_HEADERS([SDL_ttf.h] ,,AC_MSG_ERROR([cannot find SDL_ttf header.])]))
 #fi
 # checking for SDL_ttf-lib
@@ -496,5 +498,5 @@
 # checking for SDL_image-headers
 AC_CHECK_HEADERS([SDL_image.h] ,,
-    [echo "sdl_image header not found."; def_sdl_image=no; exit -1])
+    [AC_CHECK_HEADERS([SDL/SDL_image.h],, AC_MSG_ERROR([sdl_image header not found.]))])
 # checking for SDL_image-lib
 AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes])
@@ -596,5 +598,5 @@
                  src/lib/gui/Makefile
                  src/lib/tinyxml/Makefile
-		 src/subprojects/Makefile
+                 src/subprojects/Makefile
                  src/subprojects/testmain/Makefile
                  src/subprojects/importer/Makefile
Index: orxonox/trunk/orxonox.kdevelop
===================================================================
--- orxonox/trunk/orxonox.kdevelop	(revision 4661)
+++ orxonox/trunk/orxonox.kdevelop	(revision 4662)
@@ -165,5 +165,5 @@
     </groups>
     <tree>
-      <hidepatterns>*.o</hidepatterns>
+      <hidepatterns>*.o,*~</hidepatterns>
       <hidenonprojectfiles>false</hidenonprojectfiles>
     </tree>
Index: orxonox/trunk/src/defs/sdlincl.h
===================================================================
--- orxonox/trunk/src/defs/sdlincl.h	(revision 4661)
+++ orxonox/trunk/src/defs/sdlincl.h	(revision 4662)
@@ -2,5 +2,5 @@
   \file sdlincl.h
   \brief This file includes sdl Headers.
-  
+
   no Class is defined here, but the SDL Headers
 */
@@ -9,5 +9,5 @@
 #define _SDLINCL_H
 
-#include <SDL.h>
+#include <SDL/SDL.h>
 
 #endif /* _SDLINCL_H */
Index: orxonox/trunk/src/lib/event/event_def.h
===================================================================
--- orxonox/trunk/src/lib/event/event_def.h	(revision 4661)
+++ orxonox/trunk/src/lib/event/event_def.h	(revision 4662)
@@ -1,3 +1,3 @@
-/*! 
+/*!
     \file event_def.h
     \brief some central definitions
@@ -8,5 +8,9 @@
 #define _EVENT_DEF_H
 
+#ifdef HAVE_SDL_H
 #include "SDL_keysym.h"
+#else
+#include "SDL/SDL_keysym.h"
+#endif
 #include "stdincl.h"
 
Index: orxonox/trunk/src/lib/graphics/importer/texture.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/texture.cc	(revision 4661)
+++ orxonox/trunk/src/lib/graphics/importer/texture.cc	(revision 4662)
@@ -1,3 +1,3 @@
-/* 
+/*
    orxonox - the future of 3D-vertical-scrollers
 
@@ -21,5 +21,9 @@
 #include "graphics_engine.h"
 
+#ifdef HAVE_SDL_IMAGE_H
 #include <SDL_image.h>
+#else
+#include <SDL/SDL_image.h>
+#endif
 
 /**
@@ -32,9 +36,9 @@
   if (imageName)
     this->loadImage(imageName);
-}  
+}
 
 /**
    \brief Destructor of a Texture
-   
+
    Frees Data, and deletes the textures from GL
 */
@@ -62,34 +66,34 @@
       Uint32 saved_flags;
       Uint8  saved_alpha;
-      
+
       w = surface->w;
       h = surface->h;
-      
+
       image = SDL_CreateRGBSurface(SDL_SWSURFACE,
-				   w, h,
-				   32,
+                                   w, h,
+                                   32,
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
-				   0x000000FF, 
-				   0x0000FF00, 
-				   0x00FF0000, 
-				   0xFF000000
+                                   0x000000FF,
+                                   0x0000FF00,
+                                   0x00FF0000,
+                                   0xFF000000
 #else
-				   0xFF000000,
-				   0x00FF0000, 
-				   0x0000FF00, 
-				   0x000000FF
+                                   0xFF000000,
+                                   0x00FF0000,
+                                   0x0000FF00,
+                                   0x000000FF
 #endif
-				   );
+                                   );
       if ( image == NULL ) {
-	return 0;
+        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);
+        SDL_SetAlpha(surface, 0, 0);
       }
-      
+
       /* Copy the surface into the GL texture image */
       area.x = 0;
@@ -98,11 +102,11 @@
       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 | SDL_OPENGL, saved_alpha);
-	this->bAlpha = true;
+        SDL_SetAlpha(surface, saved_flags | SDL_OPENGL, saved_alpha);
+        this->bAlpha = true;
       }
-      
+
       /* Create an OpenGL texture for the image */
       glGenTextures(1, &texture);
@@ -112,22 +116,22 @@
       // build the Texture
       glTexImage2D(GL_TEXTURE_2D,
-		   0,
-		   GL_RGBA,
-		   w, h,
-		   0,
-		   GL_RGBA,
-		   GL_UNSIGNED_BYTE,
-		   image->pixels);
+                   0,
+                   GL_RGBA,
+                   w, h,
+                   0,
+                   GL_RGBA,
+                   GL_UNSIGNED_BYTE,
+                   image->pixels);
       // build the MipMaps
       gluBuild2DMipmaps(GL_TEXTURE_2D,
-			GL_RGBA,
-			w,
-			h,
-			GL_RGBA,
-			GL_UNSIGNED_BYTE,
-			image->pixels);
-      
+                        GL_RGBA,
+                        w,
+                        h,
+                        GL_RGBA,
+                        GL_UNSIGNED_BYTE,
+                        image->pixels);
+
       SDL_FreeSurface(image); /* No longer needed */
-      
+
       return texture;
     }
@@ -143,31 +147,31 @@
     {
       if (imageName)
-	{
-	  SDL_Surface* tmpSurf;
-	  if (this->texture)
-	    glDeleteTextures(1, &this->texture);
-	  // load the new Image to memory
-	  tmpSurf = IMG_Load(imageName);
-	  if(!tmpSurf)
-	    {
-	      PRINTF(1)("IMG_Load: %s\n", IMG_GetError());
-	      return false;
-	    }
+        {
+          SDL_Surface* tmpSurf;
+          if (this->texture)
+            glDeleteTextures(1, &this->texture);
+          // load the new Image to memory
+          tmpSurf = IMG_Load(imageName);
+          if(!tmpSurf)
+            {
+              PRINTF(1)("IMG_Load: %s\n", IMG_GetError());
+              return false;
+            }
 
-	  GLubyte* pixels = (GLubyte*)tmpSurf->pixels;
+          GLubyte* pixels = (GLubyte*)tmpSurf->pixels;
 
-	  PRINTF(3)("loading Image %s\n", imageName);
-	  if (tmpSurf)
-	    this->texture = loadTexToGL(tmpSurf);
+          PRINTF(3)("loading Image %s\n", imageName);
+          if (tmpSurf)
+            this->texture = loadTexToGL(tmpSurf);
 
-	  
-	  SDL_FreeSurface(tmpSurf);
-	  return true;
-	}
+
+          SDL_FreeSurface(tmpSurf);
+          return true;
+        }
       else
-	{
-	  PRINTF(2)("Image not Found: %s\n", imageName);
-	  return false;
-	}
+        {
+          PRINTF(2)("Image not Found: %s\n", imageName);
+          return false;
+        }
     }
 }
Index: orxonox/trunk/src/lib/graphics/text_engine.h
===================================================================
--- orxonox/trunk/src/lib/graphics/text_engine.h	(revision 4661)
+++ orxonox/trunk/src/lib/graphics/text_engine.h	(revision 4662)
@@ -19,5 +19,10 @@
 
 #include "glincl.h"
+
+#ifdef HAVE_SDL_IMAGE_H
 #include "SDL_ttf.h"
+#else
+#include "SDL/SDL_ttf.h"
+#endif
 
 #include "vector.h"
Index: orxonox/trunk/src/subprojects/framework.h
===================================================================
--- orxonox/trunk/src/subprojects/framework.h	(revision 4661)
+++ orxonox/trunk/src/subprojects/framework.h	(revision 4662)
@@ -4,5 +4,4 @@
 #include "vector.h"
 #include "glincl.h"
-#include "SDL_events.h"
 #include "debug.h"
 #include "graphics_engine.h"
