Index: orxonox/branches/sound/src/Makefile
===================================================================
--- orxonox/branches/sound/src/Makefile	(revision 2854)
+++ orxonox/branches/sound/src/Makefile	(revision 2964)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
 # src/Makefile.  Generated from Makefile.in by configure.
 
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,4 +15,7 @@
 
 
+
+SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
+
 srcdir = .
 top_srcdir = ..
@@ -22,7 +25,6 @@
 pkgincludedir = $(includedir)/orxonox
 top_builddir = ..
-
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = /usr/bin/install -c
+INSTALL = /bin/install -c
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -36,11 +38,63 @@
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-ACLOCAL = ${SHELL} /root/orxonox/branches/sound/missing --run aclocal-1.7
+bin_PROGRAMS = orxonox$(EXEEXT) sound$(EXEEXT)
+subdir = src
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in INSTALL
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_orxonox_OBJECTS = orxonox.$(OBJEXT) world.$(OBJEXT) \
+	player.$(OBJEXT) data_tank.$(OBJEXT) world_entity.$(OBJEXT) \
+	vector.$(OBJEXT) camera.$(OBJEXT) collision.$(OBJEXT) \
+	command_node.$(OBJEXT) ini_parser.$(OBJEXT) keynames.$(OBJEXT) \
+	track.$(OBJEXT) base_entity.$(OBJEXT) game_loader.$(OBJEXT) \
+	campaign.$(OBJEXT) story_entity.$(OBJEXT)
+orxonox_OBJECTS = $(am_orxonox_OBJECTS)
+orxonox_LDADD = $(LDADD)
+am_sound_OBJECTS = sound_test.$(OBJEXT) sound_control.$(OBJEXT)
+sound_OBJECTS = $(am_sound_OBJECTS)
+sound_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+DEP_FILES = ./$(DEPDIR)/base_entity.Po \
+	./$(DEPDIR)/camera.Po ./$(DEPDIR)/campaign.Po \
+	./$(DEPDIR)/collision.Po \
+	./$(DEPDIR)/command_node.Po \
+	./$(DEPDIR)/data_tank.Po \
+	./$(DEPDIR)/game_loader.Po \
+	./$(DEPDIR)/ini_parser.Po ./$(DEPDIR)/keynames.Po \
+	./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/player.Po \
+	./$(DEPDIR)/sound_control.Po \
+	./$(DEPDIR)/sound_test.Po \
+	./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/track.Po \
+	./$(DEPDIR)/vector.Po ./$(DEPDIR)/world.Po \
+	./$(DEPDIR)/world_entity.Po
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
+DIST_SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run aclocal-1.8
 AMDEP_FALSE = #
 AMDEP_TRUE = 
-AMTAR = ${SHELL} /root/orxonox/branches/sound/missing --run tar
-AUTOCONF = ${SHELL} /root/orxonox/branches/sound/missing --run autoconf
-AUTOHEADER = ${SHELL} /root/orxonox/branches/sound/missing --run autoheader
-AUTOMAKE = ${SHELL} /root/orxonox/branches/sound/missing --run automake-1.7
+AMTAR = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run tar
+AUTOCONF = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run automake-1.8
 AWK = gawk
 CC = gcc
@@ -66,7 +120,7 @@
 LDFLAGS = 
 LIBOBJS = 
-LIBS = -lm  -lGL -lGLU -lSDL_mixer -lSDL -lpthread -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  
+LIBS = -lm  -lGL -lGLU -lSDL -lSDL_mixer -lpthread -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  
 LTLIBOBJS = 
-MAKEINFO = ${SHELL} /root/orxonox/branches/sound/missing --run makeinfo
+MAKEINFO = ${SHELL} /home/bensch/svn/orxonox/branches/sound/missing --run makeinfo
 MSBITFIELDS = 
 OBJEXT = o
@@ -83,5 +137,5 @@
 VERSION = 0.1-pre-alpha
 ac_ct_CC = gcc
-ac_ct_CXX = g++
+ac_ct_CXX = 
 ac_ct_STRIP = 
 am__fastdepCC_FALSE = #
@@ -99,9 +153,10 @@
 includedir = ${prefix}/include
 infodir = ${prefix}/info
-install_sh = /root/orxonox/branches/sound/install-sh
+install_sh = /home/bensch/svn/orxonox/branches/sound/install-sh
 libdir = ${exec_prefix}/lib
 libexecdir = ${exec_prefix}/libexec
 localstatedir = ${prefix}/var
 mandir = ${prefix}/man
+mkdir_p = mkdir -p -- .
 oldincludedir = /usr/include
 prefix = /usr/local
@@ -113,76 +168,43 @@
 AM_CXXFLAGS = "-I/usr/X11R6/include"
 AM_LDFLAGS = "-L/usr/Mesa-6.0.1/lib  -L/usr/X11R6/lib -lXt -lX11" $(MWINDOWS)
-
-
-#"-O3 -pedantic -fPIC -ffast-math -I/usr/X11R6/include"
-bin_PROGRAMS = orxonox sound
 orxonox_SOURCES = orxonox.cc world.cc player.cc data_tank.cc world_entity.cc vector.cc camera.cc collision.cc command_node.cc ini_parser.cc keynames.cc track.cc base_entity.cc game_loader.cc campaign.cc story_entity.cc
-
 sound_SOURCES = sound_test.cc sound_control.cc
-
 noinst_HEADERS = ability.h data_tank.h npc.h stdincl.h ai.h environment.h orxonox.h synchronisable.h base_entity.h error.h player.h track.h camera.h ini_parser.h power_up.h vector.h collision.h keynames.h proto_class.h world.h command_node.h list.h shoot_laser.h world_entity.h coordinates.h message_structures.h shoot_rocket.h
-subdir = src
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-bin_PROGRAMS = orxonox$(EXEEXT) sound$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS)
-
-am_orxonox_OBJECTS = orxonox.$(OBJEXT) world.$(OBJEXT) player.$(OBJEXT) \
-	data_tank.$(OBJEXT) world_entity.$(OBJEXT) vector.$(OBJEXT) \
-	camera.$(OBJEXT) collision.$(OBJEXT) command_node.$(OBJEXT) \
-	ini_parser.$(OBJEXT) keynames.$(OBJEXT) track.$(OBJEXT) \
-	base_entity.$(OBJEXT) game_loader.$(OBJEXT) campaign.$(OBJEXT) \
-	story_entity.$(OBJEXT)
-orxonox_OBJECTS = $(am_orxonox_OBJECTS)
-orxonox_LDADD = $(LDADD)
-orxonox_DEPENDENCIES =
-orxonox_LDFLAGS =
-am_sound_OBJECTS = sound_test.$(OBJEXT) sound_control.$(OBJEXT)
-sound_OBJECTS = $(am_sound_OBJECTS)
-sound_LDADD = $(LDADD)
-sound_DEPENDENCIES =
-sound_LDFLAGS =
-
-DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-DEP_FILES = ./$(DEPDIR)/base_entity.Po ./$(DEPDIR)/camera.Po \
-	./$(DEPDIR)/campaign.Po ./$(DEPDIR)/collision.Po \
-	./$(DEPDIR)/command_node.Po \
-	./$(DEPDIR)/data_tank.Po ./$(DEPDIR)/game_loader.Po \
-	./$(DEPDIR)/ini_parser.Po ./$(DEPDIR)/keynames.Po \
-	./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/player.Po \
-	./$(DEPDIR)/sound_control.Po \
-	./$(DEPDIR)/sound_test.Po \
-	./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/track.Po \
-	./$(DEPDIR)/vector.Po ./$(DEPDIR)/world.Po \
-	./$(DEPDIR)/world_entity.Po
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-	-o $@
-DIST_SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
-HEADERS = $(noinst_HEADERS)
-
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in INSTALL \
-	Makefile.am
-SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
-
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .cc .o .obj
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
 	cd $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu  src/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
