Index: orxonox/branches/images/configure
===================================================================
--- orxonox/branches/images/configure	(revision 3107)
+++ orxonox/branches/images/configure	(revision 3108)
@@ -4779,5 +4779,4 @@
     fi
 
-    def_sdl_image=no;
     ;;
 
@@ -5480,9 +5479,24 @@
      fi
 
-## check for SDL_Image
-if test "$def_sdl_image" = "yes"; then
-# checking for SDL_image-headers
-
-for ac_header in SDL/SDL_image.h
+
+## checking for SDL
+#    SDL_VERSION=1.2.7
+#    AM_PATH_SDL($SDL_VERSION,
+#      :,
+#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
+#      )
+#    CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+#    LIBS="$LIBS $SDL_LIBS"
+    ;;
+
+### OS X ###
+ *darwin*)
+echo "OS X detected"
+
+ osX="yes"
+
+# checking gl header
+
+for ac_header in OpenGL/gl.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5630,104 +5644,14 @@
 
 else
-  echo "sdl_image not found. falling back to other options"; def_sdl_image=no
+  { { echo "$as_me:$LINENO: error: cannot find opengl headers" >&5
+echo "$as_me: error: cannot find opengl headers" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 done
 
-fi
-if test "$def_sdl_image" = "yes"; then
-# checking for SDL_image-lib
-  echo "$as_me:$LINENO: checking for main in -lSDL_image" >&5
-echo $ECHO_N "checking for main in -lSDL_image... $ECHO_C" >&6
-if test "${ac_cv_lib_SDL_image_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lSDL_image  $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_image_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_SDL_image_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_image_main" >&5
-echo "${ECHO_T}$ac_cv_lib_SDL_image_main" >&6
-if test $ac_cv_lib_SDL_image_main = yes; then
-  FOUND_SDL_image=yes
-fi
-
-     if test "$FOUND_SDL_image" = "yes" ; then
-       LIBS="$LIBS -lSDL_image"
-     else
-        echo "------------------"
-        echo "SDL_image library not found."
-	echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
-        echo "------------------"
-        exit -1
-     fi
-fi
-
-## checking for SDL
-#    SDL_VERSION=1.2.7
-#    AM_PATH_SDL($SDL_VERSION,
-#      :,
-#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
-#      )
-#    CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
-#    LIBS="$LIBS $SDL_LIBS"
-    ;;
-
-### OS X ###
- *darwin*)
-echo "OS X detected"
-
- osX="yes"
-
-# checking gl header
-
-for ac_header in OpenGL/gl.h
+# cheking for GLU-header
+
+for ac_header in OpenGL/glu.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5882,7 +5806,37 @@
 done
 
-# cheking for GLU-header
-
-for ac_header in OpenGL/glu.h
+
+   LIBS="$LIBS -framework OpenGL"
+
+# checking for SDL-headers
+#    AC_CHECK_HEADERS(SDL/SDL.h ,,
+#      [AC_MSG_ERROR([cannot find SDL headers]) ])
+
+## checking for SDL
+#    SDL_VERSION=1.2.7
+#    AM_PATH_SDL($SDL_VERSION,
+#      :,
+#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
+#      )
+
+       SDL_CFLAGS=`sdl-config --cflags`
+       SDL_LIBS=`sdl-config --libs`
+       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+       LIBS="$LIBS $SDL_LIBS"
+
+       def_sdl_image=no;
+    ;;
+
+  *)
+    ;;
+esac
+
+
+
+## check for SDL_Image
+if test "$def_sdl_image" = "yes"; then
+# checking for SDL_image-headers
+
+for ac_header in SDL/SDL_image.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -6030,37 +5984,84 @@
 
 else
-  { { echo "$as_me:$LINENO: error: cannot find opengl headers" >&5
-echo "$as_me: error: cannot find opengl headers" >&2;}
-   { (exit 1); exit 1; }; }
+  echo "sdl_image not found. falling back to other options"; def_sdl_image=no
 fi
 
 done
 
