Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3238 in orxonox.OLD for orxonox/branches/nico


Ignore:
Timestamp:
Dec 20, 2004, 2:42:54 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches: updated branches: buerli, nico, sound. And moved bezierTrack to old.bezierTrack. Conflicts resolved in a usefull order.
Conflics mostly resolved in favor of trunk
merge.

Location:
orxonox/branches/nico
Files:
9 deleted
58 edited
57 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/nico/CODING-STANDARDS

    r1856 r3238  
     1CODING-STANDARTS FOR ORXONOX
     2-==============--==---+++++-
     3In this file it is described how a orxonox-developer should structure his code.
     4Every developer has to read it and follow the rules, and orxonox will grow.
    15
    2 
     6Contents:
     7---------
     81.Coding Conventions
     92.How to format your Code
     103.Example
    311
    4121.Coding Conventions
    5 2.How to format your Code
    6 
    7 1.Coding Conventions
    8 --------------------
     13====================
    914==> If you are beginning a new code-file: copy the proto_class.{cc,h}
    1015==> and work with these files.
    1116
    12 a) in every code file, there has to be a GNU copyright header
    13 b) under the (c) header write your name as main-programmer, if
    14    you are just bugfixing or extending write it under co-programmer
    15 c) Every function has a header with informations about it:
    16 /**
    17    \brief <a brief description>
    18    \param <parameters the function needs>
    19    \param <more parameters>
     171.1.What has to be there:
     18-------------------------
     19  a) in every code file, there must be a GNU copyright header.
    2020
    21    <more description>
    22 */
    23    This makes live easier, if we want to add a documentation.
     21  b) under the (c) header write your name as main-programmer, if
     22     you are just bugfixing or extending write it under co-programmer.
     23
     24  c) Every element of the must be documented with doxygen-tags.
     25
     261.2.Doxygen Tags:
     27-----------------
     28Doxygen tags in general are comments inside a file, that look just a bit different.
     29most of the time they extend the /* or // with a second star or a !
     30
     31  a) h-files:
     32   1) every h-file you want to be documented you have to tag. (tag looks like /*! \file somefile */ )
     33   2) every class has to be Documented. ( //! what it does)
     34   3) special variables can be documented. ( //!< wow this member is cool because )
     35
     36  b) cc-files:
     37   1) all the methods must be documented, and all their parameters and return value must be covered.
     38
     39  c) look out for this: Doxygen parses preprocessor arguments,
     40     so if some comments is excluded by a #ifdef, #endif
     41     doxygen will not parse it. And ther will be nothing in the docu.
    2442
    2543
    26442.How to format your Code
    27 -------------------------
     45=========================
    2846We use the GNU conding convention (which is also used in xemacs etc.):
    2947
     
    5169
    5270
     71
     72
     733.Example
     74=========
     753.1.Header
     76----------
     77A standard header has the same name as the Class it handles.
     78
     79someclass.h
     80-----------
     81/*!
     82  \file someclass.h
     83  \brief Some short description of the someclass
     84  \todo maybe there remains something to do in this entire file
     85
     86  Here comes a longer description
     87  this can also be longer than one line
     88*/
     89
     90#ifndef _SOMECLASS_H
     91#define _SOMECLASS_H
     92
     93#include <many_headers>
     94#include "stdincl.h"
     95
     96//! short description of the class
     97/**
     98  \todo what remains to be done here
     99
     100   longer description
     101*/
     102class SomeClass
     103{
     104  private:
     105   int usefull_variable;
     106   int cool_variable; //!< this variable is cool, because...
     107
     108  protected:
     109    char* someOtherMember;
     110
     111  public:
     112   SomeClass (void);
     113   ~SomeClass (void);
     114   
     115   int mightyFunction (char* name, int value);
     116//....
     117};
     118
     119#endif /* _SOMECLASS_H */
     120
     121
     122
     1233.2.CC-Files
     124------------
     125CC-files must be named the same as the .h-files they belong to.
     126
     127someclass.cc
     128------------
     129
     130/*
     131   orxonox - the future of 3D-vertical-scrollers
     132
     133   Copyright (C) 2004 orx
     134
     135   This program is free software; you can redistribute it and/or modify
     136   it under the terms of the GNU General Public License as published by
     137   the Free Software Foundation; either version 2, or (at your option)
     138   any later version.
     139
     140   ### File Specific:
     141   main-programmer: The Name of Myself
     142   co-programmer: ...
     143*/
     144
     145#include "someclass.h"
     146
     147
     148/**
     149   \brief <a brief description>
     150   \todo I think you get it.
     151
     152   <more description>
     153*/
     154SomeClass::SomeClass (void)
     155{
     156   //constructor-stuff
     157}
     158
     159/**
     160   \brief <a brief description>
     161   \todo if something is not destructed it will be here
     162
     163   <more description>
     164*/
     165~SomeClass::~SomeClass (void)
     166{
     167  //destroy all te allocated space of the Class
     168}
     169
     170/**
     171   \brief <a brief description>
     172   \param name <what is this parameter for>
     173   \param valuse <what for...>
     174   \returns <what it returns>
     175
     176   <more description>
     177*/
     178int SomeClass::mightyFuncion (char* name, int value)
     179{
     180  this->coolVariable = value;
     181  // and so on.....
     182}
     183
     184// ...
  • orxonox/branches/nico/Makefile.am

    r2819 r3238  
    1 SUBDIRS = src console gui importer
     1AUTOMAKE_OPTIONS = foreign no-installman no-installinfo
     2
     3SUBDIRS = src
     4
     5EXTRA_DIST = CODING-STANDARDS \
     6             IDEAS \
     7             TASKS \
     8             doc/CREDITS \
     9             doc/doxyconf/build \
     10             doc/doxyconf/confopts \
     11             doc/doxyconf/input \
     12             doc/doxyconf/preprocessor \
     13             doc/doxyconf/progress \
     14             doc/doxyconf/project
     15
     16## doxygen stuff
     17if DOXYGEN
     18DOXYGEN_INPUT = "src src/gui src/importer"
     19
     20## Exclude the application wizard templates, and some file templates
     21DOXYGEN_EXCLUDE =
     22
     23DOXYGEN_EXAMPLE_PATH =
     24
     25## Use Search engine (Versions 1.3.4 and above only!)
     26DOXYGEN_SEARCHENGINE = YES
     27
     28include doc/documentation.am
     29endif
  • orxonox/branches/nico/Makefile.in

    r2991 r3238  
    3737DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
    3838        $(srcdir)/Makefile.in $(srcdir)/config.h.in \
    39         $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
    40         config.guess config.sub depcomp install-sh missing \
    41         mkinstalldirs
     39        $(srcdir)/doc/documentation.am $(top_srcdir)/configure AUTHORS \
     40        COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \
     41        install-sh missing mkinstalldirs
    4242subdir = .
    4343ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    8989CXXFLAGS = @CXXFLAGS@
    9090CYGPATH_W = @CYGPATH_W@
     91DEBUG = @DEBUG@
    9192DEFS = @DEFS@
    9293DEPDIR = @DEPDIR@
     94DOXYGEN = @DOXYGEN@
     95DOXYGEN_FALSE = @DOXYGEN_FALSE@
     96DOXYGEN_TRUE = @DOXYGEN_TRUE@
    9397ECHO_C = @ECHO_C@
    9498ECHO_N = @ECHO_N@
     
    118122PACKAGE_VERSION = @PACKAGE_VERSION@
    119123PATH_SEPARATOR = @PATH_SEPARATOR@
    120 PKG_CONFIG = @PKG_CONFIG@
    121124SET_MAKE = @SET_MAKE@
    122125SHELL = @SHELL@
     
    165168target_os = @target_os@
    166169target_vendor = @target_vendor@
    167 SUBDIRS = src console gui importer
     170AUTOMAKE_OPTIONS = foreign no-installman no-installinfo
     171SUBDIRS = src
     172EXTRA_DIST = CODING-STANDARDS \
     173             IDEAS \
     174             TASKS \
     175             doc/CREDITS \
     176             doc/doxyconf/build \
     177             doc/doxyconf/confopts \
     178             doc/doxyconf/input \
     179             doc/doxyconf/preprocessor \
     180             doc/doxyconf/progress \
     181             doc/doxyconf/project
     182
     183@DOXYGEN_TRUE@DOXYGEN_INPUT = "src src/gui src/importer"
     184@DOXYGEN_TRUE@DOXYGEN_EXCLUDE =
     185@DOXYGEN_TRUE@DOXYGEN_EXAMPLE_PATH =
     186@DOXYGEN_TRUE@DOXYGEN_SEARCHENGINE = YES
     187@DOXYGEN_TRUE@DX_CONFIG_FILE = "$(top_srcdir)/orxodox"
     188@DOXYGEN_TRUE@DX_CONF_DIR = "$(top_srcdir)/doc/doxyconf"
    168189all: config.h
    169190        $(MAKE) $(AM_MAKEFLAGS) all-recursive
     
    172193am--refresh:
    173194        @:
    174 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(am__configure_deps)
     195$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/doc/documentation.am $(am__configure_deps)
    175196        @for dep in $?; do \
    176197          case '$(am__configure_deps)' in \
    177198            *$$dep*) \
    178               echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
    179               cd $(srcdir) && $(AUTOMAKE) --gnu  \
     199              echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
     200              cd $(srcdir) && $(AUTOMAKE) --foreign  \
    180201                && exit 0; \
    181202              exit 1;; \
    182203          esac; \
    183204        done; \
    184         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \
     205        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
    185206        cd $(top_srcdir) && \
    186           $(AUTOMAKE) --gnu  Makefile
     207          $(AUTOMAKE) --foreign  Makefile
    187208.PRECIOUS: Makefile
    188209Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     
    345366        $(am__remove_distdir)
    346367        mkdir $(distdir)
     368        $(mkdir_p) $(distdir)/doc $(distdir)/doc/doxyconf
    347369        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
    348370        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
     
    483505check-am: all-am
    484506check: check-recursive
    485 all-am: Makefile config.h
     507all-am: Makefile config.h all-local
    486508installdirs: installdirs-recursive
    487509installdirs-am:
     
    512534clean: clean-recursive
    513535
    514 clean-am: clean-generic mostlyclean-am
     536clean-am: clean-generic clean-local mostlyclean-am
    515537
    516538distclean: distclean-recursive
    517539        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
    518540        -rm -f Makefile
    519 distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
     541distclean-am: clean-am distclean-generic distclean-hdr distclean-local \
     542        distclean-tags
    520543
    521544dvi: dvi-recursive
     
    557580ps-am:
    558581
    559 uninstall-am: uninstall-info-am
     582uninstall-am:
    560583
    561584uninstall-info: uninstall-info-recursive
    562585
    563 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
    564         check-am clean clean-generic clean-recursive ctags \
    565         ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
    566         dist-tarZ dist-zip distcheck distclean distclean-generic \
    567         distclean-hdr distclean-recursive distclean-tags \
    568         distcleancheck distdir distuninstallcheck dvi dvi-am html \
    569         html-am info info-am install install-am install-data \
    570         install-data-am install-exec install-exec-am install-info \
    571         install-info-am install-man install-strip installcheck \
    572         installcheck-am installdirs installdirs-am maintainer-clean \
    573         maintainer-clean-generic maintainer-clean-recursive \
    574         mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
    575         pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
    576         uninstall-info-am
    577 
     586.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-local \
     587        am--refresh check check-am clean clean-generic clean-local \
     588        clean-recursive ctags ctags-recursive dist dist-all dist-bzip2 \
     589        dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
     590        distclean-generic distclean-hdr distclean-local \
     591        distclean-recursive distclean-tags distcleancheck distdir \
     592        distuninstallcheck dvi dvi-am html html-am info info-am \
     593        install install-am install-data install-data-am install-exec \
     594        install-exec-am install-info install-info-am install-man \
     595        install-strip installcheck installcheck-am installdirs \
     596        installdirs-am maintainer-clean maintainer-clean-generic \
     597        maintainer-clean-recursive mostlyclean mostlyclean-generic \
     598        mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
     599        uninstall uninstall-am uninstall-info-am
     600
     601
     602@DOXYGEN_TRUE@doc:
     603@DOXYGEN_TRUE@  if test ! -e $(DX_CONFIG_FILE); then \
     604@DOXYGEN_TRUE@   make doc-config; \
     605@DOXYGEN_TRUE@  fi
     606@DOXYGEN_TRUE@  @echo "Generating doxygen Documentation"; \
     607@DOXYGEN_TRUE@  $(DOXYGEN) $(DX_CONFIG_FILE)
     608
     609@DOXYGEN_TRUE@doc-config:
     610@DOXYGEN_TRUE@  @echo "Generationg doxygen configuration File." ; \
     611@DOXYGEN_TRUE@  if test -e  "$(top_srcdir)/orxodox"; then \
     612@DOXYGEN_TRUE@    echo "deleting existing Configuration File" ; \
     613@DOXYGEN_TRUE@    rm $(top_srcdir)/orxodox ; \
     614@DOXYGEN_TRUE@  fi ; \
     615@DOXYGEN_TRUE@  touch $(DX_CONFIG_FILE) ; \
     616@DOXYGEN_TRUE@  $(DX_CONF_DIR)/project                                          >> $(DX_CONFIG_FILE); \
     617@DOXYGEN_TRUE@  echo "PROJECT_NAME              = \"$(PACKAGE_NAME)\""          >> $(DX_CONFIG_FILE); \
     618@DOXYGEN_TRUE@  echo "PROJECT_NUMBER            = \"$(PACKAGE_VERSION)\""       >> $(DX_CONFIG_FILE); \
     619@DOXYGEN_TRUE@  echo "OUTPUT_DIRECTORY          = \"$(top_srcdir)/doc/\""       >> $(DX_CONFIG_FILE); \
     620@DOXYGEN_TRUE@  echo " " >> $(DX_CONFIG_FILE); \
     621@DOXYGEN_TRUE@\
     622@DOXYGEN_TRUE@  $(DX_CONF_DIR)/build                                            >> $(DX_CONFIG_FILE); \
     623@DOXYGEN_TRUE@\
     624@DOXYGEN_TRUE@  $(DX_CONF_DIR)/progress                                         >> $(DX_CONFIG_FILE); \
     625@DOXYGEN_TRUE@  if test $(DEBUG) -ge 2 ; then \
     626@DOXYGEN_TRUE@   echo "QUIET                    = \"NO\""                       >> $(DX_CONFIG_FILE); \
     627@DOXYGEN_TRUE@  else \
     628@DOXYGEN_TRUE@   echo "QUIET                    = \"YES\""                      >> $(DX_CONFIG_FILE); \
     629@DOXYGEN_TRUE@  fi ;\
     630@DOXYGEN_TRUE@\
     631@DOXYGEN_TRUE@  $(DX_CONF_DIR)/input                                            >> $(DX_CONFIG_FILE); \
     632@DOXYGEN_TRUE@  echo "INPUT                     = $(DOXYGEN_INPUT)"             >> $(DX_CONFIG_FILE); \
     633@DOXYGEN_TRUE@\
     634@DOXYGEN_TRUE@  $(DX_CONF_DIR)/preprocessor                                     >> $(DX_CONFIG_FILE); \
     635@DOXYGEN_TRUE@  echo "INCLUDE_PATH              = \"$(top_srcdir)\""            >> $(DX_CONFIG_FILE); \
     636@DOXYGEN_TRUE@  echo "PREDEFINED                = \"HAVE_CONFIG_H= \""          >> $(DX_CONFIG_FILE); \
     637@DOXYGEN_TRUE@  \
     638@DOXYGEN_TRUE@  $(DX_CONF_DIR)/confopts                                         >> $(DX_CONFIG_FILE)
     639
     640@DOXYGEN_TRUE@doc-delete:
     641@DOXYGEN_TRUE@  @echo "Deleting doxygen Documentation"
     642@DOXYGEN_TRUE@  rm -rf $(top_srcdir)/doc/html
     643@DOXYGEN_TRUE@  rm -rf $(top_srcdir)/doc/latex
     644
     645@DOXYGEN_TRUE@distclean-local: doc-delete
     646@DOXYGEN_TRUE@  rm -f $(top_srcdir)/orxodox
     647
     648@DOXYGEN_TRUE@clean-local:  doc-delete
     649
     650@DOXYGEN_TRUE@all-local: doc
     651
     652@DOXYGEN_TRUE@.PHONY: doc doc-config doc-delete
     653
     654# Local Variables:
     655# mode: makefile
     656# End:
    578657# Tell versions [3.59,3.63) of GNU make to not export all variables.
    579658# Otherwise a system limit (for SysV at least) may be exceeded.
  • orxonox/branches/nico/NEWS

    r2865 r3238  
     1Date: December 20, 2004
     2Topic: New Webpage under construction
     3Body: I am proud to announce, that nico is currently developing our new webpage. It has a verry cool new style, and is much more easy to extend, than the old one. <a href="http://www.orxonox.ethz.ch/new">visit it</a>.
     4
     5Date: December 14, 2004
     6Topic: Repository Moved
     7Body: Today we moved the repository. The new location of the repository is <A href="http://orxonox.ethz.ch/repos/reporx">http://orxonox.ethz.ch/repos/reporx</A>.
     8
    19Date:   November 16, 2004
    210Topic:  Importer
  • orxonox/branches/nico/aclocal.m4

    r2991 r3238  
    1111# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    1212# PARTICULAR PURPOSE.
    13 
    14 
    15 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
    16 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
    17 dnl also defines GSTUFF_PKG_ERRORS on error
    18 AC_DEFUN(PKG_CHECK_MODULES, [
    19   succeeded=no
    20 
    21   if test -z "$PKG_CONFIG"; then
    22     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
    23   fi
    24 
    25   if test "$PKG_CONFIG" = "no" ; then
    26      echo "*** The pkg-config script could not be found. Make sure it is"
    27      echo "*** in your path, or set the PKG_CONFIG environment variable"
    28      echo "*** to the full path to pkg-config."
    29      echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
    30   else
    31      PKG_CONFIG_MIN_VERSION=0.9.0
    32      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
    33         AC_MSG_CHECKING(for $2)
    34 
    35         if $PKG_CONFIG --exists "$2" ; then
    36             AC_MSG_RESULT(yes)
    37             succeeded=yes
    38 
    39             AC_MSG_CHECKING($1_CFLAGS)
    40             $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
    41             AC_MSG_RESULT($$1_CFLAGS)
    42 
    43             AC_MSG_CHECKING($1_LIBS)
    44             $1_LIBS=`$PKG_CONFIG --libs "$2"`
    45             AC_MSG_RESULT($$1_LIBS)
    46         else
    47             $1_CFLAGS=""
    48             $1_LIBS=""
    49             ## If we have a custom action on failure, don't print errors, but
    50             ## do set a variable so people can do so.
    51             $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
    52             ifelse([$4], ,echo $$1_PKG_ERRORS,)
    53         fi
    54 
    55         AC_SUBST($1_CFLAGS)
    56         AC_SUBST($1_LIBS)
    57      else
    58         echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
    59         echo "*** See http://www.freedesktop.org/software/pkgconfig"
    60      fi
    61   fi
    62 
    63   if test $succeeded = yes; then
    64      ifelse([$3], , :, [$3])
    65   else
    66      ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
    67   fi
    68 ])
    69 
    70 
    7113
    7214#                                                        -*- Autoconf -*-
  • orxonox/branches/nico/config.h.in

    r2995 r3238  
    11/* config.h.in.  Generated from configure.ac by autoheader.  */
     2
     3/* in which debug mode we are */
     4#undef DEBUG
    25
    36/* Define to 1 if you have the `bzero' function. */
     
    1013#undef HAVE_GL_GL_H
    1114
     15/* if we have GTK2 */
     16#undef HAVE_GTK2
     17
    1218/* Define to 1 if you have the <inttypes.h> header file. */
    1319#undef HAVE_INTTYPES_H
     20
     21/* Define to 1 if you have the <jpeglib.h> header file. */
     22#undef HAVE_JPEGLIB_H
    1423
    1524/* Define to 1 if you have the `m' library (-lm). */
     
    2938#undef HAVE_OPENGL_GL_H
    3039
     40/* Define to 1 if you have the <png.h> header file. */
     41#undef HAVE_PNG_H
     42
    3143/* Define to 1 if you have the <SDL/SDL.h> header file. */
    3244#undef HAVE_SDL_SDL_H
     45
     46/* Define to 1 if you have the <SDL/SDL_image.h> header file. */
     47#undef HAVE_SDL_SDL_IMAGE_H
    3348
    3449/* Define to 1 if you have the `sqrt' function. */
  • orxonox/branches/nico/configure

    r3001 r3238  
    11#! /bin/sh
    22# Guess values for system-dependent variables and create Makefiles.
    3 # Generated by GNU Autoconf 2.59 for orxonox 0.1-pre-alpha.
     3# Generated by GNU Autoconf 2.59 for orxonox 0.2.0_alpha-r1.
    44#
    55# Report bugs to <orxonox-dev@mail.datacore.ch>.
     
    270270PACKAGE_NAME='orxonox'
    271271PACKAGE_TARNAME='orxonox'
    272 PACKAGE_VERSION='0.1-pre-alpha'
    273 PACKAGE_STRING='orxonox 0.1-pre-alpha'
     272PACKAGE_VERSION='0.2.0_alpha-r1'
     273PACKAGE_STRING='orxonox 0.2.0_alpha-r1'
    274274PACKAGE_BUGREPORT='orxonox-dev@mail.datacore.ch'
    275275
     
    312312#endif"
    313313
    314 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP MSBITFIELDS PKG_CONFIG GTK2_CFLAGS GTK2_LIBS HAVE_GTK2_TRUE HAVE_GTK2_FALSE LIBOBJS LTLIBOBJS'
     314ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP DEBUG DOXYGEN DOXYGEN_TRUE DOXYGEN_FALSE MSBITFIELDS GTK2_LIBS GTK2_CFLAGS HAVE_GTK2_TRUE HAVE_GTK2_FALSE LIBOBJS LTLIBOBJS'
    315315ac_subst_files=''
    316316
     
    789789  # This message is too long to be a string in the A/UX 3.1 sh.
    790790  cat <<_ACEOF
    791 \`configure' configures orxonox 0.1-pre-alpha to adapt to many kinds of systems.
     791\`configure' configures orxonox 0.2.0_alpha-r1 to adapt to many kinds of systems.
    792792
    793793Usage: $0 [OPTION]... [VAR=VALUE]...
     
    856856if test -n "$ac_init_help"; then
    857857  case $ac_init_help in
    858      short | recursive ) echo "Configuration of orxonox 0.1-pre-alpha:";;
     858     short | recursive ) echo "Configuration of orxonox 0.2.0_alpha-r1:";;
    859859   esac
    860860  cat <<\_ACEOF
     
    865865  --disable-dependency-tracking  speeds up one-time build
    866866  --enable-dependency-tracking   do not reject slow dependency extractors
     867  --enable-debug          compiles in debug mode. Lots of debug info about the
     868                          game.
     869
     870Optional Packages:
     871  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
     872  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
     873  --without-gtk           Prevents GTK from being loaded
     874  --without-sdl-image     Prevents SDL_image from being loaded
    867875
    868876Some influential environment variables:
     
    976984if $ac_init_version; then
    977985  cat <<\_ACEOF
    978 orxonox configure 0.1-pre-alpha
     986orxonox configure 0.2.0_alpha-r1
    979987generated by GNU Autoconf 2.59
    980988
     
    990998running configure, to aid debugging if configure makes a mistake.
    991999
    992 It was created by orxonox $as_me 0.1-pre-alpha, which was
     1000It was created by orxonox $as_me 0.2.0_alpha-r1, which was
    9931001generated by GNU Autoconf 2.59.  Invocation command line was
    9941002
     
    17111719# Define the identity of the package.
    17121720 PACKAGE='orxonox'
    1713  VERSION='0.1-pre-alpha'
     1721 VERSION='0.2.0_alpha-r1'
    17141722
    17151723
     
    38303838
    38313839
     3840### CHECKING  OPTIONAT ARGUMENTS
     3841## DEBUG-statement
     3842DEBUG=no
     3843echo "$as_me:$LINENO: checking if DEBUG-mode should be enabled" >&5
     3844echo $ECHO_N "checking if DEBUG-mode should be enabled... $ECHO_C" >&6
     3845# Check whether --enable-debug or --disable-debug was given.
     3846if test "${enable_debug+set}" = set; then
     3847  enableval="$enable_debug"
     3848  DEBUG=$enableval
     3849fi;
     3850
     3851if test "$DEBUG" = "no"; then
     3852        echo "no"
     3853        echo " -> Setting debuglevel to 1. Like this you can still see errors."
     3854        DEBUG=1
     3855elif test "$DEBUG" = yes; then
     3856        echo "yes"
     3857        echo " -> Setting debuglevel to 3. HARD DEBUG MODE!!."
     3858        DEBUG=3
     3859else
     3860        echo "yes set to $DEBUG"
     3861fi
     3862
     3863cat >>confdefs.h <<_ACEOF
     3864#define DEBUG $DEBUG
     3865_ACEOF
     3866
     3867
     3868
     3869
     3870## GTK-disabled
     3871echo "$as_me:$LINENO: checking if gtk should be enabled" >&5
     3872echo $ECHO_N "checking if gtk should be enabled... $ECHO_C" >&6
     3873
     3874# Check whether --with-gtk or --without-gtk was given.
     3875if test "${with_gtk+set}" = set; then
     3876  withval="$with_gtk"
     3877  def_gtk=no
     3878else
     3879  def_gtk=yes
     3880fi;
     3881if test "$def_gtk" = yes; then
     3882  echo "yes"
     3883fi
     3884if test "$def_gtk" = no; then
     3885  echo "no"
     3886fi
     3887### SDL_image-disable
     3888def_sdl_image=yes
     3889echo "$as_me:$LINENO: checking if SDL_image should be enabled" >&5
     3890echo $ECHO_N "checking if SDL_image should be enabled... $ECHO_C" >&6
     3891
     3892# Check whether --with-sdl_image or --without-sdl_image was given.
     3893if test "${with_sdl_image+set}" = set; then
     3894  withval="$with_sdl_image"
     3895  def_sdl_image=no
     3896fi;
     3897if test "$def_sdl_image" = yes; then
     3898  echo "yes"
     3899fi
     3900if test "$def_sdl_image" = no; then
     3901  echo "no"
     3902fi
     3903
     3904
     3905## PROGRAMM CHECKING
     3906# checking for Doxygen
     3907# Extract the first word of "doxygen", so it can be a program name with args.
     3908set dummy doxygen; ac_word=$2
     3909echo "$as_me:$LINENO: checking for $ac_word" >&5
     3910echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
     3911if test "${ac_cv_path_DOXYGEN+set}" = set; then
     3912  echo $ECHO_N "(cached) $ECHO_C" >&6
     3913else
     3914  case $DOXYGEN in
     3915  [\\/]* | ?:[\\/]*)
     3916  ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path.
     3917  ;;
     3918  *)
     3919  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
     3920for as_dir in $PATH
     3921do
     3922  IFS=$as_save_IFS
     3923  test -z "$as_dir" && as_dir=.
     3924  for ac_exec_ext in '' $ac_executable_extensions; do
     3925  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     3926    ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext"
     3927    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     3928    break 2
     3929  fi
     3930done
     3931done
     3932
     3933  ;;
     3934esac
     3935fi
     3936DOXYGEN=$ac_cv_path_DOXYGEN
     3937
     3938if test -n "$DOXYGEN"; then
     3939  echo "$as_me:$LINENO: result: $DOXYGEN" >&5
     3940echo "${ECHO_T}$DOXYGEN" >&6
     3941else
     3942  echo "$as_me:$LINENO: result: no" >&5
     3943echo "${ECHO_T}no" >&6
     3944fi
     3945
     3946
     3947
     3948if test $DOXYGEN; then
     3949  DOXYGEN_TRUE=
     3950  DOXYGEN_FALSE='#'
     3951else
     3952  DOXYGEN_TRUE='#'
     3953  DOXYGEN_FALSE=
     3954fi
     3955
     3956
    38323957### CHECKING FOR SYSTEM ###
    38333958
     
    47444869    fi
    47454870
    4746 
    47474871    ;;
    47484872
     
    47534877 Linux="yes"
    47544878
     4879CPPFLAGS="-I/usr/X11R6/include"
     4880LDFLAGS="-L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
    47554881# checking gl header
    47564882
     
    53725498
    53735499
    5374 # checking for SDL-libs
     5500# checking for SDL-lib
    53755501    echo "$as_me:$LINENO: checking for main in -lSDL" >&5
    53765502echo $ECHO_N "checking for main in -lSDL... $ECHO_C" >&6
     
    54455571     fi
    54465572
     5573
    54475574## checking for SDL
    54485575#    SDL_VERSION=1.2.7
     
    54615588 osX="yes"
    54625589
     5590 CPPFLAGS="-I/sw/include $CPPFLAGS"
    54635591# checking gl header
    54645592
     
    57895917       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
    57905918       LIBS="$LIBS $SDL_LIBS"
     5919
    57915920    ;;
    57925921
     
    57975926
    57985927
    5799 
    5800 
    5801 
    5802 ## checking for GTK
    5803 
    5804   succeeded=no
    5805 
    5806   if test -z "$PKG_CONFIG"; then
    5807     # Extract the first word of "pkg-config", so it can be a program name with args.
    5808 set dummy pkg-config; ac_word=$2
    5809 echo "$as_me:$LINENO: checking for $ac_word" >&5
    5810 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
    5811 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
    5812   echo $ECHO_N "(cached) $ECHO_C" >&6
    5813 else
    5814   case $PKG_CONFIG in
    5815   [\\/]* | ?:[\\/]*)
    5816   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
    5817   ;;
    5818   *)
    5819   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    5820 for as_dir in $PATH
    5821 do
    5822   IFS=$as_save_IFS
    5823   test -z "$as_dir" && as_dir=.
    5824   for ac_exec_ext in '' $ac_executable_extensions; do
    5825   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    5826     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
    5827     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    5828     break 2
    5829   fi
    5830 done
    5831 done
    5832 
    5833   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
    5834   ;;
    5835 esac
    5836 fi
    5837 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
    5838 
    5839 if test -n "$PKG_CONFIG"; then
    5840   echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
    5841 echo "${ECHO_T}$PKG_CONFIG" >&6
    5842 else
    5843   echo "$as_me:$LINENO: result: no" >&5
    5844 echo "${ECHO_T}no" >&6
    5845 fi
    5846 
    5847   fi
    5848 
    5849   if test "$PKG_CONFIG" = "no" ; then
    5850      echo "*** The pkg-config script could not be found. Make sure it is"
    5851      echo "*** in your path, or set the PKG_CONFIG environment variable"
    5852      echo "*** to the full path to pkg-config."
    5853      echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
    5854   else
    5855      PKG_CONFIG_MIN_VERSION=0.9.0
    5856      if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
    5857         echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3" >&5
    5858 echo $ECHO_N "checking for gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3... $ECHO_C" >&6
    5859 
    5860         if $PKG_CONFIG --exists "gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3" ; then
    5861             echo "$as_me:$LINENO: result: yes" >&5
    5862 echo "${ECHO_T}yes" >&6
    5863             succeeded=yes
    5864 
    5865             echo "$as_me:$LINENO: checking GTK2_CFLAGS" >&5
    5866 echo $ECHO_N "checking GTK2_CFLAGS... $ECHO_C" >&6
    5867             GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3"`
    5868             echo "$as_me:$LINENO: result: $GTK2_CFLAGS" >&5
    5869 echo "${ECHO_T}$GTK2_CFLAGS" >&6
    5870 
    5871             echo "$as_me:$LINENO: checking GTK2_LIBS" >&5
    5872 echo $ECHO_N "checking GTK2_LIBS... $ECHO_C" >&6
    5873             GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3"`
    5874             echo "$as_me:$LINENO: result: $GTK2_LIBS" >&5
    5875 echo "${ECHO_T}$GTK2_LIBS" >&6
    5876         else
    5877             GTK2_CFLAGS=""
    5878             GTK2_LIBS=""
    5879             ## If we have a custom action on failure, don't print errors, but
    5880             ## do set a variable so people can do so.
    5881             GTK2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3"`
    5882 
    5883         fi
    5884 
    5885 
    5886 
    5887      else
    5888         echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
    5889         echo "*** See http://www.freedesktop.org/software/pkgconfig"
    5890      fi
    5891   fi
    5892 
    5893   if test $succeeded = yes; then
    5894      have_gtk2=yes
    5895   else
    5896      have_gtk2=no
    5897   fi
    5898 
    5899 
    5900 
    5901 
    5902 
    5903 if test "x$have_gtk2" = xyes; then
    5904   HAVE_GTK2_TRUE=
    5905   HAVE_GTK2_FALSE='#'
    5906 else
    5907   HAVE_GTK2_TRUE='#'
    5908   HAVE_GTK2_FALSE=
    5909 fi
    5910 
    5911 
    5912 
    5913 #checking for pthread libs
    5914  echo "$as_me:$LINENO: checking for main in -lpthread" >&5
    5915 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
    5916 if test "${ac_cv_lib_pthread_main+set}" = set; then
    5917   echo $ECHO_N "(cached) $ECHO_C" >&6
    5918 else
    5919   ac_check_lib_save_LIBS=$LIBS
    5920 LIBS="-lpthread  $LIBS"
    5921 cat >conftest.$ac_ext <<_ACEOF
    5922 /* confdefs.h.  */
    5923 _ACEOF
    5924 cat confdefs.h >>conftest.$ac_ext
    5925 cat >>conftest.$ac_ext <<_ACEOF
    5926 /* end confdefs.h.  */
    5927 
    5928 
    5929 int
    5930 main ()
    5931 {
    5932 main ();
    5933   ;
    5934   return 0;
    5935 }
    5936 _ACEOF
    5937 rm -f conftest.$ac_objext conftest$ac_exeext
    5938 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    5939   (eval $ac_link) 2>conftest.er1
    5940   ac_status=$?
    5941   grep -v '^ *+' conftest.er1 >conftest.err
    5942   rm -f conftest.er1
    5943   cat conftest.err >&5
    5944   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    5945   (exit $ac_status); } &&
    5946          { ac_try='test -z "$ac_c_werror_flag"
    5947                          || test ! -s conftest.err'
    5948   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    5949   (eval $ac_try) 2>&5
    5950   ac_status=$?
    5951   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    5952   (exit $ac_status); }; } &&
    5953          { ac_try='test -s conftest$ac_exeext'
    5954   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    5955   (eval $ac_try) 2>&5
    5956   ac_status=$?
    5957   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    5958   (exit $ac_status); }; }; then
    5959   ac_cv_lib_pthread_main=yes
    5960 else
    5961   echo "$as_me: failed program was:" >&5
    5962 sed 's/^/| /' conftest.$ac_ext >&5
    5963 
    5964 ac_cv_lib_pthread_main=no
    5965 fi
    5966 rm -f conftest.err conftest.$ac_objext \
    5967       conftest$ac_exeext conftest.$ac_ext
    5968 LIBS=$ac_check_lib_save_LIBS
    5969 fi
    5970 echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
    5971 echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6
    5972 if test $ac_cv_lib_pthread_main = yes; then
    5973   FOUND_pthread=yes
    5974 fi
    5975 
    5976  if test "$FOUND_pthread" = "yes" ; then
    5977     LIBS="$LIBS -lpthread"
    5978  fi
    5979 
    5980 
    5981 # FIXME: Replace `main' with a function in `-lm':
    5982 
    5983 echo "$as_me:$LINENO: checking for main in -lm" >&5
    5984 echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
    5985 if test "${ac_cv_lib_m_main+set}" = set; then
    5986   echo $ECHO_N "(cached) $ECHO_C" >&6
    5987 else
    5988   ac_check_lib_save_LIBS=$LIBS
    5989 LIBS="-lm  $LIBS"
    5990 cat >conftest.$ac_ext <<_ACEOF
    5991 /* confdefs.h.  */
    5992 _ACEOF
    5993 cat confdefs.h >>conftest.$ac_ext
    5994 cat >>conftest.$ac_ext <<_ACEOF
    5995 /* end confdefs.h.  */
    5996 
    5997 
    5998 int
    5999 main ()
    6000 {
    6001 main ();
    6002   ;
    6003   return 0;
    6004 }
    6005 _ACEOF
    6006 rm -f conftest.$ac_objext conftest$ac_exeext
    6007 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    6008   (eval $ac_link) 2>conftest.er1
    6009   ac_status=$?
    6010   grep -v '^ *+' conftest.er1 >conftest.err
    6011   rm -f conftest.er1
    6012   cat conftest.err >&5
    6013   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6014   (exit $ac_status); } &&
    6015          { ac_try='test -z "$ac_c_werror_flag"
    6016                          || test ! -s conftest.err'
    6017   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6018   (eval $ac_try) 2>&5
    6019   ac_status=$?
    6020   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6021   (exit $ac_status); }; } &&
    6022          { ac_try='test -s conftest$ac_exeext'
    6023   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6024   (eval $ac_try) 2>&5
    6025   ac_status=$?
    6026   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6027   (exit $ac_status); }; }; then
    6028   ac_cv_lib_m_main=yes
    6029 else
    6030   echo "$as_me: failed program was:" >&5
    6031 sed 's/^/| /' conftest.$ac_ext >&5
    6032 
    6033 ac_cv_lib_m_main=no
    6034 fi
    6035 rm -f conftest.err conftest.$ac_objext \
    6036       conftest$ac_exeext conftest.$ac_ext
    6037 LIBS=$ac_check_lib_save_LIBS
    6038 fi
    6039 echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
    6040 echo "${ECHO_T}$ac_cv_lib_m_main" >&6
    6041 if test $ac_cv_lib_m_main = yes; then
    6042   cat >>confdefs.h <<_ACEOF
    6043 #define HAVE_LIBM 1
    6044 _ACEOF
    6045 
    6046   LIBS="-lm $LIBS"
    6047 
    6048 fi
    6049 
    6050 
    6051 
    6052 # Checks for header files.
    6053 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
    6054 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
    6055 if test "${ac_cv_header_stdc+set}" = set; then
    6056   echo $ECHO_N "(cached) $ECHO_C" >&6
    6057 else
    6058   cat >conftest.$ac_ext <<_ACEOF
    6059 /* confdefs.h.  */
    6060 _ACEOF
    6061 cat confdefs.h >>conftest.$ac_ext
    6062 cat >>conftest.$ac_ext <<_ACEOF
    6063 /* end confdefs.h.  */
    6064 #include <stdlib.h>
    6065 #include <stdarg.h>
    6066 #include <string.h>
    6067 #include <float.h>
    6068 
    6069 int
    6070 main ()
    6071 {
    6072 
    6073   ;
    6074   return 0;
    6075 }
    6076 _ACEOF
    6077 rm -f conftest.$ac_objext
    6078 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    6079   (eval $ac_compile) 2>conftest.er1
    6080   ac_status=$?
    6081   grep -v '^ *+' conftest.er1 >conftest.err
    6082   rm -f conftest.er1
    6083   cat conftest.err >&5
    6084   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6085   (exit $ac_status); } &&
    6086          { ac_try='test -z "$ac_c_werror_flag"
    6087                          || test ! -s conftest.err'
    6088   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6089   (eval $ac_try) 2>&5
    6090   ac_status=$?
    6091   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6092   (exit $ac_status); }; } &&
    6093          { ac_try='test -s conftest.$ac_objext'
    6094   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6095   (eval $ac_try) 2>&5
    6096   ac_status=$?
    6097   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6098   (exit $ac_status); }; }; then
    6099   ac_cv_header_stdc=yes
    6100 else
    6101   echo "$as_me: failed program was:" >&5
    6102 sed 's/^/| /' conftest.$ac_ext >&5
    6103 
    6104 ac_cv_header_stdc=no
    6105 fi
    6106 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    6107 
    6108 if test $ac_cv_header_stdc = yes; then
    6109   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
    6110   cat >conftest.$ac_ext <<_ACEOF
    6111 /* confdefs.h.  */
    6112 _ACEOF
    6113 cat confdefs.h >>conftest.$ac_ext
    6114 cat >>conftest.$ac_ext <<_ACEOF
    6115 /* end confdefs.h.  */
    6116 #include <string.h>
    6117 
    6118 _ACEOF
    6119 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    6120   $EGREP "memchr" >/dev/null 2>&1; then
    6121   :
    6122 else
    6123   ac_cv_header_stdc=no
    6124 fi
    6125 rm -f conftest*
    6126 
    6127 fi
    6128 
    6129 if test $ac_cv_header_stdc = yes; then
    6130   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
    6131   cat >conftest.$ac_ext <<_ACEOF
    6132 /* confdefs.h.  */
    6133 _ACEOF
    6134 cat confdefs.h >>conftest.$ac_ext
    6135 cat >>conftest.$ac_ext <<_ACEOF
    6136 /* end confdefs.h.  */
    6137 #include <stdlib.h>
    6138 
    6139 _ACEOF
    6140 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    6141   $EGREP "free" >/dev/null 2>&1; then
    6142   :
    6143 else
    6144   ac_cv_header_stdc=no
    6145 fi
    6146 rm -f conftest*
    6147 
    6148 fi
    6149 
    6150 if test $ac_cv_header_stdc = yes; then
    6151   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
    6152   if test "$cross_compiling" = yes; then
    6153   :
    6154 else
    6155   cat >conftest.$ac_ext <<_ACEOF
    6156 /* confdefs.h.  */
    6157 _ACEOF
    6158 cat confdefs.h >>conftest.$ac_ext
    6159 cat >>conftest.$ac_ext <<_ACEOF
    6160 /* end confdefs.h.  */
    6161 #include <ctype.h>
    6162 #if ((' ' & 0x0FF) == 0x020)
    6163 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
    6164 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
    6165 #else
    6166 # define ISLOWER(c) \
    6167                    (('a' <= (c) && (c) <= 'i') \
    6168                      || ('j' <= (c) && (c) <= 'r') \
    6169                      || ('s' <= (c) && (c) <= 'z'))
    6170 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
    6171 #endif
    6172 
    6173 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
    6174 int
    6175 main ()
    6176 {
    6177   int i;
    6178   for (i = 0; i < 256; i++)
    6179     if (XOR (islower (i), ISLOWER (i))
    6180         || toupper (i) != TOUPPER (i))
    6181       exit(2);
    6182   exit (0);
    6183 }
    6184 _ACEOF
    6185 rm -f conftest$ac_exeext
    6186 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
    6187   (eval $ac_link) 2>&5
    6188   ac_status=$?
    6189   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6190   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
    6191   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6192   (eval $ac_try) 2>&5
    6193   ac_status=$?
    6194   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6195   (exit $ac_status); }; }; then
    6196   :
    6197 else
    6198   echo "$as_me: program exited with status $ac_status" >&5
    6199 echo "$as_me: failed program was:" >&5
    6200 sed 's/^/| /' conftest.$ac_ext >&5
    6201 
    6202 ( exit $ac_status )
    6203 ac_cv_header_stdc=no
    6204 fi
    6205 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
    6206 fi
    6207 fi
    6208 fi
    6209 echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
    6210 echo "${ECHO_T}$ac_cv_header_stdc" >&6
    6211 if test $ac_cv_header_stdc = yes; then
    6212 
    6213 cat >>confdefs.h <<\_ACEOF
    6214 #define STDC_HEADERS 1
    6215 _ACEOF
    6216 
    6217 fi
    6218 
    6219 
    6220 
    6221 for ac_header in stdlib.h string.h
     5928## check for SDL_Image
     5929if test "$def_sdl_image" = "yes"; then
     5930# checking for SDL_image-headers
     5931
     5932for ac_header in SDL/SDL_image.h
    62225933do
    62235934as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    63646075_ACEOF
    63656076
     6077else
     6078  echo "sdl_image not found. falling back to other options"; def_sdl_image=no
    63666079fi
    63676080
    63686081done
    63696082
    6370 
    6371 # Checks for typedefs, structures, and compiler characteristics.
    6372 echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
    6373 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
    6374 if test "${ac_cv_header_stdbool_h+set}" = set; then
     6083fi
     6084if test "$def_sdl_image" = "yes"; then
     6085# checking for SDL_image-lib
     6086  echo "$as_me:$LINENO: checking for main in -lSDL_image" >&5
     6087echo $ECHO_N "checking for main in -lSDL_image... $ECHO_C" >&6
     6088if test "${ac_cv_lib_SDL_image_main+set}" = set; then
    63756089  echo $ECHO_N "(cached) $ECHO_C" >&6
    63766090else
    6377   cat >conftest.$ac_ext <<_ACEOF
     6091  ac_check_lib_save_LIBS=$LIBS
     6092LIBS="-lSDL_image  $LIBS"
     6093cat >conftest.$ac_ext <<_ACEOF
    63786094/* confdefs.h.  */
    63796095_ACEOF
     
    63826098/* end confdefs.h.  */
    63836099
    6384 #include <stdbool.h>
    6385 #ifndef bool
    6386 # error bool is not defined
    6387 #endif
    6388 #ifndef false
    6389 # error false is not defined
    6390 #endif
    6391 #if false
    6392 # error false is not 0
    6393 #endif
    6394 #ifndef true
    6395 # error true is not defined
    6396 #endif
    6397 #if true != 1
    6398 # error true is not 1
    6399 #endif
    6400 #ifndef __bool_true_false_are_defined
    6401 # error __bool_true_false_are_defined is not defined
    6402 #endif
    6403 
    6404         struct s { _Bool s: 1; _Bool t; } s;
    6405 
    6406         char a[true == 1 ? 1 : -1];
    6407         char b[false == 0 ? 1 : -1];
    6408         char c[__bool_true_false_are_defined == 1 ? 1 : -1];
    6409         char d[(bool) -0.5 == true ? 1 : -1];
    6410         bool e = &s;
    6411         char f[(_Bool) -0.0 == false ? 1 : -1];
    6412         char g[true];
    6413         char h[sizeof (_Bool)];
    6414         char i[sizeof s.t];
    64156100
    64166101int
    64176102main ()
    64186103{
    6419  return !a + !b + !c + !d + !e + !f + !g + !h + !i;
     6104main ();
    64206105  ;
    64216106  return 0;
    64226107}
    64236108_ACEOF
    6424 rm -f conftest.$ac_objext
    6425 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    6426   (eval $ac_compile) 2>conftest.er1
     6109rm -f conftest.$ac_objext conftest$ac_exeext
     6110if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6111  (eval $ac_link) 2>conftest.er1
    64276112  ac_status=$?
    64286113  grep -v '^ *+' conftest.er1 >conftest.err
     
    64386123  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    64396124  (exit $ac_status); }; } &&
    6440          { ac_try='test -s conftest.$ac_objext'
     6125         { ac_try='test -s conftest$ac_exeext'
    64416126  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    64426127  (eval $ac_try) 2>&5
     
    64446129  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    64456130  (exit $ac_status); }; }; then
    6446   ac_cv_header_stdbool_h=yes
     6131  ac_cv_lib_SDL_image_main=yes
    64476132else
    64486133  echo "$as_me: failed program was:" >&5
    64496134sed 's/^/| /' conftest.$ac_ext >&5
    64506135
    6451 ac_cv_header_stdbool_h=no
    6452 fi
    6453 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    6454 fi
    6455 echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
    6456 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
    6457 echo "$as_me:$LINENO: checking for _Bool" >&5
    6458 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
    6459 if test "${ac_cv_type__Bool+set}" = set; then
    6460   echo $ECHO_N "(cached) $ECHO_C" >&6
    6461 else
    6462   cat >conftest.$ac_ext <<_ACEOF
    6463 /* confdefs.h.  */
    6464 _ACEOF
    6465 cat confdefs.h >>conftest.$ac_ext
    6466 cat >>conftest.$ac_ext <<_ACEOF
    6467 /* end confdefs.h.  */
    6468 $ac_includes_default
    6469 int
    6470 main ()
    6471 {
    6472 if ((_Bool *) 0)
    6473   return 0;
    6474 if (sizeof (_Bool))
    6475   return 0;
    6476   ;
    6477   return 0;
    6478 }
    6479 _ACEOF
    6480 rm -f conftest.$ac_objext
    6481 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    6482   (eval $ac_compile) 2>conftest.er1
    6483   ac_status=$?
    6484   grep -v '^ *+' conftest.er1 >conftest.err
    6485   rm -f conftest.er1
    6486   cat conftest.err >&5
    6487   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6488   (exit $ac_status); } &&
    6489          { ac_try='test -z "$ac_c_werror_flag"
    6490                          || test ! -s conftest.err'
    6491   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6492   (eval $ac_try) 2>&5
    6493   ac_status=$?
    6494   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6495   (exit $ac_status); }; } &&
    6496          { ac_try='test -s conftest.$ac_objext'
    6497   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    6498   (eval $ac_try) 2>&5
    6499   ac_status=$?
    6500   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6501   (exit $ac_status); }; }; then
    6502   ac_cv_type__Bool=yes
    6503 else
    6504   echo "$as_me: failed program was:" >&5
    6505 sed 's/^/| /' conftest.$ac_ext >&5
    6506 
    6507 ac_cv_type__Bool=no
    6508 fi
    6509 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    6510 fi
    6511 echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
    6512 echo "${ECHO_T}$ac_cv_type__Bool" >&6
    6513 if test $ac_cv_type__Bool = yes; then
    6514 
    6515 cat >>confdefs.h <<_ACEOF
    6516 #define HAVE__BOOL 1
    6517 _ACEOF
    6518 
    6519 
    6520 fi
    6521 
    6522 if test $ac_cv_header_stdbool_h = yes; then
    6523 
    6524 cat >>confdefs.h <<\_ACEOF
    6525 #define HAVE_STDBOOL_H 1
    6526 _ACEOF
    6527 
    6528 fi
    6529 
    6530 
    6531 # Checks for library functions.
    6532 
    6533 for ac_header in stdlib.h
     6136ac_cv_lib_SDL_image_main=no
     6137fi
     6138rm -f conftest.err conftest.$ac_objext \
     6139      conftest$ac_exeext conftest.$ac_ext
     6140LIBS=$ac_check_lib_save_LIBS
     6141fi
     6142echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_image_main" >&5
     6143echo "${ECHO_T}$ac_cv_lib_SDL_image_main" >&6
     6144if test $ac_cv_lib_SDL_image_main = yes; then
     6145  FOUND_SDL_image=yes
     6146fi
     6147
     6148     if test "$FOUND_SDL_image" = "yes" ; then
     6149       LIBS="$LIBS -lSDL_image"
     6150     else
     6151        echo "------------------"
     6152        echo "SDL_image library not found."
     6153        echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
     6154        echo "------------------"
     6155        exit -1
     6156     fi
     6157fi
     6158
     6159
     6160if test "$def_sdl_image" = "no"; then
     6161 ## checking for libjpeg
     6162
     6163for ac_header in jpeglib.h
    65346164do
    65356165as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    66756305#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
    66766306_ACEOF
     6307 jpegHeader="yes"
     6308else
     6309  jpegHeader="no"
     6310fi
     6311
     6312done
     6313
     6314 if test $jpegHeader = "no"; then
     6315        echo " not including jpeg."
     6316 else
     6317  echo "$as_me:$LINENO: checking for main in -ljpeg" >&5
     6318echo $ECHO_N "checking for main in -ljpeg... $ECHO_C" >&6
     6319if test "${ac_cv_lib_jpeg_main+set}" = set; then
     6320  echo $ECHO_N "(cached) $ECHO_C" >&6
     6321else
     6322  ac_check_lib_save_LIBS=$LIBS
     6323LIBS="-ljpeg  $LIBS"
     6324cat >conftest.$ac_ext <<_ACEOF
     6325/* confdefs.h.  */
     6326_ACEOF
     6327cat confdefs.h >>conftest.$ac_ext
     6328cat >>conftest.$ac_ext <<_ACEOF
     6329/* end confdefs.h.  */
     6330
     6331
     6332int
     6333main ()
     6334{
     6335main ();
     6336  ;
     6337  return 0;
     6338}
     6339_ACEOF
     6340rm -f conftest.$ac_objext conftest$ac_exeext
     6341if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6342  (eval $ac_link) 2>conftest.er1
     6343  ac_status=$?
     6344  grep -v '^ *+' conftest.er1 >conftest.err
     6345  rm -f conftest.er1
     6346  cat conftest.err >&5
     6347  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6348  (exit $ac_status); } &&
     6349         { ac_try='test -z "$ac_c_werror_flag"
     6350                         || test ! -s conftest.err'
     6351  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6352  (eval $ac_try) 2>&5
     6353  ac_status=$?
     6354  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6355  (exit $ac_status); }; } &&
     6356         { ac_try='test -s conftest$ac_exeext'
     6357  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6358  (eval $ac_try) 2>&5
     6359  ac_status=$?
     6360  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6361  (exit $ac_status); }; }; then
     6362  ac_cv_lib_jpeg_main=yes
     6363else
     6364  echo "$as_me: failed program was:" >&5
     6365sed 's/^/| /' conftest.$ac_ext >&5
     6366
     6367ac_cv_lib_jpeg_main=no
     6368fi
     6369rm -f conftest.err conftest.$ac_objext \
     6370      conftest$ac_exeext conftest.$ac_ext
     6371LIBS=$ac_check_lib_save_LIBS
     6372fi
     6373echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_main" >&5
     6374echo "${ECHO_T}$ac_cv_lib_jpeg_main" >&6
     6375if test $ac_cv_lib_jpeg_main = yes; then
     6376  FOUND_jpeg=yes
     6377fi
     6378
     6379    if test "$FOUND_jpeg" = "yes" ; then
     6380      LIBS="$LIBS -ljpeg"
     6381    else
     6382         echo "------------------"
     6383         echo "jpeg library not found."
     6384         echo "please install the jpeg library from the Independent JPEG Group, which can be found at http://www.ijg.org"
     6385         echo "------------------"
     6386         exit -1
     6387    fi
     6388 fi
     6389
     6390 ## checking for libpng
     6391
     6392for ac_header in png.h
     6393do
     6394as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     6395if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6396  echo "$as_me:$LINENO: checking for $ac_header" >&5
     6397echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6398if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6399  echo $ECHO_N "(cached) $ECHO_C" >&6
     6400fi
     6401echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6402echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6403else
     6404  # Is the header compilable?
     6405echo "$as_me:$LINENO: checking $ac_header usability" >&5
     6406echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
     6407cat >conftest.$ac_ext <<_ACEOF
     6408/* confdefs.h.  */
     6409_ACEOF
     6410cat confdefs.h >>conftest.$ac_ext
     6411cat >>conftest.$ac_ext <<_ACEOF
     6412/* end confdefs.h.  */
     6413$ac_includes_default
     6414#include <$ac_header>
     6415_ACEOF
     6416rm -f conftest.$ac_objext
     6417if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6418  (eval $ac_compile) 2>conftest.er1
     6419  ac_status=$?
     6420  grep -v '^ *+' conftest.er1 >conftest.err
     6421  rm -f conftest.er1
     6422  cat conftest.err >&5
     6423  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6424  (exit $ac_status); } &&
     6425         { ac_try='test -z "$ac_c_werror_flag"
     6426                         || test ! -s conftest.err'
     6427  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6428  (eval $ac_try) 2>&5
     6429  ac_status=$?
     6430  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6431  (exit $ac_status); }; } &&
     6432         { ac_try='test -s conftest.$ac_objext'
     6433  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6434  (eval $ac_try) 2>&5
     6435  ac_status=$?
     6436  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6437  (exit $ac_status); }; }; then
     6438  ac_header_compiler=yes
     6439else
     6440  echo "$as_me: failed program was:" >&5
     6441sed 's/^/| /' conftest.$ac_ext >&5
     6442
     6443ac_header_compiler=no
     6444fi
     6445rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6446echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     6447echo "${ECHO_T}$ac_header_compiler" >&6
     6448
     6449# Is the header present?
     6450echo "$as_me:$LINENO: checking $ac_header presence" >&5
     6451echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
     6452cat >conftest.$ac_ext <<_ACEOF
     6453/* confdefs.h.  */
     6454_ACEOF
     6455cat confdefs.h >>conftest.$ac_ext
     6456cat >>conftest.$ac_ext <<_ACEOF
     6457/* end confdefs.h.  */
     6458#include <$ac_header>
     6459_ACEOF
     6460if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     6461  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     6462  ac_status=$?
     6463  grep -v '^ *+' conftest.er1 >conftest.err
     6464  rm -f conftest.er1
     6465  cat conftest.err >&5
     6466  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6467  (exit $ac_status); } >/dev/null; then
     6468  if test -s conftest.err; then
     6469    ac_cpp_err=$ac_c_preproc_warn_flag
     6470    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     6471  else
     6472    ac_cpp_err=
     6473  fi
     6474else
     6475  ac_cpp_err=yes
     6476fi
     6477if test -z "$ac_cpp_err"; then
     6478  ac_header_preproc=yes
     6479else
     6480  echo "$as_me: failed program was:" >&5
     6481sed 's/^/| /' conftest.$ac_ext >&5
     6482
     6483  ac_header_preproc=no
     6484fi
     6485rm -f conftest.err conftest.$ac_ext
     6486echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     6487echo "${ECHO_T}$ac_header_preproc" >&6
     6488
     6489# So?  What about this header?
     6490case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     6491  yes:no: )
     6492    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
     6493echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     6494    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
     6495echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     6496    ac_header_preproc=yes
     6497    ;;
     6498  no:yes:* )
     6499    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
     6500echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     6501    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
     6502echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
     6503    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
     6504echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
     6505    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
     6506echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     6507    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
     6508echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     6509    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
     6510echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     6511    (
     6512      cat <<\_ASBOX
     6513## ------------------------------------------- ##
     6514## Report this to orxonox-dev@mail.datacore.ch ##
     6515## ------------------------------------------- ##
     6516_ASBOX
     6517    ) |
     6518      sed "s/^/$as_me: WARNING:     /" >&2
     6519    ;;
     6520esac
     6521echo "$as_me:$LINENO: checking for $ac_header" >&5
     6522echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6523if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6524  echo $ECHO_N "(cached) $ECHO_C" >&6
     6525else
     6526  eval "$as_ac_Header=\$ac_header_preproc"
     6527fi
     6528echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6529echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6530
     6531fi
     6532if test `eval echo '${'$as_ac_Header'}'` = yes; then
     6533  cat >>confdefs.h <<_ACEOF
     6534#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     6535_ACEOF
     6536 pngHeader="yes"
     6537else
     6538  pngHeader="no"
     6539fi
     6540
     6541done
     6542
     6543 if test $pngHeader = "no"; then
     6544        echo " not including png."
     6545 else
     6546  echo "$as_me:$LINENO: checking for main in -lpng" >&5
     6547echo $ECHO_N "checking for main in -lpng... $ECHO_C" >&6
     6548if test "${ac_cv_lib_png_main+set}" = set; then
     6549  echo $ECHO_N "(cached) $ECHO_C" >&6
     6550else
     6551  ac_check_lib_save_LIBS=$LIBS
     6552LIBS="-lpng  $LIBS"
     6553cat >conftest.$ac_ext <<_ACEOF
     6554/* confdefs.h.  */
     6555_ACEOF
     6556cat confdefs.h >>conftest.$ac_ext
     6557cat >>conftest.$ac_ext <<_ACEOF
     6558/* end confdefs.h.  */
     6559
     6560
     6561int
     6562main ()
     6563{
     6564main ();
     6565  ;
     6566  return 0;
     6567}
     6568_ACEOF
     6569rm -f conftest.$ac_objext conftest$ac_exeext
     6570if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6571  (eval $ac_link) 2>conftest.er1
     6572  ac_status=$?
     6573  grep -v '^ *+' conftest.er1 >conftest.err
     6574  rm -f conftest.er1
     6575  cat conftest.err >&5
     6576  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6577  (exit $ac_status); } &&
     6578         { ac_try='test -z "$ac_c_werror_flag"
     6579                         || test ! -s conftest.err'
     6580  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6581  (eval $ac_try) 2>&5
     6582  ac_status=$?
     6583  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6584  (exit $ac_status); }; } &&
     6585         { ac_try='test -s conftest$ac_exeext'
     6586  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6587  (eval $ac_try) 2>&5
     6588  ac_status=$?
     6589  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6590  (exit $ac_status); }; }; then
     6591  ac_cv_lib_png_main=yes
     6592else
     6593  echo "$as_me: failed program was:" >&5
     6594sed 's/^/| /' conftest.$ac_ext >&5
     6595
     6596ac_cv_lib_png_main=no
     6597fi
     6598rm -f conftest.err conftest.$ac_objext \
     6599      conftest$ac_exeext conftest.$ac_ext
     6600LIBS=$ac_check_lib_save_LIBS
     6601fi
     6602echo "$as_me:$LINENO: result: $ac_cv_lib_png_main" >&5
     6603echo "${ECHO_T}$ac_cv_lib_png_main" >&6
     6604if test $ac_cv_lib_png_main = yes; then
     6605  FOUND_png=yes
     6606fi
     6607
     6608    if test "$FOUND_png" = "yes" ; then
     6609      LIBS="$LIBS -lpng"
     6610    else
     6611         echo "------------------"
     6612         echo "png library not found."
     6613         echo "please install the png library, which can be found at http://libpng.org/pub/png/libpng.html"
     6614         echo "------------------"
     6615         exit -1
     6616    fi
     6617 fi
     6618fi
     6619
     6620## checking for GTK
     6621if test "$def_gtk" = yes; then
     6622
     6623        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
     6624        echo "$as_me:$LINENO: checking for gtk2.0" >&5
     6625echo $ECHO_N "checking for gtk2.0... $ECHO_C" >&6
     6626        if `pkg-config --exists gtk+-2.0`; then
     6627                echo "yes"
     6628                have_gtk2=yes
     6629                GTK2_LIBS=`pkg-config --libs gtk+-2.0`
     6630                GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0`
     6631
     6632cat >>confdefs.h <<_ACEOF
     6633#define HAVE_GTK2 1
     6634_ACEOF
     6635
     6636        else
     6637                echo "no"
     6638        fi
     6639
     6640fi
     6641
     6642
     6643
     6644
     6645if test x$have_gtk2 = xyes; then
     6646  HAVE_GTK2_TRUE=
     6647  HAVE_GTK2_FALSE='#'
     6648else
     6649  HAVE_GTK2_TRUE='#'
     6650  HAVE_GTK2_FALSE=
     6651fi
     6652
     6653
     6654
     6655
     6656#checking for pthread libs
     6657# AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
     6658# if test "$FOUND_pthread" = "yes" ; then
     6659#    LIBS="$LIBS -lpthread"
     6660# fi
     6661
     6662
     6663# FIXME: Replace `main' with a function in `-lm':
     6664
     6665echo "$as_me:$LINENO: checking for main in -lm" >&5
     6666echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
     6667if test "${ac_cv_lib_m_main+set}" = set; then
     6668  echo $ECHO_N "(cached) $ECHO_C" >&6
     6669else
     6670  ac_check_lib_save_LIBS=$LIBS
     6671LIBS="-lm  $LIBS"
     6672cat >conftest.$ac_ext <<_ACEOF
     6673/* confdefs.h.  */
     6674_ACEOF
     6675cat confdefs.h >>conftest.$ac_ext
     6676cat >>conftest.$ac_ext <<_ACEOF
     6677/* end confdefs.h.  */
     6678
     6679
     6680int
     6681main ()
     6682{
     6683main ();
     6684  ;
     6685  return 0;
     6686}
     6687_ACEOF
     6688rm -f conftest.$ac_objext conftest$ac_exeext
     6689if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6690  (eval $ac_link) 2>conftest.er1
     6691  ac_status=$?
     6692  grep -v '^ *+' conftest.er1 >conftest.err
     6693  rm -f conftest.er1
     6694  cat conftest.err >&5
     6695  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6696  (exit $ac_status); } &&
     6697         { ac_try='test -z "$ac_c_werror_flag"
     6698                         || test ! -s conftest.err'
     6699  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6700  (eval $ac_try) 2>&5
     6701  ac_status=$?
     6702  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6703  (exit $ac_status); }; } &&
     6704         { ac_try='test -s conftest$ac_exeext'
     6705  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6706  (eval $ac_try) 2>&5
     6707  ac_status=$?
     6708  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6709  (exit $ac_status); }; }; then
     6710  ac_cv_lib_m_main=yes
     6711else
     6712  echo "$as_me: failed program was:" >&5
     6713sed 's/^/| /' conftest.$ac_ext >&5
     6714
     6715ac_cv_lib_m_main=no
     6716fi
     6717rm -f conftest.err conftest.$ac_objext \
     6718      conftest$ac_exeext conftest.$ac_ext
     6719LIBS=$ac_check_lib_save_LIBS
     6720fi
     6721echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
     6722echo "${ECHO_T}$ac_cv_lib_m_main" >&6
     6723if test $ac_cv_lib_m_main = yes; then
     6724  cat >>confdefs.h <<_ACEOF
     6725#define HAVE_LIBM 1
     6726_ACEOF
     6727
     6728  LIBS="-lm $LIBS"
     6729
     6730fi
     6731
     6732
     6733
     6734# Checks for header files.
     6735echo "$as_me:$LINENO: checking for ANSI C header files" >&5
     6736echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
     6737if test "${ac_cv_header_stdc+set}" = set; then
     6738  echo $ECHO_N "(cached) $ECHO_C" >&6
     6739else
     6740  cat >conftest.$ac_ext <<_ACEOF
     6741/* confdefs.h.  */
     6742_ACEOF
     6743cat confdefs.h >>conftest.$ac_ext
     6744cat >>conftest.$ac_ext <<_ACEOF
     6745/* end confdefs.h.  */
     6746#include <stdlib.h>
     6747#include <stdarg.h>
     6748#include <string.h>
     6749#include <float.h>
     6750
     6751int
     6752main ()
     6753{
     6754
     6755  ;
     6756  return 0;
     6757}
     6758_ACEOF
     6759rm -f conftest.$ac_objext
     6760if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6761  (eval $ac_compile) 2>conftest.er1
     6762  ac_status=$?
     6763  grep -v '^ *+' conftest.er1 >conftest.err
     6764  rm -f conftest.er1
     6765  cat conftest.err >&5
     6766  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6767  (exit $ac_status); } &&
     6768         { ac_try='test -z "$ac_c_werror_flag"
     6769                         || test ! -s conftest.err'
     6770  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6771  (eval $ac_try) 2>&5
     6772  ac_status=$?
     6773  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6774  (exit $ac_status); }; } &&
     6775         { ac_try='test -s conftest.$ac_objext'
     6776  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6777  (eval $ac_try) 2>&5
     6778  ac_status=$?
     6779  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6780  (exit $ac_status); }; }; then
     6781  ac_cv_header_stdc=yes
     6782else
     6783  echo "$as_me: failed program was:" >&5
     6784sed 's/^/| /' conftest.$ac_ext >&5
     6785
     6786ac_cv_header_stdc=no
     6787fi
     6788rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6789
     6790if test $ac_cv_header_stdc = yes; then
     6791  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
     6792  cat >conftest.$ac_ext <<_ACEOF
     6793/* confdefs.h.  */
     6794_ACEOF
     6795cat confdefs.h >>conftest.$ac_ext
     6796cat >>conftest.$ac_ext <<_ACEOF
     6797/* end confdefs.h.  */
     6798#include <string.h>
     6799
     6800_ACEOF
     6801if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     6802  $EGREP "memchr" >/dev/null 2>&1; then
     6803  :
     6804else
     6805  ac_cv_header_stdc=no
     6806fi
     6807rm -f conftest*
     6808
     6809fi
     6810
     6811if test $ac_cv_header_stdc = yes; then
     6812  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
     6813  cat >conftest.$ac_ext <<_ACEOF
     6814/* confdefs.h.  */
     6815_ACEOF
     6816cat confdefs.h >>conftest.$ac_ext
     6817cat >>conftest.$ac_ext <<_ACEOF
     6818/* end confdefs.h.  */
     6819#include <stdlib.h>
     6820
     6821_ACEOF
     6822if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     6823  $EGREP "free" >/dev/null 2>&1; then
     6824  :
     6825else
     6826  ac_cv_header_stdc=no
     6827fi
     6828rm -f conftest*
     6829
     6830fi
     6831
     6832if test $ac_cv_header_stdc = yes; then
     6833  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
     6834  if test "$cross_compiling" = yes; then
     6835  :
     6836else
     6837  cat >conftest.$ac_ext <<_ACEOF
     6838/* confdefs.h.  */
     6839_ACEOF
     6840cat confdefs.h >>conftest.$ac_ext
     6841cat >>conftest.$ac_ext <<_ACEOF
     6842/* end confdefs.h.  */
     6843#include <ctype.h>
     6844#if ((' ' & 0x0FF) == 0x020)
     6845# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
     6846# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
     6847#else
     6848# define ISLOWER(c) \
     6849                   (('a' <= (c) && (c) <= 'i') \
     6850                     || ('j' <= (c) && (c) <= 'r') \
     6851                     || ('s' <= (c) && (c) <= 'z'))
     6852# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
     6853#endif
     6854
     6855#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
     6856int
     6857main ()
     6858{
     6859  int i;
     6860  for (i = 0; i < 256; i++)
     6861    if (XOR (islower (i), ISLOWER (i))
     6862        || toupper (i) != TOUPPER (i))
     6863      exit(2);
     6864  exit (0);
     6865}
     6866_ACEOF
     6867rm -f conftest$ac_exeext
     6868if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6869  (eval $ac_link) 2>&5
     6870  ac_status=$?
     6871  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6872  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
     6873  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6874  (eval $ac_try) 2>&5
     6875  ac_status=$?
     6876  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6877  (exit $ac_status); }; }; then
     6878  :
     6879else
     6880  echo "$as_me: program exited with status $ac_status" >&5
     6881echo "$as_me: failed program was:" >&5
     6882sed 's/^/| /' conftest.$ac_ext >&5
     6883
     6884( exit $ac_status )
     6885ac_cv_header_stdc=no
     6886fi
     6887rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
     6888fi
     6889fi
     6890fi
     6891echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
     6892echo "${ECHO_T}$ac_cv_header_stdc" >&6
     6893if test $ac_cv_header_stdc = yes; then
     6894
     6895cat >>confdefs.h <<\_ACEOF
     6896#define STDC_HEADERS 1
     6897_ACEOF
     6898
     6899fi
     6900
     6901
     6902
     6903for ac_header in stdlib.h string.h
     6904do
     6905as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     6906if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6907  echo "$as_me:$LINENO: checking for $ac_header" >&5
     6908echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6909if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6910  echo $ECHO_N "(cached) $ECHO_C" >&6
     6911fi
     6912echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6913echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6914else
     6915  # Is the header compilable?
     6916echo "$as_me:$LINENO: checking $ac_header usability" >&5
     6917echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
     6918cat >conftest.$ac_ext <<_ACEOF
     6919/* confdefs.h.  */
     6920_ACEOF
     6921cat confdefs.h >>conftest.$ac_ext
     6922cat >>conftest.$ac_ext <<_ACEOF
     6923/* end confdefs.h.  */
     6924$ac_includes_default
     6925#include <$ac_header>
     6926_ACEOF
     6927rm -f conftest.$ac_objext
     6928if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6929  (eval $ac_compile) 2>conftest.er1
     6930  ac_status=$?
     6931  grep -v '^ *+' conftest.er1 >conftest.err
     6932  rm -f conftest.er1
     6933  cat conftest.err >&5
     6934  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6935  (exit $ac_status); } &&
     6936         { ac_try='test -z "$ac_c_werror_flag"
     6937                         || test ! -s conftest.err'
     6938  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6939  (eval $ac_try) 2>&5
     6940  ac_status=$?
     6941  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6942  (exit $ac_status); }; } &&
     6943         { ac_try='test -s conftest.$ac_objext'
     6944  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6945  (eval $ac_try) 2>&5
     6946  ac_status=$?
     6947  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6948  (exit $ac_status); }; }; then
     6949  ac_header_compiler=yes
     6950else
     6951  echo "$as_me: failed program was:" >&5
     6952sed 's/^/| /' conftest.$ac_ext >&5
     6953
     6954ac_header_compiler=no
     6955fi
     6956rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6957echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     6958echo "${ECHO_T}$ac_header_compiler" >&6
     6959
     6960# Is the header present?
     6961echo "$as_me:$LINENO: checking $ac_header presence" >&5
     6962echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
     6963cat >conftest.$ac_ext <<_ACEOF
     6964/* confdefs.h.  */
     6965_ACEOF
     6966cat confdefs.h >>conftest.$ac_ext
     6967cat >>conftest.$ac_ext <<_ACEOF
     6968/* end confdefs.h.  */
     6969#include <$ac_header>
     6970_ACEOF
     6971if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     6972  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     6973  ac_status=$?
     6974  grep -v '^ *+' conftest.er1 >conftest.err
     6975  rm -f conftest.er1
     6976  cat conftest.err >&5
     6977  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6978  (exit $ac_status); } >/dev/null; then
     6979  if test -s conftest.err; then
     6980    ac_cpp_err=$ac_c_preproc_warn_flag
     6981    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     6982  else
     6983    ac_cpp_err=
     6984  fi
     6985else
     6986  ac_cpp_err=yes
     6987fi
     6988if test -z "$ac_cpp_err"; then
     6989  ac_header_preproc=yes
     6990else
     6991  echo "$as_me: failed program was:" >&5
     6992sed 's/^/| /' conftest.$ac_ext >&5
     6993
     6994  ac_header_preproc=no
     6995fi
     6996rm -f conftest.err conftest.$ac_ext
     6997echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     6998echo "${ECHO_T}$ac_header_preproc" >&6
     6999
     7000# So?  What about this header?
     7001case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     7002  yes:no: )
     7003    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
     7004echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     7005    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
     7006echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     7007    ac_header_preproc=yes
     7008    ;;
     7009  no:yes:* )
     7010    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
     7011echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     7012    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
     7013echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
     7014    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
     7015echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
     7016    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
     7017echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     7018    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
     7019echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     7020    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
     7021echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     7022    (
     7023      cat <<\_ASBOX
     7024## ------------------------------------------- ##
     7025## Report this to orxonox-dev@mail.datacore.ch ##
     7026## ------------------------------------------- ##
     7027_ASBOX
     7028    ) |
     7029      sed "s/^/$as_me: WARNING:     /" >&2
     7030    ;;
     7031esac
     7032echo "$as_me:$LINENO: checking for $ac_header" >&5
     7033echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     7034if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7035  echo $ECHO_N "(cached) $ECHO_C" >&6
     7036else
     7037  eval "$as_ac_Header=\$ac_header_preproc"
     7038fi
     7039echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     7040echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     7041
     7042fi
     7043if test `eval echo '${'$as_ac_Header'}'` = yes; then
     7044  cat >>confdefs.h <<_ACEOF
     7045#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     7046_ACEOF
     7047
     7048fi
     7049
     7050done
     7051
     7052
     7053# Checks for typedefs, structures, and compiler characteristics.
     7054echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
     7055echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
     7056if test "${ac_cv_header_stdbool_h+set}" = set; then
     7057  echo $ECHO_N "(cached) $ECHO_C" >&6
     7058else
     7059  cat >conftest.$ac_ext <<_ACEOF
     7060/* confdefs.h.  */
     7061_ACEOF
     7062cat confdefs.h >>conftest.$ac_ext
     7063cat >>conftest.$ac_ext <<_ACEOF
     7064/* end confdefs.h.  */
     7065
     7066#include <stdbool.h>
     7067#ifndef bool
     7068# error bool is not defined
     7069#endif
     7070#ifndef false
     7071# error false is not defined
     7072#endif
     7073#if false
     7074# error false is not 0
     7075#endif
     7076#ifndef true
     7077# error true is not defined
     7078#endif
     7079#if true != 1
     7080# error true is not 1
     7081#endif
     7082#ifndef __bool_true_false_are_defined
     7083# error __bool_true_false_are_defined is not defined
     7084#endif
     7085
     7086        struct s { _Bool s: 1; _Bool t; } s;
     7087
     7088        char a[true == 1 ? 1 : -1];
     7089        char b[false == 0 ? 1 : -1];
     7090        char c[__bool_true_false_are_defined == 1 ? 1 : -1];
     7091        char d[(bool) -0.5 == true ? 1 : -1];
     7092        bool e = &s;
     7093        char f[(_Bool) -0.0 == false ? 1 : -1];
     7094        char g[true];
     7095        char h[sizeof (_Bool)];
     7096        char i[sizeof s.t];
     7097
     7098int
     7099main ()
     7100{
     7101 return !a + !b + !c + !d + !e + !f + !g + !h + !i;
     7102  ;
     7103  return 0;
     7104}
     7105_ACEOF
     7106rm -f conftest.$ac_objext
     7107if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7108  (eval $ac_compile) 2>conftest.er1
     7109  ac_status=$?
     7110  grep -v '^ *+' conftest.er1 >conftest.err
     7111  rm -f conftest.er1
     7112  cat conftest.err >&5
     7113  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7114  (exit $ac_status); } &&
     7115         { ac_try='test -z "$ac_c_werror_flag"
     7116                         || test ! -s conftest.err'
     7117  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7118  (eval $ac_try) 2>&5
     7119  ac_status=$?
     7120  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7121  (exit $ac_status); }; } &&
     7122         { ac_try='test -s conftest.$ac_objext'
     7123  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7124  (eval $ac_try) 2>&5
     7125  ac_status=$?
     7126  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7127  (exit $ac_status); }; }; then
     7128  ac_cv_header_stdbool_h=yes
     7129else
     7130  echo "$as_me: failed program was:" >&5
     7131sed 's/^/| /' conftest.$ac_ext >&5
     7132
     7133ac_cv_header_stdbool_h=no
     7134fi
     7135rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7136fi
     7137echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
     7138echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
     7139echo "$as_me:$LINENO: checking for _Bool" >&5
     7140echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
     7141if test "${ac_cv_type__Bool+set}" = set; then
     7142  echo $ECHO_N "(cached) $ECHO_C" >&6
     7143else
     7144  cat >conftest.$ac_ext <<_ACEOF
     7145/* confdefs.h.  */
     7146_ACEOF
     7147cat confdefs.h >>conftest.$ac_ext
     7148cat >>conftest.$ac_ext <<_ACEOF
     7149/* end confdefs.h.  */
     7150$ac_includes_default
     7151int
     7152main ()
     7153{
     7154if ((_Bool *) 0)
     7155  return 0;
     7156if (sizeof (_Bool))
     7157  return 0;
     7158  ;
     7159  return 0;
     7160}
     7161_ACEOF
     7162rm -f conftest.$ac_objext
     7163if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7164  (eval $ac_compile) 2>conftest.er1
     7165  ac_status=$?
     7166  grep -v '^ *+' conftest.er1 >conftest.err
     7167  rm -f conftest.er1
     7168  cat conftest.err >&5
     7169  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7170  (exit $ac_status); } &&
     7171         { ac_try='test -z "$ac_c_werror_flag"
     7172                         || test ! -s conftest.err'
     7173  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7174  (eval $ac_try) 2>&5
     7175  ac_status=$?
     7176  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7177  (exit $ac_status); }; } &&
     7178         { ac_try='test -s conftest.$ac_objext'
     7179  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7180  (eval $ac_try) 2>&5
     7181  ac_status=$?
     7182  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7183  (exit $ac_status); }; }; then
     7184  ac_cv_type__Bool=yes
     7185else
     7186  echo "$as_me: failed program was:" >&5
     7187sed 's/^/| /' conftest.$ac_ext >&5
     7188
     7189ac_cv_type__Bool=no
     7190fi
     7191rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7192fi
     7193echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
     7194echo "${ECHO_T}$ac_cv_type__Bool" >&6
     7195if test $ac_cv_type__Bool = yes; then
     7196
     7197cat >>confdefs.h <<_ACEOF
     7198#define HAVE__BOOL 1
     7199_ACEOF
     7200
     7201
     7202fi
     7203
     7204if test $ac_cv_header_stdbool_h = yes; then
     7205
     7206cat >>confdefs.h <<\_ACEOF
     7207#define HAVE_STDBOOL_H 1
     7208_ACEOF
     7209
     7210fi
     7211
     7212
     7213# Checks for library functions.
     7214
     7215for ac_header in stdlib.h
     7216do
     7217as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     7218if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7219  echo "$as_me:$LINENO: checking for $ac_header" >&5
     7220echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     7221if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7222  echo $ECHO_N "(cached) $ECHO_C" >&6
     7223fi
     7224echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     7225echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     7226else
     7227  # Is the header compilable?
     7228echo "$as_me:$LINENO: checking $ac_header usability" >&5
     7229echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
     7230cat >conftest.$ac_ext <<_ACEOF
     7231/* confdefs.h.  */
     7232_ACEOF
     7233cat confdefs.h >>conftest.$ac_ext
     7234cat >>conftest.$ac_ext <<_ACEOF
     7235/* end confdefs.h.  */
     7236$ac_includes_default
     7237#include <$ac_header>
     7238_ACEOF
     7239rm -f conftest.$ac_objext
     7240if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7241  (eval $ac_compile) 2>conftest.er1
     7242  ac_status=$?
     7243  grep -v '^ *+' conftest.er1 >conftest.err
     7244  rm -f conftest.er1
     7245  cat conftest.err >&5
     7246  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7247  (exit $ac_status); } &&
     7248         { ac_try='test -z "$ac_c_werror_flag"
     7249                         || test ! -s conftest.err'
     7250  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7251  (eval $ac_try) 2>&5
     7252  ac_status=$?
     7253  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7254  (exit $ac_status); }; } &&
     7255         { ac_try='test -s conftest.$ac_objext'
     7256  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7257  (eval $ac_try) 2>&5
     7258  ac_status=$?
     7259  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7260  (exit $ac_status); }; }; then
     7261  ac_header_compiler=yes
     7262else
     7263  echo "$as_me: failed program was:" >&5
     7264sed 's/^/| /' conftest.$ac_ext >&5
     7265
     7266ac_header_compiler=no
     7267fi
     7268rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7269echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     7270echo "${ECHO_T}$ac_header_compiler" >&6
     7271
     7272# Is the header present?
     7273echo "$as_me:$LINENO: checking $ac_header presence" >&5
     7274echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
     7275cat >conftest.$ac_ext <<_ACEOF
     7276/* confdefs.h.  */
     7277_ACEOF
     7278cat confdefs.h >>conftest.$ac_ext
     7279cat >>conftest.$ac_ext <<_ACEOF
     7280/* end confdefs.h.  */
     7281#include <$ac_header>
     7282_ACEOF
     7283if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     7284  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     7285  ac_status=$?
     7286  grep -v '^ *+' conftest.er1 >conftest.err
     7287  rm -f conftest.er1
     7288  cat conftest.err >&5
     7289  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7290  (exit $ac_status); } >/dev/null; then
     7291  if test -s conftest.err; then
     7292    ac_cpp_err=$ac_c_preproc_warn_flag
     7293    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     7294  else
     7295    ac_cpp_err=
     7296  fi
     7297else
     7298  ac_cpp_err=yes
     7299fi
     7300if test -z "$ac_cpp_err"; then
     7301  ac_header_preproc=yes
     7302else
     7303  echo "$as_me: failed program was:" >&5
     7304sed 's/^/| /' conftest.$ac_ext >&5
     7305
     7306  ac_header_preproc=no
     7307fi
     7308rm -f conftest.err conftest.$ac_ext
     7309echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     7310echo "${ECHO_T}$ac_header_preproc" >&6
     7311
     7312# So?  What about this header?
     7313case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     7314  yes:no: )
     7315    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
     7316echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     7317    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
     7318echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     7319    ac_header_preproc=yes
     7320    ;;
     7321  no:yes:* )
     7322    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
     7323echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     7324    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
     7325echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
     7326    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
     7327echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
     7328    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
     7329echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     7330    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
     7331echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     7332    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
     7333echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     7334    (
     7335      cat <<\_ASBOX
     7336## ------------------------------------------- ##
     7337## Report this to orxonox-dev@mail.datacore.ch ##
     7338## ------------------------------------------- ##
     7339_ASBOX
     7340    ) |
     7341      sed "s/^/$as_me: WARNING:     /" >&2
     7342    ;;
     7343esac
     7344echo "$as_me:$LINENO: checking for $ac_header" >&5
     7345echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     7346if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7347  echo $ECHO_N "(cached) $ECHO_C" >&6
     7348else
     7349  eval "$as_ac_Header=\$ac_header_preproc"
     7350fi
     7351echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     7352echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     7353
     7354fi
     7355if test `eval echo '${'$as_ac_Header'}'` = yes; then
     7356  cat >>confdefs.h <<_ACEOF
     7357#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     7358_ACEOF
    66777359
    66787360fi
     
    68657547
    68667548
    6867                                                   ac_config_files="$ac_config_files Makefile console/Makefile gui/Makefile src/Makefile importer/Makefile"
     7549                                                  ac_config_files="$ac_config_files Makefile src/console/Makefile src/gui/Makefile src/Makefile src/importer/Makefile"
    68687550
    68697551cat >confcache <<\_ACEOF
     
    69767658Usually this means the macro was only invoked conditionally." >&5
    69777659echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
     7660Usually this means the macro was only invoked conditionally." >&2;}
     7661   { (exit 1); exit 1; }; }
     7662fi
     7663if test -z "${DOXYGEN_TRUE}" && test -z "${DOXYGEN_FALSE}"; then
     7664  { { echo "$as_me:$LINENO: error: conditional \"DOXYGEN\" was never defined.
     7665Usually this means the macro was only invoked conditionally." >&5
     7666echo "$as_me: error: conditional \"DOXYGEN\" was never defined.
    69787667Usually this means the macro was only invoked conditionally." >&2;}
    69797668   { (exit 1); exit 1; }; }
     
    72577946cat >&5 <<_CSEOF
    72587947
    7259 This file was extended by orxonox $as_me 0.1-pre-alpha, which was
     7948This file was extended by orxonox $as_me 0.2.0_alpha-r1, which was
    72607949generated by GNU Autoconf 2.59.  Invocation command line was
    72617950
     
    73208009cat >>$CONFIG_STATUS <<_ACEOF
    73218010ac_cs_version="\\
    7322 orxonox config.status 0.1-pre-alpha
     8011orxonox config.status 0.2.0_alpha-r1
    73238012configured by $0, generated by GNU Autoconf 2.59,
    73248013  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
     
    74318120  # Handling of arguments.
    74328121  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
    7433   "console/Makefile" ) CONFIG_FILES="$CONFIG_FILES console/Makefile" ;;
    7434   "gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES gui/Makefile" ;;
     8122  "src/console/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/console/Makefile" ;;
     8123  "src/gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/gui/Makefile" ;;
    74358124  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
    7436   "importer/Makefile" ) CONFIG_FILES="$CONFIG_FILES importer/Makefile" ;;
     8125  "src/importer/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/importer/Makefile" ;;
    74378126  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
    74388127  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     
    75788267s,@CPP@,$CPP,;t t
    75798268s,@EGREP@,$EGREP,;t t
     8269s,@DEBUG@,$DEBUG,;t t
     8270s,@DOXYGEN@,$DOXYGEN,;t t
     8271s,@DOXYGEN_TRUE@,$DOXYGEN_TRUE,;t t
     8272s,@DOXYGEN_FALSE@,$DOXYGEN_FALSE,;t t
    75808273s,@MSBITFIELDS@,$MSBITFIELDS,;t t
    7581 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
     8274s,@GTK2_LIBS@,$GTK2_LIBS,;t t
    75828275s,@GTK2_CFLAGS@,$GTK2_CFLAGS,;t t
    7583 s,@GTK2_LIBS@,$GTK2_LIBS,;t t
    75848276s,@HAVE_GTK2_TRUE@,$HAVE_GTK2_TRUE,;t t
    75858277s,@HAVE_GTK2_FALSE@,$HAVE_GTK2_FALSE,;t t
  • orxonox/branches/nico/configure.ac

    r3001 r3238  
    22# Process this file with autoconf to produce a configure script.
    33
    4 #AC_PREREQ(2.56)
    5 AC_INIT(orxonox, 0.1-pre-alpha, orxonox-dev@mail.datacore.ch)
     4AC_PREREQ(2.56)
     5AC_INIT(orxonox, 0.2.0_alpha-r1, orxonox-dev@mail.datacore.ch)
    66
    77# Detect the canonical host and target build environment.
     
    2020AC_PROG_CXX
    2121AC_HEADER_STDC
     22
     23### CHECKING  OPTIONAT ARGUMENTS
     24## DEBUG-statement
     25DEBUG=no
     26AC_MSG_CHECKING([if DEBUG-mode should be enabled])
     27AC_ARG_ENABLE([debug],
     28        AC_HELP_STRING( [--enable-debug], [compiles in debug mode. Lots of debug info about the game.]),
     29         DEBUG=$enableval)
     30
     31if test "$DEBUG" = "no"; then
     32        echo "no"
     33        echo " -> Setting debuglevel to 1. Like this you can still see errors."
     34        DEBUG=1
     35elif test "$DEBUG" = yes; then
     36        echo "yes"
     37        echo " -> Setting debuglevel to 3. HARD DEBUG MODE!!."
     38        DEBUG=3
     39else       
     40        echo "yes set to $DEBUG"
     41fi
     42        AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are])
     43
     44AC_SUBST(DEBUG)
     45
     46## GTK-disabled
     47AC_MSG_CHECKING([if gtk should be enabled])
     48AC_ARG_WITH([gtk],
     49        AC_HELP_STRING( [--without-gtk],
     50        [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
     51if test "$def_gtk" = yes; then
     52  echo "yes"
     53fi
     54if test "$def_gtk" = no; then
     55  echo "no"
     56fi
     57### SDL_image-disable
     58def_sdl_image=yes
     59AC_MSG_CHECKING([if SDL_image should be enabled])
     60AC_ARG_WITH([sdl_image],
     61        AC_HELP_STRING( [--without-sdl-image],
     62        [Prevents SDL_image from being loaded]), [def_sdl_image=no])
     63if test "$def_sdl_image" = yes; then
     64  echo "yes"
     65fi
     66if test "$def_sdl_image" = no; then
     67  echo "no"
     68fi
     69
     70
     71## PROGRAMM CHECKING
     72# checking for Doxygen
     73AC_PATH_PROG(DOXYGEN, doxygen)
     74AM_CONDITIONAL(DOXYGEN, test $DOXYGEN)
    2275
    2376### CHECKING FOR SYSTEM ###
     
    99152    fi
    100153
    101 
    102154    ;;
    103155
     
    108160 Linux="yes"
    109161
     162CPPFLAGS="-I/usr/X11R6/include"
     163LDFLAGS="-L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
    110164# checking gl header
    111165   AC_CHECK_HEADERS(GL/gl.h ,,
     
    143197      [AC_MSG_ERROR([cannot find SDL headers]) ])
    144198
    145 # checking for SDL-libs
     199# checking for SDL-lib
    146200    AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
    147201     if test "$FOUND_SDL" = "yes" ; then
     
    154208        exit -1
    155209     fi   
     210
    156211
    157212## checking for SDL
     
    171226 osX="yes"
    172227
     228 CPPFLAGS="-I/sw/include $CPPFLAGS"
    173229# checking gl header
    174230   AC_CHECK_HEADERS(OpenGL/gl.h ,,
     
    195251       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
    196252       LIBS="$LIBS $SDL_LIBS"
     253
    197254    ;;
    198255
     
    203260AC_SUBST(MSBITFIELDS)
    204261
    205 
    206 
     262## check for SDL_Image
     263if test "$def_sdl_image" = "yes"; then
     264# checking for SDL_image-headers
     265  AC_CHECK_HEADERS(SDL/SDL_image.h ,,
     266      [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
     267fi
     268if test "$def_sdl_image" = "yes"; then
     269# checking for SDL_image-lib
     270  AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
     271     if test "$FOUND_SDL_image" = "yes" ; then
     272       LIBS="$LIBS -lSDL_image"
     273     else
     274        echo "------------------"
     275        echo "SDL_image library not found."
     276        echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
     277        echo "------------------"
     278        exit -1
     279     fi   
     280fi
     281
     282
     283if test "$def_sdl_image" = "no"; then
     284 ## checking for libjpeg
     285 AC_CHECK_HEADERS(jpeglib.h ,jpegHeader="yes",
     286        jpegHeader="no")
     287 if test $jpegHeader = "no"; then
     288        echo " not including jpeg."
     289 else
     290  AC_CHECK_LIB([jpeg], [main], FOUND_jpeg=yes)
     291    if test "$FOUND_jpeg" = "yes" ; then
     292      LIBS="$LIBS -ljpeg"
     293    else
     294         echo "------------------"
     295         echo "jpeg library not found."
     296         echo "please install the jpeg library from the Independent JPEG Group, which can be found at http://www.ijg.org"
     297         echo "------------------"
     298         exit -1
     299    fi   
     300 fi
     301
     302 ## checking for libpng
     303 AC_CHECK_HEADERS(png.h ,pngHeader="yes",
     304        pngHeader="no")
     305 if test $pngHeader = "no"; then
     306        echo " not including png."
     307 else
     308  AC_CHECK_LIB([png], [main], FOUND_png=yes)
     309    if test "$FOUND_png" = "yes" ; then
     310      LIBS="$LIBS -lpng"
     311    else
     312         echo "------------------"
     313         echo "png library not found."
     314         echo "please install the png library, which can be found at http://libpng.org/pub/png/libpng.html"
     315         echo "------------------"
     316         exit -1
     317    fi
     318 fi   
     319fi
    207320
    208321## checking for GTK
    209 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
     322if test "$def_gtk" = yes; then
     323
     324        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
     325        AC_MSG_CHECKING([for gtk2.0])
     326        if `pkg-config --exists gtk+-2.0`; then
     327                echo "yes"
     328                have_gtk2=yes
     329                GTK2_LIBS=`pkg-config --libs gtk+-2.0`
     330                GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0`
     331                AC_DEFINE_UNQUOTED(HAVE_GTK2, 1, [if we have GTK2])
     332        else
     333                echo "no"
     334        fi
     335
     336fi
    210337AC_SUBST(GTK2_LIBS)
    211338AC_SUBST(GTK2_CFLAGS)
    212 AM_CONDITIONAL(HAVE_GTK2, test "x$have_gtk2" = xyes)
     339AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
     340
    213341
    214342
    215343#checking for pthread libs
    216  AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
    217  if test "$FOUND_pthread" = "yes" ; then
    218     LIBS="$LIBS -lpthread"
    219  fi
     344# AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
     345# if test "$FOUND_pthread" = "yes" ; then
     346#    LIBS="$LIBS -lpthread"
     347# fi
    220348
    221349
     
    223351 AC_CHECK_LIB([m], [main])
    224352
    225 
     353 
    226354# Checks for header files.
    227355AC_HEADER_STDC
     
    236364
    237365AC_CONFIG_FILES([Makefile
    238                  console/Makefile
    239                  gui/Makefile
     366                 src/console/Makefile
     367                 src/gui/Makefile
    240368                 src/Makefile
    241                  importer/Makefile])
     369                 src/importer/Makefile])
    242370AC_OUTPUT
  • orxonox/branches/nico/src/Makefile.am

    r2990 r3238  
    1 AM_CXXFLAGS="-I/usr/X11R6/include"
    2 AM_LDFLAGS="-L/usr/Mesa-6.0.1/lib  -L/usr/X11R6/lib -lXt -lX11" $(MWINDOWS)
     1#AM_CXXFLAGS=""
     2AM_LDFLAGS= $(MWINDOWS)
    33
    44#"-O3 -pedantic -fPIC -ffast-math -I/usr/X11R6/include"
     
    77bin_PROGRAMS=orxonox
    88
    9 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 object.cc environment.cc array.cc material.cc list.cc
    10 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 object.h array.h material.h list_template.h story_entity.h story_def.h game_loader.h campaign.h
     9orxonox_SOURCES= orxonox.cc \
     10                 world.cc \
     11                 player.cc \
     12                 collision.cc \
     13                 data_tank.cc \
     14                 world_entity.cc \
     15                 vector.cc \
     16                 camera.cc \
     17                 command_node.cc \
     18                 ini_parser.cc \
     19                 keynames.cc \
     20                 track.cc \
     21                 base_entity.cc \
     22                 game_loader.cc \
     23                 campaign.cc \
     24                 story_entity.cc \
     25                 environment.cc \
     26                 importer/object.cc \
     27                 importer/array.cc \
     28                 importer/material.cc \
     29                 list.cc
    1130
     31noinst_HEADERS = ability.h \
     32                 data_tank.h \
     33                 collision.h \
     34                 npc.h \
     35                 stdincl.h \
     36                 ai.h \
     37                 environment.h \
     38                 orxonox.h \
     39                 synchronisable.h \
     40                 base_entity.h \
     41                 error.h \
     42                 player.h \
     43                 track.h \
     44                 camera.h \
     45                 ini_parser.h \
     46                 power_up.h \
     47                 vector.h \
     48                 keynames.h \
     49                 proto_class.h \
     50                 world.h \
     51                 command_node.h \
     52                 list.h \
     53                 shoot_laser.h \
     54                 world_entity.h \
     55                 coordinates.h \
     56                 message_structures.h \
     57                 shoot_rocket.h \
     58                 list_template.h \
     59                 story_entity.h \
     60                 story_def.h \
     61                 game_loader.h \
     62                 campaign.h
    1263
     64## orxonox.conf will be used from home-dir instead.
     65EXTRA_DIST = orxonox.conf
    1366
    14 #  uncomment the following if bencoder requires the math library
     67### GTK_RELATED
     68if HAVE_GTK2
     69  GTK_PROGS =console
     70else
     71  GTK_PROGS =
     72endif
     73
     74SUBDIRS = . \
     75          importer \
     76          gui \
     77          $(GTK_PROGS)
     78
     79#  uncomment the following if orxonox requires the math library
    1580#orxonox_LDADD=-lm
    1681
  • orxonox/branches/nico/src/Makefile.in

    r2991 r3238  
    5454PROGRAMS = $(bin_PROGRAMS)
    5555am_orxonox_OBJECTS = orxonox.$(OBJEXT) world.$(OBJEXT) \
    56         player.$(OBJEXT) data_tank.$(OBJEXT) world_entity.$(OBJEXT) \
    57         vector.$(OBJEXT) camera.$(OBJEXT) collision.$(OBJEXT) \
     56        player.$(OBJEXT) collision.$(OBJEXT) data_tank.$(OBJEXT) \
     57        world_entity.$(OBJEXT) vector.$(OBJEXT) camera.$(OBJEXT) \
    5858        command_node.$(OBJEXT) ini_parser.$(OBJEXT) keynames.$(OBJEXT) \
    5959        track.$(OBJEXT) base_entity.$(OBJEXT) game_loader.$(OBJEXT) \
    60         campaign.$(OBJEXT) story_entity.$(OBJEXT) object.$(OBJEXT) \
    61         environment.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT) \
    62         list.$(OBJEXT)
     60        campaign.$(OBJEXT) story_entity.$(OBJEXT) \
     61        environment.$(OBJEXT) object.$(OBJEXT) array.$(OBJEXT) \
     62        material.$(OBJEXT) list.$(OBJEXT)
    6363orxonox_OBJECTS = $(am_orxonox_OBJECTS)
    6464orxonox_LDADD = $(LDADD)
     
    8686SOURCES = $(orxonox_SOURCES)
    8787DIST_SOURCES = $(orxonox_SOURCES)
     88RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
     89        html-recursive info-recursive install-data-recursive \
     90        install-exec-recursive install-info-recursive \
     91        install-recursive installcheck-recursive installdirs-recursive \
     92        pdf-recursive ps-recursive uninstall-info-recursive \
     93        uninstall-recursive
    8894HEADERS = $(noinst_HEADERS)
    8995ETAGS = etags
    9096CTAGS = ctags
     97DIST_SUBDIRS = . importer gui console
    9198DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    9299ACLOCAL = @ACLOCAL@
     
    107114CXXFLAGS = @CXXFLAGS@
    108115CYGPATH_W = @CYGPATH_W@
     116DEBUG = @DEBUG@
    109117DEFS = @DEFS@
    110118DEPDIR = @DEPDIR@
     119DOXYGEN = @DOXYGEN@
     120DOXYGEN_FALSE = @DOXYGEN_FALSE@
     121DOXYGEN_TRUE = @DOXYGEN_TRUE@
    111122ECHO_C = @ECHO_C@
    112123ECHO_N = @ECHO_N@
     
    136147PACKAGE_VERSION = @PACKAGE_VERSION@
    137148PATH_SEPARATOR = @PATH_SEPARATOR@
    138 PKG_CONFIG = @PKG_CONFIG@
    139149SET_MAKE = @SET_MAKE@
    140150SHELL = @SHELL@
     
    183193target_os = @target_os@
    184194target_vendor = @target_vendor@
    185 AM_CXXFLAGS = "-I/usr/X11R6/include"
    186 AM_LDFLAGS = "-L/usr/Mesa-6.0.1/lib  -L/usr/X11R6/lib -lXt -lX11" $(MWINDOWS)
    187 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 object.cc environment.cc array.cc material.cc list.cc
    188 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 object.h array.h material.h list_template.h story_entity.h story_def.h game_loader.h campaign.h
    189 all: all-am
     195
     196#AM_CXXFLAGS=""
     197AM_LDFLAGS = $(MWINDOWS)
     198orxonox_SOURCES = orxonox.cc \
     199                 world.cc \
     200                 player.cc \
     201                 collision.cc \
     202                 data_tank.cc \
     203                 world_entity.cc \
     204                 vector.cc \
     205                 camera.cc \
     206                 command_node.cc \
     207                 ini_parser.cc \
     208                 keynames.cc \
     209                 track.cc \
     210                 base_entity.cc \
     211                 game_loader.cc \
     212                 campaign.cc \
     213                 story_entity.cc \
     214                 environment.cc \
     215                 importer/object.cc \
     216                 importer/array.cc \
     217                 importer/material.cc \
     218                 list.cc
     219
     220noinst_HEADERS = ability.h \
     221                 data_tank.h \
     222                 collision.h \
     223                 npc.h \
     224                 stdincl.h \
     225                 ai.h \
     226                 environment.h \
     227                 orxonox.h \
     228                 synchronisable.h \
     229                 base_entity.h \
     230                 error.h \
     231                 player.h \
     232                 track.h \
     233                 camera.h \
     234                 ini_parser.h \
     235                 power_up.h \
     236                 vector.h \
     237                 keynames.h \
     238                 proto_class.h \
     239                 world.h \
     240                 command_node.h \
     241                 list.h \
     242                 shoot_laser.h \
     243                 world_entity.h \
     244                 coordinates.h \
     245                 message_structures.h \
     246                 shoot_rocket.h \
     247                 list_template.h \
     248                 story_entity.h \
     249                 story_def.h \
     250                 game_loader.h \
     251                 campaign.h
     252
     253EXTRA_DIST = orxonox.conf
     254@HAVE_GTK2_FALSE@GTK_PROGS =
     255
     256### GTK_RELATED
     257@HAVE_GTK2_TRUE@GTK_PROGS = console
     258SUBDIRS = . \
     259          importer \
     260          gui \
     261          $(GTK_PROGS)
     262
     263all: all-recursive
    190264
    191265.SUFFIXES:
     
    200274          esac; \
    201275        done; \
    202         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
     276        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
    203277        cd $(top_srcdir) && \
    204           $(AUTOMAKE) --gnu  src/Makefile
     278          $(AUTOMAKE) --foreign  src/Makefile
    205279.PRECIOUS: Makefile
    206280Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     
    290364@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    291365@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     366
     367object.o: importer/object.cc
     368@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT object.o -MD -MP -MF "$(DEPDIR)/object.Tpo" -c -o object.o `test -f 'importer/object.cc' || echo '$(srcdir)/'`importer/object.cc; \
     369@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/object.Tpo" "$(DEPDIR)/object.Po"; else rm -f "$(DEPDIR)/object.Tpo"; exit 1; fi
     370@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='importer/object.cc' object='object.o' libtool=no @AMDEPBACKSLASH@
     371@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/object.Po' tmpdepfile='$(DEPDIR)/object.TPo' @AMDEPBACKSLASH@
     372@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     373@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o object.o `test -f 'importer/object.cc' || echo '$(srcdir)/'`importer/object.cc
     374
     375object.obj: importer/object.cc
     376@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT object.obj -MD -MP -MF "$(DEPDIR)/object.Tpo" -c -o object.obj `if test -f 'importer/object.cc'; then $(CYGPATH_W) 'importer/object.cc'; else $(CYGPATH_W) '$(srcdir)/importer/object.cc'; fi`; \
     377@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/object.Tpo" "$(DEPDIR)/object.Po"; else rm -f "$(DEPDIR)/object.Tpo"; exit 1; fi
     378@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='importer/object.cc' object='object.obj' libtool=no @AMDEPBACKSLASH@
     379@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/object.Po' tmpdepfile='$(DEPDIR)/object.TPo' @AMDEPBACKSLASH@
     380@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     381@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o object.obj `if test -f 'importer/object.cc'; then $(CYGPATH_W) 'importer/object.cc'; else $(CYGPATH_W) '$(srcdir)/importer/object.cc'; fi`
     382
     383array.o: importer/array.cc
     384@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT array.o -MD -MP -MF "$(DEPDIR)/array.Tpo" -c -o array.o `test -f 'importer/array.cc' || echo '$(srcdir)/'`importer/array.cc; \
     385@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/array.Tpo" "$(DEPDIR)/array.Po"; else rm -f "$(DEPDIR)/array.Tpo"; exit 1; fi
     386@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='importer/array.cc' object='array.o' libtool=no @AMDEPBACKSLASH@
     387@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/array.Po' tmpdepfile='$(DEPDIR)/array.TPo' @AMDEPBACKSLASH@
     388@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     389@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o array.o `test -f 'importer/array.cc' || echo '$(srcdir)/'`importer/array.cc
     390
     391array.obj: importer/array.cc
     392@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT array.obj -MD -MP -MF "$(DEPDIR)/array.Tpo" -c -o array.obj `if test -f 'importer/array.cc'; then $(CYGPATH_W) 'importer/array.cc'; else $(CYGPATH_W) '$(srcdir)/importer/array.cc'; fi`; \
     393@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/array.Tpo" "$(DEPDIR)/array.Po"; else rm -f "$(DEPDIR)/array.Tpo"; exit 1; fi
     394@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='importer/array.cc' object='array.obj' libtool=no @AMDEPBACKSLASH@
     395@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/array.Po' tmpdepfile='$(DEPDIR)/array.TPo' @AMDEPBACKSLASH@
     396@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     397@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o array.obj `if test -f 'importer/array.cc'; then $(CYGPATH_W) 'importer/array.cc'; else $(CYGPATH_W) '$(srcdir)/importer/array.cc'; fi`
     398
     399material.o: importer/material.cc
     400@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT material.o -MD -MP -MF "$(DEPDIR)/material.Tpo" -c -o material.o `test -f 'importer/material.cc' || echo '$(srcdir)/'`importer/material.cc; \
     401@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/material.Tpo" "$(DEPDIR)/material.Po"; else rm -f "$(DEPDIR)/material.Tpo"; exit 1; fi
     402@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='importer/material.cc' object='material.o' libtool=no @AMDEPBACKSLASH@
     403@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/material.Po' tmpdepfile='$(DEPDIR)/material.TPo' @AMDEPBACKSLASH@
     404@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     405@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o material.o `test -f 'importer/material.cc' || echo '$(srcdir)/'`importer/material.cc
     406
     407material.obj: importer/material.cc
     408@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT material.obj -MD -MP -MF "$(DEPDIR)/material.Tpo" -c -o material.obj `if test -f 'importer/material.cc'; then $(CYGPATH_W) 'importer/material.cc'; else $(CYGPATH_W) '$(srcdir)/importer/material.cc'; fi`; \
     409@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/material.Tpo" "$(DEPDIR)/material.Po"; else rm -f "$(DEPDIR)/material.Tpo"; exit 1; fi
     410@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='importer/material.cc' object='material.obj' libtool=no @AMDEPBACKSLASH@
     411@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/material.Po' tmpdepfile='$(DEPDIR)/material.TPo' @AMDEPBACKSLASH@
     412@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     413@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o material.obj `if test -f 'importer/material.cc'; then $(CYGPATH_W) 'importer/material.cc'; else $(CYGPATH_W) '$(srcdir)/importer/material.cc'; fi`
    292414uninstall-info-am:
     415
     416# This directory's subdirectories are mostly independent; you can cd
     417# into them and run `make' without going through this Makefile.
     418# To change the values of `make' variables: instead of editing Makefiles,
     419# (1) if the variable is set in `config.status', edit `config.status'
     420#     (which will cause the Makefiles to be regenerated when you run `make');
     421# (2) otherwise, pass the desired values on the `make' command line.
     422$(RECURSIVE_TARGETS):
     423        @set fnord $$MAKEFLAGS; amf=$$2; \
     424        dot_seen=no; \
     425        target=`echo $@ | sed s/-recursive//`; \
     426        list='$(SUBDIRS)'; for subdir in $$list; do \
     427          echo "Making $$target in $$subdir"; \
     428          if test "$$subdir" = "."; then \
     429            dot_seen=yes; \
     430            local_target="$$target-am"; \
     431          else \
     432            local_target="$$target"; \
     433          fi; \
     434          (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
     435           || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
     436        done; \
     437        if test "$$dot_seen" = "no"; then \
     438          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
     439        fi; test -z "$$fail"
     440
     441mostlyclean-recursive clean-recursive distclean-recursive \
     442maintainer-clean-recursive:
     443        @set fnord $$MAKEFLAGS; amf=$$2; \
     444        dot_seen=no; \
     445        case "$@" in \
     446          distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
     447          *) list='$(SUBDIRS)' ;; \
     448        esac; \
     449        rev=''; for subdir in $$list; do \
     450          if test "$$subdir" = "."; then :; else \
     451            rev="$$subdir $$rev"; \
     452          fi; \
     453        done; \
     454        rev="$$rev ."; \
     455        target=`echo $@ | sed s/-recursive//`; \
     456        for subdir in $$rev; do \
     457          echo "Making $$target in $$subdir"; \
     458          if test "$$subdir" = "."; then \
     459            local_target="$$target-am"; \
     460          else \
     461            local_target="$$target"; \
     462          fi; \
     463          (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
     464           || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
     465        done && test -z "$$fail"
     466tags-recursive:
     467        list='$(SUBDIRS)'; for subdir in $$list; do \
     468          test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
     469        done
     470ctags-recursive:
     471        list='$(SUBDIRS)'; for subdir in $$list; do \
     472          test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
     473        done
    293474
    294475ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
     
    302483tags: TAGS
    303484
    304 TAGS: $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
     485TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
    305486                $(TAGS_FILES) $(LISP)
    306487        tags=; \
    307488        here=`pwd`; \
     489        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
     490          include_option=--etags-include; \
     491          empty_fix=.; \
     492        else \
     493          include_option=--include; \
     494          empty_fix=; \
     495        fi; \
     496        list='$(SUBDIRS)'; for subdir in $$list; do \
     497          if test "$$subdir" = .; then :; else \
     498            test ! -f $$subdir/TAGS || \
     499              tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
     500          fi; \
     501        done; \
    308502        list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
    309503        unique=`for i in $$list; do \
     
    318512        fi
    319513ctags: CTAGS
    320 CTAGS: $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
     514CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
    321515                $(TAGS_FILES) $(LISP)
    322516        tags=; \
     
    367561          fi; \
    368562        done
     563        list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
     564          if test "$$subdir" = .; then :; else \
     565            test -d "$(distdir)/$$subdir" \
     566            || mkdir "$(distdir)/$$subdir" \
     567            || exit 1; \
     568            (cd $$subdir && \
     569              $(MAKE) $(AM_MAKEFLAGS) \
     570                top_distdir="../$(top_distdir)" \
     571                distdir="../$(distdir)/$$subdir" \
     572                distdir) \
     573              || exit 1; \
     574          fi; \
     575        done
    369576check-am: all-am
    370 check: check-am
     577check: check-recursive
    371578all-am: Makefile $(PROGRAMS) $(HEADERS)
    372 installdirs:
     579installdirs: installdirs-recursive
     580installdirs-am:
    373581        for dir in "$(DESTDIR)$(bindir)"; do \
    374582          test -z "$$dir" || $(mkdir_p) "$$dir"; \
    375583        done
    376 install: install-am
    377 install-exec: install-exec-am
    378 install-data: install-data-am
    379 uninstall: uninstall-am
     584install: install-recursive
     585install-exec: install-exec-recursive
     586install-data: install-data-recursive
     587uninstall: uninstall-recursive
    380588
    381589install-am: all-am
    382590        @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
    383591
    384 installcheck: installcheck-am
     592installcheck: installcheck-recursive
    385593install-strip:
    386594        $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
     
    398606        @echo "This command is intended for maintainers to use"
    399607        @echo "it deletes files that may require special tools to rebuild."
    400 clean: clean-am
     608clean: clean-recursive
    401609
    402610clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
    403611
    404 distclean: distclean-am
     612distclean: distclean-recursive
    405613        -rm -rf ./$(DEPDIR)
    406614        -rm -f Makefile
     
    408616        distclean-tags
    409617
    410 dvi: dvi-am
     618dvi: dvi-recursive
    411619
    412620dvi-am:
    413621
    414 html: html-am
    415 
    416 info: info-am
     622html: html-recursive
     623
     624info: info-recursive
    417625
    418626info-am:
     
    422630install-exec-am: install-binPROGRAMS
    423631
    424 install-info: install-info-am
     632install-info: install-info-recursive
    425633
    426634install-man:
     
    428636installcheck-am:
    429637
    430 maintainer-clean: maintainer-clean-am
     638maintainer-clean: maintainer-clean-recursive
    431639        -rm -rf ./$(DEPDIR)
    432640        -rm -f Makefile
    433641maintainer-clean-am: distclean-am maintainer-clean-generic
    434642
    435 mostlyclean: mostlyclean-am
     643mostlyclean: mostlyclean-recursive
    436644
    437645mostlyclean-am: mostlyclean-compile mostlyclean-generic
    438646
    439 pdf: pdf-am
     647pdf: pdf-recursive
    440648
    441649pdf-am:
    442650
    443 ps: ps-am
     651ps: ps-recursive
    444652
    445653ps-am:
     
    447655uninstall-am: uninstall-binPROGRAMS uninstall-info-am
    448656
    449 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
    450         clean-generic ctags distclean distclean-compile \
    451         distclean-generic distclean-tags distdir dvi dvi-am html \
     657uninstall-info: uninstall-info-recursive
     658
     659.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
     660        clean clean-binPROGRAMS clean-generic clean-recursive ctags \
     661        ctags-recursive distclean distclean-compile distclean-generic \
     662        distclean-recursive distclean-tags distdir dvi dvi-am html \
    452663        html-am info info-am install install-am install-binPROGRAMS \
    453664        install-data install-data-am install-exec install-exec-am \
    454665        install-info install-info-am install-man install-strip \
    455         installcheck installcheck-am installdirs maintainer-clean \
    456         maintainer-clean-generic mostlyclean mostlyclean-compile \
    457         mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
    458         uninstall-am uninstall-binPROGRAMS uninstall-info-am
    459 
    460 
    461 #  uncomment the following if bencoder requires the math library
     666        installcheck installcheck-am installdirs installdirs-am \
     667        maintainer-clean maintainer-clean-generic \
     668        maintainer-clean-recursive mostlyclean mostlyclean-compile \
     669        mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \
     670        tags tags-recursive uninstall uninstall-am \
     671        uninstall-binPROGRAMS uninstall-info-am
     672
     673
     674#  uncomment the following if orxonox requires the math library
    462675#orxonox_LDADD=-lm
    463676
  • orxonox/branches/nico/src/ability.h

    r2043 r3238  
    11
    2 #ifndef ABILITY_H
    3 #define ABILITY_H
     2#ifndef _ABILITY_H
     3#define _ABILITY_H
    44
    55#include "data_tank.h"
     
    1414};
    1515
    16 #endif
     16#endif /* _ABILITY_H */
  • orxonox/branches/nico/src/ai.h

    r1956 r3238  
    11
    2 #ifndef AI_H
    3 #define AI_H
     2#ifndef _AI_H
     3#define _AI_H
    44
    55#include "data_tank.h"
     
    1313};
    1414
    15 #endif
     15#endif /* _AI_H */
  • orxonox/branches/nico/src/base_entity.h

    r2551 r3238  
    11
    2 #ifndef BASE_ENTITY_H
    3 #define BASE_ENTITY_H
     2#ifndef _BASE_ENTITY_H
     3#define _BASE_ENTITY_H
    44
    55#include "stdincl.h"
     
    1414};
    1515
    16 #endif
     16#endif /* _BASE_ENTITY_H */
  • orxonox/branches/nico/src/camera.cc

    r2636 r3238  
    3030{
    3131  this->world = world;
    32   bound = NULL;
     32  this->bound = NULL;
    3333  /* give it some physical live */
    34   m = 10;
    35   a = new Vector(0.0, 0.0, 0.0);
    36   v = new Vector(0.0, 0.0, 0.0);
    37   fs = new Vector(0.0, 0.0, 0.0);
    38   cameraMode = NORMAL;
    39   deltaTime = 3000.0;
    40   cameraOffset = 1.0;
    41   cameraOffsetZ = 10.0;
    42   t = 0.0;
    43 
    44   actual_place.r.x = 0.0;
    45   actual_place.r.y = 10.0;
    46   actual_place.r.z = -5.0;
     34  this->m = 10;
     35  this->a = new Vector(0.0, 0.0, 0.0);
     36  this->v = new Vector(0.0, 0.0, 0.0);
     37  this->fs = new Vector(0.0, 0.0, 0.0);
     38  this->cameraMode = NORMAL;
     39  this->deltaTime = 3000.0;
     40  this->cameraOffset = 1.0;
     41  this->cameraOffsetZ = 10.0;
     42  this->t = 0.0;
     43
     44  this->actualPlace.r.x = 0.0;
     45  this->actualPlace.r.y = 10.0;
     46  this->actualPlace.r.z = -5.0;
    4747}
    4848
     
    6161   as smooth camera movement or swaying).
    6262*/
    63 void Camera::time_slice (Uint32 deltaT)
    64 {
    65   if(t <= deltaTime)
    66     {t += deltaT;}
     63void Camera::timeSlice (Uint32 deltaT)
     64{
     65  if( this->t <= deltaTime)
     66    {this->t += deltaT;}
    6767  //printf("time is: t=%f\n", t );
    68   update_desired_place ();
    69   jump (NULL);
     68  updateDesiredPlace();
     69  jump(NULL);
    7070}
    7171
     
    7676   bound entity's position on the track.
    7777*/
    78 void Camera::update_desired_place ()
     78void Camera::updateDesiredPlace ()
    7979{
    8080  switch(cameraMode)
     
    8989        if( bound != NULL)
    9090          {
    91             bound->get_lookat (&lookat);
    92             orx->get_world()->calc_camera_pos (&lookat, &plFocus);
     91            bound->getLookat (&lookat);
     92            orx->getWorld()->calcCameraPos (&lookat, &plFocus);
    9393            Quaternion *fr;
    9494            if(t < 20.0)
     
    101101               
    102102                Vector op(1.0, 0.0, 0.0);
    103                 float angle = angle_deg(op, *start);
     103                float angle = angleDeg(op, *start);
    104104                printf("angle is: %f\n", angle);
    105105
     
    144144
    145145            Vector ursp(0.0, 0.0, 0.0);
    146             desired_place.r = /*plFocus.r -*/ ursp - res->apply(r);
    147 
    148             printf("desired place is: %f, %f, %f\n", desired_place.r.x, desired_place.r.y, desired_place.r.z);
     146            desiredPlace.r = /*plFocus.r -*/ ursp - res->apply(r);
     147
     148            printf("desired place is: %f, %f, %f\n", desiredPlace.r.x, desiredPlace.r.y, desiredPlace.r.z);
    149149            //plLastBPlace = *bound->get_placement();
    150150          }
     
    153153    case SMOTH_FOLLOW:
    154154      {
    155         Placement *plBound = bound->get_placement();
     155        Placement *plBound = bound->getPlacement();
    156156        Location lcBound;
    157157        if(bound != null)
    158158          {
    159             bound->get_lookat(&lcBound);
     159            bound->getLookat(&lcBound);
    160160            Vector vDirection(0.0, 0.0, 1.0);
    161161            vDirection = plBound->w.apply(vDirection);
    162             desired_place.r = (vDirection * ((lcBound.dist-10.0)/* / l*/)) + Vector(0,0,5.0);
     162            desiredPlace.r = (vDirection * ((lcBound.dist-10.0)/* / l*/)) + Vector(0,0,5.0);
    163163          }
    164164        break;
     
    169169        if(bound != null)
    170170          {
    171             Placement *plBound = bound->get_placement();
     171            Placement *plBound = bound->getPlacement();
    172172            Vector vDirection(0.0, 0.0, 1.0);
    173173            Vector eclipticOffset(0.0, 0.0, 5.0);
    174174            vDirection = plBound->w.apply(vDirection);
    175             desired_place.r = plBound->r - vDirection*10 + eclipticOffset;
     175            desiredPlace.r = plBound->r - vDirection*10 + eclipticOffset;
    176176          }
    177177        break;
     
    182182      if( bound != NULL && world != NULL )
    183183        {
    184           bound->get_lookat (&lookat);
    185           world->calc_camera_pos (&lookat, &desired_place);
     184          bound->getLookat (&lookat);
     185          world->calcCameraPos (&lookat, &desiredPlace);
    186186        }
    187187      else
    188188        {
    189           desired_place.r = Vector (0,0,0);
    190           desired_place.w = Quaternion ();
     189          desiredPlace.r = Vector (0,0,0);
     190          desiredPlace.w = Quaternion ();
    191191        }
    192192      break;
     
    206206  // view
    207207  // TO DO: implement options for frustum generation
    208   glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 250.0);
     208  //glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 250.0);
     209  gluPerspective(60, 1.2f, 0.1, 250);
     210 
    209211  //Vector up(0,0,1);
    210212  //Vector dir(1,0,0);
     
    235237  // rotation
    236238  float matrix[4][4];
    237   actual_place.w.conjugate().matrix (matrix);
     239  actualPlace.w.conjugate().matrix (matrix);
    238240  /* orientation and */
    239241  glMultMatrixf ((float*)matrix);
    240242  /*  translation */
    241   glTranslatef (-actual_place.r.x, -actual_place.r.y,- actual_place.r.z);
    242   //Placement *plBound = bound->get_placement();
     243  glTranslatef (-actualPlace.r.x, -actualPlace.r.y,- actualPlace.r.z);
     244//Placement *plBound = bound->get_placement();
    243245
    244246  // ===== second camera control calculation option
    245247  /*
    246     gluLookAt(actual_place.r.x, actual_place.r.y, actual_place.r.z,
     248   gluLookAt(actual_place.r.x, actual_place.r.y, actual_place.r.z,
    247249              plBound->r.x, plBound->r.y, plBound->r.z,
    248250              0.0, 0.0, 1.0);
     
    263265  if( plc == NULL)
    264266    {
    265       actual_place = desired_place;
     267      actualPlace = desiredPlace;
    266268      //printf("Camera|jump: camer@ %f, %f, %f\n\n", actual_place.r.x, actual_place.r.y, actual_place.r.z);
    267269    }
    268270  else
    269271    {
    270       desired_place = *plc;
    271       actual_place = *plc;
     272      desiredPlace = *plc;
     273      actualPlace = *plc;
    272274    }
    273275}
     
    277279  \param entity: The enitity to bind the camera to
    278280       
    279         This sets the focus of the camera to the given entity. This means that it will use the given WorldEntity's
    280         Location and get_lookat() to determine the viewpoint the camera will render from.
    281         Note that you cannot bind a camera to a free entity.
     281  This sets the focus of the camera to the given entity. This means that it will use the given WorldEntity's
     282  Location and get_lookat() to determine the viewpoint the camera will render from.
     283  Note that you cannot bind a camera to a free entity.
    282284*/
    283285void Camera::bind (WorldEntity* entity)
     
    285287  if( entity != NULL)
    286288    {
    287       if( entity->isFree ()) printf("Cannot bind camera to free entity");
     289      if( entity->isFree()) printf("Cannot bind camera to free entity");
    288290      else
    289291        {
    290           bound = entity;
     292          this->bound = entity;
    291293        }
    292294    }
     
    298300  this->world = world;
    299301}
     302
     303
     304/**
     305   \brief destroy, reset the camera so that it doesn't perform anything anymore
     306
     307*/
     308void Camera::destroy()
     309{
     310  this->bound = NULL;
     311  this->world = NULL;
     312}
  • orxonox/branches/nico/src/camera.h

    r2636 r3238  
    44*/
    55
    6 #ifndef CAMERA_H
    7 #define CAMERA_H
     6#ifndef _CAMERA_H
     7#define _CAMERA_H
    88
    99#include "stdincl.h"
     
    2626 private:
    2727  WorldEntity* bound;           //!< the WorldEntity the Camera is bound to
    28   Placement actual_place;               //!< the Camera's current position
    29   Placement desired_place;        //!< where the Camera should be according to calculations
     28  Placement actualPlace;                //!< the Camera's current position
     29  Placement desiredPlace;        //!< where the Camera should be according to calculations
    3030  World* world;
    3131 
     
    5454  CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity
    5555 
    56   void update_desired_place ();
     56  void updateDesiredPlace ();
    5757 
    5858 public:
     
    6060  ~Camera ();
    6161 
    62   void time_slice (Uint32 deltaT);
     62  void timeSlice (Uint32 deltaT);
    6363  void apply ();
    6464  void bind (WorldEntity* entity);
    6565  void jump (Placement* plc);
     66  void destroy();
    6667
    6768  void setWorld(World* world); 
     
    6970};
    7071
    71 #endif
     72#endif /* _CAMERA_H */
  • orxonox/branches/nico/src/campaign.cc

    r2816 r3238  
    3434
    3535
    36 Error Campaign::init()
     36ErrorMessage Campaign::init()
    3737{
    3838  this->isInit = true;
     
    4848    want to queue up in the campaign.
    4949*/
    50 void Campaign::addEntity(StoryEntity* se, Uint32 storyID)
     50void Campaign::addEntity(StoryEntity* se, int storyID)
    5151{
    5252  se->setStoryID(storyID);
     
    6060
    6161
    62 void Campaign::removeEntity(Uint32 storyID)
     62void Campaign::removeEntity(int storyID)
    6363{
    6464  this->removeEntity(this->getStoryEntity(storyID));
     
    7373
    7474
    75 Error Campaign::start()
     75ErrorMessage Campaign::start()
    7676{
    7777  this->start(0);
    7878}
    7979
    80 Error Campaign::start(Uint32 storyID = 0)
     80ErrorMessage Campaign::start(int storyID = 0)
    8181{
    8282  printf("World::start() - starting new StoryEntity Nr:%i\n", storyID);
    83   Error errorCode;
    84   if(!this->isInit) return errorCode;
    85   if(storyID == WORLD_ID_GAMEEND) return errorCode;
     83  ErrorMessage errorCode;
     84  if( !this->isInit) return errorCode;
     85  if( storyID == WORLD_ID_GAMEEND) return errorCode;
    8686  this->running = true;
    8787  StoryEntity* se = this->getStoryEntity(storyID);
    88   while(se != NULL && this->running)
     88  this->currentEntity = se;
     89  while( se != NULL && this->running)
    8990    {
    90       se = this->getStoryEntity(storyID);
    91       this->currentEntity = se;
    92      
    93       se->displayEntityScreen();
     91      se->displayLoadScreen();
    9492      se->load();
    9593      se->init();
    96       se->releaseEntityScreen();
     94      se->releaseLoadScreen();
    9795      se->start();
     96      se->destroy();
     97     
     98      delete se;
    9899
    99100      int nextWorldID = se->getNextStoryID();
    100       if(nextWorldID == WORLD_ID_GAMEEND) return errorCode;
     101      //printf("Campaing::start() - got nextWorldID = %i\n", nextWorldID);
    101102      se = this->getStoryEntity(nextWorldID);
    102       if(se == NULL)
    103         printf("Campaign::start() - ERROR: world it not found, oh oh...");
     103      this->currentEntity = se;
     104      if( ( nextWorldID == WORLD_ID_GAMEEND) ||( se == NULL) )
     105        {
     106          printf("Campaign::start() - quitting campaing story loop\n");
     107          if(se != NULL)
     108            delete se;
     109          return errorCode;
     110        }
     111     
    104112    }
    105113}
    106114
    107 Error Campaign::stop()
     115ErrorMessage Campaign::stop()
    108116{
    109117  this->running = false;
     
    111119    {
    112120      this->currentEntity->stop();
    113       delete this->currentEntity;
    114       this->currentEntity = NULL;
     121      //delete this->currentEntity;
     122      //this->currentEntity = NULL;
    115123    }
    116124}
    117125
    118 Error Campaign::pause()
     126ErrorMessage Campaign::pause()
    119127{
    120128  if(this->currentEntity != NULL)
     
    123131
    124132
    125 Error Campaign::resume()
     133ErrorMessage Campaign::resume()
    126134{
    127135  if(this->currentEntity != NULL)
     
    130138
    131139
     140void Campaign::destroy()
     141{
     142  if(this->currentEntity != NULL)
     143    {
     144      this->currentEntity->destroy();
     145      delete this->currentEntity;
     146      this->currentEntity = NULL;
     147    }
     148}
     149
     150/*
     151  \brief this changes to the next level
     152*/
    132153void Campaign::nextLevel()
    133154{
    134   printf("Campaign|nextLevel\n");
    135   int nextID = this->currentEntity->getNextStoryID();
    136   this->stop();
    137   this->start(nextID);
     155  printf("Campaign:nextLevel()\n");
     156  //int nextID = this->currentEntity->getNextStoryID();
     157  //this->stop();
     158  //this->start(nextID);
     159  this->currentEntity->stop();
    138160}
    139161
     162/*
     163  \brief change to the previous level - not implemented
     164
     165  this propably useless
     166*/
    140167void Campaign::previousLevel()
    141168{}
    142169
    143170
    144 StoryEntity* Campaign::getStoryEntity(Uint32 storyID)
     171/*
     172  \brief lookup a entity with a given id
     173  \param story id to be lookuped
     174  \returns the entity found or NULL if search ended without match
     175*/
     176StoryEntity* Campaign::getStoryEntity(int storyID)
    145177{
     178  //printf("Campaing::getStoryEntity(%i) - getting next Entity\n", storyID);
     179  if( storyID == WORLD_ID_GAMEEND)
     180    return NULL;
    146181  ListTemplate<StoryEntity>* l;
    147   StoryEntity* entity;
    148   l = this->entities->get_next(); 
     182  StoryEntity* entity = NULL;
     183  l = this->entities->getNext(); 
    149184  while( l != NULL)
    150185    {
    151       entity = l->get_object();
    152       l = l->get_next();
    153       if(entity->getStoryID() == storyID)
    154         return entity;
     186      entity = l->getObject();
     187      l = l->getNext();
     188      int id = entity->getStoryID();
     189      //printf("Campaing::getStoryEntity() - now looping, found entity nr=%i\n", id);
     190      if(id == storyID)
     191        {
     192          //printf("Campaing::getStoryEntity() - yea, this is what we where looking for: %id\n");
     193          return entity;
     194        }
    155195    }
    156196  return NULL;
  • orxonox/branches/nico/src/campaign.h

    r2816 r3238  
    11
    2 #ifndef CAMPAIGN_H
    3 #define CAMPAIGN_H
     2#ifndef _CAMPAIGN_H
     3#define _CAMPAIGN_H
    44
    55#include "stdincl.h"
     
    1717  StoryEntity* currentEntity;
    1818
    19   virtual Error init();
    20   virtual Error start();
    21   virtual Error start(Uint32 storyID);
    22   virtual Error stop();
    23   virtual Error pause();
    24   virtual Error resume();
     19  virtual ErrorMessage init();
     20  virtual ErrorMessage start();
     21  virtual ErrorMessage start(int storyID);
     22  virtual ErrorMessage stop();
     23  virtual ErrorMessage pause();
     24  virtual ErrorMessage resume();
    2525
    26   void addEntity(StoryEntity* se, Uint32 storyID);
     26  virtual void destroy();
     27
     28  void addEntity(StoryEntity* se, int storyID);
    2729  void addEntity(StoryEntity* se);
    28   void removeEntity(Uint32 storyID);
     30  void removeEntity(int storyID);
    2931  void removeEntity(StoryEntity* se);
    3032 
     
    3638  bool running;
    3739
    38   StoryEntity* getStoryEntity(Uint32 storyID);
     40  StoryEntity* getStoryEntity(int storyID);
    3941};
    4042
    41 #endif
     43#endif /* _CAMPAIGN_H */
  • orxonox/branches/nico/src/collision.cc

    r2190 r3238  
    2828CollisionCluster::CollisionCluster (float rad = 1.0, Vector mid = Vector(0,0,0))
    2929{
    30   root = (CC_Tree*) malloc( sizeof( CC_Tree));
     30  root = (CCTree*) malloc( sizeof( CCTree));
    3131  root->n = 0;
    3232  root->data.ID = 0;
     
    6262  }
    6363 
    64   root = load_CC_Tree (stream);
     64  root = loadCCTree (stream);
    6565  fclose (stream);
    6666}
     
    7171CollisionCluster::~CollisionCluster ()
    7272{
    73   free_CC_Tree( root);
     73  freeCCTree(root);
    7474}
    7575
     
    8585  stream = fopen( filename, "wb");
    8686  if( stream == NULL) return -1;
    87   r = save_CC_Tree (root, stream);
     87  r = saveCCTree(root, stream);
    8888  fclose (stream);
    8989  return r;
     
    9999   \return true on collision, false otherwise. If true is returned, the flag in ahitflags that symbolises the hit subsphere is set, and impactpoint is set to the Location where the intersection occured
    100100*/
    101 bool check_trace (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Line* trace, Vector* impactpoint)
    102 {
    103         CC_Tree* t;
     101bool checkTrace (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Line* trace, Vector* impactpoint)
     102{
     103        CCTree* t;
    104104        if( (t = a->root) == NULL) return false;
    105105       
    106   return cctree_trace( pa, t, ahitflags, trace, impactpoint);
     106  return ccTreeTrace( pa, t, ahitflags, trace, impactpoint);
    107107}
    108108
     
    118118   If true is returned, all flags in ahitflags and bhitflags that symbolize intersecting subspheres in the respective CollisionCluster are set
    119119*/
    120 bool check_collision (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Placement* pb, const CollisionCluster* b, unsigned long* bhitflags)
    121 {
    122   CC_Tree* ta, *tb;
     120bool checkCollision (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Placement* pb, const CollisionCluster* b, unsigned long* bhitflags)
     121{
     122  CCTree* ta, *tb;
    123123  if( (ta = a->root) == NULL) return false;
    124124  if( (tb = b->root) == NULL) return false;
    125125 
    126   return cctree_iterate(pa, ta, ahitflags, pb, tb, bhitflags);
     126  return ccTreeIterate(pa, ta, ahitflags, pb, tb, bhitflags);
    127127}
    128128
     
    135135   \return true on intersection, false otherwise
    136136*/
    137 bool sphere_sphere_collision( Vector m1, float r1, Vector m2, float r2)
     137bool sphereSphereCollision( Vector m1, float r1, Vector m2, float r2)
    138138{
    139139  if ((m1-m2).len() < r1+r2) return true;
     
    149149   \return true on intersection, false otherwise. If true is returned, impactpoint is set to the loaction where the intersection occured
    150150*/
    151 bool trace_sphere_collision( Vector m, float r, const Line* l, Vector* impactpoint)
     151bool traceSphereCollision( Vector m, float r, const Line* l, Vector* impactpoint)
    152152{
    153153  float A, B, C, D, t[2];
     
    176176}
    177177
    178 bool cctree_iterate(const Placement* pa, CC_Tree* ta, unsigned long* ahitflags, const Placement* pb, CC_Tree* tb, unsigned long* bhitflags)
     178bool ccTreeIterate(const Placement* pa, CCTree* ta, unsigned long* ahitflags, const Placement* pb, CCTree* tb, unsigned long* bhitflags)
    179179{
    180180  bool r = false;
     
    182182  Vector mra = pa->r + pa->w.apply(ta->m);
    183183  Vector mrb = pb->r + pb->w.apply(tb->m);
    184   CC_Tree* use_a, *use_b;
    185  
    186   if( use_a == NULL || use_b == NULL) return false;
    187  
    188   if( sphere_sphere_collision( mra, ta->r, mrb, tb->r))
     184  CCTree* useA, *useB;
     185 
     186  if( useA == NULL || useB == NULL) return false;
     187 
     188  if( sphereSphereCollision( mra, ta->r, mrb, tb->r))
    189189  {
    190190    if( ta->n == 0 && tb->n == 0)
     
    196196    for( ia = 0; ia < ta->n || ta->n == 0; ia++)
    197197    {
    198       if( ta->n == 0) use_a = ta;
    199       else use_a = ta->data.b[ia];
     198      if( ta->n == 0) useA = ta;
     199      else useA = ta->data.b[ia];
    200200      for( ib = 0; ib < tb->n || ta->n == 0; ib++)
    201201      {
    202         if( ta->n == 0) use_b = ta;
    203         else use_b = ta->data.b[ib];
     202        if( ta->n == 0) useB = ta;
     203        else useB = ta->data.b[ib];
    204204       
    205         r = r || cctree_iterate( pa, use_a, ahitflags, pb, use_b, bhitflags);
     205        r = r || ccTreeIterate( pa, useA, ahitflags, pb, useB, bhitflags);
    206206       
    207207        if( tb->n == 0) break;
     
    233233
    234234/**
    235    \brief frees the memory allocated in a CC_Tree
    236 */
    237 void free_CC_Tree( CC_Tree* tree)
     235   \brief frees the memory allocated in a CCTree
     236*/
     237void freeCCTree( CCTree* tree)
    238238{
    239239  if (tree == NULL) return;
    240240  for (int i = 0; i < tree->n; i++)
    241241  {
    242     free_CC_Tree( tree->data.b[i]);
     242    freeCCTree(tree->data.b[i]);
    243243  }
    244244  free( tree);
     
    246246
    247247/**
    248    \brief loads a CC_Tree from a stream
    249 */
    250 CC_Tree* load_CC_Tree (FILE* stream)
    251 {
    252   CC_Tree* tree = NULL;
    253   CC_Tree** branches = NULL;
     248   \brief loads a CCTree from a stream
     249*/
     250CCTree* loadCCTree (FILE* stream)
     251{
     252  CCTree* tree = NULL;
     253  CCTree** branches = NULL;
    254254  float buf[4];
    255255  unsigned long n;
     
    267267  else
    268268  {
    269     branches = (CC_Tree**)malloc( sizeof(CC_Tree*) * n);
     269    branches = (CCTree**)malloc( sizeof(CCTree*) * n);
    270270    for( int i = 0; i < n; i++)
    271271    {
    272       if ((branches[i] = load_CC_Tree (stream)) == NULL)
     272      if ((branches[i] = loadCCTree (stream)) == NULL)
    273273      {
    274274        for( int j = 0; j < i; j++)
    275275        {
    276           free_CC_Tree (branches[j]);
    277           free (branches);
     276          freeCCTree (branches[j]);
     277          free(branches);
    278278          return NULL;
    279279        }
     
    283283 
    284284  // assemble
    285   tree = (CC_Tree*) malloc (sizeof(CC_Tree));
     285  tree = (CCTree*) malloc (sizeof(CCTree));
    286286  tree->m.x = buf[0];
    287287  tree->m.y = buf[1];
     
    297297
    298298/**
    299    \brief saves a CC_Tree to a stream
    300 */
    301 int save_CC_Tree (CC_Tree* tree, FILE* stream)
     299   \brief saves a CCTree to a stream
     300*/
     301int saveCCTree (CCTree* tree, FILE* stream)
    302302{
    303303  float buf[4];
     
    321321    for( int i = 0; i < tree->n; i++)
    322322    {
    323       if ( save_CC_Tree (tree->data.b[i], stream) == -1) return -1;
     323      if ( saveCCTree (tree->data.b[i], stream) == -1) return -1;
    324324    }
    325325  }
     
    329329}
    330330
    331 bool cctree_trace( const Placement* p, CC_Tree* t, unsigned long* hitflags, const Line* trace, Vector* impactpoint)
     331bool ccTreeTrace( const Placement* p, CCTree* t, unsigned long* hitflags, const Line* trace, Vector* impactpoint)
    332332{
    333333  bool r = false;
    334334  int i;
    335335  Vector mr = p->r + p->w.apply (t->m);
    336   CC_Tree* use_t;
     336  CCTree* useT;
    337337  Vector* ips;
    338338  unsigned long* hfs;
    339339 
    340   if( trace_sphere_collision (mr, t->r, trace, impactpoint))
     340  if( traceSphereCollision (mr, t->r, trace, impactpoint))
    341341  {
    342342        if( t->n == 0)
     
    352352                for (i = 0; i < t->n; i++)
    353353                {
    354                         r = r || cctree_trace (p, t->data.b[i], &(hfs[i]), trace, &(ips[i]));
     354                        r = r || ccTreeTrace (p, t->data.b[i], &(hfs[i]), trace, &(ips[i]));
    355355                }
    356356                if( r)
  • orxonox/branches/nico/src/collision.h

    r2190 r3238  
    44*/
    55
    6 #ifndef COLLISION_H
    7 #define COLLISION_H
     6#ifndef _COLLISION_H
     7#define _COLLISION_H
    88
    99#include "vector.h"
     
    1414
    1515//! Tree structure used by the CollisionCluster
    16 typedef struct CC_Tree
     16typedef struct CCTree
    1717{
    1818  unsigned long n;
    1919  union
    2020  {
    21   struct CC_Tree** b;
     21  struct CCTree** b;
    2222  unsigned long ID;
    2323  } data;
    2424  float r;
    2525  Vector m;
    26 } CC_Tree;
     26} CCTree;
    2727
    2828//! Basic collision detection class
     
    4242class CollisionCluster {
    4343 
    44   CC_Tree* root;
     44  CCTree* root;
    4545 
    4646 
     
    5252  int store (char* filename);
    5353 
    54   friend bool cctree_trace( const Placement* p, CC_Tree* t, unsigned long* hitflags, const Line* trace, Vector* impactpoint);
    55   friend bool cctree_iterate(const Placement* pa, CC_Tree* ta, unsigned long* ahitflags, const Placement* pb, CC_Tree* tb, unsigned long* bhitflags);
    56   friend bool check_trace (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Line* trace, Vector* impactpoint);
    57   friend bool check_collision (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Placement* pb, const CollisionCluster* b, unsigned long* bhitflags);
     54  friend bool ccTreeTrace( const Placement* p, CCTree* t, unsigned long* hitflags, const Line* trace, Vector* impactpoint);
     55  friend bool ccTreeIterate(const Placement* pa, CCTree* ta, unsigned long* ahitflags, const Placement* pb, CCTree* tb, unsigned long* bhitflags);
     56  friend bool checkTrace (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Line* trace, Vector* impactpoint);
     57  friend bool checkCollision (const Placement* pa, const CollisionCluster* a, unsigned long* ahitflags, const Placement* pb, const CollisionCluster* b, unsigned long* bhitflags);
    5858};
    5959
    60 bool sphere_sphere_collision( Vector m1, float r1, Vector m2, float r2);
    61 bool trace_sphere_collision( Vector m, float r, const Line* l, Vector* impactpoint);
     60bool sphereSphereCollision( Vector m1, float r1, Vector m2, float r2);
     61bool traceSphereCollision( Vector m, float r, const Line* l, Vector* impactpoint);
    6262
    6363void setflag( unsigned long* flags, unsigned long ID);
    6464
    65 void free_CC_Tree( CC_Tree* tree);
    66 CC_Tree* load_CC_Tree (FILE* stream);
    67 int save_CC_Tree (CC_Tree* tree, FILE* stream);
     65void freeCCTree( CCTree* tree);
     66CCTree* loadCCTree (FILE* stream);
     67int saveCCTree (CCTree* tree, FILE* stream);
    6868
    69 #endif
     69#endif /* _COLLISION_H */
  • orxonox/branches/nico/src/command_node.cc

    r2816 r3238  
    2020#include "world_entity.h"
    2121#include "game_loader.h"
     22#include "world.h"
    2223
    2324#include <stdio.h>
     
    3334CommandNode::CommandNode (int ID)
    3435{
    35   bound = new List();
    36   aliases = NULL;
    37   netID = ID;
    38   bLocalInput = false;
     36  this->bound = new tList<WorldEntity>();
     37  this->aliases = NULL;
     38  this->netID = ID;
     39  this->bLocalInput = false;
     40  this->bEnabled = true;
     41  this->world = NULL;
    3942}
    4043
     
    4548CommandNode::CommandNode (char* filename = DEFAULT_KEYBIND_FILE)
    4649{
    47   aliases = NULL;
    48   bLocalInput = true;
    49   netID = 0;
    50   bound = new List();
    51   load_bindings (filename);
     50  this->aliases = NULL;
     51  this->bLocalInput = true;
     52  this->netID = 0;
     53  this->bound = new tList<WorldEntity>();
     54  this->bEnabled = true;
     55  this->world = NULL;
     56  this->loadBindings (filename);
    5257}
    5358
     
    5863{
    5964  if( aliases != NULL) free (aliases);
    60   if( bound != NULL) delete bound;
    61 }
    62 
     65  if( bound != NULL) delete bound; /* \todo should this delete bound? dangerous FIX */
     66}
     67
     68
     69/**
     70  \brief this resets the command node
     71
     72   deleting all data contained in the command node to fill it up again
     73
     74  \todo coppling to different game-entities
     75  \todo reset/destroy has to be redesigned
     76*/
    6377
    6478void CommandNode::reset()
    6579{
    66   this->bound->clear();
    67 }
     80  this->bound->destroy();
     81  //this->bound = NULL; /* \todo this produces a NULLpointer error.. FIX */
     82  this->bEnabled = false;
     83  this->world = NULL;
     84}
     85
     86void CommandNode::enable(bool bEnabled)
     87{
     88  this->bEnabled = bEnabled;
     89}
     90
     91
     92/**
     93  \brief adds Node to a GameWorld
     94
     95   this is usefull, if you want to catch events in a world class. usualy
     96   this is done automaticaly via GameLoader. Reset it via
     97   CommandNode::reset()
     98
     99*/
     100void CommandNode::addToWorld(World* world)
     101{
     102  this->world = world;
     103}
     104
    68105
    69106/**
     
    71108   \param filename: The path and name of the file to load the bindings from
    72109*/
    73 void CommandNode::load_bindings (char* filename)
     110void CommandNode::loadBindings (char* filename)
    74111{
    75112  FILE* stream;
     
    88125  // create parser
    89126  IniParser parser (filename);
    90   if( parser.get_section ("Bindings") == -1)
     127  if( parser.getSection ("Bindings") == -1)
    91128    {
    92129      printf("Could not find key bindings in %s\n", filename);
     
    102139  int* index;
    103140 
    104   while( parser.next_var (namebuf, valuebuf) != -1)
    105     {
    106       index = name_to_index (namebuf);
     141  while( parser.nextVar (namebuf, valuebuf) != -1)
     142    {
     143      index = nameToIndex (namebuf);
    107144      switch( index[0])
    108145        {
    109146        case 0:
    110           printf("Key binding %d(%s) set to %s\n", index[1], SDLK_to_keyname( index[1]), valuebuf);
     147          printf("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), valuebuf);
    111148          strcpy (aliases->keys[index[1]], valuebuf);
    112149          break;
    113150        case 1:
    114           printf("Button binding %d(%s) set to %s\n", index[1], SDLB_to_buttonname( index[1]), valuebuf);
     151          printf("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), valuebuf);
    115152          strcpy (aliases->buttons[index[1]], valuebuf);
    116153          break;
     
    141178}
    142179
    143 int* CommandNode::name_to_index (char* name)
     180int* CommandNode::nameToIndex (char* name)
    144181{
    145182  coord[0] = -1;
    146183  coord[1] = -1;
    147184  int c;
    148   if( (c = keyname_to_SDLK (name)) != -1)
     185  if( (c = keynameToSDLK (name)) != -1)
    149186    {
    150187      coord[1] = c;
    151188      coord[0] = 0;
    152189    }
    153   if( (c = buttonname_to_SDLB (name)) != -1)
     190  if( (c = buttonnameToSDLB (name)) != -1)
    154191    {
    155192      coord[1] = c;
     
    164201void CommandNode::process ()
    165202{
    166   if( bLocalInput) process_local ();
    167   else process_network ();
    168 }
    169 
    170 void CommandNode::process_local ()
     203  if( this->bEnabled)
     204    {
     205      if( bLocalInput) processLocal ();
     206      else processNetwork ();
     207    }
     208}
     209
     210void CommandNode::processLocal ()
    171211{
    172212  SDL_Event event;
    173213  Command cmd;
    174  
    175214  while( SDL_PollEvent (&event))
    176215    {
     
    181220          strcpy (cmd.cmd, aliases->keys[event.key.keysym.sym]);
    182221          cmd.bUp = false;
    183           if( strlen (cmd.cmd) > 0) relay (&cmd);
     222          if( strlen (cmd.cmd) > 0) relay(&cmd);
    184223          break;
    185224        case SDL_KEYUP:
    186225          strcpy( cmd.cmd, aliases->keys[event.key.keysym.sym]);
    187226          cmd.bUp = true;
    188           if( strlen (cmd.cmd) > 0) relay (&cmd);
     227          if( strlen (cmd.cmd) > 0) relay(&cmd);
    189228          break;
    190229        case SDL_MOUSEMOTION:
     
    198237          strcpy( cmd.cmd, aliases->buttons[event.button.button]);
    199238          cmd.bUp = true;
    200           if( strlen (cmd.cmd) > 0) relay (&cmd);
     239          if( strlen (cmd.cmd) > 0) relay(&cmd);
    201240          break;
    202241        case SDL_MOUSEBUTTONDOWN:
    203242          strcpy( cmd.cmd, aliases->buttons[event.button.button]);
    204243          cmd.bUp = false;
    205           if( strlen (cmd.cmd) > 0) relay (&cmd);
     244          if( strlen (cmd.cmd) > 0) relay(&cmd);
    206245          break;
    207246        case SDL_JOYAXISMOTION:
     
    213252        default:
    214253          Orxonox *orx = Orxonox::getInstance();
    215           orx->event_handler (&event);
    216          
     254          orx->eventHandler(&event);
    217255          break;
    218256        }
     
    221259
    222260
    223 void CommandNode::process_network ()
     261void CommandNode::processNetwork ()
    224262{
    225263
     
    229267void CommandNode::relay (Command* cmd)
    230268{
    231  
     269
    232270  Orxonox *orx = Orxonox::getInstance();
    233   if( orx->system_command (cmd)) return;
     271  if( orx->systemCommand (cmd)) return;
     272
    234273  GameLoader* gl = GameLoader::getInstance();
    235   if(gl->worldCommand(cmd)) return;
    236  
    237   if( bLocalInput) send_over_network (cmd);
    238  
     274  if( gl->worldCommand(cmd)) return;
     275
     276  if( bLocalInput) sendOverNetwork (cmd);
     277 
     278  if( this->world->command(cmd)) return;
     279
    239280  WorldEntity* entity = bound->enumerate();
    240   while(  entity != NULL)
     281  while( entity != NULL)
    241282    {
    242283      entity->command (cmd);
     
    250291   \param ID: the new ID to use
    251292*/
    252 void CommandNode::set_netID (int ID)
     293void CommandNode::setNetID (int ID)
    253294{
    254295  netID = ID;
    255296}
    256297
    257 void CommandNode::send_over_network (Command* cmd)
    258 {
    259 }
     298void CommandNode::sendOverNetwork (Command* cmd)
     299{
     300}
  • orxonox/branches/nico/src/command_node.h

    r2816 r3238  
    66*/
    77
    8 #ifndef COMMAND_NODE_H
    9 #define COMMAND_NODE_H
     8#ifndef _COMMAND_NODE_H
     9#define _COMMAND_NODE_H
    1010
    1111#include "stdincl.h"
    1212
    1313class WorldEntity;
     14class World;
    1415
    1516#define N_STD_KEYS SDLK_LAST
     
    3940 private:
    4041  bool bLocalInput;     //!< Identifies the CommandNode that processes local input
     42  bool bEnabled;
    4143  int netID;    //!< Unique identifier that is used to determine between remote CommandNodes
    4244  KeyBindings* aliases;
    43   List* bound;  //!< List of WorldEntites that recieve commands from this CommandNode
     45  tList<WorldEntity>* bound;    //!< List of WorldEntites that recieve commands from this CommandNode
    4446  Sint32 coord[2];
     47  World* world;
    4548 
    4649
    4750  void relay (Command* cmd);
    48   int* name_to_index (char* name);
    49   void process_local ();
    50   void process_network ();
    51   void send_over_network (Command* cmd);
     51  int* nameToIndex (char* name);
     52  void processLocal ();
     53  void processNetwork ();
     54  void sendOverNetwork (Command* cmd);
    5255 
    5356 public:
     
    5659  ~CommandNode ();
    5760
    58   void reset(); 
    59   void load_bindings (char* filename);
     61  void reset ();
     62  void enable (bool bEnabled);
     63  void loadBindings (char* filename);
    6064  void bind (WorldEntity* entity);
    6165  void unbind (WorldEntity* entity);
     66  void addToWorld (World* world);
    6267  void process ();
    6368 
    64   void set_netID (int ID);
     69  void setNetID (int ID);
    6570};
    6671
    67 #endif
     72#endif /* _COMMAND_NODE_H */
  • orxonox/branches/nico/src/coordinates.h

    r2551 r3238  
    44*/
    55
    6 #ifndef COORDINATES_H
    7 #define COORDINATES_H
     6#ifndef _COORDINATES_H
     7#define _COORDINATES_H
    88
    99#include "vector.h"
     
    3434} Placement;
    3535
    36 #endif
     36#endif /* _COORDINATS_H */
  • orxonox/branches/nico/src/data_tank.h

    r2190 r3238  
    11
    2 #ifndef DATA_TANK_H
    3 #define DATA_TANK_H
     2#ifndef _DATA_TANK_H
     3#define _DATA_TANK_H
    44
    55
     
    1212};
    1313
    14 #endif
     14#endif /* _DATA_TANK_H */
  • orxonox/branches/nico/src/environment.cc

    r2816 r3238  
    6767void Environment::draw ()
    6868{
    69   printf("Environment::draw()");
    70 
    7169  glMatrixMode(GL_MODELVIEW);
    7270  glLoadIdentity();
    7371  float matrix[4][4];
    7472 
    75   glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z);
    76   get_placement()->w.matrix (matrix);
     73  glTranslatef(getPlacement()->r.x,getPlacement()->r.y,getPlacement()->r.z);
     74  getPlacement()->w.matrix (matrix);
    7775  glMultMatrixf ((float*)matrix);
    7876
    7977  glBegin(GL_TRIANGLES);
    80   glColor3f(1,1,1);
     78  glColor3f(1,0,1);
    8179  glVertex3f(0,0,0.5);
    8280  glVertex3f(-0.5,0,-1);
     
    8987   
    9088  glBegin(GL_QUADS);
    91   glColor3f(0,0,1);
     89  glColor3f(1,0,1);
    9290  glVertex3f(0.5,0.5,-1);
    9391  glVertex3f(0.5,-0.5,-1);
  • orxonox/branches/nico/src/environment.h

    r2816 r3238  
    1 #ifndef ENVIRONEMENT_H
    2 #define ENVIRONEMENT_H
     1#ifndef _ENVIRONEMENT_H
     2#define _ENVIRONEMENT_H
    33
    44#include "world_entity.h"
     
    2929};
    3030
    31 #endif
     31#endif /* _ENVIRONEMENT_H */
  • orxonox/branches/nico/src/error.h

    r2644 r3238  
    2222*/
    2323
    24 // this are the two undefined error nr. Don't use them ...
    25 #define ERROR -1
    26 #define NERROR 0
     24
     25#ifndef _ERROR_H
     26#define _ERROR_H
     27
     28// these are the two undefined error nr. Don't use them ...
     29#define oERROR -1
     30
     31#define oNOERROR 0
    2732
    2833/*!
     
    5459  char* message;
    5560  char* location;
    56 } Error;
     61} ErrorMessage;
     62
     63#endif /* _ERROR_H */
  • orxonox/branches/nico/src/game_loader.cc

    r2636 r3238  
    4242
    4343
     44/**
     45   \brief this class is a singleton class
     46   \returns an instance of itself
     47
     48   if you are unsure about singleton classes, check the theory out on the internet :)
     49*/
    4450GameLoader* GameLoader::getInstance()
    4551{
     
    5056
    5157
    52 Error GameLoader::init()
     58ErrorMessage GameLoader::init()
    5359{
    5460  if(this->currentCampaign != NULL)
     
    5763
    5864
    59 Error GameLoader::loadCampaign(char* name)
    60 {
    61   Error errorCode;
     65/**
     66   \brief reads a campaign definition file into a campaign class
     67   \param filename to be loaded
     68   \returns the loaded campaign
     69
     70   this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
     71*/
     72ErrorMessage GameLoader::loadCampaign(char* name)
     73{
     74  ErrorMessage errorCode;
    6275 
    6376  this->currentCampaign = this->fileToCampaign(name);
    6477}
    6578
    66 Error GameLoader::loadDebugCampaign(Uint32 campaignID)
     79
     80/**
     81   \brief loads a debug campaign for test purposes only.
     82   \param the identifier of the campaign.
     83   \returns error message if not able to do so.
     84*/
     85ErrorMessage GameLoader::loadDebugCampaign(Uint32 campaignID)
    6786{
    6887  switch(campaignID)
     
    7291      {
    7392        Campaign* debugCampaign = new Campaign();
     93
    7494        World* world0 = new World(DEBUG_WORLD_0);
    75         world0->setNextStoryID(DEBUG_WORLD_1);
     95        world0->setNextStoryID(WORLD_ID_1);
    7696        debugCampaign->addEntity(world0, WORLD_ID_0);
     97
    7798        World* world1 = new World(DEBUG_WORLD_1);
    7899        world1->setNextStoryID(WORLD_ID_GAMEEND);
     
    85106}
    86107
    87 Error GameLoader::start()
     108ErrorMessage GameLoader::start()
    88109{
    89110  if(this->currentCampaign != NULL)
     
    92113
    93114
    94 Error GameLoader::stop()
     115ErrorMessage GameLoader::stop()
    95116{
    96117  if(this->currentCampaign != NULL)
     
    100121
    101122
    102 Error GameLoader::pause()
     123ErrorMessage GameLoader::pause()
    103124{
    104125  this->isPaused = true;
     
    108129
    109130
    110 Error GameLoader::resume()
     131ErrorMessage GameLoader::resume()
    111132{
    112133  this->isPaused = false;
     
    115136}
    116137
    117 Error GameLoader::free()
     138/**
     139   \brief release the mem
     140 */
     141ErrorMessage GameLoader::destroy()
    118142{}
    119143
    120144
    121 
    122 
    123 
     145/**
     146   \brief reads a campaign definition file into a campaign class
     147   \param filename to be loaded
     148   \returns the loaded campaign
     149
     150   this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns
     151*/
    124152Campaign* GameLoader::fileToCampaign(char *name)
    125153{
     
    134162   \brief handle keyboard commands
    135163   \param cmd: the command to handle
    136    \return true if the command was handled by the system
     164   \returns true if the command was handled by the system
    137165*/
    138166bool GameLoader::worldCommand (Command* cmd)
     
    165193      return true;
    166194    }
     195  else if( !strcmp( cmd->cmd, "quit"))
     196    {
     197      if( !cmd->bUp) this->stop();
     198      return true;
     199    }
    167200  return false;
    168201}
    169202
     203
     204/*
     205  \brief this changes to the next level
     206*/
    170207void GameLoader::nextLevel()
    171208{
     
    174211}
    175212
     213
     214/*
     215  \brief change to the previous level - not implemented
     216
     217  this propably useless
     218*/
    176219void GameLoader::previousLevel()
    177220{
  • orxonox/branches/nico/src/game_loader.h

    r2636 r3238  
    1 #ifndef GAME_LOADER_H
    2 #define GAME_LOADER_H
     1#ifndef _GAME_LOADER_H
     2#define _GAME_LOADER_H
    33
    44#include "stdincl.h"
     
    2020  static GameLoader* getInstance();
    2121
    22   Error init();
    23   Error loadCampaign(char* name);
    24   Error start();
    25   Error stop();
    26   Error pause();
    27   Error resume();
    28   Error free();
     22  ErrorMessage init();
     23  ErrorMessage loadCampaign(char* name);
     24  ErrorMessage start();
     25  ErrorMessage stop();
     26  ErrorMessage pause();
     27  ErrorMessage resume();
     28  ErrorMessage destroy();
    2929
    3030  void nextLevel();
     
    3232
    3333  bool worldCommand(Command* cmd);
    34   Error loadDebugCampaign(Uint32 campaignID);
     34  ErrorMessage loadDebugCampaign(Uint32 campaignID);
    3535 
    3636 private:
     
    4747};
    4848
    49 #endif
     49#endif /* _GAME_LOADER_H */
  • orxonox/branches/nico/src/ini_parser.cc

    r2551 r3238  
    2525IniParser::IniParser (char* filename)
    2626{
    27         stream = NULL;
    28         bInSection = false;
    29         open_file (filename);
     27  stream = NULL;
     28  bInSection = false;
     29  openFile(filename);
    3030}
    3131
     
    3535IniParser::~IniParser ()
    3636{
    37         if( stream != NULL) fclose (stream);
     37  if( stream != NULL) fclose (stream);
    3838}
    3939
    4040/**
    41         \brief opens another file to parse
    42         \param filename: path and name of the new file to parse
    43         \return zero on success or -1 if an error occured;
     41   \brief opens another file to parse
     42   \param filename: path and name of the new file to parse
     43   \return zero on success or -1 if an error occured;
    4444*/
    45 int IniParser::open_file( char* filename)
     45int IniParser::openFile( char* filename)
    4646{
    47         if( filename == NULL) return -1;
    48         if( stream != NULL)     fclose (stream);
    49         if( (stream = fopen (filename, "r")) == NULL)
    50         {
    51                 printf("IniParser could not open %s\n", filename);
    52                 return -1;
    53         }
    54         bInSection = false;
    55         return 0;
     47  if( filename == NULL) return -1;
     48  if( stream != NULL)   fclose (stream);
     49  if( (stream = fopen (filename, "r")) == NULL)
     50    {
     51      printf("IniParser could not open %s\n", filename);
     52      return -1;
     53    }
     54  bInSection = false;
     55  return 0;
    5656}
    5757
    5858/**
    59         \brief set the parsing cursor to the specified section
    60         \param section: the name of the section to set the cursor to
    61         \return zero on success or -1 if the section could not be found
     59   \brief set the parsing cursor to the specified section
     60   \param section: the name of the section to set the cursor to
     61   \return zero on success or -1 if the section could not be found
    6262*/
    63 int IniParser::get_section( char* section)
     63int IniParser::getSection( char* section)
    6464{
    6565  bInSection = false;
     
    9595
    9696/**
    97         \brief gets the next VarName=VarValue pair from the parsing stream
    98         \param name: a pointer to a buffer to store the name of the entry
    99         \param value: a pointer to a buffer to store the value of the entry
    100         \return zero if the buffers have been filled with data or -1 if there are no entries left in the current section
     97   \brief gets the next VarName=VarValue pair from the parsing stream
     98   \param name: a pointer to a buffer to store the name of the entry
     99   \param value: a pointer to a buffer to store the value of the entry
     100   \return zero if the buffers have been filled with data or -1 if there are no entries left in the current section
    101101*/
    102 int IniParser::next_var( char* name, char* value)
     102int IniParser::nextVar( char* name, char* value)
    103103{
    104         if( stream == NULL)
     104  if( stream == NULL)
     105    {
     106      bInSection = false;
     107      return -1;
     108    }
     109  if( !bInSection) return -1;
     110 
     111  char linebuffer[PARSELINELENGHT];
     112  char* ptr;
     113 
     114  while( !feof( stream))
     115    {
     116      // get next line
     117      fgets (linebuffer, PARSELINELENGHT, stream);
     118      // remove newline char
     119      if( (ptr = strchr( linebuffer, '\n')) != NULL) *ptr = 0;
     120      if( linebuffer[0] == '[')
    105121        {
    106                 bInSection = false;
    107                 return -1;
     122          bInSection = false;
     123          return -1;
    108124        }
    109         if( !bInSection) return -1;
    110        
    111         char linebuffer[PARSELINELENGHT];
    112         char* ptr;
    113 
    114         while( !feof( stream))
     125      if( (ptr = strchr( linebuffer, '=')) != NULL)
    115126        {
    116                         // get next line
    117                 fgets (linebuffer, PARSELINELENGHT, stream);
    118                         // remove newline char
    119                 if( (ptr = strchr( linebuffer, '\n')) != NULL) *ptr = 0;
    120                 if( linebuffer[0] == '[')
    121                 {
    122                         bInSection = false;
    123                         return -1;
    124                 }
    125                 if( (ptr = strchr( linebuffer, '=')) != NULL)
    126                 {
    127                         if( ptr == linebuffer) continue;
    128                         strcpy (value, &ptr[1]);
    129                         strncpy (name, linebuffer, strlen (linebuffer) - strlen (value) - 1);
    130                         return 0;
    131                 }
     127          if( ptr == linebuffer) continue;
     128          strcpy (value, &ptr[1]);
     129          strncpy (name, linebuffer, strlen (linebuffer) - strlen (value) - 1);
     130          return 0;
    132131        }
    133         return -1;     
     132    }
     133  return -1;   
    134134}
    135135
    136136/**
    137         \brief directly acesses an entry in a section
    138         \param name: the name of the entry to find
    139         \param section: the section where the entry is to be found
    140         \param defvalue: what should be returned in case the entry cannot be found
    141         \return a pointer to a buffer conatining the value of the specified entry. This buffer will contain the data specified in defvalue in case the entry wasn't found
    142 
    143         The returned pointer points to an internal buffer, so do not free it on your own. Do not give a NULL pointer to defvalue, this will certainly
    144         lead to unwanted behaviour.
     137   \brief directly acesses an entry in a section
     138   \param name: the name of the entry to find
     139   \param section: the section where the entry is to be found
     140   \param defvalue: what should be returned in case the entry cannot be found
     141   \return a pointer to a buffer conatining the value of the specified entry. This buffer will contain the data specified in defvalue in case the entry wasn't found
     142   
     143   The returned pointer points to an internal buffer, so do not free it on your own. Do not give a NULL pointer to defvalue, this will certainly
     144   lead to unwanted behaviour.
    145145*/
    146 char* IniParser::get_var( char* name, char* section, char* defvalue = "")
     146char* IniParser::getVar( char* name, char* section, char* defvalue = "")
    147147{
    148         strcpy (internbuf, defvalue);
    149         if( get_section (section) == -1) return internbuf;
    150        
    151         char namebuf[PARSELINELENGHT];
    152         char valuebuf[PARSELINELENGHT];
    153        
    154         while( next_var (namebuf, valuebuf) != -1)
     148  strcpy (internbuf, defvalue);
     149  if( getSection (section) == -1) return internbuf;
     150 
     151  char namebuf[PARSELINELENGHT];
     152  char valuebuf[PARSELINELENGHT];
     153 
     154  while( nextVar (namebuf, valuebuf) != -1)
     155    {
     156      if( !strcmp (name, namebuf))
    155157        {
    156                 if( !strcmp (name, namebuf))
    157                 {
    158                         strcpy (internbuf, valuebuf);
    159                         return internbuf;
    160                 }
     158          strcpy (internbuf, valuebuf);
     159          return internbuf;
    161160        }
    162         return internbuf;
     161    }
     162  return internbuf;
    163163}
  • orxonox/branches/nico/src/ini_parser.h

    r2190 r3238  
    66*/
    77
    8 #ifndef INI_PARSER_H
    9 #define INI_PARSER_H
     8#ifndef _INI_PARSER_H
     9#define _INI_PARSER_H
    1010
    1111#include <stdio.h>
     
    2929  ~IniParser ();
    3030 
    31   char* get_var( char* name, char* section, char* defvalue);
    32         int open_file( char* name);
    33   int get_section( char* section);
    34   int next_var( char* name, char* value);
     31  char* getVar( char* name, char* section, char* defvalue);
     32        int openFile( char* name);
     33  int getSection( char* section);
     34  int nextVar( char* name, char* value);
    3535};
    3636
    37 #endif
     37#endif /* _INI_PARSER_H */
  • orxonox/branches/nico/src/keynames.cc

    r2995 r3238  
    2020using namespace std;
    2121
    22 int buttonname_to_SDLB( char* name)
     22int buttonnameToSDLB( char* name)
    2323{
    2424        if( !strcmp (name, "BUTTON_LEFT")) return SDL_BUTTON_LEFT;
     
    3030}
    3131
    32 char* SDLB_to_buttonname( int button)
     32char* SDLBToButtonname( int button)
    3333{
    3434        if( button == SDL_BUTTON_LEFT) return "BUTTON_LEFT";
     
    4040}
    4141
    42 int keyname_to_SDLK( char* name)
     42int keynameToSDLK( char* name)
    4343{
    4444        if( !strcmp (name, "BACKSPACE")) return SDLK_BACKSPACE;
     
    178178}
    179179
    180 char* SDLK_to_keyname( int key)
     180char* SDLKToKeyname( int key)
    181181{
    182182        if( key == SDLK_BACKSPACE) return "BACKSPACE";
  • orxonox/branches/nico/src/keynames.h

    r2995 r3238  
    55                Converts strings to SDLK/SDL_BUTTON values and vice versa
    66*/
     7#ifndef _KEYNAMES_H
     8#define _KEYNAMES_H
     9
    710
    811#ifdef __WIN32__
     
    2124        \return an int containing the SDL identifier of the mouse button or -1 if the button name is not valid
    2225*/
    23 int buttonname_to_SDLB( char* name);
     26int buttonnameToSDLB( char* name);
    2427
    2528/**
     
    2831        \return a pointer to a string containing the name of the mouse button
    2932*/
    30 char* SDLB_to_buttonname( int button);
     33char* SDLBToButtonname( int button);
    3134
    3235/**
     
    3538        \return the SDLK sym of the named key or -1 if the key name is not valid
    3639*/
    37 int keyname_to_SDLK( char* name);
     40int keynameToSDLK( char* name);
    3841
    3942/**
     
    4245        \return a pointer to a string containig the name of the key
    4346*/
    44 char* SDLK_to_keyname( int key);
     47char* SDLKToKeyname( int key);
    4548
     49
     50#endif /* _KEYNAMES_H */
  • orxonox/branches/nico/src/list.cc

    r2818 r3238  
    7777
    7878
    79 void List::clear()
     79void List::destroy()
    8080{
    8181  printf("List::clear() - clearing all world objects, releasing mem\n");
    8282  this->currentEl = this->first;
     83  listElement* le = NULL;
    8384  while(this->currentEl != NULL)
    8485    {
    85       listElement* le = this->currentEl->next;
     86      le = this->currentEl->next;
    8687      delete this->currentEl->curr;
    8788      delete this->currentEl;
  • orxonox/branches/nico/src/list.h

    r2822 r3238  
    11
    2 #ifndef LIST_H
    3 #define LIST_H
     2#ifndef _LIST_H
     3#define _LIST_H
    44
    55#include "stdincl.h"
     
    2222  void add(WorldEntity* entity);
    2323  void remove(WorldEntity* entity);
    24   void clear();
     24  void destroy();
    2525  WorldEntity* firstElement();
    2626  bool isEmpty();
     
    8080  void add(WorldEntity* entity);
    8181  void remove(WorldEntity* entity);
    82   void clear();
     82  void destroy();
    8383  T* firstElement();
    8484  bool isEmpty();
     
    106106void tList<T>::add(WorldEntity* entity)
    107107{
    108   printf("tList<T>::add() \n");
    109108  listElement* el = new listElement;
    110109  el->prev = this->last;
     
    128127    {
    129128      if( this->currentEl->curr == entity)
    130         {
    131           printf("tList<T>::remove() - object found\n");
    132          
     129        {
    133130          if( this->currentEl->prev  == NULL ) this->first = this->currentEl->next;
    134131          else this->currentEl->prev->next = this->currentEl->next;
     
    148145
    149146template<class T>
    150 void tList<T>::clear()
    151 {
    152   printf("tList<T>::clear() - clearing all world objects, releasing mem\n");
     147void tList<T>::destroy()
     148{
    153149  this->currentEl = this->first;
    154150  while(this->currentEl != NULL)
     
    209205{}
    210206
    211 #endif
     207#endif /* _LIST_H */
  • orxonox/branches/nico/src/list_template.h

    r2816 r3238  
    2323*/
    2424
    25 #ifndef LIST_TEMPLATE_H
    26 #define LIST_TEMPLATE_H
     25#ifndef _LIST_TEMPLATE_H
     26#define _LIST_TEMPLATE_H
    2727
    2828#include "stdincl.h"
     
    4646  ~ListTemplate ();
    4747 
    48   int add (T* obj, ADDMODE mode, bool bRef);
    49   T* get_object();
    50   ListTemplate<T>* get_next ();
    51   ListTemplate<T>* get_previous ();
    52   ListTemplate<T>* get_last ();
    53   ListTemplate<T>* get_first ();
    54   void set_next (ListTemplate<T>* ptr);
    55   void set_prev (ListTemplate<T>* ptr);
     48  int add(T* obj, ADDMODE mode, bool bRef);
     49  T* getObject();
     50  ListTemplate<T>* getNext();
     51  ListTemplate<T>* getPrevious();
     52  ListTemplate<T>* getLast();
     53  ListTemplate<T>* getFirst();
     54  void setNext(ListTemplate<T>* ptr);
     55  void setPrev(ListTemplate<T>* ptr);
    5656  int remove (T* obj, FINDMODE mode);
    5757  int getSize();
     58  void destroy();
    5859};
    5960
     
    100101  else
    101102  {
    102     if (prev != NULL) prev->set_next (next);
    103     if (next != NULL) next->set_prev (prev);
     103    if (prev != NULL) prev->setNext (next);
     104    if (next != NULL) next->setPrev (prev);
    104105    if (!bReference) delete object;
    105106  }
     
    130131    case LIST_ADD_NEXT:
    131132      p = new ListTemplate<T>( obj, next, this, bRef);
    132       if( next != NULL) next->set_prev (p);
     133      if( next != NULL) next->setPrev (p);
    133134      next = p;
    134135      break;
    135136    case LIST_ADD_PREV:
    136137      p = new ListTemplate<T>( obj, this, prev, bRef);
    137       if( prev != NULL) prev->set_next (p);
     138      if( prev != NULL) prev->setNext (p);
    138139      prev = p;
    139140      break;
     
    159160*/
    160161template<class T>
    161 ListTemplate<T>* ListTemplate<T>::get_next ()
     162ListTemplate<T>* ListTemplate<T>::getNext ()
    162163{
    163164  return next;
     
    169170*/
    170171template<class T>
    171 ListTemplate<T>* ListTemplate<T>::get_previous ()
     172ListTemplate<T>* ListTemplate<T>::getPrevious ()
    172173{
    173174  return prev;
     
    179180*/
    180181template<class T>
    181 ListTemplate<T>* ListTemplate<T>::get_last ()
     182ListTemplate<T>* ListTemplate<T>::getLast ()
    182183{
    183184  if (next == NULL) return this;
    184   else return next->get_last();
     185  else return next->getLast();
    185186}
    186187
     
    190191*/
    191192template<class T>
    192 ListTemplate<T>* ListTemplate<T>::get_first ()
     193ListTemplate<T>* ListTemplate<T>::getFirst ()
    193194{
    194195  if (prev == NULL) return this;
    195   else return prev->get_first();
     196  else return prev->getFirst();
    196197}
    197198
     
    220221        else
    221222        {
    222           if( prev->get_object() == obj)
     223          if( prev->getObject() == obj)
    223224          {
    224225            delete prev;
     
    234235        else
    235236        {
    236           if( next->get_object() == obj)
     237          if( next->getObject() == obj)
    237238          {
    238239            delete next;
     
    259260*/
    260261template<class T>
    261 void ListTemplate<T>::set_next (ListTemplate<T>* ptr)
     262void ListTemplate<T>::setNext (ListTemplate<T>* ptr)
    262263{
    263264  next = ptr;
     
    271272*/
    272273template<class T>
    273 void ListTemplate<T>::set_prev (ListTemplate<T>* ptr)
     274void ListTemplate<T>::setPrev (ListTemplate<T>* ptr)
    274275{
    275276  prev = ptr;
     
    281282*/
    282283template<class T>
    283 T* ListTemplate<T>::get_object()
     284T* ListTemplate<T>::getObject()
    284285{
    285286  return object;
     
    297298}
    298299
    299 #endif
    300 
     300
     301template<class T>
     302void ListTemplate<T>::destroy()
     303{
     304  /* \todo at the moment - doing nothing. should delete everything */
     305}
     306
     307#endif /* _LIST_TENMPLATE_H */
     308
  • orxonox/branches/nico/src/message_structures.h

    r2551 r3238  
    44*/
    55
    6 #ifndef _MESSAGESTRUCTURES_H
    7 #define _MESSAGESTRUCTURES_H
     6#ifndef _MESSAGE_STRUCTURES_H
     7#define _MESSAGE_STRUCTURES_H
    88
    99#define CMD_LENGHT 16
     
    2626} Command;
    2727
    28 #endif
     28#endif /* _MESSAGE_STRUCTURES_H */
  • orxonox/branches/nico/src/npc.h

    r2036 r3238  
    11
    2 #ifndef NPC_H
    3 #define NPC_H
     2#ifndef _NPC_H
     3#define _NPC_H
    44
    55#include "world_entity.h"
     
    4141};
    4242
    43 #endif
     43#endif /* _NPC_H */
  • orxonox/branches/nico/src/orxonox.cc

    r2817 r3238  
    4747Orxonox::~Orxonox ()
    4848{
    49   Orxonox::singleton_ref = NULL;
     49  Orxonox::singletonRef = NULL;
    5050  if( world != NULL) delete world;
    5151  if( localinput != NULL) delete world;
     
    5656
    5757/* this is a singleton class to prevent duplicates */
    58 Orxonox* Orxonox::singleton_ref = 0;
     58Orxonox* Orxonox::singletonRef = 0;
    5959
    6060Orxonox* Orxonox::getInstance (void)
    6161{
    62   if (singleton_ref == NULL)
    63     singleton_ref = new Orxonox();
    64   return singleton_ref;
     62  if (singletonRef == NULL)
     63    singletonRef = new Orxonox();
     64  return singletonRef;
    6565}
    6666
     
    7272   it's path and name into configfilename
    7373*/
    74 void Orxonox::get_config_file (int argc, char** argv)
    75 {
    76   /*    char* path;
    77     #ifdef __WIN32__
    78     path = getenv("");
    79     #else
    80     path = getenv("HOME");
    81     #endif
    82    
    83     if( path != NULL) strcpy (configfilename, path);
    84     else strcpy (configfilename, "./");
    85     strcat (configfilename, "/.orxonox.conf");*/
    86  
     74void Orxonox::getConfigFile (int argc, char** argv)
     75{
    8776  strcpy (configfilename, "orxonox.conf");
    8877}
     
    9685  // config file
    9786 
    98   get_config_file (argc, argv);
    99  
    100   // initialize SDL
    101   printf("> Initializing SDL\n");
    102   if( SDL_Init (SDL_INIT_EVERYTHING) == -1)
     87  getConfigFile (argc, argv);
     88  SDL_Init (SDL_INIT_TIMER);
     89  // initialize everything
     90  if( initVideo() == -1) return -1;
     91  if( initSound() == -1) return -1;
     92  printf("> Initializing input\n");
     93  if( initInput() == -1) return -1;
     94  printf("> Initializing networking\n");
     95  if( initNetworking () == -1) return -1;
     96  printf("> Initializing resources\n");
     97  if( initResources () == -1) return -1;
     98  //printf("> Initializing world\n");
     99  //if( init_world () == -1) return -1; PB: world will be initialized when started
     100 
     101  return 0;
     102}
     103
     104/**
     105   \brief initializes SDL and OpenGL
     106*/
     107int Orxonox::initVideo()
     108{
     109  printf("> Initializing video\n");
     110  if (SDL_Init(SDL_INIT_VIDEO) == -1)
    103111    {
    104       printf ("Could not SDL_Init(): %s\n", SDL_GetError());
     112      printf ("could not initialize SDL Video\n");
    105113      return -1;
    106114    }
    107  
    108   // initialize everything
    109   printf("> Initializing video\n");
    110   if( init_video () == -1) return -1;
    111   printf("> Initializing sound\n");
    112   if( init_sound () == -1) return -1;
    113   printf("> Initializing input\n");
    114   if( init_input () == -1) return -1;
    115   printf("> Initializing networking\n");
    116   if( init_networking () == -1) return -1;
    117   printf("> Initializing resources\n");
    118   if( init_resources () == -1) return -1;
    119   //printf("> Initializing world\n");
    120   //if( init_world () == -1) return -1; PB: world will be initialized when started
    121  
    122   return 0;
    123 }
    124 
    125 /**
    126    \brief initializes SDL and OpenGL
    127 */
    128 int Orxonox::init_video ()
    129 {
    130115  // Set video mode
    131116  // TO DO: parse arguments for settings
    132   SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 5);
    133   SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 5);
    134   SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 5);
    135   SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16);
     117  SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
     118  SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
     119  SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
     120  SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
    136121 
    137122  int bpp = 16;
     
    140125  Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
    141126 
    142   if( (screen = SDL_SetVideoMode (width, height, bpp, flags)) == NULL)
     127  if((screen = SDL_SetVideoMode (width, height, bpp, flags)) == NULL)
    143128  {
    144     printf ("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, flags, SDL_GetError());
     129    printf("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, flags, SDL_GetError());
    145130    SDL_Quit();
    146131    return -1;
     
    148133 
    149134  // Set window labeling
    150   // TO DO: Add version information to caption
    151   SDL_WM_SetCaption( "Orxonox", "Orxonox");
     135  SDL_WM_SetCaption("Orxonox " PACKAGE_VERSION, "Orxonox " PACKAGE_VERSION);
    152136 
    153137  // TO DO: Create a cool icon and use it here
     
    176160 
    177161  // create camera
    178   localcamera = new Camera(world);
    179  
    180   return 0;
    181 }
     162  //localcamera = new Camera(world); /* \todo camera/input node not used anymore*/
     163 
     164  return 0;
     165}
     166
    182167
    183168/**
    184169   \brief initializes the sound engine
    185170*/
    186 int Orxonox::init_sound ()
    187 {
     171int Orxonox::initSound()
     172{
     173  printf("> Initializing sound\n");
     174  // SDL_Init(SDL_INIT_AUDIO);
    188175  printf("Not yet implemented\n");
    189176  return 0;
    190177}
    191178
     179
    192180/**
    193181   \brief initializes input functions
    194182*/
    195 int Orxonox::init_input ()
     183int Orxonox::initInput()
    196184{
    197185  // create localinput
     
    201189}
    202190
     191
    203192/**
    204193   \brief initializes network system
    205194*/
    206 int Orxonox::init_networking ()
     195int Orxonox::initNetworking()
    207196{
    208197  printf("Not yet implemented\n");
     
    210199}
    211200
     201
    212202/**
    213203   \brief initializes and loads resource files
    214204*/
    215 int Orxonox::init_resources ()
     205int Orxonox::initResources()
    216206{
    217207  printf("Not yet implemented\n");
     
    219209}
    220210
     211
    221212/**
    222213   \brief initializes the world
    223214*/
    224 int Orxonox::init_world ()
     215int Orxonox::initWorld()
    225216{
    226217  //world = new World();
     
    250241}
    251242
     243
    252244/**
    253245   \brief exits Orxonox
     
    258250}
    259251
    260 /**
    261    \brief this runs all of Orxonox
    262 */
    263 void Orxonox::mainLoop()
    264 {
    265   lastframe = SDL_GetTicks();
    266   bQuitOrxonox = false;
    267   // This is where everything is run
    268   printf("Orxonox|Entering main loop\n");
    269   while( !bQuitOrxonox)
    270     {
    271       // Network
    272       synchronize();
    273       // Process input
    274       handle_input();
    275       // Process time
    276       time_slice();
    277       // Process collision
    278       collision();
    279       // Draw
    280       display();
    281     }
    282   printf("Orxonox|Exiting the main loop\n");
    283 }
     252
    284253
    285254/**
     
    287256   \param event: an event not handled by the CommandNode
    288257*/
    289 void Orxonox::event_handler (SDL_Event* event)
     258void Orxonox::eventHandler(SDL_Event* event)
    290259{
    291260  // Handle special events such as reshape, quit, focus changes
    292261}
    293 
    294 /**
    295    \brief synchronize local data with remote data
    296 */
    297 void Orxonox::synchronize ()
    298 {
    299   // Get remote input
    300   // Update synchronizables
    301 }
    302 
    303 /**
    304    \brief run all input processing
    305 */
    306 void Orxonox::handle_input ()
    307 {
    308   // localinput
    309   localinput->process();
    310   // remoteinput
    311 }
    312 
    313 /**
    314    \brief advance the timeline
    315 */
    316 void Orxonox::time_slice ()
    317 {
    318   Uint32 curframe = SDL_GetTicks();
    319   if( !pause)
    320     {
    321       Uint32 dt = curframe - lastframe;
    322      
    323       if(dt > 0)
    324         {
    325           float fps = 1000/dt;
    326           printf("fps = %f\n", fps);
    327         }
    328      
    329       world->time_slice (dt);
    330       world->update ();
    331       localcamera->time_slice (dt);
    332     }
    333   lastframe = curframe;
    334 }
    335 
    336 /**
    337    \brief compute collision detection
    338 */
    339 void Orxonox::collision ()
    340 {
    341   world->collide ();
    342 }
     262 
    343263
    344264/**
     
    347267   \return true if the command was handled by the system or false if it may be passed to the WorldEntities
    348268*/
    349 bool Orxonox::system_command (Command* cmd)
    350 {
     269bool Orxonox::systemCommand(Command* cmd)
     270{
     271  /*
    351272  if( !strcmp( cmd->cmd, "quit"))
    352273    {
     
    355276    }
    356277  return false;
    357 }
    358 
    359 /**
    360    \brief render the current frame
    361 */
    362 void Orxonox::display ()
    363 {
    364   // clear buffer
    365   glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    366   // set camera
    367   localcamera->apply ();
    368   // draw world
    369   world->draw ();
    370   // draw HUD
    371   // flip buffers
    372   SDL_GL_SwapBuffers();
    373 }
     278  */
     279  return false;
     280}
     281
    374282
    375283/**
     
    377285   \return a pointer to localcamera
    378286*/
    379 Camera* Orxonox::get_camera ()
     287Camera* Orxonox::getCamera()
    380288{
    381289  return localcamera;
    382290}
     291
    383292
    384293/**
     
    386295   \return a pointer to localinput
    387296*/
    388 CommandNode* Orxonox::get_localinput ()
     297CommandNode* Orxonox::getLocalInput()
    389298{
    390299  return localinput;
    391300}
     301
    392302
    393303/**
     
    395305   \return a pointer to world
    396306*/
    397 World* Orxonox::get_world ()
     307World* Orxonox::getWorld()
    398308{
    399309  return world;
    400310}
    401311
    402 int main (int argc, char** argv)
     312
     313
     314
     315int main(int argc, char** argv)
    403316
    404317  printf(">>> Starting Orxonox <<<\n");
    405318  Orxonox *orx = Orxonox::getInstance();
    406319 
    407   if( (*orx).init(argc, argv) == -1)
     320  if((*orx).init(argc, argv) == -1)
    408321    {
    409322      printf("! Orxonox initialization failed\n");
     
    411324    }
    412325 
    413   //(*orx).mainLoop();
    414 
    415326  orx->start();
    416327 
  • orxonox/branches/nico/src/orxonox.h

    r2995 r3238  
    44*/
    55
    6 #ifndef ORXONOX_H
    7 #define ORXONOX_H
     6#ifndef _ORXONOX_H
     7#define _ORXONOX_H
    88
    99#include "stdincl.h"
     
    2222
    2323 private:
    24   static Orxonox* singleton_ref;
     24  static Orxonox* singletonRef;
    2525  Orxonox ();
    2626  ~Orxonox ();
     
    3838  Uint32 lastframe;
    3939 
    40   void get_config_file (int argc, char** argv);
     40  void getConfigFile (int argc, char** argv);
    4141 
    4242  // main loop functions
    43   void synchronize ();
    44   void handle_input ();
    45   void time_slice ();
    46   void collision ();
    47   void display ();
     43  //  void synchronize ();
     44  //void handle_input ();
     45  //void time_slice ();
     46  //void collision ();
     47  //void display ();
    4848 
    4949        // subsystem initialization
    50   int init_video ();
    51   int init_sound ();
    52   int init_input ();
    53   int init_networking ();
    54   int init_resources ();
    55   int init_world ();
     50  int initVideo ();
     51  int initSound ();
     52  int initInput ();
     53  int initNetworking ();
     54  int initResources ();
     55  int initWorld ();
    5656 
    5757 public:
     
    6060  void quitGame();
    6161
    62   void event_handler (SDL_Event* event);
    63   bool system_command (Command* cmd);
     62  void eventHandler (SDL_Event* event);
     63  bool systemCommand (Command* cmd);
    6464
    6565  int init (int argc, char** argv);
    6666 
    67   CommandNode* get_localinput();
    68   Camera* get_camera();
    69   World* get_world();
     67  CommandNode* getLocalInput();
     68  Camera* getCamera();
     69  World* getWorld();
    7070 
    71   void mainLoop();
     71  //void mainLoop();
    7272};
    7373
    74 #endif
     74#endif /* _ORXONOX_H */
    7575
  • orxonox/branches/nico/src/player.cc

    r2969 r3238  
    2626{
    2727
    28   obj = new Object ("reaplow.obj");
     28  this->obj = new Object("reaplow.obj");
    2929  /*
    3030  objectList = glGenLists(1);
     
    5454}
    5555
    56 Player::~Player ()
    57 
     56Player::~Player()
    5857{
     58  delete this->obj;
    5959}
    6060
    61 void Player::post_spawn ()
     61void Player::postSpawn()
    6262{
    63   travel_speed = 15.0;
     63  travelSpeed = 15.0;
    6464  velocity = Vector();
    6565  bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
    6666  bFire = false;
    6767  acceleration = 10.0;
    68   set_collision (new CollisionCluster (1.0, Vector(0,0,0)));
     68  setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
    6969}
    7070
    71 void Player::tick (float time)
     71void Player::tick(float time)
    7272{
    73         // movement
    74         move (time);
     73  // movement
     74  move (time);
    7575}
    7676
    77 void Player::hit (WorldEntity* weapon, Vector loc)
     77void Player::hit(WorldEntity* weapon, Vector loc)
    7878{
    7979}
    8080
    81 void Player::destroy ()
     81void Player::destroy()
    8282{
    8383}
    8484
    85 void Player::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags)
     85void Player::collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags)
    8686{
    8787}
    8888
    89 void Player::command (Command* cmd)
     89void Player::command(Command* cmd)
    9090{
    9191  //printf("Player|recieved command [%s]\n", cmd->cmd);
     
    9797}
    9898
    99 void Player::draw ()
     99void Player::draw()
    100100{
    101101  glMatrixMode(GL_MODELVIEW);
     
    103103  float matrix[4][4];
    104104 
    105   glTranslatef(get_placement()->r.x,get_placement()->r.y,get_placement()->r.z);
    106   get_placement()->w.matrix (matrix);
    107   glMultMatrixf ((float*)matrix);
     105  glTranslatef(getPlacement()->r.x, getPlacement()->r.y, getPlacement()->r.z);
     106  getPlacement()->w.matrix (matrix);
     107  glMultMatrixf((float*)matrix);
    108108 
    109   glMatrixMode (GL_MODELVIEW);
    110   glRotatef (-90, 0,1,0);
     109  glMatrixMode(GL_MODELVIEW);
     110  glRotatef(-90, 0,1,0);
    111111  obj->draw();
    112   //  glCallList (objectList);
     112  // glCallList(objectList);
    113113
    114114 
    115115 
    116   //printf("Player@%f/%f/%f\n", get_placement()->r.x, get_placement()->r.y, get_placement()->r.z);
    117116}
    118117
    119 void Player::get_lookat (Location* locbuf)
     118void Player::getLookat(Location* locbuf)
    120119{
    121         *locbuf = *get_location();
    122         //locbuf->dist += 5.0;
     120  *locbuf = *getLocation();
     121  //locbuf->dist += 5.0;
    123122}
    124123
    125 void Player::left_world ()
     124void Player::leftWorld()
    126125{
    127126}
    128127
    129 void Player::move (float time)
     128void Player::move(float time)
    130129{
    131130  Vector accel(0.0, 0.0, 0.0);
    132   /* FIXME: calculating the direction and orthDirection every time_slice is redundant! save it somewhere */
    133   Placement *pos = get_placement();
     131  /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
     132  Placement *pos = getPlacement();
    134133  /* calculate the direction in which the craft is heading  */
    135134  Vector direction(0.0, 0.0, 1.0);
     
    143142  if( bRight ) { accel = accel - (orthDirection*acceleration); }
    144143  if( bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */}
    145   if( bDescend) {/* FIXME */}
     144  if( bDescend) {/* FIXME */} /* \todo up and down player movement */
    146145
    147   Location* l = get_location();
     146  Location* l = getLocation();
    148147 
    149148  // r(t) = r(0) + v(0)*t + 1/2*a*t^2
     
    153152
    154153  /* this the base-speed of the player: determines how fast and how the player follows the track*/
    155   l->dist = l->dist + travel_speed * time;
     154  l->dist = l->dist + travelSpeed * time;
    156155
    157156  /* this updates the player position on the track - user interaction */
    158157  l->pos = l->pos + accel*time;
    159158}
    160 
    161 
    162 
    163 
    164 
    165 
    166 
    167 
    168 
    169 
    170 
    171 
    172 
    173 
    174 
    175 
    176 
    177 
  • orxonox/branches/nico/src/player.h

    r2811 r3238  
    44*/
    55
    6 #ifndef PLAYER_H
    7 #define PLAYER_H
     6#ifndef _PLAYER_H
     7#define _PLAYER_H
    88
    99#include "world_entity.h"
    10 #include "object.h"
     10#include "importer/object.h"
    1111
    1212//! Basic controllable WorldEntity
     
    1616 
    1717 public:
    18   Player (bool isFree = false);
    19   ~Player ();
     18  Player(bool isFree = false);
     19  ~Player();
    2020 
    21   virtual void post_spawn ();
    22   virtual void tick (float time);
    23   virtual void hit (WorldEntity* weapon, Vector loc);
    24   virtual void destroy ();
    25   virtual void collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags);
    26   virtual void command (Command* cmd);
     21  virtual void postSpawn();
     22  virtual void tick(float time);
     23  virtual void hit(WorldEntity* weapon, Vector loc);
     24  virtual void destroy();
     25  virtual void collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags);
     26  virtual void command(Command* cmd);
    2727 
    28   virtual void draw ();
    29   virtual void get_lookat (Location* locbuf);
     28  virtual void draw();
     29  virtual void getLookat(Location* locbuf);
    3030 
    31   virtual void left_world ();
     31  virtual void leftWorld();
    3232 
    3333 private:
     
    3535  bool bFire;
    3636  Vector velocity;
    37   float travel_speed;
     37  float travelSpeed;
    3838  float acceleration;
    3939  GLuint objectList;
    4040  Object* obj;
    4141 
    42   void move (float time);
     42  void move(float time);
    4343 
    4444};
    4545
    46 #endif
     46#endif /* _PLAYER_H */
  • orxonox/branches/nico/src/power_up.h

    r2077 r3238  
    44*/
    55
    6 #ifndef POWER_UP_H
    7 #define POWER_UP_H
     6#ifndef _POWER_UP_H
     7#define _POWER_UP_H
    88
    99#include "data_tank.h"
     
    1919};
    2020
    21 #endif
     21#endif /* _POWER_UP_H */
  • orxonox/branches/nico/src/proto_class.h

    r2036 r3238  
    11
    2 #ifndef PROTO_CLASS_H
    3 #define PROTO_CLASS_H
     2#ifndef _PROTO_CLASS_H
     3#define _PROTO_CLASS_H
    44
    55#include "data_tank.h"
     
    1414};
    1515
    16 #endif
     16#endif /* _PROTO_CLASS_H */
  • orxonox/branches/nico/src/shoot_laser.h

    r2036 r3238  
    11
    2 #ifndef SHOOT_LASER_H
    3 #define SHOOT_LASER_H
     2#ifndef _SHOOT_LASER_H
     3#define _SHOOT_LASER_H
    44
    55
     
    4040};
    4141
    42 #endif
     42#endif /* _SHOOT_LASER_H */
  • orxonox/branches/nico/src/shoot_rocket.h

    r2036 r3238  
    11
    2 #ifndef SHOOT_ROCKET_H
    3 #define SHOOT_ROCKET_H
     2#ifndef _SHOOT_ROCKET_H
     3#define _SHOOT_ROCKET_H
    44
    55
     
    5454};
    5555
    56 #endif
     56#endif /* _SHOOT_ROCKET_H */
  • orxonox/branches/nico/src/stdincl.h

    r2995 r3238  
     1/*!
     2  \file stdincl.h
     3  \brief This file includes default headers that nearly every Class needs.
     4 
     5  no Class is defined here, but many headers to classes, and more general Headers like the openGL-header.
     6*/
    17
    2 #ifndef STDINCL_H
    3 #define STDINCL_H
     8#ifndef _STDINCL_H
     9#define _STDINCL_H
    410
    5 #define null 0
     11#define null 0   //!< null
     12
     13// this includes the information from configure/makefiles
     14#if HAVE_CONFIG_H
     15#include <config.h>
     16#endif
    617
    718#ifdef __WIN32__
     
    1122#ifndef __APPLE__
    1223#include <SDL/SDL.h>
     24#include <GL/gl.h>
     25#include <GL/glu.h>
    1326#else
    1427#include <SDL.h>
     28#include <OpenGL/gl.h>
     29#include <OpenGL/glu.h>
    1530#endif
    16 
    17 #include <GL/gl.h>
    18 #include <GL/glu.h>
    1931
    2032#include "vector.h"
     
    2335#include "list_template.h"
    2436#include "error.h"
     37#include "debug.h"
    2538#include "message_structures.h"
    2639#include "orxonox.h"
    2740
    28 #endif
     41#endif /* _STDINCL_H */
  • orxonox/branches/nico/src/story_def.h

    r2636 r3238  
    11
    2 #ifndef STORY_DEF_H
    3 #define STORY_DEF_H
     2#ifndef _STORY_DEF_H
     3#define _STORY_DEF_H
    44
    55
    6 #define DEBUG_CAMPAIGN_0 0
    7 #define DEBUG_CAMPAIGN_1 1
    8 #define DEBUG_CAMPAIGN_2 2
     6#define DEBUG_CAMPAIGN_0 1000
     7#define DEBUG_CAMPAIGN_1 1001
     8#define DEBUG_CAMPAIGN_2 1002
    99
    10 #define DEBUG_WORLD_0 0
    11 #define DEBUG_WORLD_1 1
    12 #define DEBUG_WORLD_2 2
     10#define DEBUG_WORLD_0 100
     11#define DEBUG_WORLD_1 101
     12#define DEBUG_WORLD_2 102
    1313
    1414#define WORLD_ID_0 0
     
    2020#define WORLD_ID_GAMEEND 999
    2121
    22 #define MAX_STORY_ENTITIES 99; //!> maximal StoryEntities in a Campaign
     22#define MAX_STORY_ENTITIES 99 //!> maximal StoryEntities in a Campaign
    2323
    24 #endif
     24#endif /* _STORY_DEF_H */
  • orxonox/branches/nico/src/story_entity.cc

    r2636 r3238  
    3030/**
    3131    \brief initialize the entity before use.
     32    \returns an error code if not able to apply.
    3233
    3334    After execution of this function, the Entity is ready to be played/executed,
    3435    this shifts the initialisation work before the execution - very important...
    35    
    3636*/
    37 Error StoryEntity::init()
     37ErrorMessage StoryEntity::init()
    3838{}
    3939
    4040
    41 void StoryEntity::setStoryID(Uint32 storyID)
     41/**
     42    \brief sets the story ID
     43
     44    sets the story id of the current entity, this enables it to be identified in a
     45    global context.
     46*/
     47void StoryEntity::setStoryID(int storyID)
    4248{
    4349  this->storyID = storyID;
    4450}
    4551
     52
     53/**
     54    \brief this reads the story id of the current entity
     55    \returns the story entity id
     56*/
    4657int StoryEntity::getStoryID()
    4758{
     
    5061
    5162
    52 void StoryEntity::setNextStoryID(Uint32 nextStoryID)
     63/**
     64    \brief sets the id of the next story entity
     65   
     66    StoryEntities can choose their following entity themselfs. the entity id defined here
     67    will be startet after this entity ends. this can be convenient if you want to have a
     68    non linear story with switches.
     69*/
     70void StoryEntity::setNextStoryID(int nextStoryID)
    5371{
    5472  this->nextStoryID = nextStoryID;
    5573}
    5674
    57 Uint32 StoryEntity::getNextStoryID()
     75/**
     76    \brief gets the story id of the current entity
     77    \returns story id
     78*/
     79int StoryEntity::getNextStoryID()
    5880{
    5981  return this->nextStoryID;
     
    6183
    6284
    63 Error StoryEntity::start(Uint32 storyID)
    64 {}
     85/**
     86    \brief starts the entity with the choosen id. only for entities with lists.
     87    \param story id
     88    \returns error code if this action has caused a error
    6589
    66 Error StoryEntity::start()
    67 {}
    68 
    69 Error StoryEntity::stop()
    70 {}
    71 
    72 Error StoryEntity::pause()
    73 {}
    74 
    75 Error StoryEntity::resume()
     90    this simply starts the story with the id storyID. the story with the choosen id has
     91    to be part of the current entity else, this doesn't make sense. this is used for
     92    campaigns or the GameLoader, they have lists of Campaigns/Worlds with their own
     93    storyID.
     94*/
     95ErrorMessage StoryEntity::start(int storyID)
    7696{}
    7797
    7898
     99/**
     100    \brief starts the current entity
     101    \returns error code if this action has caused a error   
     102*/
     103ErrorMessage StoryEntity::start()
     104{}
     105
     106
     107/**
     108    \brief stops the current entity
     109    \returns error code if this action has caused a error
     110
     111    ATTENTION: this function shouldn't call other functions, or if so, they must return
     112    after finishing. If you ignore or forget to do so, the current entity is not able to
     113    terminate and it will run in the background or the ressources can't be freed or even
     114    worse: are freed and the program will end in a segmentation fault!
     115    hehehe, all seen... :)
     116*/
     117ErrorMessage StoryEntity::stop()
     118{}
     119
     120
     121/**
     122    \brief pause the current entity
     123    \returns error code if this action has caused a error
     124
     125    this pauses the current entity or passes this call forth to the running entity.
     126*/
     127ErrorMessage StoryEntity::pause()
     128{}
     129
     130
     131/**
     132    \brief resumes a pause
     133    \returns error code if this action has caused a error
     134
     135    this resumess the current entity or passes this call forth to the running entity.
     136*/
     137ErrorMessage StoryEntity::resume()
     138{}
     139
     140
     141/**
     142    \brief loads the current entity
     143
     144    this is here to enable you loading maps into the entities. for all other actions you
     145    should take the init() function.
     146*/
    79147void StoryEntity::load()
    80148{}
    81149
    82150
    83 void StoryEntity::displayEntityScreen()
     151/**
     152    \brief destroys and cleans up the current entity.
     153
     154    this cleans up ressources before the deconstructor is called. for terminating
     155    the entity please use the stop() function.
     156*/
     157void StoryEntity::destroy()
    84158{}
    85159
    86 void StoryEntity::releaseEntityScreen()
     160
     161/**
     162    \brief this displays the load screen
     163
     164    it will need some time to load maps or things like that. to inform the user about
     165    progress and to just show him/her something for the eyes, put here this stuff
     166*/
     167void StoryEntity::displayLoadScreen()
    87168{}
     169
     170
     171/**
     172    \brief undisplay the load screen
     173
     174    the load process has terminated, you now can release the load screen and start this
     175    entity.
     176*/
     177void StoryEntity::releaseLoadScreen()
     178{}
  • orxonox/branches/nico/src/story_entity.h

    r2636 r3238  
     1/*!
     2    \file story_entity.h
     3    \brief holds the base class of everything that is playable - that is part of the story
     4*/
    15
    2 #ifndef STORY_ENTITY_H
    3 #define STORY_ENTITY_H
     6
     7#ifndef _STORY_ENTITY_H
     8#define _STORY_ENTITY_H
    49
    510#include "stdincl.h"
    611#include "story_def.h"
    712
     13//! A class that represents something to play in orxonox. it is a container for worlds, movies, mission briefings, etc...
    814class StoryEntity {
    915
    1016 public:
    1117  StoryEntity ();
    12   ~StoryEntity ();
     18  virtual ~StoryEntity ();
    1319
    14   bool isInit;
    15   bool isPaused;
     20  bool isInit;  //! if the entity is initialized, this has to be true
     21  bool isPaused; //! is true if the entity is paused
    1622
    17   virtual Error init();
    18   virtual Error start(Uint32 storyID);
    19   virtual Error start();
    20   virtual Error stop();
    21   virtual Error pause();
    22   virtual Error resume();
     23  virtual ErrorMessage init();
     24  virtual ErrorMessage start(int storyID);
     25  virtual ErrorMessage start();
     26  virtual ErrorMessage stop();
     27  virtual ErrorMessage pause();
     28  virtual ErrorMessage resume();
    2329
    2430  virtual void load();
     31  virtual void destroy();
    2532
    26   virtual void displayEntityScreen();
    27   virtual void releaseEntityScreen();
     33  virtual void displayLoadScreen();
     34  virtual void releaseLoadScreen();
    2835
    29   void setStoryID(Uint32 storyID);
     36  void setStoryID(int storyID);
    3037  int getStoryID();
    3138
    32   void setNextStoryID(Uint32 nextStoryID);
    33   Uint32 getNextStoryID();
     39  void setNextStoryID(int nextStoryID);
     40  int getNextStoryID();
    3441
    3542
    3643 private:
    37   Uint32 storyID;
    38   Uint32 nextStoryID;
     44  int storyID; //! this is the number of this entity, identifying it in a list/tree...
     45  int nextStoryID; //! if this entity has finished, this entity shall be called
    3946};
    4047
    41 #endif
     48#endif /* _STORY_ENTITY_H */
  • orxonox/branches/nico/src/synchronisable.h

    r2036 r3238  
    11
    2 #ifndef SYNCHRONISABLE_H
    3 #define SYNCHRONISABLE_H
     2#ifndef _SYNCHRONISABLE_H
     3#define _SYNCHRONISABLE_H
    44
    55#include "data_tank.h"
     
    2222};
    2323
    24 #endif
     24#endif /* _SYNCHRONISABLE_H */
  • orxonox/branches/nico/src/track.cc

    r3005 r3238  
    2121
    2222/**
    23         \brief creates a null Track part
     23   \brief creates a null Track part
    2424*/
    2525Track::Track ()
    2626{
    27         ID = 0;
    28         offset = NULL;
    29         end = NULL;
    30         nextID = 0;
     27  this->ID = 0;
     28  this->offset = NULL;
     29  this->end = NULL;
     30  this->nextID = 0;
    3131}
    3232
    3333/**
    34         \brief creates a functional base Track part
    35         \param number: the ID if this Track part
    36         \param next: the ID of the next Track part
    37         \param start: pointer to an anchor point (Vector) representing the offset of this part
    38         \param finish: pointer to an anchor point (Vector) representing the end of this part
     34   \brief creates a functional base Track part
     35   \param number: the ID if this Track part
     36   \param next: the ID of the next Track part
     37   \param start: pointer to an anchor point (Vector) representing the offset of this part
     38   \param finish: pointer to an anchor point (Vector) representing the end of this part
    3939*/
    4040Track::Track (Uint32 number, Uint32 next, Vector* start, Vector* finish)
    4141{
    42         ID = number;
    43         offset = start;
    44         end = finish;
    45         nextID = next;
     42  this->ID = number;
     43  this->offset = start;
     44  this->end = finish;
     45  this->nextID = next;
    4646}
    4747
    4848/**
    49         \brief removes the Track part from memory
     49   \brief removes the Track part from memory
    5050*/
    5151Track::~Track ()
     
    6868   at inside camera boundaries.
    6969*/
    70 void Track::map_camera (Location* lookat, Placement* camplc)
     70void Track::mapCamera (Location* lookat, Placement* camplc)
    7171{
    7272  Line trace(*offset, *end - *offset);
     
    103103   when transfering between track parts.
    104104*/
    105 bool Track::map_coords (Location* loc, Placement* plc)
     105bool Track::mapCoords (Location* loc, Placement* plc)
    106106{
    107         Line trace(*offset, *end - *offset);
    108         float l = trace.len ();
    109        
    110         /* change to the next track? */
    111         if( loc->dist > l)
    112         {
    113                 loc->dist -= l;
    114                 loc->part = nextID;
    115                 //FIXME: loc->track = this;
    116                 return true;
    117         }
    118        
    119         /* this quaternion represents the rotation from start-vector (0,0,1) to the direction of
    120         * the track */
    121         Quaternion dir(trace.a, Vector(0,0,1));
    122 
    123         plc->r = trace.r + (trace.a * ((loc->dist) / l)) + /*dir.apply*/(loc->pos);
    124         plc->w = dir * loc->rot;
    125        
    126         return false;
     107  Line trace(*offset, *end - *offset);
     108  float l = trace.len ();
     109 
     110  /* change to the next track? */
     111  if( loc->dist > l)
     112    {
     113      loc->dist -= l;
     114      loc->part = nextID;
     115      //FIXME: loc->track = this;
     116      return true;
     117    }
     118 
     119  /* this quaternion represents the rotation from start-vector (0,0,1) to the direction of
     120  * the track */
     121  Quaternion dir(trace.a, Vector(0,0,1));
     122 
     123  plc->r = trace.r + (trace.a * ((loc->dist) / l)) + /*dir.apply*/(loc->pos);
     124  plc->w = dir * loc->rot;
     125 
     126  return false;
    127127}
    128128
     129
    129130/**
    130         \brief this is called when a WorldEntity enters a Track part
    131         \param entity: pointer to the WorldEntity in question
    132        
    133         You can do stuff like add or remove effects, do some coordinate finetuning
    134         or whatever in here.
     131   \brief this is called when a WorldEntity enters a Track part
     132   \param entity: pointer to the WorldEntity in question
     133   
     134   You can do stuff like add or remove effects, do some coordinate finetuning
     135   or whatever in here.
    135136*/
    136 void Track::post_enter (WorldEntity* entity)
     137void Track::postEnter (WorldEntity* entity)
    137138{
    138139}
    139140
     141
    140142/**
    141         \brief this is called when a WorldEntity leaves a Track part
    142         \param entity: pointer to the WorldEntity in question
    143        
    144         You can do stuff like add or remove effects, do some coordinate finetuning
    145         or whatever in here.
     143   \brief this is called when a WorldEntity leaves a Track part
     144   \param entity: pointer to the WorldEntity in question
     145   
     146   You can do stuff like add or remove effects, do some coordinate finetuning
     147   or whatever in here.
    146148*/
    147 void Track::post_leave (WorldEntity* entity)
     149void Track::postLeave (WorldEntity* entity)
    148150{
    149151}
    150152
     153
    151154/**
    152         \brief this is called every frame
    153         \param deltaT: amount of time passed since the last frame in seconds
    154        
    155         Do time based or polling scripts here.
     155   \brief this is called every frame
     156   \param deltaT: amount of time passed since the last frame in seconds
     157   
     158   Do time based or polling scripts here.
    156159*/
    157160void Track::tick (float deltaT)
  • orxonox/branches/nico/src/track.h

    r2636 r3238  
    44*/
    55
    6 #ifndef TRACK_H
    7 #define TRACK_H
     6#ifndef _TRACK_H
     7#define _TRACK_H
    88
    99#include "stdincl.h"
     
    2525  Uint32 nextID;
    2626 
    27         
     27  
    2828 public:
    2929  Track ();
     
    3232  virtual void init();
    3333 
    34   virtual void post_enter (WorldEntity* entity);        // handle coordinate transition in here !!! (when dist < 0 or dist > lasttracklenght)
    35   virtual void post_leave (WorldEntity* entity);
     34  virtual void postEnter (WorldEntity* entity); // handle coordinate transition in here !!! (when dist < 0 or dist > lasttracklenght)
     35  virtual void postLeave (WorldEntity* entity);
    3636  virtual void tick (float deltaT);
    37   virtual void map_camera (Location* lookat, Placement* camplc);
    38   virtual bool map_coords (Location* loc, Placement* plc);      // this should return true if the entity left track boundaries
     37  virtual void mapCamera (Location* lookat, Placement* camplc);
     38  virtual bool mapCoords (Location* loc, Placement* plc);       // this should return true if the entity left track boundaries
    3939};
    4040
    41 #endif
     41#endif /* _TRACK_H */
  • orxonox/branches/nico/src/vector.cc

    r3004 r3238  
    203203   \return the angle between the vectors in radians
    204204*/
    205 float angle_rad (const Vector& v1, const Vector& v2)
     205float angleRad (const Vector& v1, const Vector& v2)
    206206{
    207207  return acos( v1 * v2 / (v1.len() * v2.len()));
     
    215215   \return the angle between the vectors in degrees
    216216*/
    217 float angle_deg (const Vector& v1, const Vector& v2)
     217float angleDeg (const Vector& v1, const Vector& v2)
    218218{
    219219  float f;
     
    243243
    244244/**
    245    \brief calculates a look_at rotation
     245   \brief calculates a lookAt rotation
    246246   \param dir: the direction you want to look
    247247   \param up: specify what direction up should be
     
    578578  Vector axis = x.cross( v);
    579579  axis.normalize();
    580   float angle = angle_rad( x, v);
     580  float angle = angleRad( x, v);
    581581  float ca = cos(angle);
    582582  float sa = sin(angle);
     
    714714   \return the rotated vector
    715715*/
    716 Vector rotate_vector( const Vector& v, const Rotation& r)
     716Vector rotateVector( const Vector& v, const Rotation& r)
    717717{
    718718  Vector t;
     
    745745   \return the distance between the Line and the point
    746746*/
    747 float Line::distance_point (const Vector& v) const
     747float Line::distancePoint (const Vector& v) const
    748748{
    749749  Vector d = v-r;
     
    761761  Vector* fp = new Vector[2];
    762762  Plane p = Plane (r + a.cross(l.a), r, r + a);
    763   fp[1] = p.intersect_line (l);
     763  fp[1] = p.intersectLine (l);
    764764  p = Plane (fp[1], l.a);
    765   fp[0] = p.intersect_line (*this);
     765  fp[0] = p.intersectLine (*this);
    766766  return fp;
    767767}
     
    783783{
    784784  Vector t = a + r;
    785   t = rotate_vector( t, rot);
    786   r = rotate_vector( r, rot),
     785  t = rotateVector( t, rot);
     786  r = rotateVector( r, rot),
    787787  a = t - r;
    788788}
     
    815815   \param l: a line
    816816*/
    817 Vector Plane::intersect_line (const Line& l) const
     817Vector Plane::intersectLine (const Line& l) const
    818818{
    819819  if (n.x*l.a.x+n.y*l.a.y+n.z*l.a.z == 0.0) return Vector(0,0,0);
     
    827827   \return the distance between the plane and the point (can be negative)
    828828*/
    829 float Plane::distance_point (const Vector& p) const
     829float Plane::distancePoint (const Vector& p) const
    830830{
    831831  float l = n.len();
     
    839839   \return 0 if the point is contained within the Plane, positive(negative) if the point is in the positive(negative) semi-space of the Plane
    840840*/
    841 float Plane::locate_point (const Vector& p) const
     841float Plane::locatePoint (const Vector& p) const
    842842{
    843843  return (n.dot(p) + k);
  • orxonox/branches/nico/src/vector.h

    r3004 r3238  
    66*/
    77
    8 #ifndef VECTOR_H
    9 #define VECTOR_H
     8#ifndef _VECTOR_H
     9#define _VECTOR_H
    1010
    1111#include <math.h>
     
    4040};
    4141
    42 float angle_deg (const Vector& v1, const Vector& v2);
    43 float angle_rad (const Vector& v1, const Vector& v2);
     42float angleDeg (const Vector& v1, const Vector& v2);
     43float angleRad (const Vector& v1, const Vector& v2);
    4444
    4545//! Quaternion
     
    9898
    9999//!< Apply a rotation to a vector
    100 Vector rotate_vector( const Vector& v, const Rotation& r);
     100Vector rotateVector( const Vector& v, const Rotation& r);
    101101
    102102//! 3D line
     
    118118 
    119119  float distance (const Line& l) const;
    120   float distance_point (const Vector& v) const;
     120  float distancePoint (const Vector& v) const;
    121121  Vector* footpoints (const Line& l) const;
    122122  float len () const;
     
    144144  ~Plane () {}
    145145 
    146   Vector intersect_line (const Line& l) const;
    147   float distance_point (const Vector& p) const;
    148   float locate_point (const Vector& p) const;
     146  Vector intersectLine (const Line& l) const;
     147  float distancePoint (const Vector& p) const;
     148  float locatePoint (const Vector& p) const;
    149149};
    150150
     
    185185
    186186
    187 #endif
     187#endif /* _VECTOR_H */
  • orxonox/branches/nico/src/world.cc

    r3005 r3238  
    5151World::~World ()
    5252{
    53   Orxonox *orx = Orxonox::getInstance();
    54   orx->get_localinput()->unbind (this->localPlayer);
     53  printf("World::~World() - deleting current world\n");
     54  CommandNode* cn = Orxonox::getInstance()->getLocalInput();
     55  cn->unbind(this->localPlayer);
     56  cn->reset();
     57  this->localCamera->destroy();
     58
     59  WorldEntity* entity = entities->enumerate(); 
     60  while( entity != NULL )
     61    {
     62      entity->destroy();
     63      entity = entities->nextElement();
     64    }
     65  this->entities->destroy();
     66
    5567  delete this->entities;
    5668  delete this->localCamera;
    57 }
    58 
    59 
    60 /**
    61     \brief initialize the world before use.
    62 */
    63 Error World::init()
     69  /* this->localPlayer hasn't to be deleted explicitly, it is
     70     contained in entities*/
     71}
     72
     73
     74ErrorMessage World::init()
    6475{
    6576  this->bPause = false;
    66 }
    67 
    68 Error World::start()
    69 {
     77  CommandNode* cn = Orxonox::getInstance()->getLocalInput();
     78  cn->addToWorld(this);
     79  cn->enable(true);
     80}
     81
     82ErrorMessage World::start()
     83{
     84  printf("World::start() - starting current World: nr %i\n", this->debugWorldNr);
     85  this->bQuitOrxonox = false;
     86  this->bQuitCurrentGame = false;
    7087  this->mainLoop();
    7188}
    7289
    73 Error World::stop()
    74 {
     90ErrorMessage World::stop()
     91{
     92  printf("World::stop() - got stop signal\n");
    7593  this->bQuitCurrentGame = true;
    76   this->localCamera->setWorld(NULL);
    77   this->entities->clear();
    78   Orxonox::getInstance()->get_localinput()->reset();
    79   this->~World();
    80 }
    81 
    82 Error World::pause()
     94}
     95
     96ErrorMessage World::pause()
    8397{
    8498  this->isPaused = true;
    8599}
    86100
    87 Error World::resume()
     101ErrorMessage World::resume()
    88102{
    89103  this->isPaused = false;
    90104}
    91105
     106void World::destroy()
     107{
     108
     109}
     110
    92111void World::load()
    93112{
     
    96115      switch(this->debugWorldNr)
    97116        {
     117          /*
     118            this loads the hard-coded debug world. this only for simplicity and will be
     119            removed by a reald world-loader, which interprets a world-file.
     120            if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
     121            make whatever you want...
     122           */
    98123        case DEBUG_WORLD_0:
    99124          {
     
    114139                this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);
    115140              }
    116            
     141            // !\todo old track-system has to be removed
     142
    117143            // create a player
    118144            WorldEntity* myPlayer = new Player();
     
    122148            // bind input
    123149            Orxonox *orx = Orxonox::getInstance();
    124             orx->get_localinput()->bind (myPlayer);
     150            orx->getLocalInput()->bind (myPlayer);
    125151           
    126152            // bind camera
     
    154180                this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);
    155181              }
    156            
     182
    157183            // create a player
    158             //WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
    159184            WorldEntity* myPlayer = new Player();
    160185            this->spawn(myPlayer);
    161             this->localPlayer = myPlayer;
     186            this->localPlayer = myPlayer;           
    162187           
    163188            // bind input
    164189            Orxonox *orx = Orxonox::getInstance();
    165             orx->get_localinput()->bind (myPlayer);
     190            orx->getLocalInput()->bind (myPlayer);
    166191           
    167192            // bind camera
     
    185210  glColor3f(1.0,0,0);
    186211  glBegin(GL_QUADS);
    187   float height [500][100];
    188   float size = 2.0;
    189     for ( int i = 0; i<=200; i+=1)
     212
     213  int sizeX = 100;
     214  int sizeY = 80;
     215  float length = 1000;
     216  float width = 200;
     217  float widthX = float (length /sizeX);
     218  float widthY = float (width /sizeY);
     219 
     220  float height [sizeX][sizeY];
     221  Vector normal_vectors[sizeX][sizeY];
     222 
     223 
     224  for ( int i = 0; i<sizeX-1; i+=1)
     225    for (int j = 0; j<sizeY-1;j+=1)
     226      //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
     227#ifdef __WIN32__
     228      height[i][j]=(sin((float)j/3)*rand()*i/182400)*.5;
     229#else
     230      height[i][j]=(sin((float)j/3)*rand()*(long)i/6282450500.0)*.5;
     231#endif
     232
     233  //Die Hügel ein wenig glätten
     234  for (int h=1; h<2;h++)
     235    for (int i=1;i<sizeX-2 ;i+=1 )
     236      for(int j=1;j<sizeY-2;j+=1)
     237        height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4;
     238 
     239  //Berechnung von normalen Vektoren
     240
     241  for(int i=1;i<sizeX-2;i+=1)
     242    for(int j=1;j<sizeY-2 ;j+=1)
    190243      {
    191         for (int j = 0; j<=50;j+=1)
    192           {
    193             height[i][j] = rand()/200321400 + (j-25)*(j-25)/30;
     244        Vector v1 = Vector (widthX*(1),      widthY*(j)  ,      height[i][j]);
     245        Vector v2 = Vector (widthX*(i-1),    widthY*(j)  ,      height[i-1][j]);
     246        Vector v3 = Vector (widthX*(i),      widthY*(j+1),      height[i][j+1]);
     247        Vector v4 = Vector (widthX*(i+1),    widthY*(j),        height[i+1][j]);
     248        Vector v5 = Vector (widthX*(i),      widthY*(j-1),      height[i][j-1]);
     249       
     250        Vector c1 = v2 - v1;
     251        Vector c2 = v3 - v1;
     252        Vector c3=  v4 - v1;
     253        Vector c4 = v5 - v1;
     254        Vector zero = Vector (0,0,0);
     255        normal_vectors[i][j]=c1.cross(v4-v2)+c2.cross(v1-v3)+c3.cross(v2-v4)+c4.cross(v3-v1);
     256        normal_vectors[i][j].normalize();
     257      }
     258
     259  int snowheight=3;
     260  for ( int i = 0; i<sizeX; i+=1)
     261    for (int j = 0; j<sizeY;j+=1)
     262      {   
     263        Vector v1 = Vector (widthX*(i),      widthY*(j)  -width/2,      height[i][j]-20 );
     264        Vector v2 = Vector (widthX*(i+1),    widthY*(j)  -width/2,      height[i+1][j]-20);
     265        Vector v3 = Vector (widthX*(i+1),    widthY*(j+1)-width/2,    height[i+1][j+1]-20);
     266        Vector v4 = Vector (widthX*(i),      widthY*(j+1)-width/2,    height[i][j+1]-20);
     267        float a[3];
     268        if(height[i][j]<snowheight){
     269          a[0]=0;
     270          a[1]=1.0-height[i][j]/10-.3;
     271          a[2]=0;
     272          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     273        }
     274        else{
     275            a[0]=1.0;
     276            a[1]=1.0;
     277            a[2]=1.0;
     278            glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
    194279           
    195           }
     280        }
     281        glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
     282        glVertex3f(v1.x, v1.y, v1.z);
     283        if(height[i+1][j]<snowheight){
     284          a[0]=0;
     285          a[1] =1.0-height[i+1][j]/10-.3;
     286          a[2]=0;
     287          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     288        }
     289        else{
     290          a[0]=1.0;
     291          a[1]=1.0;
     292          a[2]=1.0;
     293          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     294         
     295        }
     296        glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
     297        glVertex3f(v2.x, v2.y, v2.z);
     298        if(height[i+1][j+1]<snowheight){
     299          a[0]=0;
     300          a[1] =1.0-height[i+1][j+1]/10-.3;
     301          a[2]=0;
     302          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     303        }
     304        else{
     305          a[0]=1.0;
     306          a[1]=1.0;
     307          a[2]=1.0;
     308          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     309         
     310         
     311        }
     312        glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z);
     313        glVertex3f(v3.x, v3.y, v3.z);
     314        if(height[i][j+1]<snowheight){
     315          a[0]=0;
     316          a[1] =1.0-height[i+1][j+1]/10-.3;
     317          a[2]=0;
     318          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     319        }
     320        else{
     321          a[0]=1.0;
     322          a[1]=1.0;
     323          a[2]=1.0;
     324          glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
     325        }
     326        glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z);
     327        glVertex3f(v4.x, v4.y, v4.z);
     328       
    196329      }
    197     for ( int i = 0; i<=200; i+=1)
    198       {
    199         for (int j = 0; j<=50;j+=1)
    200           {       
    201             Vector* v1 = new Vector (size*i,        size*j-25*size,      height[i][j] -20);
    202             Vector* v2 = new Vector (size*i+size,    size*j-25*size,      height[i+1][j]-20);
    203             Vector* v3 = new Vector (size*i+size,    size*j+size-25*size,  height[i+1][j+1]-20);
    204             Vector* v4 = new Vector (size*i,        size*j+size -25*size,  height[i][j+1]-20);
    205            
    206             Vector c1 = *v2 - *v1;
    207             Vector c2 = *v3 - *v2;
    208             Vector c3 = *v4 - *v3;
    209             Vector c4 = *v1 - *v4;
    210            
    211             c1.cross(*v4 - *v1);
    212             c2.cross(*v1 - *v2);
    213             c3.cross(*v2 - *v3);
    214             c4.cross(*v3 - *v4);
    215 
    216 
    217             glVertex3f(v1->x, v1->y, v1->z);
    218 
    219             glVertex3f(v2->x, v2->y, v2->z);
    220 
    221             glVertex3f(v3->x, v3->y, v3->z);
    222             glNormal3f(c4.x, c4.y, c4.z);
    223             glVertex3f(v4->x, v4->y, v4->z);
    224 
    225           }
    226       }
    227 glEnd();
    228 /* 
     330  glEnd();
     331  /* 
    229332  glBegin(GL_LINES);
    230333  for( float x = -128.0; x < 128.0; x += 25.0)
     
    370473      if( !entity->isFree() )
    371474        {
    372           loc = entity->get_location();
    373           plc = entity->get_placement();
     475          loc = entity->getLocation();
     476          plc = entity->getPlacement();
    374477          t = loc->part;
    375478         
     
    378481            {
    379482              printf("An entity is out of the game area\n");
    380               entity->left_world ();
     483              entity->leftWorld ();
    381484            }
    382485          else
    383486            {
    384               while( track[t].map_coords( loc, plc) )
     487              while( track[t].mapCoords( loc, plc) )
    385488                {
    386                   track[t].post_leave (entity);
     489                  track[t].postLeave (entity);
    387490                  if( loc->part >= tracklen )
    388491                    {
    389492                      printf("An entity has left the game area\n");
    390                       entity->left_world ();
     493                      entity->leftWorld ();
    391494                      break;
    392495                    }
    393                   track[loc->part].post_enter (entity);
     496                  track[loc->part].postEnter (entity);
    394497                }
    395498            }
     
    397500      else
    398501        {
    399           /* TO DO: implement check whether this particular free entity
     502          /* \todo: implement check whether this particular free entity
    400503             is out of the game area
    401              TO DO: call function to notify the entity that it left
     504             \todo: call function to notify the entity that it left
    402505             the game area
    403506          */
     
    413516    \param deltaT: the time passed since the last frame in milliseconds
    414517*/
    415 void World::time_slice (Uint32 deltaT)
     518void World::timeSlice (Uint32 deltaT)
    416519{
    417520  //List<WorldEntity> *l;
    418521  WorldEntity* entity;
    419   float seconds = deltaT;
    420  
    421   seconds /= 1000;
     522  float seconds = deltaT / 1000.0;
    422523 
    423524  entity = entities->enumerate();
     
    428529    }
    429530
    430   for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
     531  //for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
    431532}
    432533
     
    446547   Camera Placement
    447548*/
    448 void World::calc_camera_pos (Location* loc, Placement* plc)
    449 {
    450   track[loc->part].map_camera (loc, plc);
     549void World::calcCameraPos (Location* loc, Placement* plc)
     550{
     551  track[loc->part].mapCamera (loc, plc);
    451552}
    452553
     
    462563}
    463564
     565
     566
     567/**
     568   \brief function to put your own debug stuff into it. it can display informations about
     569   the current class/procedure
     570*/
    464571void World::debug()
    465572{
     
    478585
    479586
     587/*
     588  \brief main loop of the world: executing all world relevant function
     589
     590  in this loop we synchronize (if networked), handle input events, give the heart-beat to
     591  all other member-entities of the world (tick to player, enemies etc.), checking for
     592  collisions drawing everything to the screen.
     593*/
    480594void World::mainLoop()
    481595{
    482596  this->lastFrame = SDL_GetTicks();
    483   this->bQuitOrxonox = false;
    484   this->bQuitCurrentGame = false;
    485   printf("World|Entering main loop\n");
    486   while(!this->bQuitOrxonox && !this->bQuitCurrentGame) /* pause pause pause ?!?!?*/
    487     {
    488       //debug routine
    489       //debug();
     597  printf("World::mainLoop() - Entering main loop\n");
     598  while( !this->bQuitOrxonox && !this->bQuitCurrentGame) /* \todo implement pause */
     599    {
    490600      // Network
    491601      synchronize();
    492602      // Process input
    493       handle_input();
     603      handleInput();
     604      if( this->bQuitCurrentGame || this->bQuitOrxonox)
     605        {
     606          printf("World::mainLoop() - leaving loop earlier...\n");
     607          break;
     608        }
    494609      // Process time
    495       time_slice();
     610      timeSlice();
    496611      // Process collision
    497612      collision();
     
    499614      display();
    500615 
    501       //for(int i = 0; i < 1000000; i++){}
    502 
    503     }
    504   printf("World|Exiting the main loop\n");
     616      for(int i = 0; i < 10000000; i++) {}
     617    }
     618  printf("World::mainLoop() - Exiting the main loop\n");
    505619}
    506620
     
    516630/**
    517631   \brief run all input processing
    518 */
    519 void World::handle_input ()
     632
     633   the command node is the central input event dispatcher. the node uses the even-queue from
     634   sdl and has its own event-passing-queue.
     635*/
     636void World::handleInput ()
    520637{
    521638  // localinput
    522   Orxonox::getInstance()->get_localinput()->process();
     639  CommandNode* cn = Orxonox::getInstance()->getLocalInput();
     640  cn->process();
    523641  // remoteinput
    524642}
     
    526644/**
    527645   \brief advance the timeline
    528 */
    529 void World::time_slice ()
     646
     647   this calculates the time used to process one frame (with all input handling, drawing, etc)
     648   the time is mesured in ms and passed to all world-entities and other classes that need
     649   a heart-beat.
     650*/
     651void World::timeSlice ()
    530652{
    531653  Uint32 currentFrame = SDL_GetTicks();
     
    541663      else
    542664        {
    543           printf("fps = 1000 but 0ms!\n");
    544         }
    545      
    546       this->time_slice (dt);
     665          /* the frame-rate is limited to 100 frames per second, all other things are for
     666             nothing.
     667          */
     668          printf("fps = 1000 - frame rate is adjusted\n");
     669          SDL_Delay(10);
     670          dt = 10;
     671        }
     672      this->timeSlice (dt);
    547673      this->update ();
    548       this->localCamera->time_slice (dt);
     674      this->localCamera->timeSlice(dt);
    549675    }
    550676  this->lastFrame = currentFrame;
    551677}
    552678
     679
    553680/**
    554681   \brief compute collision detection
     
    559686}
    560687
    561 /**
    562    \brief handle keyboard commands that are not meant for WorldEntities
    563    \param cmd: the command to handle
    564    \return true if the command was handled by the system or false if it may be passed to the WorldEntities
    565 */
    566 bool World::system_command (Command* cmd)
    567 {
    568   if( !strcmp( cmd->cmd, "quit"))
    569     {
    570       if( !cmd->bUp) this->bQuitOrxonox = true;
    571       return true;
    572     }
    573   return false;
    574 }
    575 
    576 /**
    577         \brief render the current frame
     688
     689/**
     690   \brief render the current frame
     691   
     692   clear all buffers and draw the world
    578693*/
    579694void World::display ()
     
    590705}
    591706
     707/**
     708   \brief give back active camera
     709   
     710   this passes back the actualy active camera
     711   \todo ability to define more than one camera or camera-places
     712*/
    592713Camera* World::getCamera()
    593714{
     
    596717
    597718
     719/**
     720   \brief add and spawn a new entity to this world
     721   \param entity to be added
     722*/
    598723void World::spawn(WorldEntity* entity)
    599724{
     
    611736  if (entity->bFree)
    612737    {
    613       this->track[loc->part].map_coords( loc, entity->get_placement());
    614     }
    615   entity->post_spawn ();
    616 }
    617 
    618 
     738      this->track[loc->part].mapCoords( loc, entity->getPlacement());
     739    }
     740  entity->postSpawn ();
     741}
     742
     743
     744/**
     745   \brief add and spawn a new entity to this world
     746   \param entity to be added
     747   \param location where to add
     748*/
    619749void World::spawn(WorldEntity* entity, Location* loc)
    620750{
     
    633763  if (entity->bFree)
    634764    {
    635       this->track[loc->part].map_coords( loc, entity->get_placement());
    636     }
    637   entity->post_spawn ();
     765      this->track[loc->part].mapCoords( loc, entity->getPlacement());
     766    }
     767  entity->postSpawn ();
    638768  //return entity;
    639769}
    640770
    641771
     772/**
     773   \brief add and spawn a new entity to this world
     774   \param entity to be added
     775   \param place where to be added
     776*/
    642777void World::spawn(WorldEntity* entity, Placement* plc)
    643778{
     
    652787  this->entities->add (entity);
    653788  entity->init (plc, owner);
    654   entity->post_spawn ();
     789  entity->postSpawn ();
    655790  //return entity;
    656791}
     792
     793
     794/*
     795  \brief commands that the world must catch
     796  \returns false if not used by the world
     797*/
     798bool World::command(Command* cmd)
     799{
     800  return false;
     801}
  • orxonox/branches/nico/src/world.h

    r2822 r3238  
    44*/
    55
    6 #ifndef WORLD_H
    7 #define WORLD_H
     6#ifndef _WORLD_H
     7#define _WORLD_H
    88
    99#include "stdincl.h"
     
    2222  World (char* name);
    2323  World (int worldID);
    24   ~World ();
     24  virtual ~World ();
    2525
    2626  template<typename T>
    27     T* spawn(Location* loc, WorldEntity* owner);        // template to be able to spawn any derivation of WorldEntity
     27    T* spawn (Location* loc, WorldEntity* owner);       // template to be able to spawn any derivation of WorldEntity
    2828  template<typename T>
    29     T* spawn(Placement* plc, WorldEntity* owner);
     29    T* spawn (Placement* plc, WorldEntity* owner);
    3030 
    31   virtual Error init();
    32   virtual Error start();
    33   virtual Error stop();
    34   virtual Error pause();
    35   virtual Error resume();
     31  virtual ErrorMessage init ();
     32  virtual ErrorMessage start ();
     33  virtual ErrorMessage stop ();
     34  virtual ErrorMessage pause ();
     35  virtual ErrorMessage resume ();
    3636
    37   virtual void load();
     37  virtual void load ();
     38  virtual void destroy ();
    3839
    39   void time_slice (Uint32 deltaT);
     40  void timeSlice (Uint32 deltaT);
    4041  void collide ();
    4142  void draw ();
    4243  void update ();       // maps Locations to Placements
    43   void calc_camera_pos (Location* loc, Placement* plc);
     44  void calcCameraPos (Location* loc, Placement* plc);
    4445       
    4546  void unload ();
     47  bool command (Command* cmd);
    4648 
    47   void setTrackLen(Uint32 tracklen);
    48   int getTrackLen();
    49   bool system_command (Command* cmd);
    50   Camera* getCamera();
     49  void setTrackLen (Uint32 tracklen);
     50  int getTrackLen ();
     51  //bool system_command (Command* cmd);
     52  Camera* getCamera ();
    5153
    52   void spawn(WorldEntity* entity);
    53   void spawn(WorldEntity* entity, Location* loc);
    54   void spawn(WorldEntity* entity, Placement* plc);
     54  void spawn (WorldEntity* entity);
     55  void spawn (WorldEntity* entity, Location* loc);
     56  void spawn (WorldEntity* entity, Placement* plc);
    5557
    5658  tList<WorldEntity>* entities;
     
    7476  WorldEntity* localPlayer;
    7577 
    76   void mainLoop();
    77   void synchronize();
    78   void handle_input();
    79   void time_slice();
    80   void collision();
    81   void display();
    82   void debug();
     78  void mainLoop ();
     79  void synchronize ();
     80  void handleInput ();
     81  void timeSlice ();
     82  void collision ();
     83  void display ();
     84  void debug ();
    8385};
    8486
    85 /**
    86     \brief spawn a new WorldEntity at a Location
    87     \param loc: the Location where the Entity should be spawned
    88     \param owner: a pointer to the parent of the Entity
    89     \return a pointer to the new WorldEntity or NULL if there was an error
    90    
    91     You can use this function to spawn any derivation of WorldEntity you want, just specify the desired
    92     class within the template specification brackets. Do not attempt to spawn any classes that have NOT been
    93     derived from WorldEntity, you won't even be able to compile the code. Note that this version of spawn()
    94     works with both free and bound WorldEntities.
    95 */
    96 template<typename T> T* World::spawn(Location* loc = NULL, WorldEntity* owner = NULL)
    97 {
    98   Location zeroloc;
    99   T* entity = new T();
    100   entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
    101   if( loc == NULL)
    102     {
    103       zeroloc.dist = 0;
    104       zeroloc.part = 0;
    105       zeroloc.pos = Vector();
    106       zeroloc.rot = Quaternion();
    107       loc = &zeroloc;
    108     }
    109   entity->init (loc, owner);
    110   if (entity->bFree)
    111     {
    112       track[loc->part].map_coords( loc, entity->get_placement());
    113     }
    114   entity->post_spawn ();
    115   return entity;
    116 }
    117 
    118 /**
    119     \brief spawn a new WorldEntity at a Placement
    120     \param lplc: the placement where the Entity should be spawned
    121     \param owner: a pointer to the parent of the Entity
    122     \return a pointer to the new WorldEntity or NULL if there was an error
    123    
    124     You can use this function to spawn any FREE derivation of WorldEntity you want, just specify the desired
    125     class within the template specification brackets. Do not attempt to spawn any classes that have NOT been
    126     derived from WorldEntity, you won't even be able to compile the code. Note that this version of spawn()
    127     works with free WorldEntities only, you will provoke an error message if you try to spawn a bound Entity with
    128     a Placement.
    129 */
    130 template<typename T> T* World::spawn(Placement* plc, WorldEntity* owner = NULL)
    131 {
    132   T* entity = new T();
    133   entities->add ((WorldEntity*)entity, LIST_ADD_NEXT);
    134   entity->init (plc, owner);
    135   if (!entity->bFree)
    136     {
    137       printf("Can't spawn unfree entity with placement\n");
    138       entities->remove( (WorldEntity*)entity, LIST_FIND_FW);
    139       return NULL;
    140     }
    141   entity->post_spawn ();
    142   return entity;
    143 }
    144 
    145 #endif
     87#endif /* _WORLD_H */
  • orxonox/branches/nico/src/world_entity.cc

    r2822 r3238  
    5353   \return a pointer to location
    5454*/
    55 Location* WorldEntity::get_location ()
     55Location* WorldEntity::getLocation ()
    5656{
    5757  return &loc;
     
    6262   \return a pointer to placement
    6363*/
    64 Placement* WorldEntity::get_placement ()
     64Placement* WorldEntity::getPlacement ()
    6565{
    6666  return &place;
     
    8282   Any previously assigned collision hull will be deleted on reassignment
    8383*/
    84 void WorldEntity::set_collision (CollisionCluster* newhull)
     84void WorldEntity::setCollision (CollisionCluster* newhull)
    8585{
    8686  if( newhull == NULL) return;
     
    159159   DO NOT place such code in the constructor, those variables are set AFTER the entity is constucted.
    160160*/
    161 void WorldEntity::post_spawn ()
     161void WorldEntity::postSpawn ()
    162162{
    163163}
     
    181181   to look at the location you return with this.
    182182*/
    183 void WorldEntity::get_lookat (Location* locbuf)
     183void WorldEntity::getLookat (Location* locbuf)
    184184{
    185185}
     
    191191   place that is not in the world anymore. In both cases you might have to take extreme measures (a.k.a. call destroy).
    192192*/
    193 void WorldEntity::left_world ()
     193void WorldEntity::leftWorld ()
    194194{
    195195}
  • orxonox/branches/nico/src/world_entity.h

    r2551 r3238  
    44*/
    55
    6 #ifndef WORLD_ENTITY_H
    7 #define WORLD_ENTITY_H
     6#ifndef _WORLD_ENTITY_H
     7#define _WORLD_ENTITY_H
    88
    99#include "stdincl.h"
     
    1818 public:
    1919  WorldEntity (bool isFree = false);
    20   ~WorldEntity ();
     20  virtual ~WorldEntity ();
    2121 
    22   Location* get_location ();
    23   Placement* get_placement ();
    24   void set_collision (CollisionCluster* newhull);
     22  Location* getLocation ();
     23  Placement* getPlacement ();
     24  void setCollision (CollisionCluster* newhull);
    2525 
    2626  bool isFree ();
     
    2929  //void removeAbility(Ability* ability);
    3030 
    31   virtual void post_spawn ();
     31  virtual void postSpawn ();
    3232  virtual void tick (float time);
    3333  virtual void hit (WorldEntity* weapon, Vector loc);
     
    3737 
    3838  virtual void draw ();
    39   virtual void get_lookat (Location* locbuf);
     39  virtual void getLookat (Location* locbuf);
    4040 
    41   virtual void left_world ();
     41  virtual void leftWorld ();
    4242 
    4343 private:
     
    5555};
    5656
    57 #endif
     57#endif /* _WORLD_ENTITY_H */
Note: See TracChangeset for help on using the changeset viewer.