-	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -190,6 +212,6 @@
 	  ; then \
 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
 	  else :; fi; \
 	done
@@ -199,6 +221,6 @@
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
-	  rm -f $(DESTDIR)$(bindir)/$$f; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
 	done
 
@@ -213,5 +235,5 @@
 
 mostlyclean-compile:
-	-rm -f *.$(OBJEXT) core *.core
+	-rm -f *.$(OBJEXT)
 
 distclean-compile:
@@ -238,33 +260,19 @@
 
 .cc.o:
-	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-	fi
+	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 #	source='$<' object='$@' libtool=no \
 #	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
 #	$(CXXDEPMODE) $(depcomp) \
-#	$(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+#	$(CXXCOMPILE) -c -o $@ $<
 
 .cc.obj:
-	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-	fi
+	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 #	source='$<' object='$@' libtool=no \
 #	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
 #	$(CXXDEPMODE) $(depcomp) \
-#	$(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+#	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 uninstall-info-am:
-
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -276,4 +284,5 @@
 	       END { for (i in files) print i; }'`; \
 	mkid -fID $$unique
+tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -287,8 +296,9 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	     $$tags $$unique
-
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -313,8 +323,4 @@
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
 
 distdir: $(DISTFILES)
@@ -330,5 +336,5 @@
 	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
 	    dir="/$$dir"; \
-	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
 	  else \
 	    dir=''; \
@@ -348,7 +354,8 @@
 check: check-am
 all-am: Makefile $(PROGRAMS) $(HEADERS)
-
 installdirs:
-	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
 install: install-am
 install-exec: install-exec-am
@@ -389,4 +396,6 @@
 dvi-am:
 
+html: html-am
+
 info: info-am
 
@@ -424,9 +433,9 @@
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
 	clean-generic ctags distclean distclean-compile \
-	distclean-generic distclean-tags distdir dvi dvi-am info \
-	info-am install install-am install-binPROGRAMS install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-binPROGRAMS \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
Index: orxonox/branches/sound/src/Makefile.in
===================================================================
--- orxonox/branches/sound/src/Makefile.in	(revision 2854)
+++ orxonox/branches/sound/src/Makefile.in	(revision 2964)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
 # @configure_input@
 
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,4 +14,7 @@
 
 @SET_MAKE@
+
+
+SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
 
 srcdir = @srcdir@
@@ -22,5 +25,4 @@
 pkgincludedir = $(includedir)/@PACKAGE@
 top_builddir = ..
-
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 INSTALL = @INSTALL@
@@ -36,4 +38,56 @@
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+bin_PROGRAMS = orxonox$(EXEEXT) sound$(EXEEXT)
+subdir = src
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in INSTALL
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_orxonox_OBJECTS = orxonox.$(OBJEXT) world.$(OBJEXT) \
+	player.$(OBJEXT) data_tank.$(OBJEXT) world_entity.$(OBJEXT) \
+	vector.$(OBJEXT) camera.$(OBJEXT) collision.$(OBJEXT) \
+	command_node.$(OBJEXT) ini_parser.$(OBJEXT) keynames.$(OBJEXT) \
+	track.$(OBJEXT) base_entity.$(OBJEXT) game_loader.$(OBJEXT) \
+	campaign.$(OBJEXT) story_entity.$(OBJEXT)
+orxonox_OBJECTS = $(am_orxonox_OBJECTS)
+orxonox_LDADD = $(LDADD)
+am_sound_OBJECTS = sound_test.$(OBJEXT) sound_control.$(OBJEXT)
+sound_OBJECTS = $(am_sound_OBJECTS)
+sound_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/base_entity.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/camera.Po ./$(DEPDIR)/campaign.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/collision.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/command_node.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/data_tank.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/game_loader.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/ini_parser.Po ./$(DEPDIR)/keynames.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/player.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/sound_control.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/sound_test.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/track.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/vector.Po ./$(DEPDIR)/world.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/world_entity.Po
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
+DIST_SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMDEP_FALSE = @AMDEP_FALSE@
@@ -104,4 +158,5 @@
 localstatedir = @localstatedir@
 mandir = @mandir@
+mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
 prefix = @prefix@
@@ -113,76 +168,43 @@
 AM_CXXFLAGS = "-I/usr/X11R6/include"
 AM_LDFLAGS = "-L/usr/Mesa-6.0.1/lib  -L/usr/X11R6/lib -lXt -lX11" $(MWINDOWS)
-
-
-#"-O3 -pedantic -fPIC -ffast-math -I/usr/X11R6/include"
-bin_PROGRAMS = orxonox sound
 orxonox_SOURCES = orxonox.cc world.cc player.cc data_tank.cc world_entity.cc vector.cc camera.cc collision.cc command_node.cc ini_parser.cc keynames.cc track.cc base_entity.cc game_loader.cc campaign.cc story_entity.cc
-
 sound_SOURCES = sound_test.cc sound_control.cc
-
 noinst_HEADERS = ability.h data_tank.h npc.h stdincl.h ai.h environment.h orxonox.h synchronisable.h base_entity.h error.h player.h track.h camera.h ini_parser.h power_up.h vector.h collision.h keynames.h proto_class.h world.h command_node.h list.h shoot_laser.h world_entity.h coordinates.h message_structures.h shoot_rocket.h
-subdir = src
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-bin_PROGRAMS = orxonox$(EXEEXT) sound$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS)
-
-am_orxonox_OBJECTS = orxonox.$(OBJEXT) world.$(OBJEXT) player.$(OBJEXT) \
-	data_tank.$(OBJEXT) world_entity.$(OBJEXT) vector.$(OBJEXT) \
-	camera.$(OBJEXT) collision.$(OBJEXT) command_node.$(OBJEXT) \
-	ini_parser.$(OBJEXT) keynames.$(OBJEXT) track.$(OBJEXT) \
-	base_entity.$(OBJEXT) game_loader.$(OBJEXT) campaign.$(OBJEXT) \
-	story_entity.$(OBJEXT)
-orxonox_OBJECTS = $(am_orxonox_OBJECTS)
-orxonox_LDADD = $(LDADD)
-orxonox_DEPENDENCIES =
-orxonox_LDFLAGS =
-am_sound_OBJECTS = sound_test.$(OBJEXT) sound_control.$(OBJEXT)
-sound_OBJECTS = $(am_sound_OBJECTS)
-sound_LDADD = $(LDADD)
-sound_DEPENDENCIES =
-sound_LDFLAGS =
-
-DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/base_entity.Po ./$(DEPDIR)/camera.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/campaign.Po ./$(DEPDIR)/collision.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/command_node.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/data_tank.Po ./$(DEPDIR)/game_loader.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/ini_parser.Po ./$(DEPDIR)/keynames.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/player.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/sound_control.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/sound_test.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/track.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/vector.Po ./$(DEPDIR)/world.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/world_entity.Po
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-	-o $@
-DIST_SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
-HEADERS = $(noinst_HEADERS)
-
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in INSTALL \
-	Makefile.am
-SOURCES = $(orxonox_SOURCES) $(sound_SOURCES)
-
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .cc .o .obj
-$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
 	cd $(top_srcdir) && \
 	  $(AUTOMAKE) --gnu  src/Makefile
-Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
-	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -190,6 +212,6 @@
 	  ; then \
 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
 	  else :; fi; \
 	done
@@ -199,6 +221,6 @@
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
-	  rm -f $(DESTDIR)$(bindir)/$$f; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
 	done
 
@@ -213,5 +235,5 @@
 
 mostlyclean-compile:
-	-rm -f *.$(OBJEXT) core *.core
+	-rm -f *.$(OBJEXT)
 
 distclean-compile:
@@ -238,33 +260,19 @@
 
 .cc.o:
-@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCXX_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-@am__fastdepCXX_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCXX_TRUE@	fi
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
 
 .cc.obj:
-@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
-@am__fastdepCXX_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
-@am__fastdepCXX_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
-@am__fastdepCXX_TRUE@	fi
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 uninstall-info-am:
-
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -276,4 +284,5 @@
 	       END { for (i in files) print i; }'`; \
 	mkid -fID $$unique
+tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -287,8 +296,9 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	     $$tags $$unique
-
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -313,8 +323,4 @@
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
 
 distdir: $(DISTFILES)
@@ -330,5 +336,5 @@
 	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
 	    dir="/$$dir"; \
-	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
 	  else \
 	    dir=''; \
@@ -348,7 +354,8 @@
 check: check-am
 all-am: Makefile $(PROGRAMS) $(HEADERS)
-
 installdirs:
-	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
 install: install-am
 install-exec: install-exec-am
@@ -389,4 +396,6 @@
 dvi-am:
 
+html: html-am
+
 info: info-am
 
@@ -424,9 +433,9 @@
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
 	clean-generic ctags distclean distclean-compile \