-
-   LIBS="$LIBS -framework OpenGL"
-
-# checking for SDL-headers
-#    AC_CHECK_HEADERS(SDL/SDL.h ,,
-#      [AC_MSG_ERROR([cannot find SDL headers]) ])
-
-## checking for SDL
-#    SDL_VERSION=1.2.7
-#    AM_PATH_SDL($SDL_VERSION,
-#      :,
-#      AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
-#      )
-
-       SDL_CFLAGS=`sdl-config --cflags`
-       SDL_LIBS=`sdl-config --libs`
-       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
-       LIBS="$LIBS $SDL_LIBS"
-
-       def_sdl_image=no;
-    ;;
-
-  *)
-    ;;
-esac
-
+fi
+if test "$def_sdl_image" = "yes"; then
+# checking for SDL_image-lib
+  echo "$as_me:$LINENO: checking for main in -lSDL_image" >&5
+echo $ECHO_N "checking for main in -lSDL_image... $ECHO_C" >&6
+if test "${ac_cv_lib_SDL_image_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lSDL_image  $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_image_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_SDL_image_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_image_main" >&5
+echo "${ECHO_T}$ac_cv_lib_SDL_image_main" >&6
+if test $ac_cv_lib_SDL_image_main = yes; then
+  FOUND_SDL_image=yes
+fi
+
+     if test "$FOUND_SDL_image" = "yes" ; then
+       LIBS="$LIBS -lSDL_image"
+     else
+        echo "------------------"
+        echo "SDL_image library not found."
+	echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
+        echo "------------------"
+        exit -1
+     fi
+fi
 
 
Index: orxonox/branches/images/configure.ac
===================================================================
--- orxonox/branches/images/configure.ac	(revision 3107)
+++ orxonox/branches/images/configure.ac	(revision 3108)
@@ -126,23 +126,4 @@
     fi
 
-## check for SDL_Image
-if test "$def_sdl_image" = "yes"; then
-# checking for SDL_image-headers
-  AC_CHECK_HEADERS(SDL/SDL_image.h ,,
-      [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
-fi
-if test "$def_sdl_image" = "yes"; then
-# checking for SDL_image-lib
-  AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
-     if test "$FOUND_SDL_image" = "yes" ; then
-       LIBS="$LIBS -lSDL_image"
-     else
-        echo "------------------"
-        echo "SDL_image library not found."
-	echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
-        echo "------------------"
-        exit -1
-     fi   
-fi
     ;;
 
@@ -200,23 +181,4 @@
      fi   
 
-## check for SDL_Image
-if test "$def_sdl_image" = "yes"; then
-# checking for SDL_image-headers
-  AC_CHECK_HEADERS(SDL/SDL_image.h ,,
-      [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
-fi
-if test "$def_sdl_image" = "yes"; then
-# checking for SDL_image-lib
-  AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
-     if test "$FOUND_SDL_image" = "yes" ; then
-       LIBS="$LIBS -lSDL_image"
-     else
-        echo "------------------"
-        echo "SDL_image library not found."
-	echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
-        echo "------------------"
-        exit -1
-     fi   
-fi
 
 ## checking for SDL
@@ -269,4 +231,25 @@
 
 AC_SUBST(MSBITFIELDS)
+
+## check for SDL_Image
+if test "$def_sdl_image" = "yes"; then
+# checking for SDL_image-headers
+  AC_CHECK_HEADERS(SDL/SDL_image.h ,,
+      [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
+fi
+if test "$def_sdl_image" = "yes"; then
+# checking for SDL_image-lib
+  AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
+     if test "$FOUND_SDL_image" = "yes" ; then
+       LIBS="$LIBS -lSDL_image"
+     else
+        echo "------------------"
+        echo "SDL_image library not found."
+	echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
+        echo "------------------"
+        exit -1
+     fi   
+fi
+
 
 if test "$def_sdl_image" = "no"; then
Index: orxonox/branches/images/importer/material.cc
===================================================================
--- orxonox/branches/images/importer/material.cc	(revision 3107)
+++ orxonox/branches/images/importer/material.cc	(revision 3108)
@@ -391,7 +391,4 @@
   pImage->width  = map->w;
   pImage->data   = (GLubyte*)map->pixels;
-
-  SDL_RWops *imgType;
-  imgType=SDL_RWFromFile(imageName, "rb");
   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)