-	distclean-generic distclean-tags distdir dvi dvi-am info \
-	info-am install install-am install-binPROGRAMS install-data \
-	install-data-am install-exec install-exec-am install-info \
-	install-info-am install-man install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-binPROGRAMS \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
Index: orxonox/branches/sound/src/array.cc
===================================================================
--- orxonox/branches/sound/src/array.cc	(revision 2964)
+++ orxonox/branches/sound/src/array.cc	(revision 2964)
@@ -0,0 +1,139 @@
+/* 
+   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 "array.h"
+
+/**
+   \brief creates a new Array
+*/
+Array::Array ()
+{
+  initializeArray ();
+}
+
+/**
+   \brief deletes an Array.
+   It does this by first deleting all the array-entries, and then delete the array[] itself
+*/
+Array::~Array()
+{
+  if (verbose >= 2)
+    printf("deleting array\n");
+  Entry* walker = firstEntry;
+  Entry* last;
+  while (walker != NULL)
+    {
+      last = walker;
+      walker = walker->next;
+      delete last;
+    }
+  if (finalized)
+    delete [] array;
+}
+
+/**
+   \brief initializes an Array
+   the Function does this by setting up a fistEntry, and setting the entryCount.
+*/
+void Array::initializeArray ()
+{
+  if (verbose >= 2)
+    printf ("crating new Array\n");
+  firstEntry = new Entry;
+  firstEntry->next =NULL;
+  currentEntry=firstEntry;
+  finalized = false;
+  entryCount = 0; //0 means one entry
+  return;
+}
+
+/**
+   \brief finalizes an array.
+   This Function creates the array, and makes it ready to be sent to the application.
+*/
+void Array::finalizeArray (void)
+{
+  if (verbose >= 3)
+    printf ("Finalizing array.\n");  
+  if ((array = (GLfloat*)malloc( entryCount* sizeof(GLfloat))) == NULL)
+  //  if ((array = new GLfloat [entryCount]) == NULL)
+    printf ("could not allocate %i data Blocks\n", entryCount);
+  Entry* walker = firstEntry;
+  for (int i=0; i<entryCount; i++)
+    {
+      array[i] = walker->value;
+      walker = walker->next;
+    }
+  finalized = true;
+
+  return;
+}
+
+/**
+   \brief adds a new Entry to the Array
+   \param entry Entry to add.
+*/
+void Array::addEntry (GLfloat entry)
+{
+  if (!finalized)
+    {
+      if (verbose >= 3)
+	printf ("adding new Entry to Array: %f\n", entry);
+      
+      currentEntry->value = entry;
+      currentEntry->next = new Entry;
+      currentEntry = currentEntry->next;
+      currentEntry->next = NULL;
+      ++entryCount;
+    }
+  else 
+    if (verbose >= 1)
+      printf ("adding failed, because list has been finalized\n");
+}
+
+/**
+   \brief Adds 3 entries at once (convenience)
+*/
+void Array::addEntry (GLfloat entry0, GLfloat entry1, GLfloat entry2)
+{
+  addEntry (entry0);
+  addEntry (entry1);
+  addEntry (entry2);
+}
+  
+/**
+   \brief Gives back the array !! MUST be executed AFTER finalize.
+   \returns The created array.
+*/
+GLfloat* Array::getArray ()
+{
+  return array;
+}
+
+/**
+   \returns The Count of entries in the Array
+*/
+int Array::getCount()
+{
+  return entryCount;
+}
+
+/**
+   \brief Simple debug info about the Array
+*/
+void Array::debug ()
+{
+  printf ("entryCount=%i, address=%p\n", entryCount, array);
+}
Index: orxonox/branches/sound/src/array.h
===================================================================
--- orxonox/branches/sound/src/array.h	(revision 2964)
+++ orxonox/branches/sound/src/array.h	(revision 2964)
@@ -0,0 +1,49 @@
+/*!
+  \file array.h
+  \brief Contains the Array Class that handles float arrays.
+  this class creates a Array of a semi-Dynamic length.
+  beware, that after finalizing the array may not be resized again.
+*/
+
+#ifndef _ARRAY_H
+#define _ARRAY_H
+
+extern int verbose; //!< will be obsolete soon
+
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <fstream>
+
+
+//! Array Class that handles dynamic-float arrays.
+class Array
+{
+ public:
+  Array ();
+  ~Array();
+
+  void initializeArray ();
+  void finalizeArray (void);
+  void addEntry (GLfloat entry);
+  void addEntry(GLfloat entry0, GLfloat entry1, GLfloat entry2);
+  
+  GLfloat* getArray ();
+  int getCount();
+  void debug(void);
+ private:
+  struct Entry
+  {
+    GLfloat value;
+    Entry* next;
+  };
+
+  GLfloat* array;
+  int entryCount;
+  bool finalized;
+  Entry* firstEntry;
+  Entry* currentEntry;
+  
+  
+};
+
+#endif
Index: orxonox/branches/sound/src/material.cc
===================================================================
--- orxonox/branches/sound/src/material.cc	(revision 2964)
+++ orxonox/branches/sound/src/material.cc	(revision 2964)
@@ -0,0 +1,293 @@
+/* 
+   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 "material.h"
+
+/**
+   \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()
+{
+  init();
+  
+  setName ("");
+}
+
+/**
+   \brief creates a Material.
+   \param mtlName Name of the Material to be added to the Material List
+*/
+Material::Material (char* mtlName)
+{
+  init();
+  
+  setName (mtlName);
+}
+
+/** 
+    \brief deletes a Material
+*/
+Material::~Material()
+{
+  if (verbose >= 2)
+    printf ("delete Material %s\n", name);
+  if (nextMat != NULL)
+    delete nextMat;
+}
+
+/**
+   \brief adds a new Material to the List.
+   this Function will append a new Material to the end of a Material List.
+   \param mtlName The name of the Material to be added.
+*/
+Material* Material::addMaterial(char* mtlName)
+{
+  if (verbose >=2)
+    printf ("adding Material %s\n", mtlName);
+  Material* newMat = new Material(mtlName);
+  Material* tmpMat = this;
+  while (tmpMat->nextMat != NULL)
+    {
+      tmpMat = tmpMat->nextMat;
+    }
+      tmpMat->nextMat = newMat;
+      return newMat;
+  
+}
+
+/**
+   \brief initializes a new Material with its default Values
+*/
+void Material::init(void)
+{
+  if (verbose >= 3)
+    printf ("initializing new Material\n");
+  nextMat = NULL;
+
+  setIllum(1);
+  setDiffuse(0,0,0);
+  setAmbient(0,0,0);
+  setSpecular(0,0,0);
+  setShininess(2.0);
+  setTransparency(0.0);
+  
+}
+
+/**
+   \brief Set the Name of the Material. (Important for searching)
+   \param mtlName the Name of the Material to be set.
+*/ 
+void Material::setName (char* mtlName)
+{
+  if (verbose >= 3)
+    printf("setting Material Name to %s", mtlName);
+  strcpy(name, mtlName);
+  //  printf ("adding new Material: %s, %p\n", this->getName(), this);
+
+}
+/**
+   \returns The Name of The Material
+*/
+char* Material::getName (void)
+{
+  return name;
+}
+
+/**
+   \brief Sets the Material Illumination Model. 
+   \brief illu illumination Model in int form
+*/
+void Material::setIllum (int illum)
+{
+  if (verbose >= 3)
+    printf("setting illumModel of Material %s to %i", name, illum);
+  illumModel = illum;
+  //  printf ("setting illumModel to: %i\n", illumModel);
+}
+/**
+   \brief Sets the Material Illumination Model. 
+   \brief illu illumination Model in char* form
+*/void Material::setIllum (char* illum)
+{
+  setIllum (atoi(illum));
+}
+
+/**
+   \brief Sets the Material Diffuse Color.
+   \param r Red Color Channel.
+   \param g Green Color Channel.
+   \param b Blue Color Channel.
+*/
+void Material::setDiffuse (float r, float g, float b)
+{
+  if (verbose >= 3)
+    printf ("setting Diffuse Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b);
+  diffuse[0] = r;
+  diffuse[1] = g;
+  diffuse[2] = b;  
+  diffuse[3] = 1.0;
+
+}
+/**
+   \brief Sets the Material Diffuse Color.
+   \param rgb The red, green, blue channel in char format (with spaces between them)
+*/
+void Material::setDiffuse (char* rgb)
+{
+  char r[20],g[20],b[20];
+  sscanf (rgb, "%s %s %s", r, g, b);
+  setDiffuse (atof(r), atof(g), atof(b));
+}
+
+/**
+   \brief Sets the Material Ambient Color. 
+   \param r Red Color Channel.
+   \param g Green Color Channel.
+   \param b Blue Color Channel.
+*/
+void Material::setAmbient (float r, float g, float b)
+{
+  if (verbose >=3)
+    printf ("setting Ambient Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b);
+  ambient[0] = r;
+  ambient[1] = g;
+  ambient[2] = b;
+  ambient[3] = 1.0;
+}
+/**
+   \brief Sets the Material Ambient Color.
+   \param rgb The red, green, blue channel in char format (with spaces between them)
+*/
+void Material::setAmbient (char* rgb)
+{
+  char r[20],g[20],b[20];
+  sscanf (rgb, "%s %s %s", r, g, b);
+  setAmbient (atof(r), atof(g), atof(b));
+}
+
+/**
+   \brief Sets the Material Specular Color. 
+   \param r Red Color Channel.
+   \param g Green Color Channel.
+   \param b Blue Color Channel.
+*/
+void Material::setSpecular (float r, float g, float b)
+{
+  if (verbose >= 3)
+    printf ("setting Specular Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b);
+  specular[0] = r;
+  specular[1] = g;
+  specular[2] = b;
+  specular[3] = 1.0;
+ }
+/**
+   \brief Sets the Material Specular Color.
+   \param rgb The red, green, blue channel in char format (with spaces between them)
+*/
+void Material::setSpecular (char* rgb)
+{
+  char r[20],g[20],b[20];
+  sscanf (rgb, "%s %s %s", r, g, b);
+  setSpecular (atof(r), atof(g), atof(b));
+}
+
+/**
+   \brief Sets the Material Shininess.
+   \param shini stes the Shininess from float.
+*/
+void Material::setShininess (float shini)
+{
+  shininess = shini;
+}
+/**
+   \brief Sets the Material Shininess.
+   \param shini stes the Shininess from char*.
+*/
+void Material::setShininess (char* shini)
+{
+  setShininess (atof(shini));
+}
+
+/**
+   \brief Sets the Material Transparency.
+   \param trans stes the Transparency from int.
+*/
+void Material::setTransparency (float trans)
+{
+  if (verbose >= 3)
+    printf ("setting Transparency of Material %s to %f\n", name, trans);
+  transparency = trans;
+}
+/**
+   \brief Sets the Material Transparency.
+   \param trans stes the Transparency from char*.
+*/
+void Material::setTransparency (char* trans)
+{
+  char tr[20];
+  sscanf (trans, "%s", tr);
+  setTransparency (atof(tr));
+}
+
+/**
+   \brief Search for a Material called mtlName
+   \param mtlName the Name of the Material to search for
+   \returns Material named mtlName if it is found. NULL otherwise.
+*/
+Material* Material::search (char* mtlName)
+{
+  if (verbose >=3)
+    printf ("Searching for material %s", mtlName);
+  Material* searcher = this;
+  while (searcher != NULL)
+    {
+      if (verbose >= 3)
+	printf (".");
+      if (!strcmp (searcher->getName(), mtlName))
+	{
+	  if (verbose >= 3)
+	    printf ("found.\n");
+	  return searcher;
+	}
+      searcher = searcher->nextMat;
+    }
+  return NULL;
+}
+
+/**
+   \brief sets the material with which the following Faces will be painted
+*/
+bool Material::select (void)
+{
+  // setting diffuse color
+  //  glColor3f (diffuse[0], diffuse[1], diffuse[2]);
+  glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
+
+  // setting ambient color
+  glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
+
+  // setting up Sprecular
+  glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
+
+  // setting up Shininess
+  glMaterialf(GL_FRONT, GL_SHININESS, shininess);
+  
+  // setting illumination Model 
+  if (illumModel == 1)
+    glShadeModel(GL_FLAT);
+  else if (illumModel >= 2)
+    glShadeModel(GL_SMOOTH);
+}
Index: orxonox/branches/sound/src/material.h
===================================================================
--- orxonox/branches/sound/src/material.h	(revision 2964)
+++ orxonox/branches/sound/src/material.h	(revision 2964)
@@ -0,0 +1,59 @@
+/*!
+  \file material.h
+  \brief Contains the Material Class that handles Material for 3D-Objects.
+*/
+
+#ifndef _MATERIAL_H
+#define _MATERIAL_H
+
+extern int verbose; //!< will be obsolete soon.
+
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <stdlib.h>
+#include <fstream>
+
+//! Class to handle Materials.
+class Material
+{
+ public:
+  Material ();
+  Material (char* mtlName);
+  Material* addMaterial(char* mtlName);
+
+  void init(void);
+  ~Material ();
+
+
+  void setName (char* mtlName);
+  char* getName (void);
+  void setIllum (int illum);
+  void setIllum (char* illum);
+  void setDiffuse (float r, float g, float b);
+  void setDiffuse (char* rgb);
+  void setAmbient (float r, float g, float b);
+  void setAmbient (char* rgb);
+  void setSpecular (float r, float g, float b);
+  void setSpecular (char* rgb);
+  void setShininess (float shini);
+  void setShininess (char* shini);
+  void setTransparency (float trans);
+  void setTransparency (char* trans);
+
+  Material* search (char* mtlName);
+
+  bool select (void);
+
+  Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
+
+ private:
+  char name [50];
+  int illumModel;
+  float diffuse [4];
+  float ambient [4];
+  float specular [4];
+  float shininess;
+  float transparency;
+
+};
+#endif
Index: orxonox/branches/sound/src/object.cc
===================================================================
--- orxonox/branches/sound/src/object.cc	(revision 2964)
+++ orxonox/branches/sound/src/object.cc	(revision 2964)
@@ -0,0 +1,717 @@
+/* 
+   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: ...
+*/
+
+int verbose = 0;
+
+#include "object.h"
+
+/**
+   \brief Creates a 3D-Object, but does not load any 3D-models
+   pretty useless
+*/
+Object::Object ()
+{
+
+  initialize();
+
+  BoxObject();
+
+  finalize();
+}
+
+/**
+   \brief Crates a 3D-Object and loads in a File
+   \param fileName file to parse and load (must be a .obj file)
+*/
+Object::Object(char* fileName)
+{
+  initialize();
+
+  importFile (fileName);
+
+  finalize();
+}
+
+/**
+   \brief Crates a 3D-Object, loads in a File and scales it.
+   \param fileName file to parse and load (must be a .obj file)
+   \param scaling The factor that the object will be scaled with.
+*/
+
+Object::Object(char* fileName, float scaling)
+{
+  initialize();
+  scaleFactor = scaling;
+
+  importFile (fileName);
+
+  finalize();
+}
+
+/**
+   \brief deletes an Object
+*/
+Object::~Object()
+{
+  if (verbose >= 2)
+    printf ("Deleting display List.\n");
+  Group* walker = firstGroup;
+  while (walker != NULL)
+    {
+      glDeleteLists (walker->listNumber, 1);
+      Group* lastWalker = walker;
+      walker = walker->nextGroup;
+      delete lastWalker;
+    } 
+}
+
+/** 
+    \brief initializes the Object
+    This Function initializes all the needed arrays, Lists and clientStates
+*/
+bool Object::initialize (void)
+{
+  if (verbose >=3)
+    printf("new 3D-Object is being created\n"); 
+
+  // setting the start group;
+  firstGroup = new Group;
+  currentGroup = firstGroup;
+  groupCount = 0;
+  
+  initGroup (currentGroup);
+  mtlFileName = "";
+  scaleFactor = 1;
+  material = new Material();
+
+  glEnableClientState (GL_VERTEX_ARRAY);
+  //  glEnableClientState (GL_NORMAL_ARRAY);
+  //  glEnableClientState (GL_TEXTURE_COORD_ARRAY);
+
+
+  return true;
+}
+
+/**
+   \brief Imports a obj file and handles the the relative location
+   \param fileName The file to import
+*/
+bool Object::importFile (char* fileName)
+{
+  if (verbose >=3)
+    printf("preparing to read in file: %s\n", fileName);   
+  objFileName = fileName;
+  this->readFromObjFile (objFileName);
+  return true;
+}
+
+/**
+  \brief finalizes an Object.
+   This funcion is needed, to close the glList and all the other lists.
+*/
+bool Object::finalize(void)
+{
+  //  if (verbose >=3)
+    printf("finalizing the 3D-Object\n"); 
+  finalizeGroup (currentGroup);
+  if (material != NULL)
+    delete material;
+  return true;
+}
+
+/**
+   \brief Draws the Objects of all Groups.
+   It does this by just calling the Lists that must have been created earlier.
+*/
+void Object::draw (void)
+{
+  if (verbose >=2)
+    printf("drawing the 3D-Objects\n"); 
+  Group* walker = firstGroup;
+  while (walker != NULL)
+    {
+      if (verbose >= 3)
+	printf ("Drawing object %s\n", walker->name);
+      glCallList (walker->listNumber);
+      walker = walker->nextGroup;
+    }
+}
+
+/**
+   \brief Draws the Object number groupNumber
+   It does this by just calling the List that must have been created earlier.
+   \param groupNumber The number of the group that will be displayed.
+*/
+void Object::draw (int groupNumber)
+{
+  if (groupNumber >= groupCount)
+    {
+      if (verbose>=2)
+	printf ("You requested object number %i, but this File only contains of %i Objects.\n", groupNumber-1, groupCount);
+      return;
+    }
+  if (verbose >=2)
+    printf("drawing the requested 3D-Objects if found.\n"); 
+  Group* walker = firstGroup;
+  int counter = 0;
+  while (walker != NULL)
+    {
+      if (counter == groupNumber)
+	{
+	  if (verbose >= 2)
+	    printf ("Drawing object number %s named %s\n", counter, walker->name);
+	  glCallList (walker->listNumber);
+	  return;
+	}
+      ++counter;
+      walker = walker->nextGroup;
+    }
+  if (verbose >= 2)
+    printf("Object number %i in %s not Found.\n", groupNumber, objFileName);
+  return;
+
+}
+
+/**
+   \brief Draws the Object with a specific groupname
+   It does this by just calling the List that must have been created earlier.
+   \param groupName The name of the group that will be displayed.
+*/
+void Object::draw (char* groupName)
+{
+  if (verbose >=2)
+    printf("drawing the requested 3D-Objects if found.\n"); 
+  Group* walker = firstGroup;
+  while (walker != NULL)
+    {
+      if (!strcmp(walker->name, groupName))
+	{
+	  if (verbose >= 2)
+	    printf ("Drawing object %s\n", walker->name);
+	  glCallList (walker->listNumber);
+	  return;
+	}
+      walker = walker->nextGroup;
+    }
+  if (verbose >= 2)
+    printf("Object Named %s in %s not Found.\n", groupName, objFileName);
+  return;
+}
+
+/**
+   \returns Count of the Objects in this File
+*/
+int Object::getGroupCount (void)
+{
+  return groupCount;
+}
+
+/**
+   \brief initializes a new Group object
+*/
+bool Object::initGroup(Group* group)
+{
+  if (verbose >= 2)
+    printf("Adding new Group\n");
+  group->name = "";
+  group->faceMode = -1;
+  group->faceCount =0;  
+  if ((group->listNumber = glGenLists(1)) == 0 )
+    {
+      printf ("list could not be created for this Object\n");
+      return false;
+    }
+  
+  if (groupCount == 0)
+    {
+      group->firstVertex = 0;
+      group->firstNormal = 0;
+      group->firstNormal = 0;
+    }
+  else
+    {
+      group->firstVertex = currentGroup->firstVertex + currentGroup->vertices->getCount()/3;
+      group->firstNormal = currentGroup->firstNormal + currentGroup->normals->getCount()/3;
+      group->firstVertexTexture = currentGroup->firstVertexTexture + currentGroup->vTexture->getCount()/2;
+    }
+  if (verbose >=2)
+    printf ("Creating new Arrays, with starting points v:%i, vt:%i, vn:%i .\n", group->firstVertex, group->firstVertexTexture, group->firstNormal);
+  group->vertices = new Array();
+  group->normals = new Array();
+  group->vTexture = new Array();
+
+  glNewList (group->listNumber, GL_COMPILE);
+}
+
+/**
+   \brief finalizes a Group.
+   \param group the group to finalize.
+*/
+bool Object::finalizeGroup(Group* group)
+{
+  if (verbose >=2)
+    printf ("Finalize group %s.\n", group->name);
+  glEnd();
+  glEndList();
+}
+/**
+   \brief deletes the Arrays of the Group to save space.
+   \param group the group to delete the arrays from.
+*/
+bool Object::cleanupGroup(Group* group)
+{
+  if (verbose >=2)
+    printf ("cleaning up group %s.\n", group->name);
+  
+  delete group->vertices;
+  delete group->normals;
+  delete group->vTexture;
+}
+
+/**
+   \brief Reads in the .obj File and sets all the Values.
+   This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks
+   \param fileName the File that will be parsed (.obj-file)
+*/
+bool Object::readFromObjFile (char* fileName)
+{
+  OBJ_FILE = new ifstream(fileName);
+  if (!OBJ_FILE->is_open())
+    {
+      if (verbose >=1)
+	printf ("unable to open .OBJ file: %s\n Loading Box Object instead.\n", fileName);
+      BoxObject();
+      return false;
+    }
+  objFileName = fileName;
+  char Buffer[10000];
+  while(!OBJ_FILE->eof())
+    {
+      OBJ_FILE->getline(Buffer, 10000);
+      if (verbose >=4)
+	printf ("Read input line: %s\n",Buffer);
+      
+
+      // case vertice
+      if (!strncmp(Buffer, "v ", 2))
+	{
+	  readVertex(Buffer+2);
+	}
+
+      // case face
+      else if (!strncmp(Buffer, "f ", 2))
+	{
+	  readFace (Buffer+2);
+	}
+      
+      else if (!strncmp(Buffer, "mtllib", 6))
+	{
+	  readMtlLib (Buffer+7);
+	}
+
+      else if (!strncmp(Buffer, "usemtl", 6))
+	{
+	  readUseMtl (Buffer+7);
+	}
+
+      // case VertexNormal
+      else if (!strncmp(Buffer, "vn ", 2))
+      {
+	readVertexNormal(Buffer+3);
+      }
+
+      // case VertexTextureCoordinate
+      else if (!strncmp(Buffer, "vt ", 2))
+      {
+	readVertexTexture(Buffer+3);
+      }
+      // case group
+      else if (!strncmp(Buffer, "g", 1))
+	{
+	  readGroup (Buffer+2);
+	}
+    }
+  OBJ_FILE->close();
+  return true;
+
+}
+
+/**
+   \brief parses a vertex-String
+   If a vertex line is found this function will inject it into the vertex-Array
+   \param vertexString The String that will be parsed.
+*/
+bool Object::readVertex (char* vertexString)
+{
+  readingVertices = true;
+  char subbuffer1[20];
+  char subbuffer2[20];
+  char subbuffer3[20];
+  sscanf (vertexString, "%s %s %s", subbuffer1, subbuffer2, subbuffer3);
+  if (verbose >= 3)
+    printf ("reading in a vertex: %s %s %s\n", subbuffer1, subbuffer2, subbuffer3);
+  currentGroup->vertices->addEntry(atof(subbuffer1)*scaleFactor, atof(subbuffer2)*scaleFactor, atof(subbuffer3)*scaleFactor);
+  return true;
+}
+
+/**
+   \brief parses a face-string
+   If a face line is found this function will add it to the glList.
+   The function makes a difference between QUADS and TRIANGLES, and will if changed re-open, set and re-close the gl-processe.
+   \param faceString The String that will be parsed.
+*/
+bool Object::readFace (char* faceString)
+{
+  // finalize the Arrays;
+  if (readingVertices == true)
+    {
+      currentGroup->vertices->finalizeArray();
+      //      glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray());
+      currentGroup->normals->finalizeArray();
+      //      glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray());
+      currentGroup->vTexture->finalizeArray();
+    }
+
+  readingVertices = false;
+  currentGroup->faceCount++;
+
+  int elemCount = 0;
+  
+  FaceElement* firstElem = new FaceElement;
+  FaceElement* tmpElem = firstElem;
+
+  
+  while(strcmp (faceString, "\0"))
+    {
+      if (elemCount>0)
+	  tmpElem = tmpElem->next = new FaceElement;
+      tmpElem->next = NULL;
+
+
+      sscanf (faceString, "%s", tmpElem->value);
+      faceString += strlen(tmpElem->value);
+      if (strcmp (faceString, "\0"))
+	faceString++;
+      elemCount++;
+
+
+    }
+  
+  
+  if (elemCount == 3)
+    {
+      if (currentGroup->faceMode != 3)
+	{
+	  if (currentGroup->faceMode != -1)
+	    glEnd();
+	  glBegin(GL_TRIANGLES);
+	}
+      
+      currentGroup->faceMode = 3;
+      if (verbose >=3)
+	printf ("found triag.\n");
+    }
+  
+  else if (elemCount == 4)
+    {
+      if (currentGroup->faceMode != 4)
+	{
+	  if (currentGroup->faceMode != -1)
+	    glEnd();
+	  glBegin(GL_QUADS);
+	}
+      currentGroup->faceMode = 4;
+      if (verbose >=3 )
+	printf ("found quad.\n");
+    }
+  
+  else if (elemCount > 4)
+    {
+      if (currentGroup->faceMode != -1)
+	glEnd();
+      glBegin(GL_POLYGON);
+      if (verbose >=3)
+	printf ("Polygon with %i faces found.", elemCount);
+      currentGroup->faceMode = elemCount;
+    }
+
+  tmpElem = firstElem;
+  while (tmpElem != NULL)
+    {
+      //      printf ("%s\n", tmpElem->value);
+      addGLElement(tmpElem->value);
+      tmpElem = tmpElem->next;
+    }
+
+}
+
+/**
+   \brief Adds a Face-element (one vertex of a face) with all its information. 
+   It does this by searching:
+   1. The Vertex itself
+   2. The VertexNormale
+   3. The VertexTextureCoordinate
+   merging this information, the face will be drawn.
+
+*/
+bool Object::addGLElement (char* elementString)
+{
+  if (verbose >=3)
+    printf ("importing grafical Element to openGL\n");
+  char* vertex = elementString;
+
+  char* texture;
+  if ((texture = strstr (vertex, "/")) != NULL)
+    {
+      texture[0] = '\0';
+      texture ++;
+      if (verbose>=3)
+	printf ("includeing texture #%i, and mapping it to group texture #%i, textureArray has %i entries.\n", atoi(texture), (atoi(texture)-1 - currentGroup->firstVertexTexture)*3, currentGroup->vTexture->getCount());
+      glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2);
+
+      char* normal;
+      if ((normal = strstr (texture, "/")) !=NULL)
+	{
+	  normal[0] = '\0';
+	  normal ++;
+	  //glArrayElement(atoi(vertex)-1);
+	  glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3);
+	}
+    }
+  if (verbose>=3)
+    printf ("includeing vertex #%i, and mapping it to group vertex #%i, vertexArray has %i entries.\n", atoi(vertex), (atoi(vertex)-1 - currentGroup->firstVertex)*3, currentGroup->vertices->getCount());
+  glVertex3fv(currentGroup->vertices->getArray() +(atoi(vertex)-1 - currentGroup->firstVertex)*3);
+
+}
+
+/**
+   \brief parses a vertexNormal-String
+   If a vertexNormal line is found this function will inject it into the vertexNormal-Array
+   \param normalString The String that will be parsed.
+*/
+bool Object::readVertexNormal (char* normalString)
+{
+  readingVertices = true;
+  char subbuffer1[20];
+  char subbuffer2[20];
+  char subbuffer3[20];
+  sscanf (normalString, "%s %s %s", subbuffer1, subbuffer2, subbuffer3);
+  if (verbose >=3 )
+    printf("found vertex-Normal %s, %s, %s\n", subbuffer1,subbuffer2,subbuffer3);
+  currentGroup->normals->addEntry(atof(subbuffer1), atof(subbuffer2), atof(subbuffer3));
+  return true;
+}
+
+/**
+   \brief parses a vertexTextureCoordinate-String
+   If a vertexTextureCoordinate line is found this function will inject it into the vertexTexture-Array
+   \param vTextureString The String that will be parsed.
+*/
+bool Object::readVertexTexture (char* vTextureString)
+{
+  readingVertices = true;
+  char subbuffer1[20];
+  char subbuffer2[20];
+  sscanf (vTextureString, "%s %s", subbuffer1, subbuffer2);
+  if (verbose >=3 )
+    printf("found vertex-Texture %s, %s\n", subbuffer1,subbuffer2);
+  currentGroup->vTexture->addEntry(atof(subbuffer1));
+  currentGroup->vTexture->addEntry(atof(subbuffer2));
+  return true;
+}
+
+/**
+   \brief parses a group String
+   This function initializes a new Group. 
+   With it you should be able to import .obj-files with more than one Objects inside. 
+   \param groupString the new Group to create
+*/
+bool Object::readGroup (char* groupString)
+{
+  // setting the group name if not default.
+  if (strcmp(currentGroup->name, "default"))
+    {
+      currentGroup->name = (char*) malloc ( strlen(groupString) * sizeof (char));
+      strcpy(currentGroup->name, groupString);
+    }
+  if (groupCount != 0 && currentGroup->faceCount>0)
+    {
+      Group* newGroup = new Group;
+      finalizeGroup(currentGroup);
+      currentGroup->nextGroup = newGroup;
+      initGroup(newGroup);
+      cleanupGroup(currentGroup); // deletes the arrays of the group; must be after initGroup.
+      currentGroup = newGroup; // must be after init see initGroup for more info
+    }
+
+  ++groupCount;
+
+}
+
+/** 
+    \brief Function to read in a mtl File.
+    this Function parses all Lines of an mtl File
+    \param mtlFile The .mtl file to read
+*/
+bool Object::readMtlLib (char* mtlFile)
+{
+  MTL_FILE = new ifstream (mtlFile);
+  if (!MTL_FILE->is_open())
+    {
+      if (verbose >= 1)
+	printf ("unable to open file: %s\n", mtlFile);
+      return false;
+    }
+  mtlFileName = mtlFile;
+  if (verbose >=2)
+    printf ("Opening mtlFile: %s\n", mtlFileName);
+  char Buffer[500];
+  Material* tmpMat = material;
+  while(!MTL_FILE->eof())
+    {
+      MTL_FILE->getline(Buffer, 500);
+      if (verbose >= 4)
+	printf("found line in mtlFile: %s\n", Buffer);
+      
+
+      // create new Material
+      if (!strncmp(Buffer, "newmtl ", 2))
+	{
+	  tmpMat = tmpMat->addMaterial(Buffer+7);
+	  //	  printf ("%s, %p\n", tmpMat->getName(), tmpMat);
+	}
+      // setting a illumMode
+      else if (!strncmp(Buffer, "illum", 5))
+	{
+	  tmpMat->setIllum(Buffer+6);
+
+	}
+      // setting Diffuse Color
+      else if (!strncmp(Buffer, "Kd", 2))
+	{
+	  tmpMat->setDiffuse(Buffer+3);
+	}
+      // setting Ambient Color
+      else if (!strncmp(Buffer, "Ka", 2))
+	{
+	  tmpMat->setAmbient(Buffer+3);
+	}
+      // setting Specular Color
+      else if (!strncmp(Buffer, "Ks", 2))
+	{
+	  tmpMat->setSpecular(Buffer+3);
+	}
+      // setting The Specular Shininess
+      else if (!strncmp(Buffer, "Ns", 2))
+	{
+	  tmpMat->setShininess(Buffer+3);
+	}
+      // setting up transparency
+      else if (!strncmp(Buffer, "d", 1))
+	{
+	  tmpMat->setTransparency(Buffer+2);
+	}
+      else if (!strncpy(Buffer, "Tf", 2))
+	{
+	  tmpMat->setTransparency(Buffer+3);
+	}
+
+    }
+  return true;
+}
+
+/**
+   \brief Function that selects a material, if changed in the obj file.
+   \param matString the Material that will be set.
+*/
+
+bool Object::readUseMtl (char* matString)
+{
+  if (!strcmp (mtlFileName, ""))
+    {
+      if (verbose >= 1)
+	printf ("Not using new defined material, because no mtlFile found yet\n");
+      return false;
+    }
+      
+  if (currentGroup->faceMode != -1)
+    glEnd();
+  currentGroup->faceMode = 0;
+  if (verbose >= 2)
+    printf ("using material %s for coming Faces.\n", matString);
+  material->search(matString)->select();
+}
+
+/**
+   \brief Includes a default object
+   This will inject a Cube, because this is the most basic object.
+*/
+void Object::BoxObject(void)
+{
+  readVertex ("-0.500000 -0.500000 0.500000");
+  readVertex ("0.500000 -0.500000 0.500000");
+  readVertex ("-0.500000 0.500000 0.500000");
+  readVertex ("0.500000 0.500000 0.500000");
+  readVertex ("-0.500000 0.500000 -0.500000");
+  readVertex ("0.500000 0.500000 -0.500000");
+  readVertex ("-0.500000 -0.500000 -0.500000");
+  readVertex ("0.500000 -0.500000 -0.500000");
+  readVertexTexture ("0.000000 0.000000");
+  readVertexTexture ("1.000000 0.000000");
+  readVertexTexture ("0.000000 1.000000");
+  readVertexTexture ("1.000000 1.000000");
+  readVertexTexture ("0.000000 2.000000");
+  readVertexTexture ("1.000000 2.000000");
+  readVertexTexture ("0.000000 3.000000");
+  readVertexTexture ("1.000000 3.000000");
+  readVertexTexture ("0.000000 4.000000");
+  readVertexTexture ("1.000000 4.000000");
+  readVertexTexture ("2.000000 0.000000");
+  readVertexTexture ("2.000000 1.000000");
+  readVertexTexture ("-1.000000 0.000000");
+  readVertexTexture ("-1.000000 1.000000");
+  
+  readVertexNormal ("0.000000 0.000000 1.000000");
+  readVertexNormal ("0.000000 0.000000 1.000000");
+  readVertexNormal ("0.000000 0.000000 1.000000");
+  readVertexNormal ("0.000000 0.000000 1.000000");
+  readVertexNormal ("0.000000 1.000000 0.000000");
+  readVertexNormal ("0.000000 1.000000 0.000000");
+  readVertexNormal ("0.000000 1.000000 0.000000");
+  readVertexNormal ("0.000000 1.000000 0.000000");
+  readVertexNormal ("0.000000 0.000000 -1.000000");
+  readVertexNormal ("0.000000 0.000000 -1.000000");
+  readVertexNormal ("0.000000 0.000000 -1.000000");
+  readVertexNormal ("0.000000 0.000000 -1.000000");
+  readVertexNormal ("0.000000 -1.000000 0.000000");
+  readVertexNormal ("0.000000 -1.000000 0.000000");
+  readVertexNormal ("0.000000 -1.000000 0.000000");
+  readVertexNormal ("0.000000 -1.000000 0.000000");
+  readVertexNormal ("1.000000 0.000000 0.000000");
+  readVertexNormal ("1.000000 0.000000 0.000000");
+  readVertexNormal ("1.000000 0.000000 0.000000");
+  readVertexNormal ("1.000000 0.000000 0.000000");
+  readVertexNormal ("-1.000000 0.000000 0.000000");
+  readVertexNormal ("-1.000000 0.000000 0.000000");
+  readVertexNormal ("-1.000000 0.000000 0.000000");
+  readVertexNormal ("-1.000000 0.000000 0.000000");
+
+  readFace ("1/1/1 2/2/2 4/4/3 3/3/4");
+  readFace ("3/3/5 4/4/6 6/6/7 5/5/8");
+  readFace ("5/5/9 6/6/10 8/8/11 7/7/12");
+  readFace ("7/7/13 8/8/14 2/10/15 1/9/16");
+  readFace ("2/2/17 8/11/18 6/12/19 4/4/20");
+  readFace ("7/13/21 1/1/22 3/3/23 5/14/24");
+}
Index: orxonox/branches/sound/src/object.h
===================================================================
--- orxonox/branches/sound/src/object.h	(revision 2964)
+++ orxonox/branches/sound/src/object.h	(revision 2964)
@@ -0,0 +1,103 @@
+/*!
+  \file object.h
+  \brief Contains the Object Class that handles 3D-Objects
+*/
+
+#ifndef _OBJECT_H
+#define _OBJECT_H
+
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+#include "array.h"
+#include "material.h"
+#include <fstream>
+
+using namespace std;
+
+extern int verbose; //!< fill be removed and added again as a verbose-class
+
+
+struct FaceElement
+{
+  char value[20];
+  FaceElement* next;
+};
+
+//! Class that handles 3D-Objects. it can also read them in and display them.
+class Object
+{
+ public:
+  Object ();
+  Object (char* fileName);
+  Object(char* fileName, float scaling);
+  ~Object ();
+  
+  bool importFile (char* fileName);
+  bool initialize (void);
+  bool finalize(void);
+  void draw (void);
+  void draw (int groupNumber);
+  void draw (char* groupName);
+  int getGroupCount();
+
+ private:
+  //! Group to handle multiple Objects per obj-file
+  struct Group
+  {
+    char* name;
+
+    GLuint listNumber;
+    Array* vertices;
+    int verticesCount;
+    Array* colors;
+    Array* normals;
+    Array* vTexture;
+    int faceMode;
+    int faceCount;
+
+    int firstVertex;
+    int firstNormal;
+    int firstVertexTexture;
+
+    Group* nextGroup;
+  };
+  
+  Group* firstGroup; //!< the first of all groups.
+  Group* currentGroup; //!< the currentGroup. this is the one we will work with.
+  int groupCount;
+
+  bool readingVertices;
+
+  char* objFileName;
+  char* mtlFileName;
+
+  Material* material;
+  float scaleFactor;
+
+  ifstream* OBJ_FILE;
+  ifstream* MTL_FILE;
+
+  bool initGroup(Group* group);
+  bool finalizeGroup (Group* group);
+  bool cleanupGroup(Group* group);
+
+
+  ///// readin ///
+  bool readFromObjFile (char* fileName);
+  
+  bool readVertex (char* vertexString);
+  bool readFace (char* faceString);
+  bool readVT (char* vtString);
+  bool readVertexNormal (char* normalString);
+  bool readVertexTexture (char* vTextureString);
+  bool readGroup (char* groupString);
+  bool readMtlLib (char* matFile);
+  bool readUseMtl (char* mtlString);
+
+  bool addGLElement (char* elementString);
+
+  void BoxObject (void);
+};
+
+#endif
