Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3430 in orxonox.OLD for orxonox/branches/trackManager


Ignore:
Timestamp:
Mar 1, 2005, 9:50:30 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/trackManager: merged trunk back to trackManager
merged with command
svn merge -r 3369:HEAD trunk/ branches/trackManager
resoloved conflicts in favor of the trunk.

Location:
orxonox/branches/trackManager
Files:
2 deleted
49 edited
11 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/trackManager

    • Property svn:externals set to
  • orxonox/branches/trackManager/Makefile.in

    r3219 r3430  
    8585CPP = @CPP@
    8686CPPFLAGS = @CPPFLAGS@
     87CURL_CFLAGS = @CURL_CFLAGS@
     88CURL_LIBS = @CURL_LIBS@
    8789CXX = @CXX@
    8890CXXDEPMODE = @CXXDEPMODE@
     
    100102EGREP = @EGREP@
    101103EXEEXT = @EXEEXT@
     104GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
     105GTHREAD_LIBS = @GTHREAD_LIBS@
    102106GTK2_CFLAGS = @GTK2_CFLAGS@
    103107GTK2_LIBS = @GTK2_LIBS@
     108HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
     109HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
     110HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
     111HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    104112HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    105113HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    125133SHELL = @SHELL@
    126134STRIP = @STRIP@
     135SUB_PROJECTS_FALSE = @SUB_PROJECTS_FALSE@
     136SUB_PROJECTS_TRUE = @SUB_PROJECTS_TRUE@
    127137VERSION = @VERSION@
    128138ac_ct_CC = @ac_ct_CC@
  • orxonox/branches/trackManager/config.h.in

    r3205 r3430  
    77#undef HAVE_BZERO
    88
     9/* if we have CURL */
     10#undef HAVE_CURL
     11
     12/* Define to 1 if you have the <curl/curl.h> header file. */
     13#undef HAVE_CURL_CURL_H
     14
    915/* Define to 1 if you have the <GL/glu.h> header file. */
    1016#undef HAVE_GL_GLU_H
     
    1218/* Define to 1 if you have the <GL/gl.h> header file. */
    1319#undef HAVE_GL_GL_H
     20
     21/* if we have gThread */
     22#undef HAVE_GTHREAD
    1423
    1524/* if we have GTK2 */
     
    4049/* Define to 1 if you have the <png.h> header file. */
    4150#undef HAVE_PNG_H
     51
     52/* Define to 1 if you have the <pthread.h> header file. */
     53#undef HAVE_PTHREAD_H
    4254
    4355/* Define to 1 if you have the <SDL/SDL.h> header file. */
  • orxonox/branches/trackManager/configure

    r3369 r3430  
    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 DEBUG DOXYGEN DOXYGEN_TRUE DOXYGEN_FALSE MSBITFIELDS GTK2_LIBS GTK2_CFLAGS 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 SUB_PROJECTS_TRUE SUB_PROJECTS_FALSE DOXYGEN DOXYGEN_TRUE DOXYGEN_FALSE MSBITFIELDS GTK2_LIBS GTK2_CFLAGS HAVE_GTK2_TRUE HAVE_GTK2_FALSE GTHREAD_LIBS GTHREAD_CFLAGS HAVE_GTHREAD_TRUE HAVE_GTHREAD_FALSE CURL_LIBS CURL_CFLAGS HAVE_CURL_TRUE HAVE_CURL_FALSE LIBOBJS LTLIBOBJS'
    315315ac_subst_files=''
    316316
     
    867867  --enable-debug          compiles in debug mode. Lots of debug info about the
    868868                          game.
     869  --enable-sub-projects   also builds the subProjects while make from srcdir
    869870
    870871Optional Packages:
     
    872873  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    873874  --without-gtk           Prevents GTK from being loaded
     875  --without-gthread       Prevents gThread from being loaded
     876  --without-pthread       Prevents pthread from being loaded
     877  --without-curl          Prevents libcURL from being loaded
    874878  --without-sdl-image     Prevents SDL_image from being loaded
    875879
     
    13351339
    13361340
    1337 # Detect the canonical host and target build environment.
     1341## Detect the canonical host and target build environment.
    13381342ac_aux_dir=
    13391343for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
     
    14431447    NONENONEs,x,x, &&
    14441448  program_prefix=${target_alias}-
    1445 
    14461449
    14471450am__api_version="1.8"
     
    18501853
    18511854
    1852 
    1853 # Checks for programs.
     1855#########################
     1856## Checks for programs ##
     1857#########################
    18541858ac_ext=cc
    18551859ac_cpp='$CXXCPP $CPPFLAGS'
     
    38383842
    38393843
    3840 ### CHECKING  OPTIONAT ARGUMENTS
    3841 ## DEBUG-statement
     3844##################################
     3845## CHECKING  OPTIONAL ARGUMENTS ##
     3846##################################
     3847
     3848#-----------------#
     3849# DEBUG-statement #
     3850#-----------------#
    38423851DEBUG=no
    38433852echo "$as_me:$LINENO: checking if DEBUG-mode should be enabled" >&5
     
    38493858fi;
    38503859
    3851 if test "$DEBUG" = "no"; then
     3860if test x$DEBUG = xno; then
    38523861        echo "no"
    3853         echo " -> Setting debuglevel to 1. Like this you can still see errors."
    3854         DEBUG=1
    3855 elif test "$DEBUG" = yes; then
     3862        echo " -> Setting debuglevel to 3. (orxonox is still in Development. It really is needed."
     3863        DEBUG=3
     3864elif test x$DEBUG = xyes; then
    38563865        echo "yes"
    3857         echo " -> Setting debuglevel to 3. HARD DEBUG MODE!!."
    3858         DEBUG=3
    3859 else
    3860         echo "yes set to $DEBUG"
     3866        echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!."
     3867        DEBUG=4
     3868else
     3869        echo "yes: setting debuglevel to to $DEBUG"
    38613870fi
    38623871
     
    38683877
    38693878
    3870 ## GTK-disabled
     3879#--------------#
     3880# GTK-disabled #
     3881#--------------#
    38713882echo "$as_me:$LINENO: checking if gtk should be enabled" >&5
    38723883echo $ECHO_N "checking if gtk should be enabled... $ECHO_C" >&6
     
    38793890  def_gtk=yes
    38803891fi;
    3881 if test "$def_gtk" = yes; then
     3892if test x$def_gtk = xyes; then
    38823893  echo "yes"
    38833894fi
    3884 if test "$def_gtk" = no; then
     3895if test x$def_gtk = xno; then
    38853896  echo "no"
    38863897fi
    3887 ### SDL_image-disable
     3898
     3899#------------------#
     3900# gThread-disabled #
     3901#------------------#
     3902echo "$as_me:$LINENO: checking if gThread should be enabled" >&5
     3903echo $ECHO_N "checking if gThread should be enabled... $ECHO_C" >&6
     3904
     3905# Check whether --with-gthread or --without-gthread was given.
     3906if test "${with_gthread+set}" = set; then
     3907  withval="$with_gthread"
     3908  def_gthread=no
     3909else
     3910  def_gthread=yes
     3911fi;
     3912if test x$def_gthread = xyes; then
     3913  echo "yes"
     3914fi
     3915if test x$def_gthread = xno; then
     3916  echo "no"
     3917fi
     3918
     3919#------------------#
     3920# pthread-disabled #
     3921#------------------#
     3922echo "$as_me:$LINENO: checking if pthread should be enabled" >&5
     3923echo $ECHO_N "checking if pthread should be enabled... $ECHO_C" >&6
     3924
     3925# Check whether --with-pthread or --without-pthread was given.
     3926if test "${with_pthread+set}" = set; then
     3927  withval="$with_pthread"
     3928  def_pthread=no
     3929else
     3930  def_pthread=yes
     3931fi;
     3932if test x$def_pthread = xyes; then
     3933  echo "yes"
     3934fi
     3935if test x$def_pthread = xno; then
     3936  echo "no"
     3937fi
     3938
     3939#------------------#
     3940# libCurl-disabled #
     3941#------------------#
     3942echo "$as_me:$LINENO: checking if libcURL should be enabled" >&5
     3943echo $ECHO_N "checking if libcURL should be enabled... $ECHO_C" >&6
     3944
     3945# Check whether --with-curl or --without-curl was given.
     3946if test "${with_curl+set}" = set; then
     3947  withval="$with_curl"
     3948  def_curl=no
     3949else
     3950  def_curl=yes
     3951fi;
     3952if test x$def_curl = xyes; then
     3953  echo "yes"
     3954fi
     3955if test x$def_curl = xno; then
     3956  echo "no"
     3957fi
     3958
     3959#-------------------#
     3960# SDL_image-disable #
     3961#-------------------#
    38883962def_sdl_image=yes
    38893963echo "$as_me:$LINENO: checking if SDL_image should be enabled" >&5
     
    38953969  def_sdl_image=no
    38963970fi;
    3897 if test "$def_sdl_image" = yes; then
     3971if test x$def_sdl_image = xyes; then
    38983972  echo "yes"
    38993973fi
    3900 if test "$def_sdl_image" = no; then
     3974if test x$def_sdl_image = xno; then
    39013975  echo "no"
    39023976fi
    3903 
    3904 
    3905 ## PROGRAMM CHECKING
    3906 # checking for Doxygen
     3977#-------------------#
     3978# SubProject-enable #
     3979#-------------------#
     3980def_sub_projects=no
     3981echo "$as_me:$LINENO: checking if the SubProjects should be built" >&5
     3982echo $ECHO_N "checking if the SubProjects should be built... $ECHO_C" >&6
     3983# Check whether --enable-sub-projects or --disable-sub-projects was given.
     3984if test "${enable_sub_projects+set}" = set; then
     3985  enableval="$enable_sub_projects"
     3986  def_sub_projects=yes
     3987fi;
     3988if test x$def_sub_projects = xyes; then
     3989  echo "yes"
     3990fi
     3991if test x$def_sub_projects = xno; then
     3992  echo "no"
     3993fi
     3994
     3995
     3996if test x$def_sub_projects = xyes; then
     3997  SUB_PROJECTS_TRUE=
     3998  SUB_PROJECTS_FALSE='#'
     3999else
     4000  SUB_PROJECTS_TRUE='#'
     4001  SUB_PROJECTS_FALSE=
     4002fi
     4003
     4004
     4005#######################
     4006## PROGRAMM CHECKING ##
     4007## 3. party Programs ##
     4008#######################
     4009
     4010#----------------------#
     4011# checking for Doxygen #
     4012#----------------------#
    39074013# Extract the first word of "doxygen", so it can be a program name with args.
    39084014set dummy doxygen; ac_word=$2
     
    39554061
    39564062
    3957 ### CHECKING FOR SYSTEM ###
     4063#########################
     4064## CHECKING FOR SYSTEM ##
     4065#########################
     4066## here the system is checked, and openGL is included
     4067## also checking for SDL on differen Systems
    39584068
    39594069echo "$as_me:$LINENO: checking for System" >&5
     
    39614071## checking for openGL-environment and other sys-specific parameters
    39624072case "$target" in
    3963 ### WINDOWS ###
     4073#---------#
     4074# WINDOWS #
     4075#---------#
    39644076  *-*-mingw32*)
    39654077echo "mingw-WINDOWS detected"
     
    42644376fi
    42654377
    4266     if test "$FOUND_opengl32" = "yes" ; then
     4378    if test x$FOUND_opengl32 = xyes ; then
    42674379        LIBS="$LIBS -lopengl32"
    42684380    else
     
    44934605fi
    44944606
    4495     if test "$FOUND_glu32" = "yes" ; then
     4607    if test x$FOUND_glu32 = xyes ; then
    44964608        LIBS="$LIBS -lGLU32"
    44974609    else
     
    45664678fi
    45674679
    4568     if test $FOUND_mingw32 = "yes"; then
     4680    if test x$FOUND_mingw32 = xyes; then
    45694681        LIBS="$LIBS -lmingw32"
    45704682    fi
     
    47884900fi
    47894901
    4790     if test "$FOUND_sdlmain" = "yes" ; then
     4902    if test x$FOUND_sdlmain = xyes ; then
    47914903       LIBS="$LIBS -lsdlmain"
    47924904    else
     
    48594971fi
    48604972
    4861     if test "$FOUND_sdl" = "yes" ; then
     4973    if test x$FOUND_sdl = xyes ; then
    48624974       LIBS="$LIBS -lsdl"
    48634975    else
     
    48704982
    48714983    ;;
    4872 
    4873 ### LINUX ###
     4984#-------#
     4985# LINUX #
     4986#-------#
    48744987 *-*-linux*)
    48754988echo "Linux detected"
     
    48784991
    48794992CPPFLAGS="-I/usr/X11R6/include"
    4880 LDFLAGS="-L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
     4993LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
    48814994# checking gl header
    48824995
     
    50365149
    50375150#  checking for Unix GL
    5038    echo "$as_me:$LINENO: checking for main in -lGL" >&5
    5039 echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6
    5040 if test "${ac_cv_lib_GL_main+set}" = set; then
     5151   echo "$as_me:$LINENO: checking for glLoadIdentity in -lGL" >&5
     5152echo $ECHO_N "checking for glLoadIdentity in -lGL... $ECHO_C" >&6
     5153if test "${ac_cv_lib_GL_glLoadIdentity+set}" = set; then
    50415154  echo $ECHO_N "(cached) $ECHO_C" >&6
    50425155else
     
    50505163/* end confdefs.h.  */
    50515164
    5052 
     5165/* Override any gcc2 internal prototype to avoid an error.  */
     5166#ifdef __cplusplus
     5167extern "C"
     5168#endif
     5169/* We use char because int might match the return type of a gcc2
     5170   builtin and then its argument prototype would still apply.  */
     5171char glLoadIdentity ();
    50535172int
    50545173main ()
    50555174{
    5056 main ();
     5175glLoadIdentity ();
    50575176  ;
    50585177  return 0;
     
    50815200  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    50825201  (exit $ac_status); }; }; then
    5083   ac_cv_lib_GL_main=yes
     5202  ac_cv_lib_GL_glLoadIdentity=yes
    50845203else
    50855204  echo "$as_me: failed program was:" >&5
    50865205sed 's/^/| /' conftest.$ac_ext >&5
    50875206
    5088 ac_cv_lib_GL_main=no
     5207ac_cv_lib_GL_glLoadIdentity=no
    50895208fi
    50905209rm -f conftest.err conftest.$ac_objext \
     
    50925211LIBS=$ac_check_lib_save_LIBS
    50935212fi
    5094 echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5
    5095 echo "${ECHO_T}$ac_cv_lib_GL_main" >&6
    5096 if test $ac_cv_lib_GL_main = yes; then
     5213echo "$as_me:$LINENO: result: $ac_cv_lib_GL_glLoadIdentity" >&5
     5214echo "${ECHO_T}$ac_cv_lib_GL_glLoadIdentity" >&6
     5215if test $ac_cv_lib_GL_glLoadIdentity = yes; then
    50975216  FOUND_GL=yes
    50985217fi
    50995218
    5100    if test "$FOUND_GL" = "yes" ; then
     5219   if test x$FOUND_GL = xyes ; then
    51015220     LIBS="$LIBS -lGL"
    51025221   else
     
    53325451fi
    53335452
    5334     if test "$FOUND_GLU" = "yes" ; then
     5453    if test x$FOUND_GLU = xyes ; then
    53355454      LIBS="$LIBS -lGLU"
    53365455    else
     
    55615680fi
    55625681
    5563      if test "$FOUND_SDL" = "yes" ; then
     5682     if test x$FOUND_SDL = xyes ; then
    55645683       LIBS="$LIBS -lSDL"
    55655684     else
     
    55815700#    LIBS="$LIBS $SDL_LIBS"
    55825701    ;;
    5583 
    5584 ### OS X ###
     5702#-----------#
     5703# MAC -OS X #
     5704#-----------#
    55855705 *darwin*)
    5586 echo "OS X detected"
     5706 echo "OS X detected"
    55875707
    55885708 osX="yes"
     
    59026022   LIBS="$LIBS -framework OpenGL"
    59036023
     6024       SDL_CFLAGS=`sdl-config --cflags`
     6025       SDL_LIBS=`sdl-config --libs`
     6026       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
     6027       LIBS="$LIBS $SDL_LIBS"
     6028
     6029
    59046030# checking for SDL-headers
    59056031#    AC_CHECK_HEADERS(SDL/SDL.h ,,
     
    59136039#      )
    59146040
    5915        SDL_CFLAGS=`sdl-config --cflags`
    5916        SDL_LIBS=`sdl-config --libs`
    5917        CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
    5918        LIBS="$LIBS $SDL_LIBS"
    59196041
    59206042    ;;
     
    59266048
    59276049
    5928 ## check for SDL_Image
    5929 if test "$def_sdl_image" = "yes"; then
     6050###################################
     6051## CHECKING FOR HEADERS AND LIBS ##
     6052###################################
     6053
     6054#-----------#
     6055# SDL_Image #
     6056#-----------#
     6057if test x$def_sdl_image = xyes; then
    59306058# checking for SDL_image-headers
    59316059
     
    60826210
    60836211fi
    6084 if test "$def_sdl_image" = "yes"; then
     6212if test x$def_sdl_image = xyes; then
    60856213# checking for SDL_image-lib
    60866214  echo "$as_me:$LINENO: checking for main in -lSDL_image" >&5
     
    61466274fi
    61476275
    6148      if test "$FOUND_SDL_image" = "yes" ; then
     6276     if test x$FOUND_SDL_image = xyes ; then
    61496277       LIBS="$LIBS -lSDL_image"
    61506278     else
     
    61576285fi
    61586286
    6159 
    6160 if test "$def_sdl_image" = "no"; then
    6161  ## checking for libjpeg
     6287## case no SDL-image:
     6288if test x$def_sdl_image = xno; then
     6289#---------#
     6290# libjpeg #
     6291#---------#
    61626292
    61636293for ac_header in jpeglib.h
     
    63126442done
    63136443
    6314  if test $jpegHeader = "no"; then
     6444 if test x$jpegHeader = xno; then
    63156445        echo " not including jpeg."
    63166446 else
     
    63776507fi
    63786508
    6379     if test "$FOUND_jpeg" = "yes" ; then
     6509    if test x$FOUND_jpeg = xyes ; then
    63806510      LIBS="$LIBS -ljpeg"
    63816511    else
     
    63886518 fi
    63896519
    6390  ## checking for libpng
     6520#--------#
     6521# libpng #
     6522#--------#
    63916523
    63926524for ac_header in png.h
     
    65416673done
    65426674
    6543  if test $pngHeader = "no"; then
     6675 if test x$pngHeader = xno; then
    65446676        echo " not including png."
    65456677 else
     
    66066738fi
    66076739
    6608     if test "$FOUND_png" = "yes" ; then
     6740    if test x$FOUND_png = xyes ; then
    66096741      LIBS="$LIBS -lpng"
    66106742    else
     
    66186750fi
    66196751
    6620 ## checking for GTK
    6621 if test "$def_gtk" = yes; then
     6752#-----#
     6753# GTK #
     6754#-----#
     6755if test x$def_gtk = xyes; then
    66226756
    66236757        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
     
    66526786
    66536787
    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 
    6665 echo "$as_me:$LINENO: checking for main in -lm" >&5
    6666 echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
    6667 if test "${ac_cv_lib_m_main+set}" = set; then
    6668   echo $ECHO_N "(cached) $ECHO_C" >&6
    6669 else
    6670   ac_check_lib_save_LIBS=$LIBS
    6671 LIBS="-lm  $LIBS"
    6672 cat >conftest.$ac_ext <<_ACEOF
    6673 /* confdefs.h.  */
    6674 _ACEOF
    6675 cat confdefs.h >>conftest.$ac_ext
    6676 cat >>conftest.$ac_ext <<_ACEOF
    6677 /* end confdefs.h.  */
    6678 
    6679 
    6680 int
    6681 main ()
    6682 {
    6683 main ();
    6684   ;
    6685   return 0;
    6686 }
    6687 _ACEOF
    6688 rm -f conftest.$ac_objext conftest$ac_exeext
    6689 if { (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
    6711 else
    6712   echo "$as_me: failed program was:" >&5
    6713 sed 's/^/| /' conftest.$ac_ext >&5
    6714 
    6715 ac_cv_lib_m_main=no
    6716 fi
    6717 rm -f conftest.err conftest.$ac_objext \
    6718       conftest$ac_exeext conftest.$ac_ext
    6719 LIBS=$ac_check_lib_save_LIBS
    6720 fi
    6721 echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
    6722 echo "${ECHO_T}$ac_cv_lib_m_main" >&6
    6723 if 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 
    6730 fi
    6731 
    6732 
    6733 
    6734 # Checks for header files.
    6735 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
    6736 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
    6737 if test "${ac_cv_header_stdc+set}" = set; then
    6738   echo $ECHO_N "(cached) $ECHO_C" >&6
    6739 else
    6740   cat >conftest.$ac_ext <<_ACEOF
    6741 /* confdefs.h.  */
    6742 _ACEOF
    6743 cat confdefs.h >>conftest.$ac_ext
    6744 cat >>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 
    6751 int
    6752 main ()
    6753 {
    6754 
    6755   ;
    6756   return 0;
    6757 }
    6758 _ACEOF
    6759 rm -f conftest.$ac_objext
    6760 if { (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
    6782 else
    6783   echo "$as_me: failed program was:" >&5
    6784 sed 's/^/| /' conftest.$ac_ext >&5
    6785 
    6786 ac_cv_header_stdc=no
    6787 fi
    6788 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    6789 
    6790 if 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
    6795 cat confdefs.h >>conftest.$ac_ext
    6796 cat >>conftest.$ac_ext <<_ACEOF
    6797 /* end confdefs.h.  */
    6798 #include <string.h>
    6799 
    6800 _ACEOF
    6801 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    6802   $EGREP "memchr" >/dev/null 2>&1; then
    6803   :
    6804 else
    6805   ac_cv_header_stdc=no
    6806 fi
    6807 rm -f conftest*
    6808 
    6809 fi
    6810 
    6811 if 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
    6816 cat confdefs.h >>conftest.$ac_ext
    6817 cat >>conftest.$ac_ext <<_ACEOF
    6818 /* end confdefs.h.  */
    6819 #include <stdlib.h>
    6820 
    6821 _ACEOF
    6822 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    6823   $EGREP "free" >/dev/null 2>&1; then
    6824   :
    6825 else
    6826   ac_cv_header_stdc=no
    6827 fi
    6828 rm -f conftest*
    6829 
    6830 fi
    6831 
    6832 if 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   :
    6836 else
    6837   cat >conftest.$ac_ext <<_ACEOF
    6838 /* confdefs.h.  */
    6839 _ACEOF
    6840 cat confdefs.h >>conftest.$ac_ext
    6841 cat >>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)))
    6856 int
    6857 main ()
    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
    6867 rm -f conftest$ac_exeext
    6868 if { (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   :
    6879 else
    6880   echo "$as_me: program exited with status $ac_status" >&5
    6881 echo "$as_me: failed program was:" >&5
    6882 sed 's/^/| /' conftest.$ac_ext >&5
    6883 
    6884 ( exit $ac_status )
    6885 ac_cv_header_stdc=no
    6886 fi
    6887 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
    6888 fi
    6889 fi
    6890 fi
    6891 echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
    6892 echo "${ECHO_T}$ac_cv_header_stdc" >&6
    6893 if test $ac_cv_header_stdc = yes; then
    6894 
    6895 cat >>confdefs.h <<\_ACEOF
    6896 #define STDC_HEADERS 1
    6897 _ACEOF
    6898 
    6899 fi
    6900 
    6901 
    6902 
    6903 for ac_header in stdlib.h string.h
     6788#---------#
     6789# gThread #
     6790#---------#
     6791if test x$def_gthread = xyes; then
     6792
     6793        echo "$as_me:$LINENO: checking for gthread" >&5
     6794echo $ECHO_N "checking for gthread... $ECHO_C" >&6
     6795        if `pkg-config --exists gthread-2.0`; then
     6796                echo "yes"
     6797                have_gthread=yes
     6798                GTHREAD_LIBS=`pkg-config --libs gthread-2.0`
     6799                GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0`
     6800
     6801cat >>confdefs.h <<_ACEOF
     6802#define HAVE_GTHREAD 1
     6803_ACEOF
     6804
     6805        else
     6806                echo "no"
     6807        fi
     6808
     6809fi
     6810
     6811
     6812
     6813
     6814if test x$have_gthread = xyes; then
     6815  HAVE_GTHREAD_TRUE=
     6816  HAVE_GTHREAD_FALSE='#'
     6817else
     6818  HAVE_GTHREAD_TRUE='#'
     6819  HAVE_GTHREAD_FALSE=
     6820fi
     6821
     6822
     6823#---------#
     6824# libcURL #
     6825#---------#
     6826if test x$def_curl = xyes; then
     6827
     6828
     6829for ac_header in curl/curl.h
    69046830do
    69056831as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    70456971#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
    70466972_ACEOF
    7047 
     6973 curlHeader="yes"
     6974else
     6975  curlHeader="no"
    70486976fi
    70496977
    70506978done
    70516979
    7052 
    7053 # Checks for typedefs, structures, and compiler characteristics.
    7054 echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
    7055 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
    7056 if test "${ac_cv_header_stdbool_h+set}" = set; then
     6980 echo "$as_me:$LINENO: checking for main in -lcurl" >&5
     6981echo $ECHO_N "checking for main in -lcurl... $ECHO_C" >&6
     6982if test "${ac_cv_lib_curl_main+set}" = set; then
    70576983  echo $ECHO_N "(cached) $ECHO_C" >&6
    70586984else
    7059   cat >conftest.$ac_ext <<_ACEOF
     6985  ac_check_lib_save_LIBS=$LIBS
     6986LIBS="-lcurl  $LIBS"
     6987cat >conftest.$ac_ext <<_ACEOF
    70606988/* confdefs.h.  */
    70616989_ACEOF
     
    70646992/* end confdefs.h.  */
    70656993
    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];
    70976994
    70986995int
    70996996main ()
    71006997{
    7101  return !a + !b + !c + !d + !e + !f + !g + !h + !i;
     6998main ();
    71026999  ;
    71037000  return 0;
    71047001}
    71057002_ACEOF
    7106 rm -f conftest.$ac_objext
    7107 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
    7108   (eval $ac_compile) 2>conftest.er1
     7003rm -f conftest.$ac_objext conftest$ac_exeext
     7004if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7005  (eval $ac_link) 2>conftest.er1
    71097006  ac_status=$?
    71107007  grep -v '^ *+' conftest.er1 >conftest.err
     
    71207017  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    71217018  (exit $ac_status); }; } &&
    7122          { ac_try='test -s conftest.$ac_objext'
     7019         { ac_try='test -s conftest$ac_exeext'
    71237020  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
    71247021  (eval $ac_try) 2>&5
     
    71267023  echo "$as_me:$LINENO: \$? = $ac_status" >&5
    71277024  (exit $ac_status); }; }; then
    7128   ac_cv_header_stdbool_h=yes
     7025  ac_cv_lib_curl_main=yes
    71297026else
    71307027  echo "$as_me: failed program was:" >&5
    71317028sed 's/^/| /' conftest.$ac_ext >&5
    71327029
    7133 ac_cv_header_stdbool_h=no
    7134 fi
    7135 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    7136 fi
    7137 echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
    7138 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
    7139 echo "$as_me:$LINENO: checking for _Bool" >&5
    7140 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
    7141 if test "${ac_cv_type__Bool+set}" = set; then
    7142   echo $ECHO_N "(cached) $ECHO_C" >&6
    7143 else
    7144   cat >conftest.$ac_ext <<_ACEOF
    7145 /* confdefs.h.  */
    7146 _ACEOF
    7147 cat confdefs.h >>conftest.$ac_ext
    7148 cat >>conftest.$ac_ext <<_ACEOF
    7149 /* end confdefs.h.  */
    7150 $ac_includes_default
    7151 int
    7152 main ()
    7153 {
    7154 if ((_Bool *) 0)
    7155   return 0;
    7156 if (sizeof (_Bool))
    7157   return 0;
    7158   ;
    7159   return 0;
    7160 }
    7161 _ACEOF
    7162 rm -f conftest.$ac_objext
    7163 if { (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
    7185 else
    7186   echo "$as_me: failed program was:" >&5
    7187 sed 's/^/| /' conftest.$ac_ext >&5
    7188 
    7189 ac_cv_type__Bool=no
    7190 fi
    7191 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
    7192 fi
    7193 echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
    7194 echo "${ECHO_T}$ac_cv_type__Bool" >&6
    7195 if test $ac_cv_type__Bool = yes; then
     7030ac_cv_lib_curl_main=no
     7031fi
     7032rm -f conftest.err conftest.$ac_objext \
     7033      conftest$ac_exeext conftest.$ac_ext
     7034LIBS=$ac_check_lib_save_LIBS
     7035fi
     7036echo "$as_me:$LINENO: result: $ac_cv_lib_curl_main" >&5
     7037echo "${ECHO_T}$ac_cv_lib_curl_main" >&6
     7038if test $ac_cv_lib_curl_main = yes; then
     7039  FOUND_curl=yes
     7040fi
     7041
     7042 if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then
     7043  have_curl=yes
     7044  CURL_LIBS=`curl-config --libs`
     7045  CURLCFLAGS=`curl-config --cflags`
    71967046
    71977047cat >>confdefs.h <<_ACEOF
    7198 #define HAVE__BOOL 1
    7199 _ACEOF
    7200 
    7201 
    7202 fi
    7203 
    7204 if test $ac_cv_header_stdbool_h = yes; then
    7205 
    7206 cat >>confdefs.h <<\_ACEOF
    7207 #define HAVE_STDBOOL_H 1
    7208 _ACEOF
    7209 
    7210 fi
    7211 
    7212 
    7213 # Checks for library functions.
    7214 
    7215 for ac_header in stdlib.h
     7048#define HAVE_CURL 1
     7049_ACEOF
     7050
     7051 else
     7052  have_curl=no
     7053 fi
     7054
     7055fi
     7056
     7057
     7058
     7059
     7060if test x$have_curl = xyes; then
     7061  HAVE_CURL_TRUE=
     7062  HAVE_CURL_FALSE='#'
     7063else
     7064  HAVE_CURL_TRUE='#'
     7065  HAVE_CURL_FALSE=
     7066fi
     7067
     7068
     7069#---------#
     7070# pthread #
     7071#---------#
     7072if test x$def_pthread = xyes ; then
     7073 if test x$have_gthread = xyes ; then
     7074
     7075for ac_header in pthread.h
    72167076do
    72177077as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    73577217#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
    73587218_ACEOF
     7219 pthreadHeader="yes"
     7220else
     7221  pthreadHeader="no"
     7222fi
     7223
     7224done
     7225
     7226  echo "$as_me:$LINENO: checking for main in -lpthread" >&5
     7227echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
     7228if test "${ac_cv_lib_pthread_main+set}" = set; then
     7229  echo $ECHO_N "(cached) $ECHO_C" >&6
     7230else
     7231  ac_check_lib_save_LIBS=$LIBS
     7232LIBS="-lpthread  $LIBS"
     7233cat >conftest.$ac_ext <<_ACEOF
     7234/* confdefs.h.  */
     7235_ACEOF
     7236cat confdefs.h >>conftest.$ac_ext
     7237cat >>conftest.$ac_ext <<_ACEOF
     7238/* end confdefs.h.  */
     7239
     7240
     7241int
     7242main ()
     7243{
     7244main ();
     7245  ;
     7246  return 0;
     7247}
     7248_ACEOF
     7249rm -f conftest.$ac_objext conftest$ac_exeext
     7250if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7251  (eval $ac_link) 2>conftest.er1
     7252  ac_status=$?
     7253  grep -v '^ *+' conftest.er1 >conftest.err
     7254  rm -f conftest.er1
     7255  cat conftest.err >&5
     7256  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7257  (exit $ac_status); } &&
     7258         { ac_try='test -z "$ac_c_werror_flag"
     7259                         || test ! -s conftest.err'
     7260  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7261  (eval $ac_try) 2>&5
     7262  ac_status=$?
     7263  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7264  (exit $ac_status); }; } &&
     7265         { ac_try='test -s conftest$ac_exeext'
     7266  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7267  (eval $ac_try) 2>&5
     7268  ac_status=$?
     7269  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7270  (exit $ac_status); }; }; then
     7271  ac_cv_lib_pthread_main=yes
     7272else
     7273  echo "$as_me: failed program was:" >&5
     7274sed 's/^/| /' conftest.$ac_ext >&5
     7275
     7276ac_cv_lib_pthread_main=no
     7277fi
     7278rm -f conftest.err conftest.$ac_objext \
     7279      conftest$ac_exeext conftest.$ac_ext
     7280LIBS=$ac_check_lib_save_LIBS
     7281fi
     7282echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
     7283echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6
     7284if test $ac_cv_lib_pthread_main = yes; then
     7285  FOUND_pthread=yes
     7286fi
     7287
     7288   if test x$FOUND_pthread = xyes ; then
     7289      LIBS="$LIBS -lpthread"
     7290   fi
     7291 fi
     7292fi
     7293
     7294
     7295# FIXME: Replace `main' with a function in `-lm':
     7296
     7297echo "$as_me:$LINENO: checking for main in -lm" >&5
     7298echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
     7299if test "${ac_cv_lib_m_main+set}" = set; then
     7300  echo $ECHO_N "(cached) $ECHO_C" >&6
     7301else
     7302  ac_check_lib_save_LIBS=$LIBS
     7303LIBS="-lm  $LIBS"
     7304cat >conftest.$ac_ext <<_ACEOF
     7305/* confdefs.h.  */
     7306_ACEOF
     7307cat confdefs.h >>conftest.$ac_ext
     7308cat >>conftest.$ac_ext <<_ACEOF
     7309/* end confdefs.h.  */
     7310
     7311
     7312int
     7313main ()
     7314{
     7315main ();
     7316  ;
     7317  return 0;
     7318}
     7319_ACEOF
     7320rm -f conftest.$ac_objext conftest$ac_exeext
     7321if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7322  (eval $ac_link) 2>conftest.er1
     7323  ac_status=$?
     7324  grep -v '^ *+' conftest.er1 >conftest.err
     7325  rm -f conftest.er1
     7326  cat conftest.err >&5
     7327  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7328  (exit $ac_status); } &&
     7329         { ac_try='test -z "$ac_c_werror_flag"
     7330                         || test ! -s conftest.err'
     7331  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7332  (eval $ac_try) 2>&5
     7333  ac_status=$?
     7334  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7335  (exit $ac_status); }; } &&
     7336         { ac_try='test -s conftest$ac_exeext'
     7337  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7338  (eval $ac_try) 2>&5
     7339  ac_status=$?
     7340  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7341  (exit $ac_status); }; }; then
     7342  ac_cv_lib_m_main=yes
     7343else
     7344  echo "$as_me: failed program was:" >&5
     7345sed 's/^/| /' conftest.$ac_ext >&5
     7346
     7347ac_cv_lib_m_main=no
     7348fi
     7349rm -f conftest.err conftest.$ac_objext \
     7350      conftest$ac_exeext conftest.$ac_ext
     7351LIBS=$ac_check_lib_save_LIBS
     7352fi
     7353echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
     7354echo "${ECHO_T}$ac_cv_lib_m_main" >&6
     7355if test $ac_cv_lib_m_main = yes; then
     7356  cat >>confdefs.h <<_ACEOF
     7357#define HAVE_LIBM 1
     7358_ACEOF
     7359
     7360  LIBS="-lm $LIBS"
     7361
     7362fi
     7363
     7364
     7365
     7366# Checks for header files.
     7367echo "$as_me:$LINENO: checking for ANSI C header files" >&5
     7368echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
     7369if test "${ac_cv_header_stdc+set}" = set; then
     7370  echo $ECHO_N "(cached) $ECHO_C" >&6
     7371else
     7372  cat >conftest.$ac_ext <<_ACEOF
     7373/* confdefs.h.  */
     7374_ACEOF
     7375cat confdefs.h >>conftest.$ac_ext
     7376cat >>conftest.$ac_ext <<_ACEOF
     7377/* end confdefs.h.  */
     7378#include <stdlib.h>
     7379#include <stdarg.h>
     7380#include <string.h>
     7381#include <float.h>
     7382
     7383int
     7384main ()
     7385{
     7386
     7387  ;
     7388  return 0;
     7389}
     7390_ACEOF
     7391rm -f conftest.$ac_objext
     7392if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7393  (eval $ac_compile) 2>conftest.er1
     7394  ac_status=$?
     7395  grep -v '^ *+' conftest.er1 >conftest.err
     7396  rm -f conftest.er1
     7397  cat conftest.err >&5
     7398  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7399  (exit $ac_status); } &&
     7400         { ac_try='test -z "$ac_c_werror_flag"
     7401                         || test ! -s conftest.err'
     7402  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7403  (eval $ac_try) 2>&5
     7404  ac_status=$?
     7405  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7406  (exit $ac_status); }; } &&
     7407         { ac_try='test -s conftest.$ac_objext'
     7408  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7409  (eval $ac_try) 2>&5
     7410  ac_status=$?
     7411  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7412  (exit $ac_status); }; }; then
     7413  ac_cv_header_stdc=yes
     7414else
     7415  echo "$as_me: failed program was:" >&5
     7416sed 's/^/| /' conftest.$ac_ext >&5
     7417
     7418ac_cv_header_stdc=no
     7419fi
     7420rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7421
     7422if test $ac_cv_header_stdc = yes; then
     7423  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
     7424  cat >conftest.$ac_ext <<_ACEOF
     7425/* confdefs.h.  */
     7426_ACEOF
     7427cat confdefs.h >>conftest.$ac_ext
     7428cat >>conftest.$ac_ext <<_ACEOF
     7429/* end confdefs.h.  */
     7430#include <string.h>
     7431
     7432_ACEOF
     7433if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     7434  $EGREP "memchr" >/dev/null 2>&1; then
     7435  :
     7436else
     7437  ac_cv_header_stdc=no
     7438fi
     7439rm -f conftest*
     7440
     7441fi
     7442
     7443if test $ac_cv_header_stdc = yes; then
     7444  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
     7445  cat >conftest.$ac_ext <<_ACEOF
     7446/* confdefs.h.  */
     7447_ACEOF
     7448cat confdefs.h >>conftest.$ac_ext
     7449cat >>conftest.$ac_ext <<_ACEOF
     7450/* end confdefs.h.  */
     7451#include <stdlib.h>
     7452
     7453_ACEOF
     7454if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
     7455  $EGREP "free" >/dev/null 2>&1; then
     7456  :
     7457else
     7458  ac_cv_header_stdc=no
     7459fi
     7460rm -f conftest*
     7461
     7462fi
     7463
     7464if test $ac_cv_header_stdc = yes; then
     7465  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
     7466  if test "$cross_compiling" = yes; then
     7467  :
     7468else
     7469  cat >conftest.$ac_ext <<_ACEOF
     7470/* confdefs.h.  */
     7471_ACEOF
     7472cat confdefs.h >>conftest.$ac_ext
     7473cat >>conftest.$ac_ext <<_ACEOF
     7474/* end confdefs.h.  */
     7475#include <ctype.h>
     7476#if ((' ' & 0x0FF) == 0x020)
     7477# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
     7478# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
     7479#else
     7480# define ISLOWER(c) \
     7481                   (('a' <= (c) && (c) <= 'i') \
     7482                     || ('j' <= (c) && (c) <= 'r') \
     7483                     || ('s' <= (c) && (c) <= 'z'))
     7484# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
     7485#endif
     7486
     7487#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
     7488int
     7489main ()
     7490{
     7491  int i;
     7492  for (i = 0; i < 256; i++)
     7493    if (XOR (islower (i), ISLOWER (i))
     7494        || toupper (i) != TOUPPER (i))
     7495      exit(2);
     7496  exit (0);
     7497}
     7498_ACEOF
     7499rm -f conftest$ac_exeext
     7500if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     7501  (eval $ac_link) 2>&5
     7502  ac_status=$?
     7503  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7504  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
     7505  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7506  (eval $ac_try) 2>&5
     7507  ac_status=$?
     7508  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7509  (exit $ac_status); }; }; then
     7510  :
     7511else
     7512  echo "$as_me: program exited with status $ac_status" >&5
     7513echo "$as_me: failed program was:" >&5
     7514sed 's/^/| /' conftest.$ac_ext >&5
     7515
     7516( exit $ac_status )
     7517ac_cv_header_stdc=no
     7518fi
     7519rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
     7520fi
     7521fi
     7522fi
     7523echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
     7524echo "${ECHO_T}$ac_cv_header_stdc" >&6
     7525if test $ac_cv_header_stdc = yes; then
     7526
     7527cat >>confdefs.h <<\_ACEOF
     7528#define STDC_HEADERS 1
     7529_ACEOF
     7530
     7531fi
     7532
     7533
     7534
     7535for ac_header in stdlib.h string.h
     7536do
     7537as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     7538if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7539  echo "$as_me:$LINENO: checking for $ac_header" >&5
     7540echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     7541if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7542  echo $ECHO_N "(cached) $ECHO_C" >&6
     7543fi
     7544echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     7545echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     7546else
     7547  # Is the header compilable?
     7548echo "$as_me:$LINENO: checking $ac_header usability" >&5
     7549echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
     7550cat >conftest.$ac_ext <<_ACEOF
     7551/* confdefs.h.  */
     7552_ACEOF
     7553cat confdefs.h >>conftest.$ac_ext
     7554cat >>conftest.$ac_ext <<_ACEOF
     7555/* end confdefs.h.  */
     7556$ac_includes_default
     7557#include <$ac_header>
     7558_ACEOF
     7559rm -f conftest.$ac_objext
     7560if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7561  (eval $ac_compile) 2>conftest.er1
     7562  ac_status=$?
     7563  grep -v '^ *+' conftest.er1 >conftest.err
     7564  rm -f conftest.er1
     7565  cat conftest.err >&5
     7566  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7567  (exit $ac_status); } &&
     7568         { ac_try='test -z "$ac_c_werror_flag"
     7569                         || test ! -s conftest.err'
     7570  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7571  (eval $ac_try) 2>&5
     7572  ac_status=$?
     7573  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7574  (exit $ac_status); }; } &&
     7575         { ac_try='test -s conftest.$ac_objext'
     7576  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7577  (eval $ac_try) 2>&5
     7578  ac_status=$?
     7579  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7580  (exit $ac_status); }; }; then
     7581  ac_header_compiler=yes
     7582else
     7583  echo "$as_me: failed program was:" >&5
     7584sed 's/^/| /' conftest.$ac_ext >&5
     7585
     7586ac_header_compiler=no
     7587fi
     7588rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7589echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     7590echo "${ECHO_T}$ac_header_compiler" >&6
     7591
     7592# Is the header present?
     7593echo "$as_me:$LINENO: checking $ac_header presence" >&5
     7594echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
     7595cat >conftest.$ac_ext <<_ACEOF
     7596/* confdefs.h.  */
     7597_ACEOF
     7598cat confdefs.h >>conftest.$ac_ext
     7599cat >>conftest.$ac_ext <<_ACEOF
     7600/* end confdefs.h.  */
     7601#include <$ac_header>
     7602_ACEOF
     7603if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     7604  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     7605  ac_status=$?
     7606  grep -v '^ *+' conftest.er1 >conftest.err
     7607  rm -f conftest.er1
     7608  cat conftest.err >&5
     7609  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7610  (exit $ac_status); } >/dev/null; then
     7611  if test -s conftest.err; then
     7612    ac_cpp_err=$ac_c_preproc_warn_flag
     7613    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     7614  else
     7615    ac_cpp_err=
     7616  fi
     7617else
     7618  ac_cpp_err=yes
     7619fi
     7620if test -z "$ac_cpp_err"; then
     7621  ac_header_preproc=yes
     7622else
     7623  echo "$as_me: failed program was:" >&5
     7624sed 's/^/| /' conftest.$ac_ext >&5
     7625
     7626  ac_header_preproc=no
     7627fi
     7628rm -f conftest.err conftest.$ac_ext
     7629echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     7630echo "${ECHO_T}$ac_header_preproc" >&6
     7631
     7632# So?  What about this header?
     7633case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     7634  yes:no: )
     7635    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
     7636echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     7637    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
     7638echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     7639    ac_header_preproc=yes
     7640    ;;
     7641  no:yes:* )
     7642    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
     7643echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     7644    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
     7645echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
     7646    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
     7647echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
     7648    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
     7649echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     7650    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
     7651echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     7652    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
     7653echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     7654    (
     7655      cat <<\_ASBOX
     7656## ---------------------------------------------- ##
     7657## Report this to orxonox-dev at mail.datacore.ch ##
     7658## ---------------------------------------------- ##
     7659_ASBOX
     7660    ) |
     7661      sed "s/^/$as_me: WARNING:     /" >&2
     7662    ;;
     7663esac
     7664echo "$as_me:$LINENO: checking for $ac_header" >&5
     7665echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     7666if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7667  echo $ECHO_N "(cached) $ECHO_C" >&6
     7668else
     7669  eval "$as_ac_Header=\$ac_header_preproc"
     7670fi
     7671echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     7672echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     7673
     7674fi
     7675if test `eval echo '${'$as_ac_Header'}'` = yes; then
     7676  cat >>confdefs.h <<_ACEOF
     7677#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     7678_ACEOF
     7679
     7680fi
     7681
     7682done
     7683
     7684
     7685# Checks for typedefs, structures, and compiler characteristics.
     7686echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
     7687echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
     7688if test "${ac_cv_header_stdbool_h+set}" = set; then
     7689  echo $ECHO_N "(cached) $ECHO_C" >&6
     7690else
     7691  cat >conftest.$ac_ext <<_ACEOF
     7692/* confdefs.h.  */
     7693_ACEOF
     7694cat confdefs.h >>conftest.$ac_ext
     7695cat >>conftest.$ac_ext <<_ACEOF
     7696/* end confdefs.h.  */
     7697
     7698#include <stdbool.h>
     7699#ifndef bool
     7700# error bool is not defined
     7701#endif
     7702#ifndef false
     7703# error false is not defined
     7704#endif
     7705#if false
     7706# error false is not 0
     7707#endif
     7708#ifndef true
     7709# error true is not defined
     7710#endif
     7711#if true != 1
     7712# error true is not 1
     7713#endif
     7714#ifndef __bool_true_false_are_defined
     7715# error __bool_true_false_are_defined is not defined
     7716#endif
     7717
     7718        struct s { _Bool s: 1; _Bool t; } s;
     7719
     7720        char a[true == 1 ? 1 : -1];
     7721        char b[false == 0 ? 1 : -1];
     7722        char c[__bool_true_false_are_defined == 1 ? 1 : -1];
     7723        char d[(bool) -0.5 == true ? 1 : -1];
     7724        bool e = &s;
     7725        char f[(_Bool) -0.0 == false ? 1 : -1];
     7726        char g[true];
     7727        char h[sizeof (_Bool)];
     7728        char i[sizeof s.t];
     7729
     7730int
     7731main ()
     7732{
     7733 return !a + !b + !c + !d + !e + !f + !g + !h + !i;
     7734  ;
     7735  return 0;
     7736}
     7737_ACEOF
     7738rm -f conftest.$ac_objext
     7739if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7740  (eval $ac_compile) 2>conftest.er1
     7741  ac_status=$?
     7742  grep -v '^ *+' conftest.er1 >conftest.err
     7743  rm -f conftest.er1
     7744  cat conftest.err >&5
     7745  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7746  (exit $ac_status); } &&
     7747         { ac_try='test -z "$ac_c_werror_flag"
     7748                         || test ! -s conftest.err'
     7749  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7750  (eval $ac_try) 2>&5
     7751  ac_status=$?
     7752  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7753  (exit $ac_status); }; } &&
     7754         { ac_try='test -s conftest.$ac_objext'
     7755  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7756  (eval $ac_try) 2>&5
     7757  ac_status=$?
     7758  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7759  (exit $ac_status); }; }; then
     7760  ac_cv_header_stdbool_h=yes
     7761else
     7762  echo "$as_me: failed program was:" >&5
     7763sed 's/^/| /' conftest.$ac_ext >&5
     7764
     7765ac_cv_header_stdbool_h=no
     7766fi
     7767rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7768fi
     7769echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
     7770echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
     7771echo "$as_me:$LINENO: checking for _Bool" >&5
     7772echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
     7773if test "${ac_cv_type__Bool+set}" = set; then
     7774  echo $ECHO_N "(cached) $ECHO_C" >&6
     7775else
     7776  cat >conftest.$ac_ext <<_ACEOF
     7777/* confdefs.h.  */
     7778_ACEOF
     7779cat confdefs.h >>conftest.$ac_ext
     7780cat >>conftest.$ac_ext <<_ACEOF
     7781/* end confdefs.h.  */
     7782$ac_includes_default
     7783int
     7784main ()
     7785{
     7786if ((_Bool *) 0)
     7787  return 0;
     7788if (sizeof (_Bool))
     7789  return 0;
     7790  ;
     7791  return 0;
     7792}
     7793_ACEOF
     7794rm -f conftest.$ac_objext
     7795if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7796  (eval $ac_compile) 2>conftest.er1
     7797  ac_status=$?
     7798  grep -v '^ *+' conftest.er1 >conftest.err
     7799  rm -f conftest.er1
     7800  cat conftest.err >&5
     7801  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7802  (exit $ac_status); } &&
     7803         { ac_try='test -z "$ac_c_werror_flag"
     7804                         || test ! -s conftest.err'
     7805  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7806  (eval $ac_try) 2>&5
     7807  ac_status=$?
     7808  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7809  (exit $ac_status); }; } &&
     7810         { ac_try='test -s conftest.$ac_objext'
     7811  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7812  (eval $ac_try) 2>&5
     7813  ac_status=$?
     7814  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7815  (exit $ac_status); }; }; then
     7816  ac_cv_type__Bool=yes
     7817else
     7818  echo "$as_me: failed program was:" >&5
     7819sed 's/^/| /' conftest.$ac_ext >&5
     7820
     7821ac_cv_type__Bool=no
     7822fi
     7823rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7824fi
     7825echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
     7826echo "${ECHO_T}$ac_cv_type__Bool" >&6
     7827if test $ac_cv_type__Bool = yes; then
     7828
     7829cat >>confdefs.h <<_ACEOF
     7830#define HAVE__BOOL 1
     7831_ACEOF
     7832
     7833
     7834fi
     7835
     7836if test $ac_cv_header_stdbool_h = yes; then
     7837
     7838cat >>confdefs.h <<\_ACEOF
     7839#define HAVE_STDBOOL_H 1
     7840_ACEOF
     7841
     7842fi
     7843
     7844
     7845# Checks for library functions.
     7846
     7847for ac_header in stdlib.h
     7848do
     7849as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     7850if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7851  echo "$as_me:$LINENO: checking for $ac_header" >&5
     7852echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     7853if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7854  echo $ECHO_N "(cached) $ECHO_C" >&6
     7855fi
     7856echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     7857echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     7858else
     7859  # Is the header compilable?
     7860echo "$as_me:$LINENO: checking $ac_header usability" >&5
     7861echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
     7862cat >conftest.$ac_ext <<_ACEOF
     7863/* confdefs.h.  */
     7864_ACEOF
     7865cat confdefs.h >>conftest.$ac_ext
     7866cat >>conftest.$ac_ext <<_ACEOF
     7867/* end confdefs.h.  */
     7868$ac_includes_default
     7869#include <$ac_header>
     7870_ACEOF
     7871rm -f conftest.$ac_objext
     7872if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     7873  (eval $ac_compile) 2>conftest.er1
     7874  ac_status=$?
     7875  grep -v '^ *+' conftest.er1 >conftest.err
     7876  rm -f conftest.er1
     7877  cat conftest.err >&5
     7878  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7879  (exit $ac_status); } &&
     7880         { ac_try='test -z "$ac_c_werror_flag"
     7881                         || test ! -s conftest.err'
     7882  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7883  (eval $ac_try) 2>&5
     7884  ac_status=$?
     7885  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7886  (exit $ac_status); }; } &&
     7887         { ac_try='test -s conftest.$ac_objext'
     7888  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     7889  (eval $ac_try) 2>&5
     7890  ac_status=$?
     7891  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7892  (exit $ac_status); }; }; then
     7893  ac_header_compiler=yes
     7894else
     7895  echo "$as_me: failed program was:" >&5
     7896sed 's/^/| /' conftest.$ac_ext >&5
     7897
     7898ac_header_compiler=no
     7899fi
     7900rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     7901echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     7902echo "${ECHO_T}$ac_header_compiler" >&6
     7903
     7904# Is the header present?
     7905echo "$as_me:$LINENO: checking $ac_header presence" >&5
     7906echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
     7907cat >conftest.$ac_ext <<_ACEOF
     7908/* confdefs.h.  */
     7909_ACEOF
     7910cat confdefs.h >>conftest.$ac_ext
     7911cat >>conftest.$ac_ext <<_ACEOF
     7912/* end confdefs.h.  */
     7913#include <$ac_header>
     7914_ACEOF
     7915if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     7916  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     7917  ac_status=$?
     7918  grep -v '^ *+' conftest.er1 >conftest.err
     7919  rm -f conftest.er1
     7920  cat conftest.err >&5
     7921  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     7922  (exit $ac_status); } >/dev/null; then
     7923  if test -s conftest.err; then
     7924    ac_cpp_err=$ac_c_preproc_warn_flag
     7925    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     7926  else
     7927    ac_cpp_err=
     7928  fi
     7929else
     7930  ac_cpp_err=yes
     7931fi
     7932if test -z "$ac_cpp_err"; then
     7933  ac_header_preproc=yes
     7934else
     7935  echo "$as_me: failed program was:" >&5
     7936sed 's/^/| /' conftest.$ac_ext >&5
     7937
     7938  ac_header_preproc=no
     7939fi
     7940rm -f conftest.err conftest.$ac_ext
     7941echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     7942echo "${ECHO_T}$ac_header_preproc" >&6
     7943
     7944# So?  What about this header?
     7945case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     7946  yes:no: )
     7947    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
     7948echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     7949    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
     7950echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     7951    ac_header_preproc=yes
     7952    ;;
     7953  no:yes:* )
     7954    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
     7955echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     7956    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
     7957echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
     7958    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
     7959echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
     7960    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
     7961echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     7962    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
     7963echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     7964    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
     7965echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     7966    (
     7967      cat <<\_ASBOX
     7968## ---------------------------------------------- ##
     7969## Report this to orxonox-dev at mail.datacore.ch ##
     7970## ---------------------------------------------- ##
     7971_ASBOX
     7972    ) |
     7973      sed "s/^/$as_me: WARNING:     /" >&2
     7974    ;;
     7975esac
     7976echo "$as_me:$LINENO: checking for $ac_header" >&5
     7977echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     7978if eval "test \"\${$as_ac_Header+set}\" = set"; then
     7979  echo $ECHO_N "(cached) $ECHO_C" >&6
     7980else
     7981  eval "$as_ac_Header=\$ac_header_preproc"
     7982fi
     7983echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     7984echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     7985
     7986fi
     7987if test `eval echo '${'$as_ac_Header'}'` = yes; then
     7988  cat >>confdefs.h <<_ACEOF
     7989#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     7990_ACEOF
    73597991
    73607992fi
     
    75478179
    75488180
    7549                                                   ac_config_files="$ac_config_files Makefile src/console/Makefile src/gui/Makefile src/Makefile src/importer/Makefile"
     8181######################
     8182## OUTPUT CONFIGURE ##
     8183######################
     8184                                                  ac_config_files="$ac_config_files Makefile src/Makefile src/importer/Makefile src/console/Makefile src/gui/Makefile"
     8185
    75508186
    75518187cat >confcache <<\_ACEOF
     
    76618297   { (exit 1); exit 1; }; }
    76628298fi
     8299if test -z "${SUB_PROJECTS_TRUE}" && test -z "${SUB_PROJECTS_FALSE}"; then
     8300  { { echo "$as_me:$LINENO: error: conditional \"SUB_PROJECTS\" was never defined.
     8301Usually this means the macro was only invoked conditionally." >&5
     8302echo "$as_me: error: conditional \"SUB_PROJECTS\" was never defined.
     8303Usually this means the macro was only invoked conditionally." >&2;}
     8304   { (exit 1); exit 1; }; }
     8305fi
    76638306if test -z "${DOXYGEN_TRUE}" && test -z "${DOXYGEN_FALSE}"; then
    76648307  { { echo "$as_me:$LINENO: error: conditional \"DOXYGEN\" was never defined.
     
    76728315Usually this means the macro was only invoked conditionally." >&5
    76738316echo "$as_me: error: conditional \"HAVE_GTK2\" was never defined.
     8317Usually this means the macro was only invoked conditionally." >&2;}
     8318   { (exit 1); exit 1; }; }
     8319fi
     8320if test -z "${HAVE_GTHREAD_TRUE}" && test -z "${HAVE_GTHREAD_FALSE}"; then
     8321  { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTHREAD\" was never defined.
     8322Usually this means the macro was only invoked conditionally." >&5
     8323echo "$as_me: error: conditional \"HAVE_GTHREAD\" was never defined.
     8324Usually this means the macro was only invoked conditionally." >&2;}
     8325   { (exit 1); exit 1; }; }
     8326fi
     8327if test -z "${HAVE_CURL_TRUE}" && test -z "${HAVE_CURL_FALSE}"; then
     8328  { { echo "$as_me:$LINENO: error: conditional \"HAVE_CURL\" was never defined.
     8329Usually this means the macro was only invoked conditionally." >&5
     8330echo "$as_me: error: conditional \"HAVE_CURL\" was never defined.
    76748331Usually this means the macro was only invoked conditionally." >&2;}
    76758332   { (exit 1); exit 1; }; }
     
    81208777  # Handling of arguments.
    81218778  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     8779  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     8780  "src/importer/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/importer/Makefile" ;;
    81228781  "src/console/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/console/Makefile" ;;
    81238782  "src/gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/gui/Makefile" ;;
    8124   "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
    8125   "src/importer/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/importer/Makefile" ;;
    81268783  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
    81278784  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     
    82688925s,@EGREP@,$EGREP,;t t
    82698926s,@DEBUG@,$DEBUG,;t t
     8927s,@SUB_PROJECTS_TRUE@,$SUB_PROJECTS_TRUE,;t t
     8928s,@SUB_PROJECTS_FALSE@,$SUB_PROJECTS_FALSE,;t t
    82708929s,@DOXYGEN@,$DOXYGEN,;t t
    82718930s,@DOXYGEN_TRUE@,$DOXYGEN_TRUE,;t t
     
    82768935s,@HAVE_GTK2_TRUE@,$HAVE_GTK2_TRUE,;t t
    82778936s,@HAVE_GTK2_FALSE@,$HAVE_GTK2_FALSE,;t t
     8937s,@GTHREAD_LIBS@,$GTHREAD_LIBS,;t t
     8938s,@GTHREAD_CFLAGS@,$GTHREAD_CFLAGS,;t t
     8939s,@HAVE_GTHREAD_TRUE@,$HAVE_GTHREAD_TRUE,;t t
     8940s,@HAVE_GTHREAD_FALSE@,$HAVE_GTHREAD_FALSE,;t t
     8941s,@CURL_LIBS@,$CURL_LIBS,;t t
     8942s,@CURL_CFLAGS@,$CURL_CFLAGS,;t t
     8943s,@HAVE_CURL_TRUE@,$HAVE_CURL_TRUE,;t t
     8944s,@HAVE_CURL_FALSE@,$HAVE_CURL_FALSE,;t t
    82788945s,@LIBOBJS@,$LIBOBJS,;t t
    82798946s,@LTLIBOBJS@,$LTLIBOBJS,;t t
  • orxonox/branches/trackManager/configure.ac

    r3240 r3430  
    1 #                                               -*- Autoconf -*-
    2 # Process this file with autoconf to produce a configure script.
    3 
     1##########################################################################
     2#   orxonox - the future of 3D-vertical-scrollers                        #
     3#                                                                        #
     4#   Copyright (C) 2004 orx                                               #
     5#                                                                        #
     6#   This program is free software; you can redistribute it and/or modify #
     7#   it under the terms of the GNU General Public License as published by #
     8#   the Free Software Foundation; either version 2, or (at your option)  #
     9#   any later version.                                                   #
     10#                                                                        #
     11#   ### File Specific:                                                   #
     12#   main-programmer: Benjamin Grauer                                     #
     13#   co-programmer: ...                                                   #
     14#                                                                        #
     15#   This is the main configuration File of autoconf.                     #
     16#   Please edit this file only, if you exactly know what you are doing.  #
     17#   It is quite fragile, and compiling orxonox on different Platforms    #
     18#   is only guarantied, if build with the right config.                  #
     19##########################################################################
     20
     21#########################
     22## AUTOCONF INIT PHASE ##
     23#########################
    424AC_PREREQ(2.56)
    525AC_INIT(orxonox, 0.2.1-pre-alpha, [orxonox-dev at mail.datacore.ch])
    626
    7 # Detect the canonical host and target build environment.
     27## Detect the canonical host and target build environment.
    828AC_CANONICAL_BUILD
    929AC_CANONICAL_HOST
    1030AC_CANONICAL_TARGET
    1131
    12 
    1332AM_INIT_AUTOMAKE
    1433
     
    1635AC_CONFIG_HEADER([config.h])
    1736
    18 
    19 # Checks for programs.
     37#########################
     38## Checks for programs ##
     39#########################
    2040AC_PROG_CXX
    2141AC_HEADER_STDC
    2242
    23 ### CHECKING  OPTIONAT ARGUMENTS
    24 ## DEBUG-statement
     43##################################
     44## CHECKING  OPTIONAL ARGUMENTS ##
     45##################################
     46
     47#-----------------#
     48# DEBUG-statement #
     49#-----------------#
    2550DEBUG=no
    2651AC_MSG_CHECKING([if DEBUG-mode should be enabled])
     
    2954         DEBUG=$enableval)
    3055
    31 if test "$DEBUG" = "no"; then
     56if test x$DEBUG = xno; then
    3257        echo "no"
    33         echo " -> Setting debuglevel to 1. Like this you can still see errors."
    34         DEBUG=1
    35 elif test "$DEBUG" = yes; then
     58        echo " -> Setting debuglevel to 3. (orxonox is still in Development. It really is needed."
     59        DEBUG=3
     60elif test x$DEBUG = xyes; then
    3661        echo "yes"
    37         echo " -> Setting debuglevel to 3. HARD DEBUG MODE!!."
    38         DEBUG=3
     62        echo " -> Setting debuglevel to 4. HARD DEBUG MODE!!."
     63        DEBUG=4
    3964else       
    40         echo "yes set to $DEBUG"
     65        echo "yes: setting debuglevel to to $DEBUG"
    4166fi
    4267        AC_DEFINE_UNQUOTED(DEBUG, $DEBUG, [in which debug mode we are])
     
    4469AC_SUBST(DEBUG)
    4570
    46 ## GTK-disabled
     71#--------------#
     72# GTK-disabled #
     73#--------------#
    4774AC_MSG_CHECKING([if gtk should be enabled])
    4875AC_ARG_WITH([gtk],
    4976        AC_HELP_STRING( [--without-gtk],
    5077        [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
    51 if test "$def_gtk" = yes; then
     78if test x$def_gtk = xyes; then
    5279  echo "yes"
    5380fi
    54 if test "$def_gtk" = no; then
     81if test x$def_gtk = xno; then
    5582  echo "no"
    5683fi
    57 ### SDL_image-disable
     84
     85#------------------#
     86# gThread-disabled #
     87#------------------#
     88AC_MSG_CHECKING([if gThread should be enabled])
     89AC_ARG_WITH([gthread],
     90        AC_HELP_STRING( [--without-gthread],
     91        [Prevents gThread from being loaded]), [def_gthread=no], [def_gthread=yes])
     92if test x$def_gthread = xyes; then
     93  echo "yes"
     94fi
     95if test x$def_gthread = xno; then
     96  echo "no"
     97fi
     98
     99#------------------#
     100# pthread-disabled #
     101#------------------#
     102AC_MSG_CHECKING([if pthread should be enabled])
     103AC_ARG_WITH([pthread],
     104        AC_HELP_STRING( [--without-pthread],
     105        [Prevents pthread from being loaded]), [def_pthread=no], [def_pthread=yes])
     106if test x$def_pthread = xyes; then
     107  echo "yes"
     108fi
     109if test x$def_pthread = xno; then
     110  echo "no"
     111fi
     112
     113#------------------#
     114# libCurl-disabled #
     115#------------------#
     116AC_MSG_CHECKING([if libcURL should be enabled])
     117AC_ARG_WITH([curl],
     118        AC_HELP_STRING( [--without-curl],
     119        [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes])
     120if test x$def_curl = xyes; then
     121  echo "yes"
     122fi
     123if test x$def_curl = xno; then
     124  echo "no"
     125fi
     126
     127#-------------------#
     128# SDL_image-disable #
     129#-------------------#
    58130def_sdl_image=yes
    59131AC_MSG_CHECKING([if SDL_image should be enabled])
     
    61133        AC_HELP_STRING( [--without-sdl-image],
    62134        [Prevents SDL_image from being loaded]), [def_sdl_image=no])
    63 if test "$def_sdl_image" = yes; then
     135if test x$def_sdl_image = xyes; then
    64136  echo "yes"
    65137fi
    66 if test "$def_sdl_image" = no; then
     138if test x$def_sdl_image = xno; then
    67139  echo "no"
    68140fi
    69 
    70 
    71 ## PROGRAMM CHECKING
    72 # checking for Doxygen
     141#-------------------#
     142# SubProject-enable #
     143#-------------------#
     144def_sub_projects=no
     145AC_MSG_CHECKING([if the SubProjects should be built])
     146AC_ARG_ENABLE([sub-projects],
     147        AC_HELP_STRING( [--enable-sub-projects],
     148        [also builds the subProjects while make from srcdir]), [def_sub_projects=yes])
     149if test x$def_sub_projects = xyes; then
     150  echo "yes"
     151fi
     152if test x$def_sub_projects = xno; then
     153  echo "no"
     154fi
     155AM_CONDITIONAL(SUB_PROJECTS, test x$def_sub_projects = xyes)
     156
     157#######################
     158## PROGRAMM CHECKING ##
     159## 3. party Programs ##
     160#######################
     161
     162#----------------------#
     163# checking for Doxygen #
     164#----------------------#
    73165AC_PATH_PROG(DOXYGEN, doxygen)
    74166AM_CONDITIONAL(DOXYGEN, test $DOXYGEN)
    75167
    76 ### CHECKING FOR SYSTEM ###
     168#########################
     169## CHECKING FOR SYSTEM ##
     170#########################
     171## here the system is checked, and openGL is included
     172## also checking for SDL on differen Systems
    77173
    78174AC_MSG_CHECKING([for System])
    79175## checking for openGL-environment and other sys-specific parameters
    80176case "$target" in
    81 ### WINDOWS ###
     177#---------#
     178# WINDOWS #
     179#---------#
    82180  *-*-mingw32*)
    83181echo "mingw-WINDOWS detected"
     
    95193#   checking for Windows openGl library
    96194    AC_CHECK_LIB([opengl32], [main], FOUND_opengl32=yes, "gl/gl.h")
    97     if test "$FOUND_opengl32" = "yes" ; then
     195    if test x$FOUND_opengl32 = xyes ; then
    98196        LIBS="$LIBS -lopengl32"
    99197    else
     
    106204
    107205# cheking for GLU-header
    108     AC_CHECK_HEADERS(GL/glu.h ,,
     206    AC_CHECK_HEADERS([GL/glu.h] ,,
    109207      [AC_MSG_ERROR([cannot find opengl headers]) ])
    110208
    111209# checking for libGLU
    112210    AC_CHECK_LIB([glu32], [main], FOUND_glu32=yes)
    113     if test "$FOUND_glu32" = "yes" ; then
     211    if test x$FOUND_glu32 = xyes ; then
    114212        LIBS="$LIBS -lGLU32"
    115213    else
     
    123221# checking for mingw32
    124222    AC_CHECK_LIB([mingw32], [main], FOUND_mingw32=yes)
    125     if test $FOUND_mingw32 = "yes"; then
     223    if test x$FOUND_mingw32 = xyes; then
    126224        LIBS="$LIBS -lmingw32"
    127225    fi
    128226# checking for SDL-headers
    129     AC_CHECK_HEADERS(SDL/SDL.h ,,
     227    AC_CHECK_HEADERS([SDL/SDL.h] ,,
    130228      [AC_MSG_ERROR([cannot find SDL headers]) ])
    131229
    132230#checking for libSDL
    133231    AC_CHECK_LIB([sdlmain], [main], FOUND_sdlmain=yes)
    134     if test "$FOUND_sdlmain" = "yes" ; then
     232    if test x$FOUND_sdlmain = xyes ; then
    135233       LIBS="$LIBS -lsdlmain"
    136234    else
     
    142240    fi
    143241    AC_CHECK_LIB([sdl], [main], FOUND_sdl=yes)
    144     if test "$FOUND_sdl" = "yes" ; then
     242    if test x$FOUND_sdl = xyes ; then
    145243       LIBS="$LIBS -lsdl"
    146244    else
     
    153251
    154252    ;;
    155 
    156 ### LINUX ###
     253#-------#
     254# LINUX #
     255#-------#
    157256 *-*-linux*)
    158257echo "Linux detected"
     
    161260
    162261CPPFLAGS="-I/usr/X11R6/include"
    163 LDFLAGS="-L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
     262LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
    164263# checking gl header
    165    AC_CHECK_HEADERS(GL/gl.h ,,
     264   AC_CHECK_HEADERS([GL/gl.h] ,,
    166265      [AC_MSG_ERROR([cannot find opengl headers]) ])
    167266
    168267#  checking for Unix GL
    169    AC_CHECK_LIB([GL], [main], FOUND_GL=yes)
    170    if test "$FOUND_GL" = "yes" ; then
     268   AC_CHECK_LIB([GL], [glLoadIdentity], FOUND_GL=yes)
     269   if test x$FOUND_GL = xyes ; then
    171270     LIBS="$LIBS -lGL"
    172271   else
     
    179278
    180279# cheking for GLU-header
    181     AC_CHECK_HEADERS(GL/glu.h ,,
     280    AC_CHECK_HEADERS([GL/glu.h] ,,
    182281      [AC_MSG_ERROR([cannot find opengl headers]) ])
    183282
    184283    AC_CHECK_LIB([GLU], [gluProject], FOUND_GLU=yes)
    185     if test "$FOUND_GLU" = "yes" ; then
     284    if test x$FOUND_GLU = xyes ; then
    186285      LIBS="$LIBS -lGLU"
    187286    else
     
    194293
    195294# checking for SDL-headers
    196     AC_CHECK_HEADERS(SDL/SDL.h ,,
     295    AC_CHECK_HEADERS([SDL/SDL.h] ,,
    197296      [AC_MSG_ERROR([cannot find SDL headers]) ])
    198297
    199298# checking for SDL-lib
    200299    AC_CHECK_LIB([SDL], [main], FOUND_SDL=yes)
    201      if test "$FOUND_SDL" = "yes" ; then
     300     if test x$FOUND_SDL = xyes ; then
    202301       LIBS="$LIBS -lSDL"
    203302     else
     
    219318#    LIBS="$LIBS $SDL_LIBS"
    220319    ;;
    221 
    222 ### OS X ###
     320#-----------#
     321# MAC -OS X #
     322#-----------#
    223323 *darwin*)
    224 echo "OS X detected"
     324 echo "OS X detected"
    225325
    226326 osX="yes"
     
    228328 CPPFLAGS="-I/sw/include $CPPFLAGS"
    229329# checking gl header
    230    AC_CHECK_HEADERS(OpenGL/gl.h ,,
     330   AC_CHECK_HEADERS([OpenGL/gl.h] ,,
    231331      [AC_MSG_ERROR([cannot find opengl headers]) ])
    232332# cheking for GLU-header
    233     AC_CHECK_HEADERS(OpenGL/glu.h ,,
     333    AC_CHECK_HEADERS([OpenGL/glu.h] ,,
    234334      [AC_MSG_ERROR([cannot find opengl headers]) ])
    235335
    236336   LIBS="$LIBS -framework OpenGL"
     337
     338       SDL_CFLAGS=`sdl-config --cflags`
     339       SDL_LIBS=`sdl-config --libs`
     340       CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
     341       LIBS="$LIBS $SDL_LIBS"
     342
    237343
    238344# checking for SDL-headers
     
    247353#      )
    248354
    249        SDL_CFLAGS=`sdl-config --cflags`
    250        SDL_LIBS=`sdl-config --libs`
    251        CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
    252        LIBS="$LIBS $SDL_LIBS"
    253355
    254356    ;;
     
    260362AC_SUBST(MSBITFIELDS)
    261363
    262 ## check for SDL_Image
    263 if test "$def_sdl_image" = "yes"; then
     364###################################
     365## CHECKING FOR HEADERS AND LIBS ##
     366###################################
     367
     368#-----------#
     369# SDL_Image #
     370#-----------#
     371if test x$def_sdl_image = xyes; then
    264372# checking for SDL_image-headers
    265   AC_CHECK_HEADERS(SDL/SDL_image.h ,,
     373  AC_CHECK_HEADERS([SDL/SDL_image.h] ,,
    266374      [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
    267375fi
    268 if test "$def_sdl_image" = "yes"; then
     376if test x$def_sdl_image = xyes; then
    269377# checking for SDL_image-lib
    270   AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
    271      if test "$FOUND_SDL_image" = "yes" ; then
     378  AC_CHECK_LIB([SDL_image], [main], [FOUND_SDL_image=yes])
     379     if test x$FOUND_SDL_image = xyes ; then
    272380       LIBS="$LIBS -lSDL_image"
    273381     else
     
    280388fi
    281389
    282 
    283 if 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
     390## case no SDL-image:
     391if test x$def_sdl_image = xno; then
     392#---------#
     393# libjpeg #
     394#---------#
     395 AC_CHECK_HEADERS([jpeglib.h], [jpegHeader="yes"],
     396        [jpegHeader="no"])
     397 if test x$jpegHeader = xno; then
    288398        echo " not including jpeg."
    289399 else
    290   AC_CHECK_LIB([jpeg], [main], FOUND_jpeg=yes)
    291     if test "$FOUND_jpeg" = "yes" ; then
     400  AC_CHECK_LIB([jpeg], [main], [FOUND_jpeg=yes])
     401    if test x$FOUND_jpeg = xyes ; then
    292402      LIBS="$LIBS -ljpeg"
    293403    else
     
    300410 fi
    301411
    302  ## checking for libpng
    303  AC_CHECK_HEADERS(png.h ,pngHeader="yes",
    304         pngHeader="no")
    305  if test $pngHeader = "no"; then
     412#--------#
     413# libpng #
     414#--------#
     415 AC_CHECK_HEADERS([png.h], [pngHeader="yes"],
     416        [pngHeader="no"])
     417 if test x$pngHeader = xno; then
    306418        echo " not including png."
    307419 else
    308420  AC_CHECK_LIB([png], [main], FOUND_png=yes)
    309     if test "$FOUND_png" = "yes" ; then
     421    if test x$FOUND_png = xyes ; then
    310422      LIBS="$LIBS -lpng"
    311423    else
     
    319431fi
    320432
    321 ## checking for GTK
    322 if test "$def_gtk" = yes; then
     433#-----#
     434# GTK #
     435#-----#
     436if test x$def_gtk = xyes; then
    323437
    324438        #PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.3 gthread-2.0 >= 2.0.3, have_gtk2=yes, have_gtk2=no)
     
    339453AM_CONDITIONAL(HAVE_GTK2, test x$have_gtk2 = xyes)
    340454
    341 
    342 
    343 #checking for pthread libs
    344 # AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
    345 # if test "$FOUND_pthread" = "yes" ; then
    346 #    LIBS="$LIBS -lpthread"
    347 # fi
     455#---------#
     456# gThread #
     457#---------#
     458if test x$def_gthread = xyes; then
     459
     460        AC_MSG_CHECKING([for gthread])
     461        if `pkg-config --exists gthread-2.0`; then
     462                echo "yes"
     463                have_gthread=yes
     464                GTHREAD_LIBS=`pkg-config --libs gthread-2.0`
     465                GTHREAD_CFLAGS=`pkg-config --cflags gthread-2.0`
     466                AC_DEFINE_UNQUOTED(HAVE_GTHREAD, 1, [if we have gThread])
     467        else
     468                echo "no"
     469        fi
     470
     471fi
     472AC_SUBST(GTHREAD_LIBS)
     473AC_SUBST(GTHREAD_CFLAGS)
     474AM_CONDITIONAL(HAVE_GTHREAD, test x$have_gthread = xyes)
     475
     476#---------#
     477# libcURL #
     478#---------#
     479if test x$def_curl = xyes; then
     480
     481 AC_CHECK_HEADERS([curl/curl.h], [curlHeader="yes"], [curlHeader="no"])
     482 AC_CHECK_LIB([curl], [main], [FOUND_curl=yes])
     483 if test x$curlHeader = xyes & test x$FOUND_curl = xyes ; then
     484  have_curl=yes
     485  CURL_LIBS=`curl-config --libs`
     486  CURLCFLAGS=`curl-config --cflags`
     487  AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [if we have CURL])
     488 else
     489  have_curl=no
     490 fi
     491
     492fi
     493AC_SUBST(CURL_LIBS)
     494AC_SUBST(CURL_CFLAGS)
     495AM_CONDITIONAL(HAVE_CURL, test x$have_curl = xyes)
     496
     497#---------#
     498# pthread #
     499#---------#
     500if test x$def_pthread = xyes ; then
     501 if test x$have_gthread = xyes ; then
     502  AC_CHECK_HEADERS([pthread.h], [pthreadHeader="yes"], [pthreadHeader="no"])
     503  AC_CHECK_LIB([pthread], [main], [FOUND_pthread=yes])
     504   if test x$FOUND_pthread = xyes ; then
     505      LIBS="$LIBS -lpthread"
     506   fi
     507 fi
     508fi
    348509
    349510
     
    363524AC_CHECK_FUNCS([bzero sqrt])
    364525
     526######################
     527## OUTPUT CONFIGURE ##
     528######################
    365529AC_CONFIG_FILES([Makefile
     530                 src/Makefile
     531                 src/importer/Makefile
    366532                 src/console/Makefile
    367                  src/gui/Makefile
    368                  src/Makefile
    369                  src/importer/Makefile])
     533                 src/gui/Makefile])
     534
    370535AC_OUTPUT
  • orxonox/branches/trackManager/doc/orxonox.1

    r1861 r3430  
    1414.\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    1515.\"
    16 .TH ORXONOX 1 "April 13, 2004"
     16.TH ORXONOX 1 "March 2, 2004"
    1717.\" Please update the above date whenever this man page is modified.
    1818.\"
     
    2828.\" for manpage-specific macros, see man(7)
    2929.SH NAME
    30 orxonox \- the future of 3D-vertical-scrollers
     30orxonox \-  High-End Vertical Scroller
    3131.SH SYNOPSIS
    3232.B orxonox
    3333.RI [ options ]
    3434.SH DESCRIPTION
    35 \fBorxonox\fP washes your windows, mends your fences, mows your lawn...
     35\fBorxonox\fP is an open-source vertical scroller game programmed in C++,OpenGL and SDL. It's designed to run on all important platforms like Linux, MacOS X, Windows.
    3636.PP
    37 It also...
     37It washes your windows, mends your fences, mows your lawn...
    3838.SH OPTIONS
    3939\fBorxonox\fP accepts the following options:
    40 .TP
    41 .BR  -q , " --quiet" , " --silent"
    42 Inhibit usual output.
    43 .TP
    44 .B  -v, --verbose
    45 Print more information.
    4640.TP
    4741.B \-h, \-\-help
    4842Show summary of options.
    4943.TP
    50 .B \-V, \-\-version
    51 Show version of program.
     44.B \-v=<i>, \-\-verbose=\<i\>
     45Prints out: 0: nothing, 1: error, 2: warnings, 3: information, 4+: debug
     46.TP
     47.B \-g, \-\-gui
     48displays the gui prior to starting orxonox. (this is also the case, if the configuration-files do not exist in your home).
     49.TP
     50.B \-q, \-\-windowed
     51starts orxonox in windowed mode. (not fullscreen)
     52.TP
     53.B \-\-no\-sound
     54Disables audio completely
     55.TP
     56.B \-w, \-\-wireframe
     57Renders everything in Wireframe mode.
     58.TP
    5259.\" .SH "SEE ALSO"
    5360.\" .BR foo (1),
    5461.\" .BR bar (1).
    5562.SH AUTHOR
    56 orx <orxonox-announce@mail.datacore.ch>.
     63orx-crew <orxonox@orxonox.ethz.ch>.
  • orxonox/branches/trackManager/src/Makefile.am

    r3374 r3430  
    2424                 environment.cc \
    2525                 importer/model.cc \
     26                 importer/objModel.cc \
    2627                 importer/array.cc \
    2728                 importer/material.cc \
     
    3536                 matrix.cc \
    3637                 curve.cc \
    37                  glmenu_imagescreen.cc
    38 
     38                 glmenu_imagescreen.cc \
     39                 skysphere.cc
    3940
    4041noinst_HEADERS = ability.h \
     
    7576                 matrix.h \
    7677                 curve.h \
    77                  glmenu_imagescreen.h
    78 
     78                 glmenu_imagescreen.h \
     79                 debug.h \
     80                 skysphere.h
    7981
    8082## orxonox.conf will be used from home-dir instead.
     
    8789  GTK_PROGS =
    8890endif
     91if SUB_PROJECTS
     92  SUB_PROGS = importer \
     93              gui \
     94              $(GTK_PROGS)
     95else
     96  SUB_PROGS =
     97endif
    8998
    9099SUBDIRS = . \
    91           importer \
    92           gui \
    93           $(GTK_PROGS)
     100          $(SUB_PROGS)
    94101
    95102#  uncomment the following if orxonox requires the math library
  • orxonox/branches/trackManager/src/Makefile.in

    r3374 r3430  
    5959        base_entity.$(OBJEXT) game_loader.$(OBJEXT) campaign.$(OBJEXT) \
    6060        story_entity.$(OBJEXT) environment.$(OBJEXT) model.$(OBJEXT) \
    61         array.$(OBJEXT) material.$(OBJEXT) texture.$(OBJEXT) \
    62         list.$(OBJEXT) p_node.$(OBJEXT) null_parent.$(OBJEXT) \
    63         base_object.$(OBJEXT) helper_parent.$(OBJEXT) \
    64         track_manager.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \
    65         glmenu_imagescreen.$(OBJEXT)
     61        objModel.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT) \
     62        texture.$(OBJEXT) list.$(OBJEXT) p_node.$(OBJEXT) \
     63        null_parent.$(OBJEXT) base_object.$(OBJEXT) \
     64        helper_parent.$(OBJEXT) track_manager.$(OBJEXT) \
     65        matrix.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
     66        skysphere.$(OBJEXT)
    6667orxonox_OBJECTS = $(am_orxonox_OBJECTS)
    6768orxonox_LDADD = $(LDADD)
     
    8283@AMDEP_TRUE@    ./$(DEPDIR)/list.Po ./$(DEPDIR)/material.Po \
    8384@AMDEP_TRUE@    ./$(DEPDIR)/matrix.Po ./$(DEPDIR)/model.Po \
    84 @AMDEP_TRUE@    ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/orxonox.Po \
    85 @AMDEP_TRUE@    ./$(DEPDIR)/p_node.Po ./$(DEPDIR)/player.Po \
     85@AMDEP_TRUE@    ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
     86@AMDEP_TRUE@    ./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \
     87@AMDEP_TRUE@    ./$(DEPDIR)/player.Po ./$(DEPDIR)/skysphere.Po \
    8688@AMDEP_TRUE@    ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \
    8789@AMDEP_TRUE@    ./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \
     
    118120CPP = @CPP@
    119121CPPFLAGS = @CPPFLAGS@
     122CURL_CFLAGS = @CURL_CFLAGS@
     123CURL_LIBS = @CURL_LIBS@
    120124CXX = @CXX@
    121125CXXDEPMODE = @CXXDEPMODE@
     
    133137EGREP = @EGREP@
    134138EXEEXT = @EXEEXT@
     139GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
     140GTHREAD_LIBS = @GTHREAD_LIBS@
    135141GTK2_CFLAGS = @GTK2_CFLAGS@
    136142GTK2_LIBS = @GTK2_LIBS@
     143HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
     144HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
     145HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
     146HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    137147HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    138148HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    158168SHELL = @SHELL@
    159169STRIP = @STRIP@
     170SUB_PROJECTS_FALSE = @SUB_PROJECTS_FALSE@
     171SUB_PROJECTS_TRUE = @SUB_PROJECTS_TRUE@
    160172VERSION = @VERSION@
    161173ac_ct_CC = @ac_ct_CC@
     
    221233                 environment.cc \
    222234                 importer/model.cc \
     235                 importer/objModel.cc \
    223236                 importer/array.cc \
    224237                 importer/material.cc \
     
    232245                 matrix.cc \
    233246                 curve.cc \
    234                  glmenu_imagescreen.cc
     247                 glmenu_imagescreen.cc \
     248                 skysphere.cc
    235249
    236250noinst_HEADERS = ability.h \
     
    271285                 matrix.h \
    272286                 curve.h \
    273                  glmenu_imagescreen.h
     287                 glmenu_imagescreen.h \
     288                 debug.h \
     289                 skysphere.h
    274290
    275291EXTRA_DIST = orxonox.conf
     
    278294### GTK_RELATED
    279295@HAVE_GTK2_TRUE@GTK_PROGS = console
     296@SUB_PROJECTS_FALSE@SUB_PROGS =
     297@SUB_PROJECTS_TRUE@SUB_PROGS = importer \
     298@SUB_PROJECTS_TRUE@           gui \
     299@SUB_PROJECTS_TRUE@           $(GTK_PROGS)
     300
    280301SUBDIRS = . \
    281           importer \
    282           gui \
    283           $(GTK_PROGS)
     302          $(SUB_PROGS)
    284303
    285304all: all-recursive
     
    369388@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
    370389@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null_parent.Po@am__quote@
     390@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@
    371391@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox.Po@am__quote@
    372392@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@
    373393@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@
     394@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skysphere.Po@am__quote@
    374395@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/story_entity.Po@am__quote@
    375396@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
     
    410431@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    411432@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o model.obj `if test -f 'importer/model.cc'; then $(CYGPATH_W) 'importer/model.cc'; else $(CYGPATH_W) '$(srcdir)/importer/model.cc'; fi`
     433
     434objModel.o: importer/objModel.cc
     435@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.o -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.o `test -f 'importer/objModel.cc' || echo '$(srcdir)/'`importer/objModel.cc; \
     436@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi
     437@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='importer/objModel.cc' object='objModel.o' libtool=no @AMDEPBACKSLASH@
     438@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@
     439@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     440@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.o `test -f 'importer/objModel.cc' || echo '$(srcdir)/'`importer/objModel.cc
     441
     442objModel.obj: importer/objModel.cc
     443@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.obj -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.obj `if test -f 'importer/objModel.cc'; then $(CYGPATH_W) 'importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/importer/objModel.cc'; fi`; \
     444@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi
     445@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='importer/objModel.cc' object='objModel.obj' libtool=no @AMDEPBACKSLASH@
     446@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@
     447@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     448@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.obj `if test -f 'importer/objModel.cc'; then $(CYGPATH_W) 'importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/importer/objModel.cc'; fi`
    412449
    413450array.o: importer/array.cc
  • orxonox/branches/trackManager/src/console/Makefile.in

    r3219 r3430  
    8787CPP = @CPP@
    8888CPPFLAGS = @CPPFLAGS@
     89CURL_CFLAGS = @CURL_CFLAGS@
     90CURL_LIBS = @CURL_LIBS@
    8991CXX = @CXX@
    9092CXXDEPMODE = @CXXDEPMODE@
     
    102104EGREP = @EGREP@
    103105EXEEXT = @EXEEXT@
     106GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
     107GTHREAD_LIBS = @GTHREAD_LIBS@
    104108GTK2_CFLAGS = @GTK2_CFLAGS@
    105109GTK2_LIBS = @GTK2_LIBS@
     110HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
     111HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
     112HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
     113HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    106114HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    107115HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    128136SHELL = @SHELL@
    129137STRIP = @STRIP@
     138SUB_PROJECTS_FALSE = @SUB_PROJECTS_FALSE@
     139SUB_PROJECTS_TRUE = @SUB_PROJECTS_TRUE@
    130140VERSION = @VERSION@
    131141ac_ct_CC = @ac_ct_CC@
  • orxonox/branches/trackManager/src/debug.h

    r3369 r3430  
     1/*
     2   orxonox - the future of 3D-vertical-scrollers
     3
     4   Copyright (C) 2004 orx
     5
     6   This program is free software; you can redistribute it and/or modify
     7   it under the terms of the GNU General Public License as published by
     8   the Free Software Foundation; either version 2, or (at your option)
     9   any later version.
     10
     11   ### File Specific:
     12   main-programmer: Benjamin Grauer
     13   co-programmer: ...
     14*/
     15
     16/*!
     17    \file debug.h
     18    \brief Handles output to console for different Verbose-Modes.
     19*/
     20
    121#ifndef _DEBUG_H
    222#define _DEBUG_H
    323
     24#define NO              0
     25#define ERROR           1
     26#define WARNING         2
     27#define INFORMATION     3
     28#define DEBUGING        4
     29
     30#include <stdio.h>
    431
    532///////////////////////////////////////////////////
     
    1239           PRINTF ## x
    1340
    14 #if DEBUG >= 1
     41#if DEBUG >= ERROR
    1542#define PRINTF1 \
    16     if (verbose >= 1 ) \
     43    if (verbose >= ERROR) \
    1744      printf("%s:%d::", __FILE__, __LINE__) && printf
    1845#else
    19 #define PRINTF1 //
     46#define PRINTF1 if (NO)
    2047#endif
    2148     
    22 #if DEBUG >= 2
     49#if DEBUG >= WARNING
    2350#define PRINTF2 \
    24      if (verbose >= 2 ) \
     51     if (verbose >= WARNING) \
    2552       printf("%s:%d::", __FILE__, __LINE__) && printf
    2653         
    2754#else
    28 #define PRINTF2 //
     55#define PRINTF2 if (NO)
    2956#endif
    3057     
    31 #if DEBUG >= 3
     58#if DEBUG >= INFORMATION
    3259#define PRINTF3 \
    33      if (verbose >= 3 ) \
     60     if (verbose >= INFORMATION) \
    3461       printf("%s:%d::", __FILE__, __LINE__) && printf
    3562#else
    36 #define PRINTF3 //
     63#define PRINTF3 if (NO)
    3764#endif
    3865     
    39 #if DEBUG >= 4
     66#if DEBUG >= DEBUGING
    4067#define PRINTF4 \
    41      if (verbose >= 4 ) \
     68     if (verbose >= DEBUGING) \
    4269       printf("%s:%d::", __FILE__, __LINE__) && printf
    4370#else
    44 #define PRINTF4 //
     71#define PRINTF4 if (NO)
    4572#endif
    4673     
    4774     
    4875#else 
    49 #define PRINTF(x) //
     76#define PRINTF(x) if (NO)
    5077#endif
    5178
     
    5481
    5582
    56 
    57 
    5883///////////////////////////////////////////////////
    5984///  PRINT: just prints output as is            ///
    6085///////////////////////////////////////////////////
     86#ifdef  DEBUG
     87extern int verbose;
     88#define PRINT(x) \
     89  PRINT ## x
    6190
    62 #ifdef  DEBUG
    63 #define PRINT(x) \
    64            PRINT ## x
     91#if DEBUG >= ERROR
     92#define PRINT1  \
     93  if (verbose >= ERROR) \
     94    printf
     95#else
     96#define PRINT1 if (NO)
     97#endif
    6598
    66 #if DEBUG >= 1
    67 #define PRINT1 \
    68     if (verbose >= 1 ) \
    69       printf
    70 #else
    71 #define PRINT1 //
    72 #endif
    73      
    74 #if DEBUG >= 2
     99#if DEBUG >= WARNING
    75100#define PRINT2 \
    76      if (verbose >= 2 ) \
    77        printf
     101  if (verbose >= WARNING) \
     102    printf
    78103
    79104#else
    80 #define PRINT2 //
     105#define PRINT2 if (NO)
    81106#endif
    82      
    83 #if DEBUG >= 3
     107
     108#if DEBUG >= INFORMATION
    84109#define PRINT3 \
    85      if (verbose >= 3 ) \
    86        printf
    87 #else
    88 #define PRINT3 //
     110  if (verbose >= INFORMATION) \
     111    printf
     112#else 
     113#define PRINT3 if (NO)
    89114#endif
    90      
    91 #if DEBUG >= 4
     115
     116#if DEBUG >= DEBUGING
    92117#define PRINT4 \
    93      if (verbose >= 4 ) \
    94        printf
     118  if (verbose >= DEBUGING) \
     119    printf
    95120#else
    96 #define PRINT4 //
     121#define PRINT4 if (NO)
    97122#endif
    98      
    99      
     123
     124
    100125#else 
    101 #define PRINT(x) //
     126#define PRINT(x) if (NO)
    102127#endif
    103128
    104129#define PRINT0 \
    105            printf
    106 
     130  printf
    107131
    108132///////////////////////////////////////////////////
     
    118142      cout
    119143#else
    120 #define COUT1 //
     144#define COUT1 if (NO) cout
    121145#endif
    122146     
     
    127151
    128152#else
    129 #define COUT2 //
     153#define COUT2 if (NO) cout
    130154#endif
    131155     
     
    135159       cout
    136160#else
    137 #define COUT3 //
     161#define COUT3 if (NO) cout
    138162#endif
    139163     
     
    143167       cout
    144168#else
    145 #define COUT4 //
     169#define COUT4 if (NO) cout
    146170#endif
    147171     
    148172     
    149173#else 
    150 #define COUT(x) //
     174#define COUT(x) if (NO) cout
    151175#endif
    152176
  • orxonox/branches/trackManager/src/environment.cc

    r3374 r3430  
    2121#include "world_entity.h"
    2222#include "vector.h"
    23 #include "importer/model.h"
     23#include "importer/objModel.h"
    2424
    2525using namespace std;
     
    2929Environment::Environment () : WorldEntity()
    3030{
    31   this->model = new Model("fighter.obj", .3);
     31  this->model = new OBJModel("../data/models/fighter.obj");
    3232}
    3333
  • orxonox/branches/trackManager/src/glmenu_imagescreen.cc

    r3369 r3430  
    1818
    1919#include "glmenu_imagescreen.h"
    20 #include "importer/texture.h"
     20
     21#include "importer/material.h"
    2122
    2223using namespace std;
    2324
     25GLMenuImageScreen* GLMenuImageScreen::singletonRef = 0;
     26
     27GLMenuImageScreen* GLMenuImageScreen::getInstance()
     28{
     29  if( singletonRef == NULL)
     30    singletonRef = new GLMenuImageScreen ();
     31  return singletonRef;
     32}
    2433
    2534/**
     
    3948   \todo this deconstructor is not jet implemented - do it
    4049*/
    41 GLMenuImageScreen::~GLMenuImageScreen () {}
     50GLMenuImageScreen::~GLMenuImageScreen()
     51{
     52  if (backMat)
     53    delete backMat;
     54}
    4255
    4356
     
    5871  glMatrixMode(GL_MODELVIEW);
    5972
    60   this->backTex = new Texture();
    61   this->backTex->loadImage("orx_tex.bmp");
    62 
    6373  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    6474  glLoadIdentity();
     
    7181 
    7282  // Select Our VU Meter Background Texture
    73   this->backTex = new Texture();
    74   this->backTex->loadImage("load_screen.jpg");
     83  this->backMat = new Material("load_screen");
     84  this->backMat->setDiffuseMap("../data/pictures/load_screen.jpg");
     85  this->maxValue = 10;
     86  this->currentValue = 0;
    7587
    7688  // End of Background image code.
     
    126138  glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    127139
    128   // Screen Size.
     140  /* screen size */
    129141  int screenWidth = 640;
    130142  int screenHeight = 480;
    131143 
    132   // Set Image Size.
     144  /* set image size */
    133145  int imageWidth = 640;
    134146  int imageHeight = 480;
    135147 
    136   // Start pos of image.
     148  /* start pos of image */
    137149  int offsetX = (screenWidth - imageWidth)/2;
    138150  int offsetY = (screenHeight - imageHeight)/2;
    139151 
    140   glEnable(GL_BLEND);
    141   glEnable(GL_TEXTURE_2D);
    142 
    143   glPushAttrib(GL_LIGHTING_BIT | GL_TRANSFORM_BIT);
    144  
    145   glDisable(GL_LIGHTING);
     152  /* loadbar pos */
     153  int barX = 390;
     154  int barY = 50;
     155  int barWidth = 230;
     156  int barHeight = 30;
     157
     158  int val = (int)((float)this->currentValue/(float)this->maxValue) * barWidth;
     159
    146160  glMatrixMode(GL_PROJECTION);
    147161  glPushMatrix();
     
    152166  glLoadIdentity();
    153167  glPushMatrix();
     168
    154169  glEnable(GL_BLEND);
    155 
     170  glPushAttrib(GL_LIGHTING_BIT | GL_TRANSFORM_BIT);
     171  glDisable(GL_LIGHTING);
     172
     173  backMat->select();
     174  glBegin(GL_QUADS);
     175  glColor3f(0.96, 0.84, 0.34);
     176  glVertex2i(barX, barY);
     177  glVertex2i(barX + val, barY);
     178  glVertex2i(barX + val, barY + barHeight);
     179  glVertex2i(barX, barY + barHeight);
     180  glColor3f(1.0, 1.0, 1.0);
     181  glEnd();
     182
     183  glBegin(GL_QUADS);
     184  glColor3f(0.0, 0.0, 0.0);
     185  glVertex2i(barX, barY);
     186  glVertex2i(barX + barWidth, barY);
     187  glVertex2i(barX + barWidth, barY + barHeight);
     188  glVertex2i(barX, barY + barHeight);
     189  glColor3f(1.0, 1.0, 1.0);
     190  glEnd();
     191
     192  /* draw black border */
     193  glBegin(GL_QUADS);
     194  glColor3f(0.0, 0.0, 0.0);
     195  glVertex2i(barX-1, barY-1);
     196  glVertex2i(barX + barWidth +1, barY-1);
     197  glVertex2i(barX + barWidth+1, barY + barHeight+1);
     198  glVertex2i(barX - 1, barY + barHeight +1);
     199  glColor3f(1.0, 1.0, 1.0);
     200  glEnd();
     201
     202  /* draw white border */
     203  glBegin(GL_QUADS);
     204  glColor3f(1.0, 1.0, 1.0);
     205  glVertex2i(barX-2, barY-2);
     206  glVertex2i(barX + barWidth +2, barY-2);
     207  glVertex2i(barX + barWidth+2, barY + barHeight+2);
     208  glVertex2i(barX - 2, barY + barHeight +2);
     209  glColor3f(1.0, 1.0, 1.0);
     210  glEnd();
     211
     212  glEnable(GL_TEXTURE_2D);
    156213  glBegin(GL_QUADS);
    157214  glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY);
    158   glTexCoord2i(1, 0 ); glVertex2i(offsetX + imageWidth, offsetY);
    159   glTexCoord2i( 1, 1 ); glVertex2i(offsetX + imageWidth, offsetY + imageHeight);
    160   glTexCoord2i( 0, 1 ); glVertex2i(offsetX, offsetY + imageHeight);
    161   glEnd();
    162 
     215  glTexCoord2i(1, 0); glVertex2i(offsetX + imageWidth, offsetY);
     216  glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY + imageHeight);
     217  glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY + imageHeight);
     218  glEnd();
    163219  glDisable(GL_TEXTURE_2D);
    164 
    165   glBegin(GL_QUADS);
    166   glColor3f(1.0, 0.0, 0.0);
    167   glVertex2i(100, 100);
    168   glVertex2i(200, 100);
    169   glVertex2i(200, 150);
    170   glVertex2i(100, 150);
    171   glEnd();
    172 
    173220
    174221  glDisable(GL_BLEND);
     
    179226
    180227  SDL_GL_SwapBuffers();                   
    181   SDL_Delay(1000);
    182228}
    183229 
     
    213259   \param maximum of steps
    214260*/
    215 void GLMenuImageScreen::setMaximum(int maxStep)
    216 {
    217   this->maxStep = maxStep;
     261void GLMenuImageScreen::setMaximum(int maxValue)
     262{
     263  this->maxValue = maxValue;
    218264}
    219265
     
    224270int GLMenuImageScreen::getMaximum()
    225271{
    226   return this->maxStep;
     272  return this->maxValue;
    227273}
    228274
     
    256302{
    257303  this->currentValue++;
    258 }
     304  this->draw();
     305}
  • orxonox/branches/trackManager/src/glmenu_imagescreen.h

    r3369 r3430  
    99
    1010#include "stdincl.h"
    11 
    1211class Texture;
     12class Material;
    1313
    1414class GLMenuImageScreen : public BaseObject {
    1515
     16 private:
     17  GLMenuImageScreen ();
     18
    1619 public:
    17   GLMenuImageScreen ();
    1820  ~GLMenuImageScreen ();
     21
     22  static GLMenuImageScreen* getInstance();
     23
     24  static GLMenuImageScreen* singletonRef;
    1925
    2026  void init ();
     
    2834  void setSize (float height, float width);
    2935 
    30   void setMaximum (int maxStep);
     36  void setMaximum (int maxValue);
    3137  int getMaximum ();
    3238  void setValue (int currentValue);
     
    3541
    3642 private:
    37   char* backImageName;       //! the name of the file of the background image
    38   float height, width;       //! hight and width of the image
    39   float offsetX, offsetY;    //! offset of the image from left and up
    40   Texture* backTex;          //! background texture
    41   int currentValue;          //! the current count of step() calls fired yet
    42   int maxStep;               //! total count of steps
     43  char* backImageName;       //!< the name of the file of the background image
     44  float height, width;       //!< hight and width of the image
     45  float offsetX, offsetY;    //!< offset of the image from left and up
     46  Material* backMat;         //!< Background Material.
     47  int currentValue;          //!< the current count of step() calls fired yet
     48  int maxValue;              //!< total count of steps
    4349
    4450};
  • orxonox/branches/trackManager/src/gui/Makefile.am

    r3144 r3430  
    1 AM_CXXFLAGS=$(GTK2_CFLAGS) $(MSBITFIELDS)
    2 #AM_LDFLAGS=$(GTK2_LIBS)
    3 LIBS=$(GTK2_LIBS)
     1AM_CXXFLAGS=$(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
     2#AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
     3LIBS=$(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
    44
    55bin_PROGRAMS=gui
     
    1111            orxonox_gui_flags.cc \
    1212            orxonox_gui_banner.cc \
    13             orxonox_gui_keys.cc
     13            orxonox_gui_keys.cc \
     14            orxonox_gui_update.cc
    1415
    1516noinst_HEADERS=orxonox_gui.h \
     
    2021            orxonox_gui_flags.h \
    2122            orxonox_gui_banner.h \
    22             orxonox_gui_keys.h
     23            orxonox_gui_keys.h \
     24            orxonox_gui_update.h
    2325
    2426#  uncomment the following if orxonox requires the mathlibrary
  • orxonox/branches/trackManager/src/gui/Makefile.in

    r3219 r3430  
    5656        orxonox_gui_video.$(OBJEXT) orxonox_gui_audio.$(OBJEXT) \
    5757        orxonox_gui_exec.$(OBJEXT) orxonox_gui_flags.$(OBJEXT) \
    58         orxonox_gui_banner.$(OBJEXT) orxonox_gui_keys.$(OBJEXT)
     58        orxonox_gui_banner.$(OBJEXT) orxonox_gui_keys.$(OBJEXT) \
     59        orxonox_gui_update.$(OBJEXT)
    5960gui_OBJECTS = $(am_gui_OBJECTS)
    6061gui_LDADD = $(LDADD)
     
    6970@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_gtk.Po \
    7071@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_keys.Po \
     72@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_update.Po \
    7173@AMDEP_TRUE@    ./$(DEPDIR)/orxonox_gui_video.Po
    7274CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
     
    9496CPP = @CPP@
    9597CPPFLAGS = @CPPFLAGS@
     98CURL_CFLAGS = @CURL_CFLAGS@
     99CURL_LIBS = @CURL_LIBS@
    96100CXX = @CXX@
    97101CXXDEPMODE = @CXXDEPMODE@
     
    109113EGREP = @EGREP@
    110114EXEEXT = @EXEEXT@
     115GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
     116GTHREAD_LIBS = @GTHREAD_LIBS@
    111117GTK2_CFLAGS = @GTK2_CFLAGS@
    112118GTK2_LIBS = @GTK2_LIBS@
     119HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
     120HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
     121HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
     122HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    113123HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    114124HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    119129LDFLAGS = @LDFLAGS@
    120130LIBOBJS = @LIBOBJS@
    121 #AM_LDFLAGS=$(GTK2_LIBS)
    122 LIBS = $(GTK2_LIBS)
     131#AM_LDFLAGS=$(GTK2_LIBS)   $(GTHREAD_LIBS)
     132LIBS = $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS)
    123133LTLIBOBJS = @LTLIBOBJS@
    124134MAKEINFO = @MAKEINFO@
     
    135145SHELL = @SHELL@
    136146STRIP = @STRIP@
     147SUB_PROJECTS_FALSE = @SUB_PROJECTS_FALSE@
     148SUB_PROJECTS_TRUE = @SUB_PROJECTS_TRUE@
    137149VERSION = @VERSION@
    138150ac_ct_CC = @ac_ct_CC@
     
    178190target_os = @target_os@
    179191target_vendor = @target_vendor@
    180 AM_CXXFLAGS = $(GTK2_CFLAGS) $(MSBITFIELDS)
     192AM_CXXFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS)
    181193gui_SOURCES = orxonox_gui.cc \
    182194            orxonox_gui_gtk.cc \
     
    186198            orxonox_gui_flags.cc \
    187199            orxonox_gui_banner.cc \
    188             orxonox_gui_keys.cc
     200            orxonox_gui_keys.cc \
     201            orxonox_gui_update.cc
    189202
    190203noinst_HEADERS = orxonox_gui.h \
     
    195208            orxonox_gui_flags.h \
    196209            orxonox_gui_banner.h \
    197             orxonox_gui_keys.h
     210            orxonox_gui_keys.h \
     211            orxonox_gui_update.h
    198212
    199213
     
    280294@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_gtk.Po@am__quote@
    281295@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_keys.Po@am__quote@
     296@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_update.Po@am__quote@
    282297@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox_gui_video.Po@am__quote@
    283298
  • orxonox/branches/trackManager/src/gui/orxonox_gui.cc

    r3187 r3430  
    2424*/
    2525
     26#include <unistd.h>
     27
    2628#include "orxonox_gui.h"
    2729#include "orxonox_gui_video.h"
     
    3133#include "orxonox_gui_banner.h"
    3234#include "orxonox_gui_keys.h"
     35#include "orxonox_gui_update.h"
    3336
    3437  Window* orxonoxGUI;
     
    3942  OrxonoxGuiBanner* banner;
    4043  OrxonoxGuiKeys* keys;
     44  OrxonoxGuiUpdate* update;
     45int verbose = 4;
    4146
    42 int main( int argc, char *argv[] )
     47int main(int argc, char *argv[])
    4348{
    4449  OrxonoxGui* orxonoxgui = new OrxonoxGui(argc, argv);
     
    5156   \brief Initializes the Gui
    5257*/
    53 OrxonoxGui::OrxonoxGui (int argc, char *argv[])
     58OrxonoxGui::OrxonoxGui(int argc, char *argv[])
    5459{
    55 #ifdef HAVE_GTK2
    56   initGTK(argc, argv);
    57 #endif /* HAVE_GTK2 */
    58   orxonoxGUI = new Window( "Grafical OrxOnoX loader, "PACKAGE_VERSION);
    59 #ifdef HAVE_GTK2
    60   orxonoxGUI->connectSignal ("destroy", orxonoxGUI->orxonox_gui_quit);
    61   orxonoxGUI->connectSignal ("delete_event", orxonoxGUI->orxonox_gui_quit);
    62 #endif /* HAVE_GTK2 */
     60  initGUI(argc, argv);
     61
     62  orxonoxGUI = new Window( "grafical orxonox loader, "PACKAGE_VERSION);
    6363 
    6464  Box* windowBox = new Box ('h');
     
    6767  windowBox->fill (banner->getWidget());
    6868 
    69   Box* optionBox = new Box ('v');
     69  Box* optionBox = new Box('v');
    7070 
    71   Box* avBox = new Box ('h');
     71  Box* avBox = new Box('h');
    7272
    73   video = new OrxonoxGuiVideo ();
    74   avBox->fill (video->getWidget ());
    75   audio = new OrxonoxGuiAudio ();
    76   avBox->fill (audio->getWidget ());
     73  video = new OrxonoxGuiVideo();
     74  avBox->fill(video->getWidget());
     75  audio = new OrxonoxGuiAudio();
     76  avBox->fill(audio->getWidget());
    7777     
    78   optionBox->fill (avBox);
     78  optionBox->fill(avBox);
    7979
    80   keys = new OrxonoxGuiKeys ();
    81   optionBox->fill (keys->getWidget ());
     80  keys = new OrxonoxGuiKeys();
     81  optionBox->fill(keys->getWidget());
    8282
    83   exec = new OrxonoxGuiExec (orxonoxGUI);
    84   optionBox->fill (exec->getWidget ());
     83  exec = new OrxonoxGuiExec();
     84  optionBox->fill(exec->getWidget());
    8585
    86   flags = new OrxonoxGuiFlags (orxonoxGUI);
     86  flags = new OrxonoxGuiFlags();
     87
     88  optionBox->fill(flags->getWidget());
     89  windowBox->fill(optionBox);
     90
     91  update = new OrxonoxGuiUpdate();
     92  optionBox->fill(update->getWidget());
     93 
     94  orxonoxGUI->fill(windowBox);
     95
     96  // Reading Values from File
     97  exec->setFilename("~/.orxonox.conf");
     98  exec->readFromFile(orxonoxGUI);
     99  // Merging changes to the Options from appended flags.
     100  for (int optCount = 1; optCount < argc; optCount++)
     101    orxonoxGUI->walkThrough(Widget::flagCheck, argv[optCount], 0);
     102
     103  flags->setTextFromFlags(orxonoxGUI);
     104  orxonoxGUI->showall();
     105
     106  //// Handling special Cases. ///
     107
     108  // case update //
     109#ifdef HAVE_CURL
     110  if (static_cast<Option*>(orxonoxGUI->findWidgetByName("auto update", 0))->value == 1)
     111    {
     112      update->checkForUpdates();
     113    }
     114#endif /* HAVE_CURL */
     115
     116  // case start-with-gui.
     117  if (!access(exec->getConfigFile(), F_OK) && static_cast<Option*>(orxonoxGUI->findWidgetByName("Always Show this Menu", 0))->value == 0)
     118    OrxonoxGuiExec::startOrxonox(NULL, exec);
     119  else
     120    {
     121      mainloopGUI();
     122    }
     123
     124}
    87125
    88126
    89   optionBox->fill (flags->getWidget ());
    90   windowBox->fill (optionBox);
    91  
    92   orxonoxGUI->fill (windowBox);
    93   flags->setTextFromFlags (orxonoxGUI);
    94 
    95   exec->setFilename ("~/.orxonox.conf");
    96   exec->readFromFile (orxonoxGUI);
    97   //  orxonoxGUI->walkThrough(orxonoxGUI->listOptions);
    98 
    99   orxonoxGUI->showall ();
    100 
    101  
    102 #ifdef HAVE_GTK2
    103   mainloopGTK();
    104 #else /* HAVE_GTK2 */
    105   cout << " Listing all the Orxonox Options: \n";
    106   cout << "  #############################\n";
    107   orxonoxGUI->walkThrough(orxonoxGUI->listOptions);
    108 
    109   cout << "\nDo you want me to save the the above values now? [Yn] ";
    110   char c = getchar();
    111   if ((c == 'y' || c == 'Y' || c== 10) && exec->shouldsave())
    112     exec->writeToFile (Window::mainWindow);
    113  
    114 #endif /* HAVE_GTK2 */
    115 
     127/**
     128   \brief Destructor.
     129*/
     130OrxonoxGui::~OrxonoxGui(void)
     131{
     132  delete video;
     133  delete audio;
     134  delete exec;
     135  delete flags;
     136  delete banner;
     137  delete keys;
     138  delete update;
    116139}
  • orxonox/branches/trackManager/src/gui/orxonox_gui.h

    r3187 r3430  
    2525{
    2626 public:
    27   OrxonoxGui (int argc, char *argv[]);
    28   ~OrxonoxGui ();
     27  OrxonoxGui(int argc, char *argv[]);
     28  ~OrxonoxGui(void);
    2929
    3030};
    3131
    32 
    33 
    3432#endif /* _ORXONOX_GUI_H */
  • orxonox/branches/trackManager/src/gui/orxonox_gui_audio.cc

    r2739 r3430  
    2929   \brief Creates an Audio-Frame
    3030*/
    31 OrxonoxGuiAudio::OrxonoxGuiAudio ()
     31OrxonoxGuiAudio::OrxonoxGuiAudio(void)
    3232{
    33   audioFrame = new Frame ("Audio-Options:");
    34   audioBox = new Box ('v');
    35   audioFrame->setGroupName ("audio");
     33  this->audioFrame = new Frame("Audio-Options:");
     34  this->audioBox = new Box('v');
     35  this->audioFrame->setGroupName("audio");
    3636 
    37   enableSound = new CheckButton ("Disable Sound");
    38   enableSound->setFlagName ("no-sound", 0);
    39   enableSound->saveable = true;
    40   audioBox->fill (enableSound);
    41   Label* musicVolumeLabel = new Label ("Music Volume");
    42   audioBox->fill (musicVolumeLabel);
    43   musicVolume = new Slider ("Music Volume", 0, 100);
    44   musicVolume->setFlagName ("music-volume", "m", 80);
    45   musicVolume->saveable = true;
    46   audioBox->fill (musicVolume);
     37  this->enableSound = new CheckButton("Disable Sound");
     38  this->enableSound->setFlagName ("no-sound", 0);
     39  this->enableSound->saveability();
     40  this->audioBox->fill(this->enableSound);
     41  Label* musicVolumeLabel = new Label("Music Volume");
     42  this->audioBox->fill(musicVolumeLabel);
     43  this->musicVolume = new Slider("Music Volume", 0, 100);
     44  this->musicVolume->setFlagName("music-volume", "m", 80);
     45  this->musicVolume->saveability();
     46  this->audioBox->fill (this->musicVolume);
    4747  Label* effectsVolumeLabel = new Label ("Effects Volume");
    48   audioBox->fill (effectsVolumeLabel);
    49   effectsVolume = new Slider ("Effects Volume", 0, 100);
    50   effectsVolume->setFlagName ("effects-volume", "e", 80);
    51   effectsVolume->saveable = true;
    52   audioBox->fill (effectsVolume);
     48  this->audioBox->fill (effectsVolumeLabel);
     49  this->effectsVolume = new Slider ("Effects Volume", 0, 100);
     50  this->effectsVolume->setFlagName ("effects-volume", "e", 80);
     51  this->effectsVolume->saveability();
     52  this->audioBox->fill (this->effectsVolume);
    5353
    54   audioFrame->fill (audioBox);
     54  this->audioFrame->fill (this->audioBox);
     55}
     56
     57/**
     58    \brief Destructs the Audio-Stuff
     59*/
     60OrxonoxGuiAudio::~OrxonoxGuiAudio(void)
     61{
     62  // nothing to do here.
    5563}
    5664
     
    5967   \return Returns the Audio-frame
    6068*/
    61 Widget* OrxonoxGuiAudio::getWidget ()
     69Widget* OrxonoxGuiAudio::getWidget(void)
    6270{
    63   return audioFrame;
     71  return this->audioFrame;
    6472}
  • orxonox/branches/trackManager/src/gui/orxonox_gui_audio.h

    r3187 r3430  
    1919  Slider* effectsVolume;    //!< A Slider for effects volume.
    2020 public:
    21   OrxonoxGuiAudio ();
    22   ~OrxonoxGuiAudio ();
     21  OrxonoxGuiAudio(void);
     22  ~OrxonoxGuiAudio(void);
    2323 
    24   Widget* getWidget ();
     24  Widget* getWidget(void);
    2525};
    2626#endif /* _ORXONOX_GUI_AUDIO_H */
  • orxonox/branches/trackManager/src/gui/orxonox_gui_banner.cc

    r3165 r3430  
    2929   \brief Creates a new BannerEventBox and its content.
    3030*/
    31 OrxonoxGuiBanner::OrxonoxGuiBanner ()
     31OrxonoxGuiBanner::OrxonoxGuiBanner(void)
    3232{
    3333  // Banner Itself //
    34   bannerEventBox = new EventBox ("BannerEventBox");
    35   bannerImage = new Image ("banner.xpm");
    36   bannerEventBox->fill(bannerImage);
     34  this->bannerEventBox = new EventBox("BannerEventBox");
     35  this->bannerImage = new Image("banner.xpm");
     36  this->bannerEventBox->fill(this->bannerImage);
    3737
    3838  // Banner Window //
    39   logoWindow = new Window("Logo");
     39  this->logoWindow = new Window("Logo");
    4040
    4141#ifdef HAVE_GTK2
    42   bannerEventBox->connectSignal ("button_press_event", logoWindow, Window::windowOpen);
     42  this->bannerEventBox->connectSignal("button_press_event", this->logoWindow, Window::windowOpen);
    4343
    44   logoWindow->connectSignal("destroy", logoWindow, Window::windowClose);
    45   logoWindow->connectSignal("delete_event", logoWindow, Window::windowClose);
     44  this->logoWindow->connectSignal("destroy", this->logoWindow, Window::windowClose);
     45  this->logoWindow->connectSignal("delete_event", this->logoWindow, Window::windowClose);
    4646#endif /* HAVE_GTK2 */
    47   logoEventBox = new EventBox();
    48   logoBox = new Box('v');
    49   logoLabel = new Label("OrxOnoX, Version: " PACKAGE_VERSION);
    50   logoImage = new Image("banner.xpm");
    51   logoEventBox->fill(logoImage);
     47  this->logoEventBox = new EventBox();
     48  this->logoBox = new Box('v');
     49  this->logoLabel = new Label("OrxOnoX, Version: " PACKAGE_VERSION);
     50  this->logoImage = new Image("banner.xpm");
     51  this->logoEventBox->fill(this->logoImage);
    5252 
    53   logoBox->fill(logoLabel);
    54   logoBox->fill(logoEventBox);
     53  this->logoBox->fill(this->logoLabel);
     54  this->logoBox->fill(this->logoEventBox);
    5555#ifdef HAVE_GTK2
    56   logoEventBox->connectSignal("button_press_event",logoWindow, Window::windowClose);
     56  this->logoEventBox->connectSignal("button_press_event", this->logoWindow, Window::windowClose);
    5757#endif /* HAVE_GTK2 */
    5858
    59   logoWindow->fill (logoBox);
     59  this->logoWindow->fill(this->logoBox);
    6060 
    61   Window::addWindow (logoWindow);
     61  Window::addWindow(this->logoWindow);
    6262}
    6363
     
    6565   \brief Destructs it.
    6666*/
    67 OrxonoxGuiBanner::~OrxonoxGuiBanner ()
     67OrxonoxGuiBanner::~OrxonoxGuiBanner(void)
    6868{
     69  // nothing to do here
    6970}
    7071
     
    7374   \return The EventBox, that holds the Banner.
    7475*/
    75 Widget* OrxonoxGuiBanner::getWidget ()
     76Widget* OrxonoxGuiBanner::getWidget(void)
    7677{
    77   return bannerEventBox;
     78  return this->bannerEventBox;
    7879}
    7980
  • orxonox/branches/trackManager/src/gui/orxonox_gui_banner.h

    r3187 r3430  
    2929
    3030 public:
    31   OrxonoxGuiBanner ();
    32   ~OrxonoxGuiBanner ();
     31  OrxonoxGuiBanner(void);
     32  ~OrxonoxGuiBanner(void);
    3333
    34   Widget* getWidget ();
     34  Widget* getWidget(void);
    3535
    3636};
  • orxonox/branches/trackManager/src/gui/orxonox_gui_exec.cc

    r3187 r3430  
    2828#include <string>
    2929
     30HashTable* orxonoxFlagHash;
     31
    3032/**
    3133    \brief Creates the Exec-Frame
    32     \param orxonoxGUI ExecFrame needs to know where to get the Options from
    33 */
    34 OrxonoxGuiExec::OrxonoxGuiExec (Window* orxonoxGUI)
    35 {
    36   configFile = (char*)malloc (512*sizeof (char));
    37 
    38   execFrame = new Frame ("Execute-Tags:");
    39   execBox = new Box ('v');
    40   execFrame->setGroupName ("misc");
     34*/
     35OrxonoxGuiExec::OrxonoxGuiExec(void)
     36{
     37  configFile =(char*)malloc(512*sizeof(char));
     38
     39  this->execFrame = new Frame("Execute-Tags:");
     40  this->execBox = new Box('v');
     41  this->execFrame->setGroupName("misc");
    4142 
    42   start = new Button ("Start");
     43  this->start = new Button("Start");
    4344#ifdef HAVE_GTK2
    44   start->connectSignal ("clicked", startOrxonox);
     45  this->start->connectSignal("clicked", this, startOrxonox);
    4546#endif /* HAVE_GTK2 */
    46   execBox->fill (start);
    47   saveSettings = new CheckButton ("Save Settings");
    48   saveSettings->value = 1;
    49   saveSettings->saveable = true;
    50   execBox->fill (saveSettings);
    51   verboseMode = new Menu ("verbose mode", "no output", "verbose", "debug", "lastItem");
    52   verboseMode->setFlagName ("verbose", "v", 0);
    53   verboseMode->saveable = true;
    54   execBox->fill (verboseMode);
    55   alwaysShow = new CheckButton ("Always Show this Menu");
    56   alwaysShow->setFlagName ("gui", "g", 0);
    57   alwaysShow->saveable = true;
    58   execBox->fill (alwaysShow);
    59   quit = new Button ("Quit");
     47  this->execBox->fill(start);
     48  this->saveSettings = new CheckButton("Save Settings");
     49  this->saveSettings->value = 1;
     50  this->saveSettings->saveability();
     51  this->execBox->fill(this->saveSettings);
     52  this->verboseMode = new Menu("verbose mode", "no output", "error", "warning", "info", "lastItem");
     53  this->verboseMode->setFlagName("verbose", "v", 0);
     54  this->verboseMode->saveability();
     55  this->execBox->fill(this->verboseMode);
     56  this->alwaysShow = new CheckButton("Always Show this Menu");
     57  this->alwaysShow->setFlagName("gui", "g", 0);
     58  this->alwaysShow->saveability();
     59  this->execBox->fill(this->alwaysShow);
     60  this->quit = new Button("Quit");
    6061#ifdef HAVE_GTK2
    61   quit->connectSignal ("clicked", orxonoxGUI->orxonox_gui_quit);
     62  this->quit->connectSignal("clicked", this, OrxonoxGuiExec::quitOrxonox);
     63  //  Window::mainWindow->connectSignal("remove", this, OrxonoxGuiExec::quitOrxonox);
     64  Window::mainWindow->connectSignal("destroy", this, OrxonoxGuiExec::quitOrxonox);
    6265#endif /* HAVE_GTK2 */
    63   execBox->fill (quit);
    64 
    65   execFrame->fill (execBox);
     66  this->execBox->fill(this->quit);
     67
     68  this->execFrame->fill(this->execBox);
     69}
     70
     71/**
     72   \brief Destructs the Execution-stuff
     73*/
     74OrxonoxGuiExec::~OrxonoxGuiExec(void)
     75{
     76  if(this->configFile)
     77    delete []this->configFile;
    6678}
    6779
     
    7082   \return Returns the Exec-frame
    7183*/
    72 Widget* OrxonoxGuiExec::getWidget ()
     84Widget* OrxonoxGuiExec::getWidget(void)
    7385{
    7486  return execFrame;
     
    7890
    7991/**
    80    \brief Sets the location of the configuration File.\n
    81    * The name will be parsed from ~/ to /home/[username] on unix and c:/Documents and Settings/username/Settings/ on Windows
     92   \brief Sets the location of the configuration File.
    8293   \param filename the location of the configFile
    83 */
    84 void OrxonoxGuiExec::setFilename (char* filename)
    85 {
    86   char* buffer = (char*) malloc (512*sizeof(buffer));
    87   sprintf (buffer, "%s", filename);
    88   if (!strncmp (buffer, "~/", 2))
     94
     95   \todo: memory allocation could be better.
     96
     97   The name will be parsed from ~/ to /home/[username] on unix and c:/Documents and Settings/username/Settings/ on Windows
     98*/
     99void OrxonoxGuiExec::setFilename(char* filename)
     100{
     101  char* buffer = (char*)malloc(2048*sizeof(char));
     102  sprintf(buffer, "%s", filename);
     103  if(!strncmp(buffer, "~/", 2))
    89104  {
    90105#ifdef __WIN32__
    91     sprintf (configFile, "%s/%s", getenv ("USERPROFILE"), buffer+2);
     106    sprintf(configFile, "%s/%s", getenv("USERPROFILE"), buffer+2);
    92107#else
    93     sprintf (configFile, "%s/%s", getenv ("HOME"), buffer+2);
     108    sprintf(configFile, "%s/%s", getenv("HOME"), buffer+2);
    94109#endif
    95110  }
    96   else if (buffer)
    97     sprintf(configFile, "%s", buffer);
    98   delete buffer;
     111  else if(buffer)
     112    strcpy(this->configFile, buffer);
     113  free (buffer);
     114}
     115
     116/**
     117   \returns The name of the Configuration-File
     118*/
     119char* OrxonoxGuiExec::getConfigFile(void)
     120{
     121  return this->configFile;
    99122}
    100123
     
    103126   \return 1 if it should 0 if not/
    104127*/
    105 int OrxonoxGuiExec::shouldsave ()
    106 {
    107   return (static_cast<Option*>(saveSettings)->value);
     128int OrxonoxGuiExec::shouldsave()
     129{
     130  return(static_cast<Option*>(this->saveSettings)->value);
    108131}
    109132
     
    112135    \param widget from which Widget on should be saved.
    113136
    114     this Function only opens and closes the file, in between OrxonoxGuiExec::writeFileText (Widget* widget) will execute the real writing process.
    115 */
    116 void OrxonoxGuiExec::writeToFile (Widget* widget)
    117 {
    118   CONFIG_FILE = fopen (configFile, "w");
    119   if (CONFIG_FILE)
    120     writeFileText (widget, 0);
    121   fclose (CONFIG_FILE);
     137    this Function only opens and closes the file, in between OrxonoxGuiExec::writeFileText(Widget* widget) will execute the real writing process.
     138*/
     139void OrxonoxGuiExec::writeToFile(Widget* widget)
     140{
     141  this->CONFIG_FILE = fopen(configFile, "w");
     142  if(this->CONFIG_FILE)
     143    this->writeFileText(widget, 0);
     144  fclose(this->CONFIG_FILE);
    122145}
    123146
     
    127150   \param depth initially "0", and grows higher, while new Groups are bundeled.
    128151*/
    129 void OrxonoxGuiExec::writeFileText (Widget* widget, int depth)
     152void OrxonoxGuiExec::writeFileText(Widget* widget, int depth)
    130153{
    131154  int counter = 0;
    132   while (counter < depth && ((widget->isOption>0
    133                               && (static_cast<Option*>(widget)->saveable) )
    134                              || (widget->isOption<0
    135                                  && static_cast<Packer*>(widget)->getGroupName())))
    136     {
    137       fprintf (CONFIG_FILE, "  ", depth);
     155  while(counter < depth &&((widget->isOption>0
     156                              &&(static_cast<Option*>(widget)->isSaveable()))
     157                             ||(widget->isOption<0
     158                                && static_cast<Packer*>(widget)->getGroupName())))
     159    {
     160      fprintf(this->CONFIG_FILE, "  ", depth);
    138161      counter++;
    139162    }
    140163 
    141164  // check if it is a Packer, and if it is, check if it has a name and if there is something in it.
    142   if (widget->isOption <0)
    143     {
    144       if (static_cast<Packer*>(widget)->getGroupName())
    145         {
    146           fprintf (CONFIG_FILE, "[%s]\n", static_cast<Packer*>(widget)->getGroupName());
    147           writeFileText (static_cast<Packer*>(widget)->down, depth+1);
     165  if(widget->isOption <0)
     166    {
     167      if(static_cast<Packer*>(widget)->getGroupName())
     168        {
     169          fprintf(CONFIG_FILE, "[%s]\n", static_cast<Packer*>(widget)->getGroupName());
     170          this->writeFileText(static_cast<Packer*>(widget)->down, depth+1);
    148171          fprintf(CONFIG_FILE, "\n");
    149172        }
    150173      else
    151174        {
    152           writeFileText (static_cast<Packer*>(widget)->down, depth);
     175          this->writeFileText(static_cast<Packer*>(widget)->down, depth);
    153176        }
    154177    }
    155   //  if (widget->isOption == 0)
    156   //    printf ("%s\n",widget->label);
    157   if (widget->isOption >= 1)
    158     if  (static_cast<Option*>(widget)->saveable)
     178  //  if(widget->isOption == 0)
     179  //    printf("%s\n",widget->title);
     180  if(widget->isOption >= 1)
     181    if (static_cast<Option*>(widget)->isSaveable())
    159182      {
    160183        char Buffer[256];
    161184        char* space2under;
    162         strcpy (Buffer, static_cast<Option*>(widget)->label);
    163         if (strchr (Buffer, '_'))
     185        strcpy(Buffer, static_cast<Option*>(widget)->title);
     186        if(strchr(Buffer, '_'))
    164187          cout << "Warning Optionname" << Buffer << " is not Valid for Saving, because it includes an underscore" << endl;
    165         while (space2under = strchr(Buffer, ' '))
     188        while(space2under = strchr(Buffer, ' '))
    166189          {
    167190            space2under[0] = '_';
    168191          }
    169         if (widget->isOption <=3)
    170           fprintf (CONFIG_FILE, "%s = %d\n", Buffer, static_cast<Option*>(widget)->value);
    171         else if (widget->isOption == 5)
    172           fprintf (CONFIG_FILE, "%s = %s\n", Buffer, static_cast<OptionLabel*>(widget)->cValue);
     192        if(widget->isOption <=3)
     193          fprintf(CONFIG_FILE, "%s = %d\n", Buffer, static_cast<Option*>(widget)->value);
     194        else if(widget->isOption == 5)
     195          fprintf(CONFIG_FILE, "%s = %s\n", Buffer, static_cast<OptionLabel*>(widget)->cValue);
    173196      }
    174197
    175   if (widget->next != NULL)
    176     writeFileText (widget->next, depth);
     198  if(widget->next != NULL)
     199    this->writeFileText(widget->next, depth);
    177200}
    178201
     
    181204   \param widget from which Widget on should be saved.
    182205*/
    183 void OrxonoxGuiExec::readFromFile (Widget* widget)
    184 {
    185   CONFIG_FILE = fopen (configFile, "r");
    186   if (CONFIG_FILE)
     206void OrxonoxGuiExec::readFromFile(Widget* widget)
     207{
     208  this->CONFIG_FILE = fopen(configFile, "r");
     209  VarInfo varInfo;
     210  if(this->CONFIG_FILE)
    187211    {
    188212      Widget* groupWidget = widget;
     
    190214      char Variable[256]= "";
    191215      char* Value;
    192       while (fscanf (CONFIG_FILE, "%s", Buffer) != EOF)
     216      while(fscanf(this->CONFIG_FILE, "%s", Buffer) != EOF)
    193217        {
    194218          // group-search //
    195           if (!strncmp (Buffer, "[", 1))
     219          if(!strncmp(Buffer, "[", 1))
    196220            {
    197               if ((groupWidget = locateGroup (widget, Buffer, 1))==NULL)
     221              if((groupWidget = locateGroup(widget, Buffer, 1))==NULL)
    198222                {
    199223                  cout << "!!There is no group called " << Buffer << " in this GUI.\n First best Widget will get the Infos assigned.\n Config-File will be updated in next Save\n";
    200224                  groupWidget = widget;
    201225                }
     226              else
     227                PRINT(3)("Group %s located.\n", static_cast<Packer*>(groupWidget)->groupName);
    202228            }
    203229          // option-setting //
    204           if (!strcmp (Buffer, "="))
     230          if(!strcmp(Buffer, "="))
    205231            {
    206232              char* under2space;
    207               while (under2space = strchr(Variable, '_'))
     233              while(under2space = strchr(Variable, '_'))
    208234                {
    209                   sprintf (under2space, " %s", under2space+1);
     235                  sprintf(under2space, " %s", under2space+1);
    210236                }
    211237             
    212               fscanf (CONFIG_FILE, "%s", Buffer);
    213               Value = Buffer;
    214               readFileText (groupWidget, Variable, Value, 0);
    215               sprintf (Variable, "");
     238              fscanf(this->CONFIG_FILE, "%s", Buffer);
     239              varInfo.variableName = Variable;
     240              varInfo.variableValue = Buffer;
     241              groupWidget->walkThrough(this->readFileText, &varInfo, 0);
     242              sprintf(Variable, "");
    216243            }
    217           sprintf (Variable, "%s", Buffer);
    218         }
    219       widget->walkThrough(widget->setOptions);
    220     }
    221 }
     244          sprintf(Variable, "%s", Buffer);
     245        }
     246      widget->walkThrough(widget->setOptions, 0);
     247    }
     248}
     249
    222250/**
    223251   \brief Maps Confugurations to the Options.
    224252   \param widget which widget downwards
    225    \param variableName the name of the Variable that should be set up.
    226    \param variableValue the Value of the Variable that should be set up
    227    \param depth the depth of the local Widget
    228 */
    229 void OrxonoxGuiExec::readFileText (Widget* widget, char* variableName, char* variableValue, int depth)
    230 {
    231   if (widget->isOption >= 1 && widget->isOption <= 3)
    232     {
    233       if (!strcmp (static_cast<Option*>(widget)->label, variableName))
    234         static_cast<Option*>(widget)->value = atoi(variableValue);
    235     }
    236   else if (widget->isOption == 5)
    237     {
    238        if (!strcmp (static_cast<Option*>(widget)->label, variableName))
    239         static_cast<OptionLabel*>(widget)->setValue(variableValue);
    240     }
    241   if (widget->isOption < 0)
    242     {
    243       readFileText (static_cast<Packer*>(widget)->down, variableName, variableValue, depth+1);
    244     }
    245 
    246   if (widget->next != NULL && depth !=0)
    247     readFileText (widget->next, variableName, variableValue, depth);
     253   \param varInfo Information about the Variable to read
     254*/
     255void OrxonoxGuiExec::readFileText(Widget* widget, void* varInfo)
     256{
     257  VarInfo* info =(VarInfo*)varInfo;
     258  if(widget->title && !strcmp(widget->title, info->variableName))
     259    {
     260      PRINT(3)("Located Option %s.\n", widget->title);
     261      if(widget->isOption >= 1 && widget->isOption <= 3)
     262        {
     263          static_cast<Option*>(widget)->value = atoi(info->variableValue);
     264          static_cast<Option*>(widget)->redraw(); //!< \todo change this to setValue.
     265        }
     266      else if(widget->isOption == 5)
     267        static_cast<OptionLabel*>(widget)->setValue(info->variableValue);
     268    }
    248269}
    249270
     
    254275   \param depth The Depth of the search seen from the first widget we searched from.
    255276   \returns The Widget that holds the Group, or the NULL if the Group wasn't found.
     277
     278   \todo do this in gui-gtk.
    256279*/
    257280Widget* OrxonoxGuiExec::locateGroup(Widget* widget, char* groupName, int depth)
     
    260283
    261284  // removes the trailing and ending [ ].
    262   if (!strncmp (groupName, "[", 1))
     285  if(!strncmp(groupName, "[", 1))
    263286    {
    264287      groupName = groupName+1;
     
    266289    }
    267290
    268   if (widget->isOption < 0)
    269     {
    270       if (static_cast<Packer*>(widget)->getGroupName() && !strcmp(groupName, static_cast<Packer*>(widget)->getGroupName()))
     291  if(widget->isOption < 0)
     292    {
     293      if(static_cast<Packer*>(widget)->getGroupName() && !strcmp(groupName, static_cast<Packer*>(widget)->getGroupName()))
    271294        {
    272295          return widget;
     
    274297      else
    275298        {
    276           if ((tmp = locateGroup (static_cast<Packer*>(widget)->down, groupName, depth+1)) != NULL)
     299          if((tmp = locateGroup(static_cast<Packer*>(widget)->down, groupName, depth+1)) != NULL)
    277300            return tmp;
    278301        }
    279302    }
    280303 
    281   if (widget->next != NULL && depth != 0)
    282     {
    283       if ((tmp = locateGroup (widget->next, groupName, depth)) != NULL)
     304  if(widget->next != NULL && depth != 0)
     305    {
     306      if((tmp = locateGroup(widget->next, groupName, depth)) != NULL)
    284307        return tmp;
    285308    }
     
    289312#ifdef HAVE_GTK2
    290313/**
    291    \brief Starts ORXONOX. (not really implemented yet, but the function is there.\n
    292    This is a Signal and can be executed through Widget::signal_connect
     314   \brief Starts ORXONOX.(not really implemented yet, but the function is there.\n
    293315   \param widget the widget that executed the start command
    294316   \param data additional data
    295 */
    296 gint startOrxonox (GtkWidget *widget, Widget* data)
    297 {
     317
     318   This is a Signal and can be executed through Widget::signal_connect
     319*/
     320int OrxonoxGuiExec::startOrxonox(GtkWidget* widget, void* data)
     321{
     322  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
     323  if(exec->shouldsave())
     324    exec->writeToFile(Window::mainWindow);
    298325  cout << "Starting Orxonox" <<endl;
    299 }
     326  gtk_main_quit();
     327  system("cd ..;./orxonox"); //!< \todo fix this. should execute orxonox for real(coded not over the shell)
     328}
     329
     330/**
     331   \brief Starts ORXONOX.(not really implemented yet, but the function is there.\n
     332   \param widget the widget that executed the start command
     333   \param data additional data
     334
     335   This is a Signal and can be executed through Widget::signal_connect
     336*/
     337int OrxonoxGuiExec::quitOrxonox(GtkWidget* widget, void* data)
     338{
     339  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
     340  PRINT(3)( "Quitting Orxonox %p\n", exec);
     341  if(exec->shouldsave())
     342    exec->writeToFile(Window::mainWindow);
     343  gtk_main_quit();
     344}
     345#else /* HAVE_GTK2 */
     346/**
     347   \brief Starts ORXONOX.(not really implemented yet, but the function is there.\n
     348   \param widget the widget that executed the start command
     349   \param data additional data
     350*/
     351int OrxonoxGuiExec::startOrxonox(void* widget, void* data)
     352{
     353  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
     354  PRINT(3)("Starting Orxonox\n");
     355  if(exec->shouldsave())
     356    exec->writeToFile(Window::mainWindow);
     357  system("cd ..;./orxonox"); //!< \todo fix this. should execute orxonox for real(coded not over the shell)
     358}
     359/**
     360   \brief Quits ORXONOX.
     361   \param widget the widget that executed the Quit command
     362   \param data additional data
     363
     364   This is a Signal and can be executed through Widget::signal_connect
     365*/
     366int OrxonoxGuiExec::quitOrxonox(void* widget, void* data)
     367{
     368  OrxonoxGuiExec* exec =(OrxonoxGuiExec*)data;
     369  PRINT(3)("Quiting Orxonox");
     370  if(exec->shouldsave())
     371    exec->writeToFile(Window::mainWindow);
     372}
     373
    300374#endif /* HAVE_GTK2 */
  • orxonox/branches/trackManager/src/gui/orxonox_gui_exec.h

    r3187 r3430  
    2424  char* configFile;            //!< The name of the .orxonox.conf(ig)-file.
    2525  FILE* CONFIG_FILE;           //!< Filehandler for reading and writing.
     26 
     27  //! A struct that holds informations about variables.
     28  struct VarInfo
     29  {
     30    char* variableName;        //!< The Name of this variable;
     31    char* variableValue;       //!< The Value this variable gets.
     32  };
    2633
    2734 public:
    28   OrxonoxGuiExec (Window* orxonoxGUI);
    29   ~OrxonoxGuiExec ();
     35  OrxonoxGuiExec(void);
     36  ~OrxonoxGuiExec(void);
    3037 
    31   Widget* getWidget ();
     38  Widget* getWidget(void);
    3239 
    33   void setFilename (char* filename);
    34   int shouldsave ();
    35   void writeToFile (Widget* widget);
    36   void writeFileText (Widget* widget, int depth);
    37   void readFromFile (Widget* widget);
    38   void readFileText (Widget* widget, char* variableName, char* variableValue, int depth);
     40  void setFilename(char* filename);
     41  char* getConfigFile(void);
     42  int shouldsave(void);
     43  void writeToFile(Widget* widget);
     44  void writeFileText(Widget* widget, int depth);
     45  void readFromFile(Widget* widget);
     46  static void readFileText(Widget* widget, void* varInfo);
    3947  Widget* locateGroup(Widget* widget, char* groupName, int depth);
    4048
     49#ifdef HAVE_GTK2
     50  static int startOrxonox(GtkWidget *widget, void* data);
     51  static int quitOrxonox(GtkWidget *widget, void* data);
     52#else /* HAVE_GTK2 */
     53  static int startOrxonox(void* widget, void* data);
     54  static int quitOrxonox(void* widget, void* data);
     55#endif /* HAVE_GTK2 */
    4156};
    42 #ifdef HAVE_GTK2
    43   gint startOrxonox (GtkWidget *widget, Widget* data);
    44 #endif /* HAVE_GTK2 */
     57
     58
     59struct HashTable
     60{
     61  char* name;
     62  char* value;
     63  HashTable* next;
     64};
     65
     66
    4567#endif /* _ORXONOX_GUI_EXEC_H */
  • orxonox/branches/trackManager/src/gui/orxonox_gui_flags.cc

    r3158 r3430  
    2828/**
    2929   \brief Creates the Flags-Frame
    30    \param widget The Widget from which the data will be parsed
    3130*/
    32 OrxonoxGuiFlags::OrxonoxGuiFlags (Widget* widget)
     31OrxonoxGuiFlags::OrxonoxGuiFlags(void)
    3332{
    34   flagText = (char*) malloc (1024);
     33  this->flagsFrame = new Frame("Orxonox-Startup-Flags:");
     34  this->flagsBox = new Box('v');
    3535
    36   flagsFrame = new Frame ("Orxonox-Startup-Flags:");
    37   flagsBox = new Box ('v');
     36  this->flagsLabel = new Label();
     37  this->flagsLabel->setSize(260,60);
     38  this->flagsBox->fill(flagsLabel);
     39  this->shortFlags = new CheckButton("shortFlags");
     40  this->flagsBox->fill(shortFlags);
    3841
    39   flagsLabel = new Label ();
    40   flagsLabel->setSize (260,60);
    41   flagsBox->fill (flagsLabel);
    42   shortFlags = new CheckButton ("shortFlags");
    43   flagsBox->fill (shortFlags);
     42  this->flagsFrame->fill(flagsBox);
     43}
    4444
    45   flagsFrame->fill (flagsBox);
     45/**
     46   \brief Destructs the Flags-stuff
     47*/
     48OrxonoxGuiFlags::~OrxonoxGuiFlags(void)
     49{
     50  // nothing to do here
    4651}
    4752
     
    5055   \returns Frame that holds the Flagtext.
    5156*/
    52 Widget* OrxonoxGuiFlags::getWidget ()
     57Widget* OrxonoxGuiFlags::getWidget(void)
    5358{
    54   return flagsFrame;
     59  return this->flagsFrame;
    5560}
    5661
     
    5964   \param widget the Widget from which on to scan for deeper Options and their settings.
    6065*/
    61 void OrxonoxGuiFlags::setTextFromFlags (Widget* widget)
     66void OrxonoxGuiFlags::setTextFromFlags(Widget* widget)
    6267{
    63   sprintf (flagText, "");
    64   strcat (flagText, "orxonox");
    65   FlagsText (widget);
    66   flagsLabel->setText (flagText);
     68  FlagInfo flagInfo;
     69  flagInfo.shortFlags = this->shortFlags;
     70  flagInfo.flagsLabel = this->flagsLabel;
     71
     72  this->flagsLabel->ereaseText();
     73  this->flagsLabel->appendText("orxonox");
     74  widget->walkThrough(OrxonoxGuiFlags::flagsText, &flagInfo, 0);
     75  //  flagsLabel->setTitle(flagText);
    6776}
    6877
     
    7079    \brief this actually sets the flagtext, and appends it to flagText
    7180    \param widget like OrxonoxGuiFlags::setTextFromFlags(widget)
     81    \param flagInfo Information aboout the Flag that should be updated.
    7282*/
    73 void OrxonoxGuiFlags::FlagsText(Widget* widget)
     83void OrxonoxGuiFlags::flagsText(Widget* widget, void* flagInfo)
    7484{
    75   if (widget->isOption >= 1)
    76     if  (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue && (static_cast<Option*>(widget)->flagName || static_cast<Option*>(widget)->flagNameShort ))
     85  FlagInfo* info =(FlagInfo*)flagInfo;
     86  if(widget->isOption >= 1)
     87    if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue )
    7788      {
    78         if (shortFlags->isActive())
     89        if(info->shortFlags->isActive() && static_cast<Option*>(widget)->flagNameShort)
    7990          {
    80             strcat (flagText, " -");
    81             strcat (flagText, static_cast<Option*>(widget)->flagNameShort);
     91            info->flagsLabel->appendText(" -");
     92            info->flagsLabel->appendText(static_cast<Option*>(widget)->flagNameShort);
    8293          }
    83         else
     94        else if(!info->shortFlags->isActive() && static_cast<Option*>(widget)->flagName)
    8495          {
    85             strcat (flagText, " --");
    86             strcat (flagText, static_cast<Option*>(widget)->flagName);
     96            info->flagsLabel->appendText(" --");
     97            info->flagsLabel->appendText(static_cast<Option*>(widget)->flagName);
    8798          }
    88         if (static_cast<Option*>(widget)->isOption == 2)
     99
     100        if(static_cast<Option*>(widget)->isOption == 2)
    89101          {
    90             sprintf (flagText, "%s=%i", flagText, static_cast<Option*>(widget)->value);
     102            info->flagsLabel->appendText("=");
     103            info->flagsLabel->appendInt(static_cast<Option*>(widget)->value);
    91104          }
    92105      }
    93   switch (widget->isOption)
    94     {
    95     case -1:
    96       FlagsText (static_cast<Container*>(widget)->down);
    97       break;
    98     case -2:
    99       FlagsText (static_cast<Box*>(widget)->down);
    100       break;
    101     }
    102  
    103   if (widget->next != NULL)
    104     FlagsText (widget->next);
    105106}
  • orxonox/branches/trackManager/src/gui/orxonox_gui_flags.h

    r3187 r3430  
    1717  CheckButton* shortFlags;    //!< CheckButton to change the display of short and long flags \todo show long if long not availible...
    1818  Label* flagsLabel;          //!< The Label of the Flags
    19   char* flagText;             //!< The Text of the Label. \todo Delete when Object is destroyed.
    2019
    2120 public:
    22   OrxonoxGuiFlags (Widget* widget);
    23   ~OrxonoxGuiFlags ();
     21  OrxonoxGuiFlags(void);
     22  ~OrxonoxGuiFlags(void);
    2423
    25   void setTextFromFlags (Widget* widget);
    26   void OrxonoxGuiFlags::FlagsText(Widget* widget);
     24  void setTextFromFlags(Widget* widget);
     25  static void flagsText(Widget* widget, void* flagInfo);
    2726 
    28   Widget* getWidget ();
     27  struct FlagInfo
     28  {
     29    CheckButton* shortFlags;
     30    Label* flagsLabel;
     31  };
     32  Widget* getWidget(void);
    2933};
    3034#endif /* _ORXONOX_GUI_FLAGS_H */
  • orxonox/branches/trackManager/src/gui/orxonox_gui_gtk.cc

    r3192 r3430  
    3434// temporarily.
    3535#include "orxonox_gui_flags.h"
    36 #include "orxonox_gui_exec.h"
    3736extern Window* orxonoxGUI;
    3837extern OrxonoxGuiFlags* flags;
    39 extern OrxonoxGuiExec* exec;
    40 
    41 #ifdef HAVE_GTK2
     38
    4239/**
    4340   \brief Initializes the Guis GTK-stuff.
     
    4542   \param argv The Argument strings.
    4643*/
    47 bool initGTK(int argc, char *argv[])
    48 {
    49   gtk_init (&argc, &argv);
     44bool initGUI(int argc, char *argv[])
     45{
     46#ifdef HAVE_GTK2
     47#ifdef HAVE_GTHREAD
     48  PRINTF(3)("Initializing the ThreadSystem of the GUI\n");
     49  g_thread_init(NULL);
     50  gdk_threads_init();
     51#endif /* HAVE_GTHREAD */
     52  gtk_init(&argc, &argv);
    5053  gtk_rc_parse( "rc" );
    51 }
    52 
    53 /**
    54    \brief enters the GTK-main-loop
    55 */
    56 bool mainloopGTK(void)
    57 {
     54#endif /* HAVE_GTK2 */
     55}
     56
     57
     58/**
     59   \brief enters the GUI's main-loop
     60*/
     61bool mainloopGUI(void)
     62{
     63#ifdef HAVE_GTK2
     64  gdk_threads_enter();
    5865  gtk_main();
    59 }
    60 #endif /* HAVE_GTK2 */
     66  gdk_threads_leave();
     67  delete Window::mainWindow;
     68#else /* HAVE_GTK2 */
     69  char boolAns = 'y';
     70  char ans[10];
     71  while(true)
     72    {
     73      PRINT(0)(" Listing all the Orxonox Options: \n");
     74      PRINT(0)("  #############################\n");
     75      Window::mainWindow->walkThrough(Widget::listOptionsAndGroups, 1);
     76     
     77      PRINT(0)("\nDo you want change any of the above values now? [Yn] ");
     78      cin >>boolAns ;
     79      if (boolAns =='n' || boolAns=='N')
     80        break;
     81     
     82      PRINT(0)("\n Listing all groups\n");
     83      PRINT(0)("  #################\n");
     84      int groupCount = 0;
     85      Window::mainWindow->walkThrough(Widget::listGroups, &groupCount, 1);
     86     
     87      PRINT(0)("\nIn which Group? [1-%d] ", groupCount);
     88      Packer* group;
     89      while(true)
     90        {
     91          cin >> ans;
     92          int ansIp = atoi(ans);
     93          if (ansIp <= groupCount)
     94            {
     95              group = static_cast<Packer*>(Window::mainWindow->findGroupByNumber(&ansIp, 1));
     96              break;
     97            }
     98          else
     99            PRINT(0)("\nChoose a smaler Number please: [1-%d] ", groupCount);
     100        }
     101      PRINT(0)("\n\nGroup: [%s]\n\n", group->groupName);
     102      int optionCount = 0;
     103      group->walkThrough(Widget::listOptions, &optionCount, 0);
     104      PRINT(0)("\nWhich Option? [1-%d] ", optionCount);
     105      Option* option;
     106      while(true)
     107        {
     108          cin >> ans;
     109          int ansIp = atoi(ans);
     110          if (ansIp <= groupCount)
     111            {
     112              option = static_cast<Option*>(group->findOptionByNumber(&ansIp, 0));
     113              break;
     114            }
     115          else
     116            PRINT(0)("\nChoose a smaler Number please: [1-%d] ", optionCount);
     117        }
     118      PRINT(0)("\n\n:: %s ::\n", option->title);
     119      option->changeOption();
     120     
     121      // here follows the rest.... this will be nasty.
     122      //! \todo move this into the gui-gtk-file
     123      //! \todo finish it.
     124    }
     125#endif /* HAVE_GTK2 */
     126 
     127}
     128
     129
     130//////////////////////////////
     131/// DEFINING WIDGET-CLASES ///
     132//////////////////////////////
    61133
    62134/* WIDGET */
     
    66138   This is still pretty crappy.
    67139*/
    68 Widget::~Widget()
    69 {
    70   //  cout << "hiding: " <<this->label <<"\n";
    71   this->hide();
    72   //  cout << "check if Packer: "<<this->label <<"\n";
    73   if (this->isOption < 0)
    74     {
    75       //  cout << "get Down "<<this->label <<"\n";
    76       static_cast<Packer*>(this)->down->~Widget();
    77     }
    78   //  cout << "next != NULL?: " <<this->label <<"\n";
    79   if (this->next != NULL)
    80     this->next->~Widget();
    81   cout << "delete Widget: " <<this->label <<"\n";
    82   //  delete widget;
     140Widget::~Widget(void)
     141{
     142  this->destroy();
    83143}
    84144
     
    87147   Initializes the next Pointer and the other Widget-specific Defaults.
    88148*/
    89 void Widget::init()
     149void Widget::init(void)
    90150{
    91151  next = NULL;
    92   label = NULL;
     152  this->title = NULL;
    93153  return;
    94154}
    95155
    96156/**
     157   \brief Destroys a Widget
     158*/
     159void Widget::destroy(void)
     160{
     161  if (this->title)
     162    {
     163      delete []this->title;
     164    }
     165 
     166  PRINTF(4)("deleting the Widget part.\n");
     167
     168  PRINTF(4)("deleting recursively\n");
     169
     170  // deleting next item if existent
     171  if (this->next)
     172    delete this->next;
     173  this->next = NULL;
     174
     175  //!  \todo not hiding widget, deleting.
     176  //  this->hide();
     177  //  delete this->widget;
     178}
     179
     180/**
    97181   \brief makes the widget visible.
    98182*/
    99 void Widget::show()
    100 {
    101 #ifdef HAVE_GTK2
    102   gtk_widget_show (this->widget);
     183void Widget::show(void)
     184{
     185#ifdef HAVE_GTK2
     186  gtk_widget_show(this->widget);
    103187#endif /* HAVE_GTK2 */
    104188}
     
    107191   \brief hides the widget.
    108192*/
    109 void Widget::hide()
    110 {
    111 #ifdef HAVE_GTK2
    112   gtk_widget_hide (this->widget);
     193void Widget::hide(void)
     194{
     195#ifdef HAVE_GTK2
     196  gtk_widget_hide(this->widget);
    113197#endif /* HAVE_GTK2 */
    114198}
     
    122206{
    123207#ifdef HAVE_GTK2
    124   gtk_widget_set_usize (this->widget, width, height);
    125 #endif /* HAVE_GTK2 */
    126 }
    127 
    128 #ifdef HAVE_GTK2
    129 /**
    130     \brief Connect any signal to any given Sub-widget
    131 */
    132 gulong Widget::connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *))
    133 {
    134   return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), NULL);
    135 }
    136 
    137 /**
    138    \brief Connect a signal with additionally passing the whole Object
    139 */
    140 gulong Widget::connectSignal (char* event, gint (*signal)( GtkWidget*, Widget *))
    141 {
    142   return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), this);
    143 }
    144 
    145 /**
    146    \brief Connect a signal with additionally passing a whole external Object
    147 */
    148 gulong Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *))
    149 {
    150   return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
    151 }
    152 
    153 /**
    154    \brief Connect a signal with additionally passing a whole external Object
    155 */
    156 gulong Widget::connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *))
    157 {
    158   return g_signal_connect (G_OBJECT (this->widget), event, G_CALLBACK (signal), extObj);
    159 }
    160 
    161 void Widget::disconnectSignal (gulong signalID)
    162 {
    163   g_signal_handler_disconnect (G_OBJECT (this->widget), signalID);
    164 }
    165 #endif /* HAVE_GTK2 */
     208  gtk_widget_set_usize(this->widget, width, height);
     209#endif /* HAVE_GTK2 */
     210}
     211
     212/**
     213   \brief searches through widgets for a Name.
     214*/
     215Widget* Widget::findWidgetByName(char* name, unsigned int depth)
     216{
     217
     218  if (this->title && !strcmp(this->title, name))
     219    return this;
     220
     221  if (this->isOption < 0 && static_cast<Packer*>(this)->down)
     222    {
     223      Widget* tmp = static_cast<Packer*>(this)->down->findWidgetByName(name, depth+1);
     224      if (tmp)
     225        return tmp;
     226    }
     227 
     228  if (depth>0 && this->next)
     229    return this->next->findWidgetByName(name, depth);
     230
     231  return NULL;
     232}
    166233
    167234/**
    168235   \brief Moves through all the Widgets downwards from this and executes the function on them.
    169    \param Function must be of type void and takes a Widget* as an Input.
    170 */
    171 void Widget::walkThrough (void (*function)(Widget*))
     236   \param function must be of type void and takes a Widget* as an Input.
     237   \param depth the current depth. if > 0 then the next Widget will also be walked through.
     238*/
     239void Widget::walkThrough(void(*function)(Widget*), unsigned int depth)
    172240{
    173241  function(this);
    174242  if (this->isOption < 0)
    175243    {
    176       static_cast<Packer*>(this)->down->walkThrough (function);
     244      static_cast<Packer*>(this)->down->walkThrough(function, depth+1);
    177245    }
    178246
    179   if (this->next != NULL)
    180     this->next->walkThrough(function);
     247  if (this->next && depth != 0)
     248    this->next->walkThrough(function, depth);
     249}
     250
     251/**
     252   \brief Moves through all the Widgets downwards from this and executes the function on them.
     253   \param function must be of type void and takes a Widget* as an Input.
     254   \param data Additional Data you want to pass to the function.
     255   \param depth the current depth. if > 0 then the next Widget will also be walked through.
     256*/
     257void Widget::walkThrough(void(*function)(Widget*, void*), void* data, unsigned int depth)
     258{
     259  function(this, data);
     260  if (this->isOption < 0)
     261    {
     262      static_cast<Packer*>(this)->down->walkThrough(function, data, depth+1);
     263    }
     264  if (this->next && depth != 0)
     265    this->next->walkThrough(function, data, depth);
    181266}
    182267
    183268/**
    184     \brief This is for listing the option of "widget"
     269    \brief This is for listing the options of "widget"
    185270    \param widget specifies the widget that should be listed
    186271*/
    187 void Widget::listOptions (Widget* widget)
     272void Widget::listOptionsAndGroups(Widget* widget)
    188273{
    189274  if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
    190275    cout << "[" << static_cast<Packer*>(widget)->groupName << "]\n";
    191276  if (widget->isOption >= 1 && widget->isOption <= 3)
    192     cout << "  " << static_cast<Option*>(widget)->label <<" is : " << static_cast<Option*>(widget)->value <<endl;
     277    cout << "  " << static_cast<Option*>(widget)->title <<" is : " << static_cast<Option*>(widget)->value <<endl;
    193278  else if (widget->isOption == 5)
    194     cout << "  " << static_cast<Option*>(widget)->label <<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl;
    195 }
    196 
     279    cout << "  " << static_cast<Option*>(widget)->title <<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl;
     280}
     281
     282/**
     283    \brief This is for listing the options of "widget"
     284    \param widget specifies the widget that should be listed
     285*/
     286void Widget::listOptions(Widget* widget)
     287{
     288  if (widget->isOption >= 1 && widget->isOption <= 3)
     289    cout << "  " << static_cast<Option*>(widget)->title <<" is : " << static_cast<Option*>(widget)->value <<endl;
     290  else if (widget->isOption == 5)
     291    cout << "  " << static_cast<Option*>(widget)->title <<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl;
     292}
     293
     294/**
     295    \brief This is for listing the options of "widget"
     296    \param widget specifies the widget that should be listed
     297    \param data A Counter, that always knows how many Options have been found yet.
     298*/
     299void Widget::listOptions(Widget* widget, void* data)
     300{
     301 
     302  if (widget->isOption >= 1 && widget->isOption <= 3)
     303    {
     304      int* count =(int*)data;
     305      *count = *count +1;
     306      cout << *count << ": " << static_cast<Option*>(widget)->title <<" is : " << static_cast<Option*>(widget)->value <<endl;
     307    }
     308  else if (widget->isOption == 5)
     309    {
     310      int* count =(int*)data;
     311      *count = *count +1;
     312      cout << *count << ": " << static_cast<Option*>(widget)->title <<" is : " << static_cast<OptionLabel*>(widget)->cValue <<endl;
     313    }
     314}
     315
     316/**
     317    \brief Finds an Option by a given number(the n'th option found away from this Widget)
     318    \param number The Count of options to wait(by reference)
     319    \param depth The depth of the sarch. if 0 it will not search next pointer
     320   
     321    \todo should return Option* would be much sexier.
     322*/
     323Widget* Widget::findOptionByNumber(int* number, unsigned int depth)
     324{
     325  if (isOption > 0)
     326    {
     327      --*number;
     328      if (*number <= 0)
     329        {
     330          return this;
     331        }
     332    }
     333  if (this->isOption < 0 && static_cast<Packer*>(this)->down)
     334    {
     335      Widget* tmp = static_cast<Packer*>(this)->down->findOptionByNumber(number, depth+1);
     336      if (tmp)
     337        return tmp;
     338    }
     339  if (depth>0 && this->next)
     340    return this->next->findOptionByNumber(number, depth);
     341
     342  return NULL;
     343}
     344
     345/**
     346    \brief This is for listing the groups of "widget"
     347    \param widget specifies the widget that should be listed
     348*/
     349void Widget::listGroups(Widget* widget)
     350{
     351  if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
     352    cout << "[" << static_cast<Packer*>(widget)->groupName << "]\n";
     353}
     354
     355/**
     356    \brief This is for listing the Groups of "widget". It also displays the n'th number found.
     357    \param widget specifies the widget that should be listed
     358    \param data the Counter, that will show the number(this function will raise it by one if a Group is fount.
     359*/
     360void Widget::listGroups(Widget* widget, void* data)
     361{
     362  if (widget->isOption < 0 && static_cast<Packer*>(widget)->groupName)
     363    {
     364      int* count =(int*)data;
     365      *count = *count +1;
     366      cout << *count <<": [" << static_cast<Packer*>(widget)->groupName << "]\n";
     367    }
     368}
     369
     370/**
     371    \brief Finds a Group by a given number(the n'th Group found away from this Widget)
     372    \param number The Count of options to wait(by reference)
     373    \param depth The depth of the sarch. if 0 it will not search next pointer
     374*/
     375Widget* Widget::findGroupByNumber(int* number, unsigned int depth)
     376{
     377  if (isOption < 0 && static_cast<Packer*>(this)->groupName)
     378    {
     379      --*number;
     380      if (*number <= 0)
     381        {
     382          return this;
     383        }
     384    }
     385  if (this->isOption < 0 && static_cast<Packer*>(this)->down)
     386    {
     387      Widget* tmp = static_cast<Packer*>(this)->down->findGroupByNumber(number, depth+1);
     388      if (tmp)
     389        return tmp;
     390    }
     391  if (depth>0 && this->next)
     392    return this->next->findGroupByNumber(number, depth);
     393
     394  return NULL;
     395}
     396 
    197397/**
    198398    \brief This is for setting the option of "widget"
    199399    \param widget specifies the widget that should be set.
    200400*/
    201 void Widget::setOptions (Widget* widget)
     401void Widget::setOptions(Widget* widget)
    202402{
    203403  if (widget->isOption >= 1)
    204     static_cast<Option*>(widget)->redraw();// <<" is : " << static_cast<Option*>(this)->value <<endl;
    205 }
    206 
    207 #ifdef HAVE_GTK2
     404    static_cast<Option*>(widget)->redraw();
     405}
     406
     407/**
     408   \brief Walks through all the Flags given at startuptime.
     409*/
     410void Widget::flagCheck(Widget* widget, void* flagName)
     411{
     412  if (widget->isOption>=1)
     413    {     
     414      Option* option =(Option*)widget;
     415      char* name =(char*)flagName;
     416      char* value = NULL;
     417      bool found = false;
     418      // check if long flag matches
     419      if ((option->flagName && strlen(name)>2 && !strncmp(name+2, option->flagName, strlen(option->flagName)) &&(name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') ))
     420        {
     421          found = true;
     422          if (name[strlen(option->flagName)+2] == '=')
     423            {
     424              value = name+strlen(option->flagName)+3;
     425            }
     426        }
     427      else if (option->flagNameShort && strlen(name)>1 && !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort))&&(name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '=')) // check if short flag matches
     428        {
     429          found = true;
     430          if (name[strlen(option->flagNameShort)+1] == '=')
     431            {
     432              value = name+strlen(option->flagNameShort)+2;
     433            }     
     434        }
     435
     436      if (found)
     437        {
     438          PRINT(3)("found matching Flag %s\n", name);
     439          if (value)
     440            {
     441              PRINT(3)("with Value %s\n", value);
     442              option->value = atoi(value);
     443            }
     444          else
     445            {
     446              option->value = !option->defaultValue;
     447            }
     448          option->redraw();
     449        }
     450
     451    }
     452}
     453
     454#ifdef HAVE_GTK2
     455/**
     456    \brief Connect any signal to any given Sub-widget
     457*/
     458gulong Widget::connectSignal(char* event, gint(*signal)(GtkWidget*, GdkEvent*, void *))
     459{
     460  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), NULL);
     461}
     462
     463/**
     464   \brief Connect a signal with additionally passing the whole Object
     465*/
     466gulong Widget::connectSignal(char* event, gint(*signal)( GtkWidget*, Widget *))
     467{
     468  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), this);
     469}
     470
     471/**
     472   \brief Connect a signal with additionally passing a whole external Object
     473*/
     474gulong Widget::connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, GdkEvent*, void *))
     475{
     476  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), extObj);
     477}
     478
     479/**
     480   \brief Connect a signal with additionally passing a whole external Object
     481*/
     482gulong Widget::connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, void *))
     483{
     484  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), extObj);
     485}
     486
     487/**
     488   \brief Connect a signal with additionally passing a whole external Object
     489*/
     490gulong Widget::connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, GdkEventKey*, void *))
     491{
     492  return g_signal_connect(G_OBJECT(this->widget), event, G_CALLBACK(signal), extObj);
     493}
     494
     495void Widget::disconnectSignal(gulong signalID)
     496{
     497  g_signal_handler_disconnect(G_OBJECT(this->widget), signalID);
     498}
    208499
    209500/**
     
    213504   \param nothing nothin.
    214505*/
    215 gint Widget::doNothingSignal (GtkWidget *widget, GdkEvent* event, void* nothing)
     506gint Widget::doNothingSignal(GtkWidget *widget, GdkEvent* event, void* nothing)
    216507{
    217508}
     
    228519   Sets the down-pinter to NULL and other PackerSpecific-values to their defaults.
    229520*/
    230 void Packer::init (void)
    231 {
    232   down = NULL;
    233   groupName = NULL;
     521void Packer::init(void)
     522{
     523  this->down = NULL;
     524  this->groupName = NULL;
    234525
    235526
     
    239530
    240531/**
     532   \brief Destroys a Packer.
     533*/
     534void Packer::destroy(void)
     535{
     536  PRINTF(4)("deleting the Packer part.\n");
     537 
     538  if (this->groupName)
     539    delete []this->groupName;
     540
     541  //deleting recursively.
     542  if (this->down)
     543    delete this->down;
     544  this->down = NULL;
     545
     546  static_cast<Widget*>(this)->destroy();
     547}
     548
     549/**
    241550   \brief Sets the group name under which all the lower widgets of this will be saved.
    242551   \param name The name of the group.
    243552*/
    244 void Packer::setGroupName (char* name)
    245 {
    246   if (groupName)
    247     delete groupName;
    248   groupName = new char [strlen(name)+1];
    249   strcpy(groupName, name);
     553void Packer::setGroupName(char* name)
     554{
     555  if (this->groupName)
     556    delete []this->groupName;
     557  this->groupName = new char[strlen(name)+1];
     558  strcpy(this->groupName, name);
    250559}
    251560
     
    254563   \returns name The name of the group.
    255564*/
    256 char* Packer::getGroupName (void)
    257 {
    258   return groupName;
     565char* Packer::getGroupName(void)
     566{
     567  return this->groupName;
    259568}
    260569
     
    266575   sets the Container-Specific defaults.
    267576*/
    268 void Container::init (void)
    269 {
    270   isOption = -1;
     577void Container::init(void)
     578{
     579  this->isOption = -1;
    271580
    272581  static_cast<Packer*>(this)->init();
    273582
    274583  return;
     584}
     585
     586/**
     587   \brief Destroys a Container.
     588*/
     589void Container::destroy(void)
     590{
     591  PRINTF(4)("deleting the Container part.\n");
     592
     593  static_cast<Packer*>(this)->destroy();
    275594}
    276595
     
    281600   It does this by filling up the down pointer only if down points to NULL.
    282601*/
    283 void Container::fill (Widget *lowerWidget)
     602void Container::fill(Widget *lowerWidget)
    284603{
    285604  if (this->down == NULL)
    286605    {
    287606#ifdef HAVE_GTK2
    288       gtk_container_add (GTK_CONTAINER (this->widget), lowerWidget->widget);
     607      gtk_container_add(GTK_CONTAINER(this->widget), lowerWidget->widget);
    289608#endif /* HAVE_GTK2 */
    290609      this->down = lowerWidget;
    291610    }
    292611  else
    293     cout << "!!error!! You try to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n"<<endl;
    294 }
    295 
    296 // gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
     612    PRINTF(1)("!!error!! You try to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n");
     613}
     614
     615// gtk_container_set_border_width(GTK_CONTAINER(widget), 5);
    297616
    298617/* WINDOW */
     
    303622   \brief Adds a new Window Windows to the List of Windows.
    304623   \param windowToAdd The Windows that should be added to the List
    305    \todo this instead of windowToAdd (possibly)
     624   \todo this instead of windowToAdd(possibly)
    306625*/
    307626void Window::addWindow(Window* windowToAdd)
     
    314633
    315634  Widget* tmpWindow = mainWindow;
    316   while (tmpWindow->next)
     635  while(tmpWindow->next)
    317636    tmpWindow = tmpWindow->next;
    318637  tmpWindow->next = windowToAdd;
     
    322641     
    323642
    324 
    325643/**
    326644   \brief Creating a new Window without a Name
    327645*/
    328 Window::Window (void)
     646Window::Window(void)
    329647{
    330648  this->init();
     
    335653   \param windowName the name the window should get.
    336654*/
    337 Window::Window (char* windowName)
     655
     656Window::Window(char* windowName)
    338657{
    339658  this->init();
    340   this->setTitle (windowName);
     659  this->setTitle(windowName);
     660}
     661
     662/**
     663   \brief Destructs a Window.
     664*/
     665Window::~Window(void)
     666{
     667  this->destroy();
    341668}
    342669
     
    344671   \brief initializes a new Window
    345672*/
    346 void Window::init()
     673void Window::init(void)
    347674{
    348675  if (!mainWindow)
     
    354681
    355682#ifdef HAVE_GTK2
    356   widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    357   gtk_window_set_policy (GTK_WINDOW(widget), TRUE, TRUE, TRUE);
     683  widget = gtk_window_new(GTK_WINDOW_TOPLEVEL);
     684  gtk_window_set_policy(GTK_WINDOW(widget), TRUE, TRUE, TRUE);
    358685#if !defined(__WIN32__)
    359   //  gtk_window_set_decorated (GTK_WINDOW (widget), FALSE);
     686  //  gtk_window_set_decorated(GTK_WINDOW(widget), FALSE);
    360687#endif
    361   gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
    362 #endif /* HAVE_GTK2 */
     688  gtk_container_set_border_width(GTK_CONTAINER(widget), 3);
     689#endif /* HAVE_GTK2 */
     690}
     691
     692/**
     693   \brief Destroys a Window.
     694*/
     695void Window::destroy(void)
     696{
     697  if (this->title)
     698    PRINTF(3)("deleting the Window: %s\n", this->title);
     699  else
     700    PRINTF(3)("deleting the Window.\n");
     701  //  this->hide();
     702  static_cast<Container*>(this)->destroy();
     703 
    363704}
    364705
     
    366707   \brief Shows all Widgets that are included within this->widget.
    367708*/
    368 void Window::showall ()
    369 {
    370   if (!isOpen)
    371     {
    372       //      printf ("showall\n");
    373 #ifdef HAVE_GTK2
    374       gtk_widget_show_all  (widget);
     709void Window::showall(void)
     710{
     711  if (!this->isOpen)
     712    {
     713      //      printf("showall\n");
     714#ifdef HAVE_GTK2
     715      gtk_widget_show_all(this->widget);
    375716#endif /* HAVE_GTK2 */
    376      isOpen = true;
     717     this->isOpen = true;
    377718    }
    378719  else
    379720    {
    380       //      printf ("showone\n");
    381 #ifdef HAVE_GTK2
    382       gtk_widget_show (widget);
     721      //      printf("showone\n");
     722#ifdef HAVE_GTK2
     723      gtk_widget_show(this->widget);
    383724#endif /* HAVE_GTK2 */
    384725    }
     
    389730   \param title title the Window should get.
    390731*/
    391 void Window::setTitle (char* title)
    392 {
    393   if (label)
    394     delete []label;
    395   label = new char[strlen(title)+1];
    396   strcpy(label, title);
    397 #ifdef HAVE_GTK2
    398   gtk_window_set_title (GTK_WINDOW (widget), title);
     732void Window::setTitle(char* title)
     733{
     734  if (this->title)
     735    delete []this->title;
     736  this->title = new char[strlen(title)+1];
     737  strcpy(this->title, title);
     738#ifdef HAVE_GTK2
     739  gtk_window_set_title(GTK_WINDOW(widget), title);
    399740#endif /* HAVE_GTK2 */
    400741}
     
    403744   \brief opens up a Window and fixes the Focus to it
    404745*/
    405 void Window::open()
     746void Window::open(void)
    406747{
    407748  if (this != mainWindow)
     
    409750      isOpen = true;
    410751#ifdef HAVE_GTK2
    411       gtk_widget_show_all(widget);
    412       gtk_grab_add(widget);
     752      gtk_widget_show_all(this->widget);
     753      gtk_grab_add(this->widget);
    413754#endif /* HAVE_GTK2 */
    414755    }
     
    418759   \brief closes up a Window and removes the Focus from it
    419760*/
    420 void Window::close()
     761void Window::close(void)
    421762{
    422763  if (this != mainWindow)
    423764    {
    424       isOpen = false;
    425 #ifdef HAVE_GTK2
    426       gtk_grab_remove(widget);
    427       gtk_widget_hide (widget);
    428 #endif /* HAVE_GTK2 */
    429     }
    430 }
    431 
    432 #ifdef HAVE_GTK2
    433 /**
    434    \brief opens up a window (not topmost Window).
     765      this->isOpen = false;
     766#ifdef HAVE_GTK2
     767      gtk_grab_remove(this->widget);
     768      gtk_widget_hide(this->widget);
     769#endif /* HAVE_GTK2 */
     770    }
     771}
     772
     773#ifdef HAVE_GTK2
     774/**
     775   \brief opens up a window(not topmost Window).
    435776   this is the Signal that does it. !!SIGNALS ARE STATIC!!
    436777   \param widget the widget that did it.
     
    438779   \param window the Window that should be opened
    439780*/
    440 gint Window::windowOpen (GtkWidget *widget, GdkEvent* event, void* window)
     781gint Window::windowOpen(GtkWidget *widget, GdkEvent* event, void* window)
    441782{
    442783  static_cast<Window*>(window)->open();
     
    444785
    445786/**
    446    \brief closes a window (not topmost Window).
     787   \brief closes a window(not topmost Window).
    447788   this is the Signal that does it. !!SIGNALS ARE STATIC!!
    448789   \param widget the widget that did it!
     
    450791   \param window the Window that should be closed
    451792*/
    452 gint Window::windowClose (GtkWidget *widget, GdkEvent* event, void* window)
     793gint Window::windowClose(GtkWidget *widget, GdkEvent* event, void* window)
    453794{
    454795  static_cast<Window*>(window)->close();
    455796}
    456797
    457 /**
    458  * Quits the orxonox_GUI.
    459  * This can be called as a Signal and is therefor static
    460  \param widget The widget that called this function
    461  \param event the event that happened to execute this function
    462  \param data some data passed with the Signal
    463  */
    464 gint Window::orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data)
    465 {
    466   if (exec->shouldsave())
    467     exec->writeToFile (Window::mainWindow);
    468 
    469   gtk_main_quit();
    470   return FALSE;
    471 }
    472798#endif /* HAVE_GTK2 */
    473799
     
    478804    \brief Creates a new Frame without a name
    479805*/
    480 Frame::Frame (void)
     806Frame::Frame(void)
    481807{
    482808  this->init();
     
    486812   \brief Creates a new Frame with name title
    487813*/
    488 Frame::Frame (char* title)
     814Frame::Frame(char* title)
    489815{
    490816  this->init();
     
    492818}
    493819
     820/**
     821   \brief destrcucts a Frame
     822*/
     823Frame::~Frame(void)
     824{
     825  this->destroy();
     826}
     827
    494828/**
    495829    \brief Initializes a new Frame with default settings
    496830*/
    497 void Frame::init()
     831void Frame::init(void)
    498832{
    499833  static_cast<Container*>(this)->init();
    500834
    501835#ifdef HAVE_GTK2
    502   widget = gtk_frame_new ("");
    503   gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
    504 #endif /* HAVE_GTK2 */
     836  this->widget = gtk_frame_new("");
     837  gtk_container_set_border_width(GTK_CONTAINER(this->widget), 3);
     838#endif /* HAVE_GTK2 */
     839}
     840
     841/**
     842   \brief Destroys a Frame.
     843*/
     844void Frame::destroy(void)
     845{
     846  if (this->title)
     847    PRINTF(3)("deleting the Frame: %s\n", this->title);
     848  else
     849    PRINTF(3)("deleting the Frame.\n");
     850
     851   static_cast<Container*>(this)->destroy();
    505852}
    506853
     
    509856   \param title The title the Frame should get.
    510857*/
    511 void Frame::setTitle (char* title)
    512 {
    513   if (label)
    514     delete []label;
    515   label = new char[strlen(title)+1];
    516   strcpy(label, title);
    517 #ifdef HAVE_GTK2
    518   gtk_frame_set_label (GTK_FRAME (widget), title);
     858void Frame::setTitle(char* title)
     859{
     860  if (this->title)
     861    delete []this->title;
     862  this->title = new char[strlen(title)+1];
     863  strcpy(this->title, title);
     864#ifdef HAVE_GTK2
     865  gtk_frame_set_label(GTK_FRAME(widget), title);
    519866#endif /* HAVE_GTK2 */
    520867}
     
    525872   \brief Creates a new EventBox with default settings.
    526873*/
    527 EventBox::EventBox ()
     874EventBox::EventBox(void)
    528875{
    529876  this->init();
    530877}
     878
    531879/**
    532880   \brief Creates a new EventBox with name title
    533    \param title title the Eventbox should get (only data-structure-internal)
    534 */
    535 EventBox::EventBox (char* title)
     881   \param title title the Eventbox should get(only data-structure-internal)
     882*/
     883EventBox::EventBox(char* title)
    536884{
    537885  this->init();
     
    540888
    541889/**
     890   \brief destructs an EventBox.
     891*/
     892EventBox::~EventBox(void)
     893{
     894  this->destroy();
     895
     896}
     897
     898/**
    542899   \brief Initializes a new EventBox
    543900*/
    544901void EventBox::init(void)
    545902{
    546   isOption = -1;
     903  this->isOption = -1;
    547904
    548905  static_cast<Container*>(this)->init();
    549906
    550907#ifdef HAVE_GTK2
    551   widget = gtk_event_box_new ();
    552   gtk_container_set_border_width (GTK_CONTAINER (widget), 3);
    553 #endif /* HAVE_GTK2 */
    554 }
    555 
    556 /**
    557    \brief Sets the Title of the EventBox (not implemented)
    558    \param title Name the EventBox should get (only datastructure-internal).
    559 */
    560 void EventBox::setTitle (char* title)
    561 {
    562   if (label)
    563     delete []label;
    564   label = new char[strlen(title)+1];
    565   strcpy(label, title);
     908  this->widget = gtk_event_box_new();
     909  gtk_container_set_border_width(GTK_CONTAINER(this->widget), 3);
     910#endif /* HAVE_GTK2 */
     911}
     912
     913/**
     914   \brief Destroys an EventBox.
     915*/
     916void EventBox::destroy(void)
     917{
     918  if (this->title)
     919    PRINTF(3)("deleting the EventBox: %s\n", this->title);
     920  else
     921    PRINTF(3)("deleting the EventBox.\n");
     922
     923  static_cast<Container*>(this)->destroy();
     924}
     925
     926/**
     927   \brief Sets the Title of the EventBox(not implemented)
     928   \param title Name the EventBox should get(only datastructure-internal).
     929*/
     930void EventBox::setTitle(char* title)
     931{
     932  if (this->title)
     933    delete []this->title;
     934  this->title = new char[strlen(title)+1];
     935  strcpy(this->title, title);
    566936}
    567937
     
    571941   \brief Creates a new horizontal Box
    572942*/
    573 Box::Box (void)
     943Box::Box(void)
    574944{
    575945  this->init('h');
     
    580950   \param boxtype if 'v' the Box will be vertically, if 'h' the Box will be horizontally
    581951*/
    582 Box::Box (char boxtype)
     952Box::Box(char boxtype)
    583953{
    584954  this->init(boxtype);
     955}
     956
     957/**
     958   \brief destructs a Box.
     959*/
     960Box::~Box(void)
     961{
     962  this->destroy();
    585963}
    586964
     
    591969void Box::init(char boxtype)
    592970{
    593   isOption = -2;
     971  this->isOption = -2;
    594972
    595973  static_cast<Packer*>(this)->init();
     
    597975  if (boxtype == 'v')
    598976    {
    599       widget = gtk_vbox_new (FALSE, 0);
     977      this->widget = gtk_vbox_new(FALSE, 0);
    600978    }
    601979  else
    602980    {
    603       widget = gtk_hbox_new (FALSE, 0);
    604     }
    605 #endif /* HAVE_GTK2 */
    606 
     981      this->widget = gtk_hbox_new(FALSE, 0);
     982    }
     983#endif /* HAVE_GTK2 */
     984}
     985
     986/**
     987   \brief Destroys a Box.
     988*/
     989void Box::destroy(void)
     990{
     991  if (this->title)
     992    PRINTF(3)("deleting the Box: %s\n", this->title);
     993  else
     994    PRINTF(3)("deleting the Box.\n");
     995
     996  static_cast<Packer*>(this)->destroy();
    607997}
    608998
     
    6131003    It does this by apending the first one to its down-pointer and all its following ones to the preceding next-pointer. The last one will receive a NULL pointer as Next
    6141004*/
    615 void Box::fill (Widget *lowerWidget)
    616 {
    617 #ifdef HAVE_GTK2
    618   gtk_box_pack_start (GTK_BOX (this->widget), lowerWidget->widget, TRUE, TRUE, 0);
     1005void Box::fill(Widget* lowerWidget)
     1006{
     1007#ifdef HAVE_GTK2
     1008  gtk_box_pack_start(GTK_BOX(this->widget), lowerWidget->widget, TRUE, TRUE, 0);
    6191009#endif /* HAVE_GTK2 */
    6201010  if (this->down == NULL)
     
    6241014      Widget* tmp;
    6251015      tmp = this->down;
    626       while (tmp->next != NULL)
     1016      while(tmp->next != NULL)
    6271017        {
    6281018          tmp = tmp->next;
     
    6321022}
    6331023
    634 /* IMAGE */
    635 
    636 /**
    637    \brief Creates a new Image
    638    \param imagename the location of the Image on the Hard Disc
    639 */
    640 Image::Image (char* imagename)
    641 {
    642   this->init();
    643   if (label)
    644     delete []label;
    645   label = new char[strlen(imagename)+1];
    646   strcpy(label, imagename);
    647 
    648 #ifdef HAVE_GTK2
    649   widget = gtk_image_new_from_file (imagename);
    650 #endif /* HAVE_GTK2 */
    651 }
    652 
    653 /**
    654     \brief Initializes a new Image
    655 */
    656 void Image::init()
    657 {
    658   isOption = 0;
    659 
    660   static_cast<Widget*>(this)->init();
    661 }
    662 
     1024/**
     1025   \brief Sets the Title of a Box.
     1026   \param title the new Title to set.
     1027*/
     1028void Box::setTitle(char* title)
     1029{
     1030  if (this->title)
     1031    delete []this->title;
     1032  this->title = new char[strlen(title)+1];
     1033  strcpy(this->title, title);
     1034}
    6631035
    6641036/* OPTION */
     
    6681040   sets all Option-Specific-Values to their defaults.
    6691041*/
    670 void Option::init()
    671 {
    672   value = 0;
    673   flagName = NULL;
    674   flagNameShort = NULL;
    675   saveable = false;
    676   defaultValue = 0;
     1042void Option::init(void)
     1043{
     1044  this->value = 0;
     1045  this->flagName = NULL;
     1046  this->flagNameShort = NULL;
     1047  this->saveable = false;
     1048  this->defaultValue = 0;
    6771049
    6781050  static_cast<Widget*>(this)->init();
    6791051
    6801052  return;
     1053}
     1054
     1055/**
     1056   \brief Destroys an Option.
     1057*/
     1058void Option::destroy(void)
     1059{
     1060  PRINTF(4)("deleting the Option Part.\n");
     1061  if (this->flagName)
     1062    delete []this->flagName;
     1063  if (this->flagNameShort)
     1064    delete []this->flagNameShort;
     1065
     1066  static_cast<Widget*>(this)->destroy();
    6811067}
    6821068
     
    6851071   !! Options will be saved if flagname is different from NULL !!
    6861072   \param flagname the Name that will be displayed in the output
    687    \param defaultvalue the default Value for this Option (see definition of defaultvalue
    688 */
    689 void Option::setFlagName (char* flagname, int defaultvalue)
    690 {
    691   if (flagName)
    692     delete flagName;
    693   flagName = new char [strlen(flagname)+1];
    694   strcpy(flagName, flagname);
    695   defaultValue = defaultvalue;
    696 
    697   //  cout << "Set Flagname of " << label << " to " << flagname << endl;
     1073   \param defaultvalue the default Value for this Option(see definition of defaultvalue
     1074*/
     1075void Option::setFlagName(char* flagname, int defaultvalue)
     1076{
     1077  if (this->flagName)
     1078    delete this->flagName;
     1079  this->flagName = new char [strlen(flagname)+1];
     1080  strcpy(this->flagName, flagname);
     1081  this->defaultValue = defaultvalue;
     1082
     1083  //  cout << "Set Flagname of " << this->title << " to " << flagname << endl;
    6981084}
    6991085
    7001086/**
    701     \brief see Option::setFlagName (char* flagname, int defaultvalue)
     1087    \brief see Option::setFlagName(char* flagname, int defaultvalue)
    7021088    \param flagname the Name that will be displayed in the output
    703     \param defaultvalue the default Value for this Option (see definition of defaultvalue
     1089    \param defaultvalue the default Value for this Option(see definition of defaultvalue
    7041090    \param flagnameshort a short flagname to be displayed in the output
    7051091*/
    706 void Option::setFlagName (char* flagname, char* flagnameshort,  int defaultvalue)
    707 {
    708   if (flagName)
    709     delete flagName;
    710   flagName = new char [strlen(flagname)+1];
    711   strcpy(flagName, flagname);
    712 
    713   if (flagNameShort)
    714     delete flagNameShort;
    715   flagNameShort = new char [strlen(flagnameshort)+1];
    716   strcpy(flagNameShort, flagnameshort);
    717   defaultValue = defaultvalue;
    718   //  cout << "Set Flagname of " << label << " to " << flagname << endl;
    719 }
     1092void Option::setFlagName(char* flagname, char* flagnameshort,  int defaultvalue)
     1093{
     1094  if (this->flagName)
     1095    delete []this->flagName;
     1096  this->flagName = new char [strlen(flagname)+1];
     1097  strcpy(this->flagName, flagname);
     1098
     1099  if (this->flagNameShort)
     1100    delete []this->flagNameShort;
     1101  this->flagNameShort = new char [strlen(flagnameshort)+1];
     1102  strcpy(this->flagNameShort, flagnameshort);
     1103  this->defaultValue = defaultvalue;
     1104  //  cout << "Set Flagname of " << this->title << " to " << flagname << endl;
     1105}
     1106
     1107/**
     1108   \brief Sets the saveable-state of the option to true.
     1109*/
     1110void Option::saveability(void)
     1111{
     1112  this->saveable = true;
     1113}
     1114
     1115/**
     1116   \brief Sets the saveable-state of the option.
     1117   \param isSaveable the saveable-state to set.
     1118*/
     1119void Option::saveability(bool isSaveable)
     1120{
     1121  this->saveable = isSaveable;
     1122}
     1123
     1124/**
     1125   \returns The saveable-state.
     1126*/
     1127bool Option::isSaveable(void)
     1128{
     1129  return this->saveable;
     1130}
     1131
     1132#ifdef HAVE_GTK2
     1133/**
     1134    \brief Signal OptionChange writes the Value from the Slider to its Object-Database.
     1135    \param widget The widget(Slider) that has a changed Value
     1136    \param slider the Slider-Object that should receive the change.
     1137*/
     1138gint Option::OptionChange(GtkWidget *widget, Widget* option)
     1139{
     1140  static_cast<Option*>(option)->changeOption();
     1141  flags->setTextFromFlags(Window::mainWindow);  //// must be different !!!
     1142}
     1143#endif /* HAVE_GTK2 */
    7201144
    7211145
     
    7331157
    7341158/**
     1159   \brief destructs a Button.
     1160*/
     1161Button::~Button(void)
     1162{
     1163  this->destroy();
     1164}
     1165
     1166/**
    7351167   \brief Initializes a new Button
    7361168*/
     
    7421174
    7431175#ifdef HAVE_GTK2
    744   widget = gtk_button_new_with_label ("");
    745 #endif /* HAVE_GTK2 */
     1176  widget = gtk_button_new_with_label("");
     1177#endif /* HAVE_GTK2 */
     1178}
     1179
     1180/**
     1181   \brief Destroys a Button.
     1182*/
     1183void Button::destroy(void)
     1184{
     1185  if (this->title)
     1186    PRINTF(3)("deleting the Label: %s\n", this->title);
     1187  else
     1188    PRINTF(3)("deleting the Label.\n");
     1189
     1190  static_cast<Option*>(this)->destroy();
    7461191}
    7471192
     
    7501195   \param title The name the Button should get
    7511196*/
    752 void Button::setTitle (char *title)
    753 {
    754   if (label)
    755     delete []label;
    756   label = new char[strlen(title)+1];
    757   strcpy(label, title);
    758 #ifdef HAVE_GTK2
    759   gtk_button_set_label (GTK_BUTTON(widget), title);
     1197void Button::setTitle(char *title)
     1198{
     1199  if (this->title)
     1200    delete []this->title;
     1201  this->title = new char[strlen(title)+1];
     1202  strcpy(this->title, title);
     1203#ifdef HAVE_GTK2
     1204  gtk_button_set_label(GTK_BUTTON(widget), title);
    7601205#endif /* HAVE_GTK2 */
    7611206}
     
    7651210   not implemented yet
    7661211*/
    767 void Button::redraw ()
    768 {
     1212void Button::redraw(void)
     1213{
     1214}
     1215
     1216/**
     1217   \brief Button can not be changed, optionChange is empty)
     1218
     1219   \todo Actions for non-GTK-mode
     1220*/
     1221void Button::changeOption(void)
     1222{
     1223  // This will possibly be used for ACTIONS !
    7691224}
    7701225
     
    7751230   \param buttonname The name the CheckButton should display.
    7761231*/
    777 CheckButton::CheckButton (char* buttonname)
     1232CheckButton::CheckButton(char* buttonname)
    7781233{
    7791234  this->init();
     
    7811236
    7821237#ifdef HAVE_GTK2
    783   this->connectSignal ("clicked", this->OptionChange);
    784 #endif /* HAVE_GTK2 */
     1238  this->connectSignal("clicked", this->OptionChange);
     1239#endif /* HAVE_GTK2 */
     1240}
     1241
     1242/**
     1243   \brief destructs a CheckButton.
     1244*/
     1245CheckButton::~CheckButton(void)
     1246{
     1247  this->destroy();
    7851248}
    7861249
     
    7901253void CheckButton::init(void)
    7911254{
    792   isOption = 1;
     1255  this->isOption = 1;
    7931256
    7941257  static_cast<Option*>(this)->init();
    7951258
    7961259#ifdef HAVE_GTK2
    797   widget = gtk_check_button_new_with_label ("");
    798 #endif /* HAVE_GTK2 */
     1260  this->widget = gtk_check_button_new_with_label("");
     1261#endif /* HAVE_GTK2 */
     1262}
     1263
     1264/**
     1265   \brief Destroys a CheckButton.
     1266*/
     1267void CheckButton::destroy(void)
     1268{
     1269  if (this->title)
     1270    PRINTF(3)("deleting the CheckButton: %s\n", this->title);
     1271  else
     1272    PRINTF(3)("deleting the CheckButton.\n");
     1273
     1274  static_cast<Option*>(this)->destroy();
    7991275}
    8001276
     
    8051281void CheckButton::setTitle(char* title)
    8061282{
    807   if (label)
    808     delete []label;
    809   label = new char[strlen(title)+1];
    810   strcpy(label, title);
     1283  if (this->title)
     1284    delete []this->title;
     1285  this->title = new char[strlen(title)+1];
     1286  strcpy(this->title, title);
    8111287#ifdef HAVE_GTK2
    8121288  gtk_button_set_label(GTK_BUTTON(widget), title);
     
    8141290}
    8151291
    816 bool CheckButton::isActive()
     1292bool CheckButton::isActive(void)
    8171293{
    8181294#ifdef HAVE_GTK2
     
    8211297}
    8221298
    823 #ifdef HAVE_GTK2
    824 /**
    825     \brief Signal OptionChange writes the Value from the CheckButton to its Object-Database.
    826     \param widget The widget(CheckButton) that has a changed Value
    827     \param checkbutton the CheckButton-Object that should receive the change.
    828 */
    829 gint CheckButton::OptionChange (GtkWidget *widget, Widget* checkbutton)
    830 {
    831   static_cast<CheckButton*>(checkbutton)->value = (int)gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON ((CheckButton*)checkbutton->widget));
    832   flags->setTextFromFlags(orxonoxGUI);   ////// must be different!!!
    833   cout << static_cast<CheckButton*>(checkbutton)->label << " set to: " << static_cast<CheckButton*>(checkbutton)->value << endl;
    834 }
    835 #endif /* HAVE_GTK2 */
    836 
    837 /**
    838    \brief Redraws the CheckButton (if option has changed).
     1299/**
     1300   \brief Changed the Option, call this Function
     1301*/
     1302void CheckButton::changeOption(void)
     1303{
     1304#ifdef HAVE_GTK2
     1305  this->value =(int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(this->widget));
     1306#else /* HAVE_GTK2 */
     1307  char tmpChar[20];
     1308  cout << "\nPlease give me a new value for " << this->title << " [0,1](defualt:" << this->defaultValue << "): ";
     1309  cin >> tmpChar;
     1310
     1311  if ((this->value = atoi(tmpChar))=!0)
     1312    this->value = 1;
     1313#endif /* HAVE_GTK2 */
     1314  cout << this->title << " set to: " << this->value << endl;
     1315}
     1316
     1317
     1318/**
     1319   \brief Redraws the CheckButton(if option has changed).
    8391320   Example: if new settings are loaded the Button must be redrawn for the GUI to display that Change
    8401321*/
    841 void CheckButton::redraw ()
    842 {
    843 #ifdef HAVE_GTK2
    844   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), value);
     1322void CheckButton::redraw(void)
     1323{
     1324#ifdef HAVE_GTK2
     1325  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(this->widget), value);
    8451326#endif /* HAVE_GTK2 */
    8461327}
     
    8541335   \param end The maximal Value of the slider.
    8551336*/
    856 Slider::Slider (char* slidername, int start, int end)
     1337Slider::Slider(char* slidername, int start, int end)
    8571338{
    8581339  this->init(start, end);
     
    8601341  this->setTitle(slidername);
    8611342#ifdef HAVE_GTK2
    862   this->connectSignal ("value_changed", this->OptionChange);
    863 #endif /* HAVE_GTK2 */
     1343  this->connectSignal("value_changed", this->OptionChange);
     1344#endif /* HAVE_GTK2 */
     1345}
     1346
     1347/**
     1348   \brief destructs a Slider.
     1349*/
     1350Slider::~Slider(void)
     1351{
     1352  this->destroy();
    8641353}
    8651354
    8661355/**
    8671356   \brief Initializes a Slider with start and end Values
    868    params: see Slider::Slider (char* slidername, int start, int end)
     1357   params: see Slider::Slider(char* slidername, int start, int end)
    8691358*/
    8701359void Slider::init(int start, int end)
    8711360{
    872   isOption = 2;
     1361  this->isOption = 2;
    8731362
    8741363  static_cast<Option*>(this)->init();
    8751364
    876 #ifdef HAVE_GTK2
    877  widget = gtk_hscale_new_with_range (start, end, 5);
    878 #endif /* HAVE_GTK2 */
     1365  this->start = start;
     1366  this->end = end;
     1367#ifdef HAVE_GTK2
     1368 widget = gtk_hscale_new_with_range(this->start, this->end, 5);
     1369#endif /* HAVE_GTK2 */
     1370}
     1371
     1372/**
     1373   \brief Destroys a Slider.
     1374*/
     1375void Slider::destroy(void)
     1376{
     1377  if (this->title)
     1378    PRINTF(3)("deleting the Slider: %s\n", this->title);
     1379  else
     1380    PRINTF(3)("deleting the Slider.\n");
     1381
     1382  static_cast<Option*>(this)->destroy();
     1383
    8791384}
    8801385
     
    8851390void Slider::setTitle(char* title)
    8861391{
    887   if (label)
    888     delete []label;
    889   label = new char[strlen(title)+1];
    890   strcpy(label, title);
     1392  if (this->title)
     1393    delete []this->title;
     1394  this->title = new char[strlen(title)+1];
     1395  strcpy(this->title, title);
    8911396}
    8921397
     
    9001405}
    9011406
    902 #ifdef HAVE_GTK2
    903 /**
    904     \brief Signal OptionChange writes the Value from the Slider to its Object-Database.
    905     \param widget The widget(Slider) that has a changed Value
    906     \param slider the Slider-Object that should receive the change.
    907 */
    908 gint Slider::OptionChange (GtkWidget *widget, Widget* slider)
    909 {
    910   static_cast<Slider*>(slider)->value = (int)gtk_range_get_value (GTK_RANGE ((Slider*)slider->widget));
    911   flags->setTextFromFlags(orxonoxGUI);  //// must be different !!!
    912   cout << static_cast<Slider*>(slider)->label << " set to: "<< static_cast<Slider*>(slider)->value << endl;
    913 }
    914 #endif /* HAVE_GTK2 */
    915 
    9161407/**
    9171408   \brief Redraws the widget
    918    Example: see void CheckButton::redraw ()
    919 */
    920 void Slider::redraw ()
    921 {
    922 #ifdef HAVE_GTK2
    923   gtk_range_set_value (GTK_RANGE (widget), value);
    924 #endif /* HAVE_GTK2 */
     1409   Example: see void CheckButton::redraw(void)
     1410*/
     1411void Slider::redraw(void)
     1412{
     1413#ifdef HAVE_GTK2
     1414  gtk_range_set_value(GTK_RANGE(this->widget), value);
     1415#endif /* HAVE_GTK2 */
     1416}
     1417
     1418/**
     1419   \brief Changed the Option, call this Function
     1420*/
     1421void Slider::changeOption(void)
     1422{
     1423#ifdef HAVE_GTK2
     1424  this->value =(int)gtk_range_get_value(GTK_RANGE(this->widget));
     1425#else /* HAVE_GTK2 */
     1426  char tmpChar[20];
     1427  cout << "\nPlease give me a new value for " << this->title << " [" <<this->start << "-" << this->end << "](defualt:" << this->defaultValue << "): ";
     1428  cin >> tmpChar;
     1429
     1430  if ((this->value = atoi(tmpChar))> this->end)
     1431    this->value = this->end;
     1432  if (this->value <= this->start)
     1433    this->value = this->start;
     1434#endif /* HAVE_GTK2 */
     1435  cout << this->title << " set to: " << this->value << endl;
    9251436}
    9261437
     
    9331444    \param ... items to be added to this Menu. !! Consider, that the last input argument has to be "lastItem" for this to work!!
    9341445*/
    935 Menu::Menu (char* menuname, ...)
     1446Menu::Menu(char* menuname, ...)
    9361447{
    9371448  this->init();
     
    9411452
    9421453#ifdef HAVE_GTK2             /////////////////////// REINPLEMENT
    943   va_start (itemlist, menuname);
    944   while (strcmp (itemName = va_arg (itemlist, char*), "lastItem"))
     1454  va_start(itemlist, menuname);
     1455  while(strcmp(itemName = va_arg(itemlist, char*), "lastItem"))
    9451456    {
    9461457      this->addItem(itemName);
     
    9501461
    9511462#ifdef HAVE_GTK2
    952   gtk_option_menu_set_menu (GTK_OPTION_MENU (widget), menu);
    953   this->connectSignal ("changed", this->OptionChange);
    954 #endif /* HAVE_GTK2 */
     1463  gtk_option_menu_set_menu(GTK_OPTION_MENU(this->widget), menu);
     1464  this->connectSignal("changed", this->OptionChange);
     1465#endif /* HAVE_GTK2 */
     1466}
     1467
     1468/**
     1469   \brief destructs a Menu.
     1470*/
     1471Menu::~Menu(void)
     1472{
     1473  this->destroy();
    9551474}
    9561475
     
    9601479void Menu::init(void)
    9611480{
    962   isOption = 2;
     1481  this->isOption = 2;
    9631482
    9641483  static_cast<Option*>(this)->init();
    9651484
    9661485#ifdef HAVE_GTK2
    967   widget = gtk_option_menu_new ();
    968   menu = gtk_menu_new ();
    969 #endif /* HAVE_GTK2 */
    970 
    971 }
     1486  this->widget = gtk_option_menu_new();
     1487  this->menu = gtk_menu_new();
     1488#endif /* HAVE_GTK2 */
     1489
     1490}
     1491
     1492/**
     1493   \brief Destroys a Menu.
     1494*/
     1495void Menu::destroy(void)
     1496{
     1497  if (this->title)
     1498    PRINTF(3)("deleting the Menu: %s\n", this->title);
     1499  else
     1500    PRINTF(3)("deleting the Menu.\n");
     1501  //! \todo destroy menu
     1502 
     1503  static_cast<Option*>(this)->destroy();
     1504}
     1505
    9721506
    9731507/**
     
    9771511void Menu::setTitle(char* title)
    9781512{
    979   if (label)
    980     delete []label;
    981   label = new char[strlen(title)+1];
    982   strcpy(label, title);
     1513  if (this->title)
     1514    delete []this->title;
     1515  this->title = new char[strlen(title)+1];
     1516  strcpy(this->title, title);
    9831517}
    9841518
     
    9861520   \brief appends a new Item to the Menu-List.
    9871521   \param itemName the itemName to be appendet.
    988 */
    989 void Menu::addItem (char* itemName)
    990 {
    991 #ifdef HAVE_GTK2
    992   item = gtk_menu_item_new_with_label (itemName);
    993   gtk_menu_shell_append(GTK_MENU_SHELL (menu), item);
    994 #endif /* HAVE_GTK2 */
    995 }
    996 
    997 #ifdef HAVE_GTK2
    998 /**
    999     \brief Signal OptionChange writes the Value from the Menu to its Object-Database.
    1000     \param widget The widget(Menu) that has a changed Value
    1001     \param menu the Menu-Object that should receive the change.
    1002 */
    1003 gint Menu::OptionChange (GtkWidget *widget, Widget* menu)
    1004 {
    1005   static_cast<Menu*>(menu)->value = (int)gtk_option_menu_get_history (GTK_OPTION_MENU (menu->widget));
    1006   flags->setTextFromFlags(orxonoxGUI); //// must be different !!!
    1007   cout << static_cast<Menu*>(menu)->label << " changed to : " << static_cast<Menu*>(menu)->value << endl;
    1008 }
    1009 #endif /* HAVE_GTK2 */
     1522
     1523   \todo make the item-list readable without GTK
     1524*/
     1525void Menu::addItem(char* itemName)
     1526{
     1527#ifdef HAVE_GTK2
     1528  this->item = gtk_menu_item_new_with_label(itemName);
     1529  gtk_menu_shell_append(GTK_MENU_SHELL(this->menu), this->item);
     1530#endif /* HAVE_GTK2 */
     1531}
    10101532
    10111533/**
    10121534   \brief Redraws the widget
    1013    Example: see void CheckButton::redraw ()
    1014 */
    1015 void Menu::redraw ()
    1016 {
    1017 #ifdef HAVE_GTK2
    1018  gtk_option_menu_set_history (GTK_OPTION_MENU (widget), value);
    1019 #endif /* HAVE_GTK2 */
    1020 }
     1535   Example: see void CheckButton::redraw(void)
     1536*/
     1537void Menu::redraw(void)
     1538{
     1539#ifdef HAVE_GTK2
     1540 gtk_option_menu_set_history(GTK_OPTION_MENU(this->widget), this->value);
     1541#endif /* HAVE_GTK2 */
     1542}
     1543
     1544/**
     1545   \brief Changed the Option, call this Function
     1546*/
     1547void Menu::changeOption(void)
     1548{
     1549#ifdef HAVE_GTK2
     1550  this->value =(int)gtk_option_menu_get_history(GTK_OPTION_MENU(this->widget));
     1551#else /* HAVE_GTK2 */
     1552  char tmpChar[20];
     1553  cout << "\nPlease give me a new value for " << this->title << "(defualt:" << this->defaultValue << "): ";
     1554  cin >> tmpChar;
     1555  this->value = atoi(tmpChar);
     1556
     1557#endif /* HAVE_GTK2 */
     1558  cout << this->title << " set to: " << this->value << endl;
     1559}
     1560
     1561/* OPTION LABEL */
    10211562
    10221563/**
    10231564   \brief Creates a new OptionLabel with a LabelName and a Value.
    10241565   \param label The name of the OptionLabel.
    1025    \param value The Value of the OptionLabel (what will be displayed).
     1566   \param value The Value of the OptionLabel(what will be displayed).
    10261567*/
    10271568OptionLabel::OptionLabel(char* label, char* value)
    10281569{
    1029   init();
    1030   setTitle(label);
    1031   setValue(value);
     1570  this->init();
     1571  this->setTitle(label);
     1572  this->setValue(value);
     1573}
     1574
     1575/**
     1576   \brief destructs an OptionLabel.
     1577*/
     1578OptionLabel::~OptionLabel(void)
     1579{
     1580  this->destroy();
    10321581}
    10331582
     
    10371586void OptionLabel::init(void)
    10381587{
     1588  this->isOption = 5;
    10391589  static_cast<Option*>(this)->init();
    1040   isOption = 5;
     1590
    10411591  cValue = NULL;
    10421592
    10431593#ifdef HAVE_GTK2
    1044   widget = gtk_label_new ("");
    1045 #endif /* HAVE_GTK2 */
    1046 }
     1594  this->widget = gtk_label_new("");
     1595#endif /* HAVE_GTK2 */
     1596}
     1597
     1598/**
     1599   \brief Destroys a OptionLabel.
     1600*/
     1601void OptionLabel::destroy(void)
     1602{
     1603  if (this->title)
     1604    PRINTF(3)("deleting the OptionLabel: %s\n", this->title);
     1605  else
     1606    PRINTF(3)("deleting the OptionLabel.\n");
     1607  if (this->cValue)
     1608    delete []this->cValue;
     1609
     1610  static_cast<Option*>(this)->destroy();
     1611}
     1612
    10471613
    10481614/**
     
    10521618void OptionLabel::setValue(char* newValue)
    10531619{
    1054   if (cValue)
    1055     delete cValue;
    1056   cValue = new char [strlen(newValue)+1];
    1057   strcpy(cValue, newValue);
    1058 #ifdef HAVE_GTK2
    1059   gtk_label_set_text (GTK_LABEL (widget), cValue);
     1620  if (this->cValue)
     1621    delete []this->cValue;
     1622  this->cValue = new char [strlen(newValue)+1];
     1623  strcpy(this->cValue, newValue);
     1624#ifdef HAVE_GTK2
     1625  gtk_label_set_text(GTK_LABEL(this->widget), this->cValue);
    10601626#endif /* HAVE_GTK2 */
    10611627}
     
    10671633void OptionLabel::setTitle(char* title)
    10681634{
    1069   if (label)
    1070     delete []label;
    1071   label = new char [strlen(title)+1];
    1072   strcpy(label, title);
    1073 #ifdef HAVE_GTK2
    1074   gtk_label_set_text (GTK_LABEL (widget), title);
    1075 #endif /* HAVE_GTK2 */
    1076 }
    1077 
    1078 /**
    1079    \brief Redraws an OptionLabel (not implemented yet, but it works).
     1635  if (this->title)
     1636    delete []this->title;
     1637  this->title = new char [strlen(title)+1];
     1638  strcpy(this->title, title);
     1639  this->redraw();
     1640}
     1641
     1642/**
     1643   \brief Redraws an OptionLabel(not implemented yet, but it works).
    10801644*/
    10811645void OptionLabel::redraw(void)
    10821646{
    1083  
    1084 }
     1647#ifdef HAVE_GTK2
     1648  gtk_label_set_text(GTK_LABEL(widget), title);
     1649#endif /* HAVE_GTK2 */
     1650}
     1651
     1652/**
     1653   \brief Changed the Option, call this Function
     1654*/
     1655void OptionLabel::changeOption(void)
     1656{
     1657#ifdef HAVE_GTK2
     1658  this->cValue =(char*)gtk_label_get_text(GTK_LABEL(this->widget));
     1659#else /* HAVE_GTK2 */
     1660  cout << "\nPlease give me a new input for " << this->title << ": ";
     1661  cin >> this->cValue;
     1662#endif /* HAVE_GTK2 */
     1663  cout << this->title << " set to: " << this->cValue << endl;
     1664}
     1665
    10851666
    10861667/**
     
    10881669   You migth consider adding Label::setTitle with this.
    10891670*/
    1090 Label::Label ()
     1671Label::Label(void)
    10911672{
    10921673  this->init();
     
    10971678   \param text The text to be displayed.
    10981679*/
    1099 Label:: Label (char* text)
     1680Label:: Label(char* text)
    11001681{
    11011682  this->init();
    1102   this->setText(text);
     1683  this->setTitle(text);
     1684}
     1685
     1686/**
     1687   \brief destructs a Label.
     1688*/
     1689Label::~Label(void)
     1690{
     1691  this->destroy();
    11031692}
    11041693
     
    11081697void Label::init(void)
    11091698{
    1110   isOption = 0;
     1699  this->isOption = 0;
    11111700
    11121701  static_cast<Widget*>(this)->init();
    11131702
    11141703#ifdef HAVE_GTK2
    1115   widget = gtk_label_new ("");
    1116   gtk_label_set_line_wrap (GTK_LABEL(widget), TRUE);
    1117 #endif /* HAVE_GTK2 */
     1704  this->widget = gtk_label_new("");
     1705  gtk_label_set_line_wrap(GTK_LABEL(this->widget), TRUE);
     1706#endif /* HAVE_GTK2 */
     1707}
     1708
     1709/**
     1710   \brief Destroys a Label.
     1711*/
     1712void Label::destroy(void)
     1713{
     1714  if (this->title)
     1715    PRINTF(3)("deleting the Label: %s\n", this->title);
     1716  else
     1717    PRINTF(3)("deleting the Label.\n");
     1718
     1719  static_cast<Widget*>(this)->destroy();
    11181720}
    11191721
     
    11221724   \param text The text to be inserted into the Label.
    11231725*/
    1124 void Label::setText (char* text)
    1125 {
    1126   if (label)
    1127     delete []label;
    1128   label = new char[strlen(text)+1];
    1129   strcpy(label, text);
    1130 #ifdef HAVE_GTK2
    1131   gtk_label_set_text (GTK_LABEL (this->widget), text);
    1132 #endif /* HAVE_GTK2 */
    1133 }
     1726void Label::setTitle(char* text)
     1727{
     1728  if (this->title)
     1729    delete []this->title;
     1730  this->title = new char[strlen(text)+1];
     1731  strcpy(this->title, text);
     1732#ifdef HAVE_GTK2
     1733  gtk_label_set_text(GTK_LABEL(this->widget), this->title);
     1734#endif /* HAVE_GTK2 */
     1735}
     1736
     1737/**
     1738   \brief ereases the Text of a Label
     1739*/
     1740void Label::ereaseText(void)
     1741{
     1742  this->setTitle("");
     1743}
     1744
     1745/**
     1746    \brief appends some Text to a Label
     1747    \param textToAppend The text that will be appended to this Label
     1748*/
     1749void Label::appendText(char* textToAppend)
     1750{
     1751  if (this->title)
     1752    {
     1753      char* tmpTitle = new char[strlen(this->title)+strlen(textToAppend)+1];
     1754      strcpy(tmpTitle, title); 
     1755      strcat(tmpTitle, textToAppend);
     1756      delete []this->title;
     1757      this->title = tmpTitle;
     1758    }
     1759  else
     1760    {
     1761      this->title = new char[strlen(textToAppend)];
     1762    }
     1763 
     1764#ifdef HAVE_GTK2
     1765  gtk_label_set_text(GTK_LABEL(this->widget), title);
     1766#endif /* HAVE_GTK2 */
     1767}
     1768
     1769/**
     1770    \brief Appends some integer to the Label
     1771    \param intToAppend The Int that will be added.
     1772   
     1773    it does this by just converting the int into a char* and send it to appendText
     1774*/
     1775void Label::appendInt(int intToAppend)
     1776{
     1777  char append [32];
     1778  sprintf(append, "%d", intToAppend);
     1779  this->appendText(append);
     1780}
     1781
    11341782
    11351783/**
     
    11371785   \return The Text the Label holds.
    11381786*/
    1139 char* Label::getText ()
    1140 {
    1141   return label;
    1142 }
     1787char* Label::getText(void)
     1788{
     1789  return this->title;
     1790}
     1791
     1792/**
     1793   \brief Creates a new ProgressBar.
     1794*/
     1795ProgressBar::ProgressBar(void)
     1796{
     1797  this->init();
     1798}
     1799
     1800/**
     1801   \brief Creates a new ProgressBar.
     1802   \param label The name you want to get the ProgressBar.
     1803*/
     1804ProgressBar::ProgressBar(char* label)
     1805{
     1806  this->init();
     1807  this->setTitle(label);
     1808}
     1809
     1810/**
     1811   \brief destructs a ProgressBar
     1812*/
     1813ProgressBar::~ProgressBar(void)
     1814{
     1815  this->destroy();
     1816}
     1817
     1818/**
     1819   \brief Initializes a ProgressBar
     1820*/
     1821void ProgressBar::init(void)
     1822{
     1823  this->isOption = 0;
     1824  this->progress = 0.0;
     1825  this->totalSize = 0.0;
     1826
     1827  static_cast<Widget*>(this)->init();
     1828#ifdef HAVE_GTK2
     1829  this->adjustment =(GtkAdjustment*)gtk_adjustment_new(0, 0, 100, 0, 0, 0);
     1830  this->widget = gtk_progress_bar_new_with_adjustment(this->adjustment);
     1831#endif /* HAVE_GTK2 */
     1832}
     1833
     1834/**
     1835   \brief Destroys a ProgressBar.
     1836*/
     1837void ProgressBar::destroy(void)
     1838{
     1839  if (this->title)
     1840    PRINTF(3)("deleting the ProgressBar: %s\n", this->title);
     1841  else
     1842    PRINTF(3)("deleting the ProgressBar.\n");
     1843
     1844  static_cast<Widget*>(this)->destroy();
     1845}
     1846
     1847/**
     1848   \brief Sets a ned Title to the ProgressBar.
     1849   \param title The now title of the ProgressBar.
     1850*/
     1851void ProgressBar::setTitle(char* title)
     1852{
     1853  if (this->title)
     1854    delete []this->title;
     1855  this->title = new char [strlen(title)+1];
     1856  strcpy(this->title, title);
     1857}
     1858
     1859/**
     1860   \brief Sets the Total size of the Bar.(ex. The maximum one can download)
     1861*/
     1862void ProgressBar::setTotalSize(double totalSize)
     1863{
     1864  this->totalSize = totalSize;
     1865}
     1866
     1867/**
     1868   \brief Sets the progress maximum is this->totalSize
     1869*/
     1870void ProgressBar::setProgress(double progress)
     1871{
     1872  this->progress = progress;
     1873
     1874  if (this->progress > this->totalSize)
     1875    this->progress = this->totalSize;
     1876
     1877#ifdef HAVE_GTK2
     1878  gtk_progress_set_value(GTK_PROGRESS(widget), this->progress*100.0/this->totalSize);
     1879#endif /* HAVE_GTK2 */
     1880  PRINTF(3)("Progress: %f\n", this->progress*100.0/this->totalSize);
     1881}
     1882
     1883/**
     1884    \brief returns the Progress Status
     1885*/
     1886double ProgressBar::getProgress(void)
     1887{
     1888  return this->progress;
     1889}
     1890
     1891/* IMAGE */
     1892
     1893/**
     1894   \brief Creates a new Image
     1895   \param imagename the location of the Image on the Hard Disc
     1896*/
     1897Image::Image(char* imagename)
     1898{
     1899  this->init();
     1900  if (this->title)
     1901    delete []this->title;
     1902  this->title = new char[strlen(imagename)+1];
     1903  strcpy(this->title, imagename);
     1904
     1905#ifdef HAVE_GTK2
     1906  widget = gtk_image_new_from_file(imagename);
     1907#endif /* HAVE_GTK2 */
     1908}
     1909
     1910/**
     1911   \brief destructs an Image.
     1912*/
     1913Image::~Image(void)
     1914{
     1915  this->destroy();
     1916}
     1917
     1918/**
     1919    \brief Initializes a new Image
     1920*/
     1921void Image::init(void)
     1922{
     1923  isOption = 0;
     1924
     1925  static_cast<Widget*>(this)->init();
     1926}
     1927
     1928/**
     1929   \brief Destroys a Image.
     1930*/
     1931void Image::destroy(void)
     1932{
     1933  if (this->title)
     1934    PRINTF(3)("deleting the Image: %s\n", this->title);
     1935  else
     1936    PRINTF(3)("deleting the Image.\n");
     1937
     1938  static_cast<Widget*>(this)->destroy();
     1939}
     1940
     1941/**
     1942   \brief Sets a ned Title to the Image.
     1943   \param title The now title of the OptionLabel.
     1944*/
     1945void Image::setTitle(char* title)
     1946{
     1947  if (this->title)
     1948    delete []this->title;
     1949  this->title = new char [strlen(title)+1];
     1950  strcpy(this->title, title);
     1951}
  • orxonox/branches/trackManager/src/gui/orxonox_gui_gtk.h

    r3187 r3430  
    33 \brief Contains all th different Widgets.
    44*/
    5 
    65#ifndef _ORXONOX_GUI_GTK_H
    76#define _ORXONOX_GUI_GTK_H
     
    109#include <config.h>
    1110#endif
     11
     12//! verbose level, soon obsolete
     13extern int verbose; // soon obsolete here
     14
     15#include "../debug.h"
    1216
    1317#ifdef HAVE_GTK2
     
    2630#include <gtk/gtkimage.h>
    2731#include <gtk/gtkeventbox.h>
    28 #endif /* HAVE_GTK2 */
    29 
    30 #ifdef HAVE_GTK2
    31 bool initGTK(int argc, char *argv[]);
    32 bool mainloopGTK(void);
    33 #endif /* HAVE_GTK2 */
    34 
     32#include <gtk/gtkprogressbar.h>
     33#endif /* HAVE_GTK2 */
     34
     35bool initGUI(int argc, char* argv[]);
     36bool mainloopGUI(void);
    3537
    3638//! This is the topmost object that can be displayed all others are derived from it.
     
    4042
    4143 public:
    42   ~Widget ();
    43 
    44   Widget* next; //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next
    45 #ifdef HAVE_GTK2
    46   GtkWidget* widget; //!< widget is the gtk_widget that the specific Object Contains.
    47 #endif /* HAVE_GTK2 */
    48   void init(void);
    49   int isOption; //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3: float option, 4:char option, 5: char* option
    50   /**
    51      \briefdefines isOption states
    52   */
     44  virtual ~Widget(void);
     45  void init(void);
     46  void destroy(void);
     47
     48  void show(void);
     49  void hide(void);
     50  void setSize(int width, int height);
     51  virtual void setTitle(char* title) = 0;  //!< An abstract Function, that sets the title of Widgets.
     52
     53  Widget* findWidgetByName(char* name, unsigned int depth);
     54  void walkThrough(void(*function)(Widget*), unsigned int depth);
     55  void walkThrough(void(*function)(Widget*, void*), void* data, unsigned int depth);
     56  static void listOptionsAndGroups(Widget* widget);
     57  static void listOptions(Widget* widget);
     58  static void listOptions(Widget* widget, void* data);
     59  Widget* findOptionByNumber(int* number, unsigned int depth);
     60  static void listGroups(Widget* widget);
     61  static void listGroups(Widget* widget, void* data);
     62  Widget* findGroupByNumber(int* number, unsigned int depth);
     63  static void setOptions(Widget* widget);
     64  static void flagCheck(Widget* widget, void* flagName);
     65 
     66#ifdef HAVE_GTK2
     67  // Connection - Functions
     68
     69  gulong connectSignal(char* event, gint(*signal)(GtkWidget*, GdkEvent*, void* ));
     70  gulong connectSignal(char* event, gint(*signal)(GtkWidget*, Widget* ));
     71  gulong connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, GdkEvent*, void* ));
     72  gulong connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, void* ));
     73  gulong connectSignal(char* event, void* extObj, gint(*signal)(GtkWidget*, GdkEventKey*, void* ));
     74  void disconnectSignal(gulong signalID);
     75
     76  // Signals
     77  static gint doNothingSignal(GtkWidget* widget, GdkEvent* event, void* nothing);
     78#endif /* HAVE_GTK2 */
     79
     80  Widget* next;                     //!< next always points to the next Widget in the list. Every Widget has a next one, or has NULL as next
     81#ifdef HAVE_GTK2
     82  GtkWidget* widget;                //!< widget is the gtk_widget that the specific Object Contains.
     83#endif /* HAVE_GTK2 */
     84  int isOption;                     //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3: float option, 4:char option, 5: char* option
     85
     86  //! defines isOption states
    5387  enum option { containerType = -2, boxType = -1, nothingType = 0, boolType = 1, intType = 2};
    54   char* label; //!< The name of the Widget. Some do display it, Options need it to save;
    55 #ifdef HAVE_GTK2
    56   gulong connectSignal (char* event, gint (*signal)(GtkWidget*, GdkEvent*, void *));
    57   gulong connectSignal (char* event, gint (*signal)(GtkWidget*, Widget *));
    58   gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEvent*, void *));
    59   gulong connectSignal (char* event, void* extObj, gint (*signal)(GtkWidget*, GdkEventKey*, void *));
    60   void disconnectSignal (gulong signalID);
    61 #endif /* HAVE_GTK2 */
    62   void show ();
    63   void hide ();
    64   void setSize(int width, int height);
    65 
    66   void walkThrough (void (*function)(Widget*));
    67   static void listOptions (Widget* widget);
    68   static void setOptions (Widget* widget);
    69  
    70 #ifdef HAVE_GTK2
    71   static gint doNothingSignal (GtkWidget *widget, GdkEvent* event, void* nothing);
    72 #endif /* HAVE_GTK2 */
     88  char* title;                      //!< The name of the Widget. Some do display it, Options need it to save;
    7389};
    7490
     
    8197
    8298  void init(void);
    83   void setGroupName (char* name);
    84   char* getGroupName (void);
     99  void destroy(void);
     100
     101  void setGroupName(char* name);
     102  char* getGroupName(void);
     103
     104  virtual void fill(Widget* lowerWidget) = 0; //!< An abstract function, that fills Packers.
    85105};
    86106
     
    94114{
    95115 private:
    96   int borderwidth;
    97   int policy;
    98  
    99  public:
    100   void init(void);
    101   //  void setBorderWidth (int borderwidth);
    102   //  virtual void setTitle (char* title) = 0;
    103   void fill (Widget *lowerWidget);
     116  int borderwidth;          //!< The width of The Container Boarder.
     117  int policy;               //!< The Update Policy of a Container.
     118 
     119 public:
     120  void init(void);
     121  void destroy(void);
     122
     123  //  void setBorderWidth(int borderwidth);
     124  //  virtual void setTitle(char* title) = 0;
     125  void fill(Widget* lowerWidget);
    104126};
    105127
     
    112134{
    113135 private:
    114   bool isOpen;                //!< A bool Variable that checks if a Window is already open.
    115  public:
    116   static Window* mainWindow;  //!< Pointer to the First Window that was opened. By default this should be the GUI's main-Window.
     136  bool isOpen;                      //!< A bool Variable that checks if a Window is already open.
     137 public:
     138  static Window* mainWindow;        //!< Pointer to the First Window that was opened. By default this should be the GUI's main-Window.
    117139  static void addWindow(Window* windowToAdd);
    118140
    119   Window (void);
    120   Window (char* windowName);
    121   void init ();
    122  
    123   void setTitle (char* title);
    124   void showall ();
    125   void open();
    126   void close();
    127 
    128 #ifdef HAVE_GTK2
    129   static gint windowOpen (GtkWidget *widget, GdkEvent* event, void* window);
    130   static gint windowClose (GtkWidget *widget, GdkEvent* event, void* window);
    131   static gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
     141  Window(void);
     142  Window(char* windowName);
     143  ~Window(void);
     144  void init(void);
     145  void destroy(void);
     146 
     147  void setTitle(char* title);
     148  void showall(void);
     149  void open(void);
     150  void close(void);
     151
     152#ifdef HAVE_GTK2
     153  // Signals
     154  static gint windowOpen(GtkWidget* widget, GdkEvent* event, void* window);
     155  static gint windowClose(GtkWidget* widget, GdkEvent* event, void* window);
    132156#endif /* HAVE_GTK2 */
    133157};
     
    141165{
    142166 public:
    143   Frame (char* frameName);
    144   Frame (void);
    145   void init(void);
    146  
    147   void setTitle (char* title);
     167  Frame(void);
     168  Frame(char* frameName);
     169  ~Frame(void);
     170  void init(void);
     171  void destroy(void);
     172 
     173  void setTitle(char* title);
    148174};
    149175
     
    155181{
    156182 public:
    157   EventBox (char* eventBoxName);
    158   EventBox (void);
    159   void init(void);
    160  
    161   void setTitle (char* title);
     183  EventBox(void);
     184  EventBox(char* eventBoxName);
     185  ~EventBox(void);
     186  void init(void);
     187  void destroy(void);
     188 
     189  void setTitle(char* title);
    162190};
    163191
     
    166194   A Box can Contain multiple Widgets, that are ordered either horizontally or vertically
    167195   I defined the standartbox to be horizontally.
    168    A Box is always filled left->right (horizontally) or up->down (vertically)
     196   A Box is always filled left->right(horizontally) or up->down(vertically)
    169197*/
    170198class Box : public Packer
    171199{
    172200 public:
    173   Box (void);
    174   Box (char boxtype);
     201  Box(void);
     202  Box(char boxtype);
     203  ~Box(void);
    175204  void init(char boxtype);
    176 
    177   void fill (Widget* lowerWidget);
    178 
     205  void destroy(void);
     206 
     207  void fill(Widget* lowerWidget);
     208
     209  void setTitle(char* title);
     210};
     211
     212//! An Option is a Widget that contains something that may change its state.
     213/**
     214 * Options are the essence of a GUI, they: Configure, Start, Quit, Execute, and make it worth something
     215 */
     216class Option : public Widget
     217{
     218 protected:
     219  bool saveable;  //!< Options can be Saved.
     220 
     221 public:
     222  void init(void);
     223  void destroy(void);
     224
     225  int value; //!< every option has a value either true or false(0,1) or something else like 25 for 25% of the volume
     226  char* flagName; //!< options have a flag name that will be appendet if you start the Program from the GUI.
     227  char* flagNameShort; //!< like flag_name but shorter
     228  int defaultValue; //!< A default value is good, for hiding a option if it is not needed.(hidden if value == default_value)
     229
     230  void saveability(void);
     231  void saveability(bool isSaveable);
     232  bool isSaveable(void);
     233  void setFlagName(char* flagname, int defaultvalue);
     234  void setFlagName(char* flagname, char* flagnameshort, int defaultvalue);
     235  virtual void redraw(void) = 0; //!< A Option must be able to redraw itself.
     236  virtual void changeOption(void) = 0; //!< What to do, if an Option is Changed. eacht option decides for itself.
     237#ifdef HAVE_GTK2
     238    // Signals 
     239  static gint OptionChange(GtkWidget* widget, Widget* option); //!< Signal for Options that change.
     240#endif /* HAVE_GTK2 */
     241};
     242
     243//! Buttons can be pressed, and released.
     244/**
     245 * Buttons are mainly there for executing some action like Starting the Programm, or Quiting it.
     246 */
     247class Button : public Option
     248{
     249 public:
     250  Button(char* buttonname);
     251  ~Button(void);
     252  void init(void);
     253  void destroy(void);
     254
     255  void setTitle(char* title);
     256  void redraw(void);
     257  void changeOption(void);
     258};
     259
     260//! CheckButtons are a key in configuring bool Variables
     261/** CheckButtons can configure bool Variables like wireframe on/off, enable_sound etc.
     262 */
     263class CheckButton : public Option
     264{
     265 public:
     266  CheckButton(char* buttonname);
     267  ~CheckButton(void);
     268  void init(void);
     269  void destroy(void);
     270
     271  void setTitle(char* title);
     272  bool isActive(void);           //!< a Bool value to see, if this CheckButton is active.
     273  void redraw(void);
     274  void changeOption(void);
     275};
     276
     277//! Sliders are Options that can be modified in their value
     278/**
     279 * good for volume, brightness, etc.
     280 */
     281class Slider : public Option
     282{
     283 private:
     284  int start;                            //!< The beginning of the Slider-range.
     285  int end;                              //!< The end of the Slider-range.
     286 public:
     287  Slider(char* slidername, int start, int end);
     288  ~Slider(void);
     289  void init(int start, int end);
     290  void destroy(void);
     291
     292  void setTitle(char* title);
     293  void setValue(int value);
     294  void redraw(void);
     295  void changeOption(void);
     296};
     297
     298//! A Menu is an Option that has a dropdown menu, where you can chose between different Items
     299class Menu : public Option
     300{
     301 private:
     302#ifdef HAVE_GTK2
     303  GtkWidget* menu;                      //!< The menu That will hold the Options.
     304  GtkWidget* item;                      //!< One Item From a Menu.
     305#endif /* HAVE_GTK2 */
     306  va_list itemlist;                     //!< The list to readin multiple Options.
     307 
     308 public:
     309  Menu(char* menuname, ...);
     310  ~Menu(void);
     311  void init(void);
     312  void destroy(void);
     313 
     314  void setTitle(char* title);
     315  void addItem(char* itemName);
     316  void redraw(void);
     317  void changeOption(void);
     318};
     319
     320//! A OptionLabel is a simple Label, that holds a char*, and will be updated, if changed.
     321class OptionLabel : public Option
     322{
     323 private:
     324
     325 public:
     326  OptionLabel(char* label, char* value);
     327  ~OptionLabel(void);
     328  void init(void);
     329  void destroy(void);
     330 
     331 
     332  void setValue(char* newValue);
     333  void setTitle(char* title);
     334  void redraw(void);
     335  void changeOption(void);
     336
     337  char* cValue;                          //!< The Value the Label will have. \todo make private
     338
     339};
     340
     341//! A label is a Widget, that displays a text
     342class Label : public Widget
     343{
     344 public:
     345  Label(void);
     346  Label(char* text);
     347  ~Label(void);
     348  void init(void);
     349  void destroy(void);
     350 
     351  void setTitle(char* text);
     352  void ereaseText(void);
     353  void appendText(char* textToAppend);
     354  void appendInt(int intToAppend);
     355  char* getText(void);
     356};
     357
     358//! A ProgressBar is a Widget, that can display a Progress
     359class ProgressBar : public Widget
     360{
     361 public:
     362  ProgressBar(void);
     363  ProgressBar(char* label);
     364  ~ProgressBar(void);
     365  void init(void);
     366  void destroy(void);
     367
     368  void setTitle(char* title);
     369  void setProgress(double progress);
     370  void setTotalSize(double totalSize);
     371  double getProgress(void);
     372
     373 private:
     374  double totalSize;         //!< The total Size of a download Bar
     375  double progress;          //!< The progress of a Bar.
     376#ifdef HAVE_GTK2
     377  GtkAdjustment* adjustment;
     378#endif /* HAVE_GTK2 */
    179379};
    180380
     
    187387{
    188388 public:
    189   Image (char* imgaename);
    190   void init(void);
    191 };
    192 
    193 //! An Option is a Widget that contains something that may change its state.
    194 /**
    195  * Options are the essence of a GUI, they: Configure, Start, Quit, Execute, and make it worth something
    196  */
    197 class Option : public Widget
    198 {
    199  public:
    200   //virtual gint OptionChange (GtkWidget *widget, GdkEvent *event, gpointer data);
    201   void init(void);
    202 
    203   int value; //!< every option has a value either true or false (0,1) or something else like 25 for 25% of the volume
    204   char* flagName; //!< options have a flag name that will be appendet if you start the Program from the GUI.
    205   char* flagNameShort; //!< like flag_name but shorter
    206   int defaultValue; //!< A default value is good, for hiding a option if it is not needed. (hidden if value == default_value)
    207   bool saveable;  //!< Options can be Saved.
    208 
    209   void setFlagName (char* flagname, int defaultvalue);
    210   void setFlagName (char* flagname, char* flagnameshort, int defaultvalue);
    211   virtual void redraw () = 0; //!< A Option must be able to redraw itself.
    212 };
    213 
    214 //! Buttons can be pressed, and released.
    215 /**
    216  * Buttons are mainly there for executing some action like Starting the Programm, or Quiting it.
    217  */
    218 class Button : public Option
    219 {
    220  public:
    221   Button (char* buttonname);
    222   void init(void);
    223 
    224   void setTitle(char* title);
    225  
    226   void redraw();
    227 };
    228 
    229 //! CheckButtons are a key in configuring bool Variables
    230 /** CheckButtons can configure bool Variables like wireframe on/off, enable_sound etc.
    231  */
    232 class CheckButton : public Option
    233 {
    234  public:
    235   CheckButton (char* buttonname);
    236 #ifdef HAVE_GTK2
    237   static gint OptionChange (GtkWidget* widget, Widget* checkbutton);
    238 #endif /* HAVE_GTK2 */
    239  
    240   void init(void);
    241   void setTitle(char* title);
    242 
    243   bool isActive();
    244   void redraw ();
    245 };
    246 
    247 //! Sliders are Options that can be modified in their value
    248 /**
    249  * good for volume, brightness, etc.
    250  */
    251 class Slider : public Option
    252 {
    253  public:
    254   Slider (char* slidername,int start, int end);
    255   void init(int start, int end);
    256 
    257   void setTitle(char* title);
    258   void setValue(int value);
    259 
    260 #ifdef HAVE_GTK2
    261   static gint OptionChange (GtkWidget* widget, Widget* slider);
    262 #endif /* HAVE_GTK2 */
    263   void redraw();
    264 };
    265 
    266 //! A Menu is an Option that has a dropdown menu, where you can chose between different Items
    267 class Menu : public Option
    268 {
    269  private:
    270 #ifdef HAVE_GTK2
    271   GtkWidget* menu;     //!< The menu That will hold the Options.
    272   GtkWidget* item;     //!< One Item From a Menu.
    273 #endif /* HAVE_GTK2 */
    274   va_list itemlist;    //!> The list to readin multiple Options.
    275  
    276  public:
    277   Menu (char* menuname, ...);
    278   void init(void);
    279 
    280   void setTitle(char* title);
    281 
    282   void addItem(char* itemName);
    283 #ifdef HAVE_GTK2
    284   static gint OptionChange (GtkWidget* widget, Widget* menu);
    285 #endif /* HAVE_GTK2 */
    286   void redraw();
    287 };
    288 
    289 //! A CharLabel is a simple Label, that holds a char*, and will be updated, if changed.
    290 class OptionLabel : public Option
    291 {
    292  public:
    293   OptionLabel(char* label, char* value);
    294   void init(void);
    295  
    296   char* cValue;   //!< The Value the Label will have.
    297  
    298   void setValue(char* newValue);
    299   void setTitle(char* title);
    300   void redraw();
    301 };
    302 
    303 //! A label is a Widget, that displays a text
    304 class Label : public Widget
    305 {
    306  public:
    307   Label ();
    308   Label (char* text);
    309   void init(void);
    310  
    311   void setText (char* text);
    312   char* getText ();
    313 };
    314 
    315 
    316 //gint orxonox_gui_quit (GtkWidget *widget, GdkEvent *event, gpointer data);
     389  Image(char* imgaename);
     390  ~Image(void);
     391  void init(void);
     392  void destroy(void);
     393
     394  void setTitle(char* title);
     395};
     396
     397//gint orxonox_gui_quit(GtkWidget* widget, GdkEvent* event, gpointer data);
    317398
    318399#endif /* _ORXONOX_GUI_GTK_H */
  • orxonox/branches/trackManager/src/gui/orxonox_gui_keys.cc

    r3187 r3430  
    2929   \brief Creates an Keyboard-Frame
    3030*/
    31 OrxonoxGuiKeys::OrxonoxGuiKeys ()
    32 {
    33   keysFrame = new Frame ("Keyboard-Options:");
     31OrxonoxGuiKeys::OrxonoxGuiKeys(void)
     32{
     33  this->keysFrame = new Frame("Keyboard-Options:");
    3434  //  keysFrame->setGroupName("Keyboard");
    35   keysBox = new Box ('h');
    36   player1 = new Player("player1");
    37   player2 = new Player("player2");
    38 
    39   keysBox->fill(player1->getOpenButton());
    40   keysBox->fill(player2->getOpenButton());
    41 
    42   keysFrame->fill (keysBox);
     35  this->keysBox = new Box('h');
     36  this->player1 = new Player("player1");
     37  this->player2 = new Player("player2");
     38
     39  this->keysBox->fill(this->player1->getOpenButton());
     40  this->keysBox->fill(this->player2->getOpenButton());
     41
     42  this->keysFrame->fill(this->keysBox);
     43}
     44
     45/**
     46   \brief Destructs the Keys-stuff
     47*/
     48OrxonoxGuiKeys::~OrxonoxGuiKeys(void)
     49{
     50  // nothing to do here.
    4351}
    4452
     
    4755   \return Returns the Audio-frame
    4856*/
    49 Widget* OrxonoxGuiKeys::getWidget ()
    50 {
    51   return keysFrame;
     57Widget* OrxonoxGuiKeys::getWidget(void)
     58{
     59  return this->keysFrame;
    5260}
    5361
     
    6068Player::Player(char* player)
    6169{
    62   char windowName[100] = "Keyboard settings of ";
    63   strcat (windowName, player);
    64   pKeyWindow = new Window(windowName);
    65   pKeyFrame = new Frame (windowName);
    66    pKeysBox = new Box('v');
    67    pKeysBox->setGroupName (player);
    68     pKeysBox->fill(addKey(UP, "up"));
    69     pKeysBox->fill(addKey(DOWN, "down"));
    70     pKeysBox->fill(addKey(LEFT, "left"));
    71     pKeysBox->fill(addKey(RIGHT, "right"));
    72     pKeysBox->fill(addKey(SHOOT, "shoot"));
    73    
     70  char* windowName = new char[strlen(player)+25];
     71  strcpy(windowName, "Keyboard settings of ");
     72  strcat(windowName, player);
     73  this->pKeyWindow = new Window(windowName);
     74  this->pKeyFrame = new Frame(windowName);
     75   this->pKeysBox = new Box('v');
     76   this->pKeysBox->setGroupName(player);
     77    this->pKeysBox->fill(addKey(UP, "up"));
     78    this->pKeysBox->fill(addKey(DOWN, "down"));
     79    this->pKeysBox->fill(addKey(LEFT, "left"));
     80    this->pKeysBox->fill(addKey(RIGHT, "right"));
     81    this->pKeysBox->fill(addKey(SHOOT, "shoot"));
     82    delete windowName;
    7483    closeButton = new Button("close");
    7584#ifdef HAVE_GTK2
    76     closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose);
    77 #endif /* HAVE_GTK2 */
    78 
    79     pKeysBox->fill(closeButton);
    80     pKeyFrame->fill(pKeysBox);
    81    pKeyWindow->fill(pKeyFrame);
    82    Window::addWindow(pKeyWindow);
    83 #ifdef HAVE_GTK2
    84    pKeyWindow->connectSignal("destroy", pKeyWindow, Window::windowClose);
    85    pKeyWindow->connectSignal("delete_event", pKeyWindow, Window::windowClose);
    86 #endif /* HAVE_GTK2 */
    87 
    88   openButton = new Button (player);
    89 #ifdef HAVE_GTK2
    90   openButton->connectSignal("button_press_event", pKeyWindow, Window::windowOpen);
    91 #endif /* HAVE_GTK2 */
    92 
    93   inputWindow = new Window("inputWindow");
    94 
    95   inputButton = new Button ("test");
    96   inputWindow->fill (inputButton);
    97 #ifdef HAVE_GTK2
    98   inputWindow->connectSignal("destroy",  Widget::doNothingSignal);
    99   inputWindow->connectSignal("delete_event", Widget::doNothingSignal);
     85    this->closeButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowClose);
     86#endif /* HAVE_GTK2 */
     87
     88    this->pKeysBox->fill(this->closeButton);
     89    this->pKeyFrame->fill(this->pKeysBox);
     90   this->pKeyWindow->fill(this->pKeyFrame);
     91   Window::addWindow(this->pKeyWindow);
     92#ifdef HAVE_GTK2
     93   this->pKeyWindow->connectSignal("destroy", this->pKeyWindow, Window::windowClose);
     94   this->pKeyWindow->connectSignal("delete_event", this->pKeyWindow, Window::windowClose);
     95#endif /* HAVE_GTK2 */
     96
     97  this->openButton = new Button(player);
     98#ifdef HAVE_GTK2
     99  this->openButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowOpen);
     100#endif /* HAVE_GTK2 */
     101
     102  this->inputWindow = new Window("inputWindow");
     103
     104  this->inputButton = new Button("test");
     105  this->inputWindow->fill(inputButton);
     106#ifdef HAVE_GTK2
     107  this->inputWindow->connectSignal("destroy",  Widget::doNothingSignal);
     108  this->inputWindow->connectSignal("delete_event", Widget::doNothingSignal);
    100109#endif /* HAVE_GTK2 */
    101110
     
    108117   \returns A widget that has the Key-Box
    109118*/
    110 Widget* Player::addKey (KEYS key, char* name)
    111 {
    112   inputKey[key] = new InputKey;
    113   inputKey[key]->pKeyBox = new Box();
    114   inputKey[key]->pKeyButton = new Button(name);
    115   inputKey[key]->pKeyOLabel = new OptionLabel (name, name);
    116   inputKey[key]->pKeyOLabel->saveable = true;
     119Widget* Player::addKey(KEYS key, char* name)
     120{
     121  this->inputKey[key] = new InputKey;
     122  this->inputKey[key]->pKeyBox = new Box();
     123  this->inputKey[key]->pKeyButton = new Button(name);
     124  this->inputKey[key]->pKeyOLabel = new OptionLabel(name, name);
     125  this->inputKey[key]->pKeyOLabel->saveability();
    117126
    118127#ifdef HAVE_GTK2
    119128  //inputKey[key]->pKeyButton->connectSignal("key_press_event", inputKey[key]->pKeyButton, key_cb);
    120   inputKey[key]->pKeyButton->connectSignal("button_press_event", inputKey[key], inputWindowEvent);
    121 #endif /* HAVE_GTK2 */
    122   inputKey[key]->pKeyBox->fill(inputKey[key]->pKeyButton);
    123   inputKey[key]->pKeyBox->fill(inputKey[key]->pKeyOLabel);
    124   return inputKey[key]->pKeyBox;
     129  this->inputKey[key]->pKeyButton->connectSignal("button_press_event", this->inputKey[key], inputWindowEvent);
     130#endif /* HAVE_GTK2 */
     131  this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyButton);
     132  this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyOLabel);
     133  return this->inputKey[key]->pKeyBox;
    125134}
    126135
     
    128137   \returns the OpenButton of a Player
    129138*/
    130 Button* Player::getOpenButton()
    131 {
    132   return openButton;
    133 }
    134 
    135 /**
    136    \brief sets a new Key (only output)
     139Button* Player::getOpenButton(void)
     140{
     141  return this->openButton;
     142}
     143
     144/**
     145   \brief sets a new Key(only output)
    137146   \param key the new Key.
    138147*/
     
    163172gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey)
    164173{
    165   InputKey* inputkey = (InputKey*) inputKey;
     174  InputKey* inputkey =(InputKey*) inputKey;
    166175  char title [20];
    167176
     
    256265      char* tmp;
    257266      sprintf(tmp, "%c", event->keyval);
    258       printf ("other key %s \n", tmp);
     267      printf("other key %s \n", tmp);
    259268      strcpy(title, tmp);
    260269      break;
    261270    }
    262271
    263   inputkey->pKeyOLabel->setValue (title);
     272  inputkey->pKeyOLabel->setValue(title);
    264273  inputButton->disconnectSignal(keySignal);
    265274  inputWindow->close();
  • orxonox/branches/trackManager/src/gui/orxonox_gui_keys.h

    r3187 r3430  
    1515   \brief defines the Possible Player Keys
    1616*/
    17 enum KEYS { UP, DOWN, LEFT, RIGHT, SHOOT };
     17enum KEYS {UP, DOWN, LEFT, RIGHT, SHOOT};
    1818
    1919class Player;
     
    2929
    3030 public:
    31   OrxonoxGuiKeys ();
    32   ~OrxonoxGuiKeys ();
     31  OrxonoxGuiKeys(void);
     32  ~OrxonoxGuiKeys(void);
    3333 
    34   Widget* getWidget ();
     34  Widget* getWidget(void);
    3535};
    3636
     
    6464  Player(char* player);
    6565
    66   Widget* addKey (KEYS key, char* name);
     66  Widget* addKey(KEYS key, char* name);
    6767
    68   Button* getOpenButton();
     68  Button* getOpenButton(void);
    6969
    7070#ifdef HAVE_GTK2
  • orxonox/branches/trackManager/src/gui/orxonox_gui_video.cc

    r3187 r3430  
    3030   \brief Creates the Video-Option-Frame
    3131*/
    32 OrxonoxGuiVideo::OrxonoxGuiVideo ()
     32OrxonoxGuiVideo::OrxonoxGuiVideo(void)
    3333{
    34   videoFrame = new Frame ("Video-Options:");
    35   videoBox = new Box ('v');
    36   videoFrame->setGroupName("video");
     34  this->videoFrame = new Frame("Video-Options:");
     35  this->videoBox = new Box('v');
     36  this->videoFrame->setGroupName("video");
    3737 
    38   fullscreen = new CheckButton ("Fullscreen-mode");
    39   fullscreen->setFlagName ("windowed", "q", 1);
    40   fullscreen->saveable = true;
    41   videoBox->fill (fullscreen);
    42   wireframe = new CheckButton ("WireFrame-mode");
    43   wireframe->setFlagName ("wireframe", "w", 0);
    44   wireframe->saveable = true;
    45   videoBox->fill (wireframe);
     38  this->fullscreen = new CheckButton("Fullscreen-mode");
     39  this->fullscreen->setFlagName("windowed", "q", 1);
     40  this->fullscreen->saveability();
     41  this->videoBox->fill(fullscreen);
     42  this->wireframe = new CheckButton("WireFrame-mode");
     43  this->wireframe->setFlagName("wireframe", "w", 0);
     44  this->wireframe->saveability();
     45  this->videoBox->fill(wireframe);
    4646
    47   videoFrame->fill (videoBox);
     47  this->advancedWindowCreate();
     48  this->videoBox->fill(this->advancedWindowGetButton());
     49
     50  this->videoFrame->fill(videoBox);
     51}
     52
     53/**
     54   \brief Destructs the Video-stuff
     55*/
     56OrxonoxGuiVideo::~OrxonoxGuiVideo(void)
     57{
     58  // nothing to do here.
    4859}
    4960
     
    5162   \return Returns the Video-frame
    5263*/
    53 Widget* OrxonoxGuiVideo::getWidget ()
     64Widget* OrxonoxGuiVideo::getWidget(void)
    5465{
    55   return videoFrame;
     66  return this->videoFrame;
    5667}
     68
     69
     70/**
     71   \brief Creates a window, and all it contains for the Source-update.
     72*/
     73void OrxonoxGuiVideo::advancedWindowCreate(void)
     74{
     75  // the button, that opens this Window.
     76  this->advancedButton = new Button("advanced");
     77
     78  // the Window itself
     79  this->advancedWindow = new Window("Advanced Video Options");
     80  this->advancedWindow->setGroupName("advancedVideoOptions");
     81
     82  this->advancedBox = new Box('v');
     83
     84  // Advanced Performance Options
     85  this->shadows = new CheckButton("Shadows");
     86  this->shadows->saveability();
     87  this->advancedBox->fill(this->shadows);
     88
     89  this->fog = new CheckButton("Fog");
     90  this->fog->saveability();
     91  this->advancedBox->fill(this->fog);
     92
     93  this->reflections = new CheckButton("Reflections");
     94  this->reflections->saveability();
     95  this->advancedBox->fill(this->reflections);
     96
     97  this->textures = new CheckButton("Textures");
     98  this->textures->saveability();
     99  this->advancedBox->fill(this->textures);
     100
     101  this->textureDetail = new Menu("Texture Detail", "low", "medium", "high", "lastItem");
     102  this->textureDetail->saveability();
     103  this->advancedBox->fill(this->textureDetail);
     104
     105  this->modelDetailLabel = new Label("Model Detail");
     106  this->advancedBox->fill(this->modelDetailLabel);
     107  this->modelDetail = new Menu("Model Detail", "low", "medium", "high", "lastItem");
     108  this->modelDetail->saveability();
     109  this->advancedBox->fill(this->modelDetail);
     110
     111  this->antiAliasingLabel = new Label("Anti-Aliasing-depth:");
     112  this->advancedBox->fill(this->antiAliasingLabel);
     113  this->antiAliasing = new Menu("Anti Aliasing", "0", "1", "2", "4", "8",  "lastItem");
     114  this->antiAliasing->saveability();
     115  this->advancedBox->fill(this->antiAliasing);
     116
     117  this->filterMethodLabel = new Label("Filtering Method:");
     118  this->advancedBox->fill(this->filterMethodLabel);
     119  this->filterMethod = new Menu("Filtering Method", "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem");
     120  this->filterMethod->saveability();
     121  this->advancedBox->fill(this->filterMethod);
     122 
     123  this->closeButton = new Button("close");
     124  this->advancedBox->fill(this->closeButton);
     125
     126  this->advancedWindow->fill(advancedBox);
     127#ifdef HAVE_GTK2
     128  this->advancedButton->connectSignal("button_press_event", this->advancedWindow, Window::windowOpen);
     129  this->closeButton->connectSignal("button_press_event", this->advancedWindow, Window::windowClose);
     130  this->advancedWindow->connectSignal("destroy", this->advancedWindow, Window::windowClose);
     131  this->advancedWindow->connectSignal("delete_event", this->advancedWindow, Window::windowClose);
     132#endif /* HAVE_GTK2 */
     133   Window::addWindow(this->advancedWindow);
     134
     135}
     136
     137/**
     138   \returns A Pointer to the Button of the UpdaterSourceWindow
     139*/
     140Button* OrxonoxGuiVideo::advancedWindowGetButton(void)
     141{
     142  return this->advancedButton;
     143}
     144
  • orxonox/branches/trackManager/src/gui/orxonox_gui_video.h

    r3187 r3430  
    1616  CheckButton* fullscreen;  //!< CheckButton for fullscreen-mode
    1717  CheckButton* wireframe;   //!< CheckButton for wireframe Mode.
     18
     19  // advanced-Performance-Options
     20  Window* advancedWindow;   //!< A Window to display advanced options.
     21  Button* advancedButton;   //!< A Button to open the Advanced Video Performance Window.
     22  Box* advancedBox;         //!< A Box to pack the options into.
     23  CheckButton* shadows;     //!< CheckButton for shadows
     24  CheckButton* fog;         //!< CheckButton for fog.
     25  CheckButton* reflections; //!< CheckButton for reflections
     26  CheckButton* textures;    //!< CheckButton for textures
     27  Menu* textureDetail;      //!< Menu for the Texture-Detail.
     28 
     29  Label* modelDetailLabel;  //!< Label for model-detail.
     30  Menu* modelDetail;        //!< model-detail.
     31 
     32  Label* antiAliasingLabel; //!< Label for the anti-aliasing mode.
     33  Menu* antiAliasing;       //!< Menu for the Antialiasing-mode.
     34
     35  Label* filterMethodLabel; //!< Label for filtering-Method.
     36  Menu* filterMethod;       //!< Menu for filtering Method.
     37
     38  Button* closeButton;      //!< A Button to close the Advanced-settingsWindow.
     39
     40  Button* advancedWindowGetButton(void);
     41  void advancedWindowCreate(void);
     42 
    1843 public:
    19   OrxonoxGuiVideo ();
    20   ~OrxonoxGuiVideo ();
     44  OrxonoxGuiVideo(void);
     45  ~OrxonoxGuiVideo(void);
    2146 
    22   Widget* getWidget ();
     47  Widget* getWidget(void);
    2348};
    2449#endif /* _ORXONOX_GUI_VIDEO_H */
  • orxonox/branches/trackManager/src/gui/rc

    r2595 r3430  
    120120# just listed in this document for the users reference.
    121121
    122 widget_class "GtkWindow" style "window"
    123 widget_class "GtkFrame" style "window"
    124 widget_class "Gtk*EventBox" style "window"
    125 widget_class "GtkDialog" style "window"
    126 widget_class "GtkFileSelection" style "window"
    127 widget_class "*Gtk*Scale" style "scale"
    128 widget_class "*GtkCheckButton*" style "toggle_button"
    129 widget_class "*Gtk*Menu*" style "toggle_button"
    130 widget_class "*GtkRadioButton*" style "toggle_button"
    131 widget_class "*GtkButton*" style "button"
    132 widget_class "*Ruler" style "ruler"
    133 widget_class "*GtkText" style "text"
    134 widget_class "*GtkLabel" style "text"
     122widget_class "GtkWindow"           style "window"
     123widget_class "GtkFrame"            style "window"
     124widget_class "Gtk*EventBox"        style "window"
     125widget_class "GtkDialog"           style "window"
     126widget_class "GtkFileSelection"    style "window"
     127widget_class "*Gtk*Scale"          style "scale"
     128widget_class "*GtkCheckButton*"    style "toggle_button"
     129widget_class "*Gtk*Menu*"          style "toggle_button"
     130widget_class "*GtkRadioButton*"    style "toggle_button"
     131widget_class "*GtkButton*"         style "button"
     132widget_class "*Ruler"              style "ruler"
     133widget_class "*GtkText"            style "text"
     134widget_class "*GtkLabel"           style "text"
    135135
    136136
  • orxonox/branches/trackManager/src/importer/Makefile.am

    r3369 r3430  
    99                  windowHandler.cc \
    1010                  model.cc \
     11                  objModel.cc \
    1112                  array.cc \
    1213                  material.cc \
    1314                  texture.cc \
    14                   vector.cc
     15                  ../vector.cc
    1516
    1617noinst_HEADERS= framework.h \
    1718                windowHandler.h \
    1819                model.h \
     20                objModel.h \
    1921                array.h \
    2022                material.h \
  • orxonox/branches/trackManager/src/importer/Makefile.in

    r3369 r3430  
    5454PROGRAMS = $(bin_PROGRAMS)
    5555am_importer_OBJECTS = framework.$(OBJEXT) windowHandler.$(OBJEXT) \
    56         model.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT) \
    57         texture.$(OBJEXT) vector.$(OBJEXT)
     56        model.$(OBJEXT) objModel.$(OBJEXT) array.$(OBJEXT) \
     57        material.$(OBJEXT) texture.$(OBJEXT) vector.$(OBJEXT)
    5858importer_OBJECTS = $(am_importer_OBJECTS)
    5959importer_LDADD = $(LDADD)
     
    6363@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po ./$(DEPDIR)/framework.Po \
    6464@AMDEP_TRUE@    ./$(DEPDIR)/material.Po ./$(DEPDIR)/model.Po \
    65 @AMDEP_TRUE@    ./$(DEPDIR)/texture.Po ./$(DEPDIR)/vector.Po \
    66 @AMDEP_TRUE@    ./$(DEPDIR)/windowHandler.Po
     65@AMDEP_TRUE@    ./$(DEPDIR)/objModel.Po ./$(DEPDIR)/texture.Po \
     66@AMDEP_TRUE@    ./$(DEPDIR)/vector.Po ./$(DEPDIR)/windowHandler.Po
    6767CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    6868        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    8989CPP = @CPP@
    9090CPPFLAGS = @CPPFLAGS@
     91CURL_CFLAGS = @CURL_CFLAGS@
     92CURL_LIBS = @CURL_LIBS@
    9193CXX = @CXX@
    9294CXXDEPMODE = @CXXDEPMODE@
     
    104106EGREP = @EGREP@
    105107EXEEXT = @EXEEXT@
     108GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
     109GTHREAD_LIBS = @GTHREAD_LIBS@
    106110GTK2_CFLAGS = @GTK2_CFLAGS@
    107111GTK2_LIBS = @GTK2_LIBS@
     112HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
     113HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
     114HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
     115HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    108116HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    109117HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
     
    129137SHELL = @SHELL@
    130138STRIP = @STRIP@
     139SUB_PROJECTS_FALSE = @SUB_PROJECTS_FALSE@
     140SUB_PROJECTS_TRUE = @SUB_PROJECTS_TRUE@
    131141VERSION = @VERSION@
    132142ac_ct_CC = @ac_ct_CC@
     
    178188                  windowHandler.cc \
    179189                  model.cc \
     190                  objModel.cc \
    180191                  array.cc \
    181192                  material.cc \
    182193                  texture.cc \
    183                   vector.cc
     194                  ../vector.cc
    184195
    185196noinst_HEADERS = framework.h \
    186197                windowHandler.h \
    187198                model.h \
     199                objModel.h \
    188200                array.h \
    189201                material.h \
     
    260272@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
    261273@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
     274@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@
    262275@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
    263276@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
     
    279292@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    280293@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     294
     295vector.o: ../vector.cc
     296@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vector.o -MD -MP -MF "$(DEPDIR)/vector.Tpo" -c -o vector.o `test -f '../vector.cc' || echo '$(srcdir)/'`../vector.cc; \
     297@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/vector.Tpo" "$(DEPDIR)/vector.Po"; else rm -f "$(DEPDIR)/vector.Tpo"; exit 1; fi
     298@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='../vector.cc' object='vector.o' libtool=no @AMDEPBACKSLASH@
     299@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/vector.Po' tmpdepfile='$(DEPDIR)/vector.TPo' @AMDEPBACKSLASH@
     300@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     301@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.o `test -f '../vector.cc' || echo '$(srcdir)/'`../vector.cc
     302
     303vector.obj: ../vector.cc
     304@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vector.obj -MD -MP -MF "$(DEPDIR)/vector.Tpo" -c -o vector.obj `if test -f '../vector.cc'; then $(CYGPATH_W) '../vector.cc'; else $(CYGPATH_W) '$(srcdir)/../vector.cc'; fi`; \
     305@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/vector.Tpo" "$(DEPDIR)/vector.Po"; else rm -f "$(DEPDIR)/vector.Tpo"; exit 1; fi
     306@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='../vector.cc' object='vector.obj' libtool=no @AMDEPBACKSLASH@
     307@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/vector.Po' tmpdepfile='$(DEPDIR)/vector.TPo' @AMDEPBACKSLASH@
     308@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     309@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.obj `if test -f '../vector.cc'; then $(CYGPATH_W) '../vector.cc'; else $(CYGPATH_W) '$(srcdir)/../vector.cc'; fi`
    281310uninstall-info-am:
    282311
  • orxonox/branches/trackManager/src/importer/array.h

    r3196 r3430  
    1212
    1313#include "../stdincl.h"
    14 #include <fstream>
    15 
    1614
    1715//! Array Class that handles dynamic-float arrays.
  • orxonox/branches/trackManager/src/importer/framework.cc

    r3369 r3430  
    1616#include "framework.h"
    1717
     18#include "../vector.h"
     19
     20int verbose;
    1821void DrawGLScene()
    1922{
     
    5255int main(int argc, char *argv[])
    5356{
    54   verbose = 2;
    55 
    56   PRINTF(2)("This is The big verbose-Test %i, %s\n", 1, "cool");
     57  verbose = 3;
    5758
    5859  Uint8* keys; // This variable will be used in the keyboard routine
     
    7172  PRINTF(2)("screensize: %i, %i\n", wHandler.screen->w, wHandler.screen->h);
    7273  if (argc>=3)
    73     obj = new Model (argv[1], atof(argv[2]));
     74    obj = new OBJModel (argv[1], atof(argv[2]));
    7475  else if (argc>=2)
    75     obj = new Model(argv[1]);
     76    obj = new OBJModel(argv[1]);
    7677  else
    77     obj = new Model();
    78  
     78    {
     79      // This is an example, of how it is possible, to create a new Model, and adding some vertex-information.
     80      // This also packs everything into a DisplayList, and can be handled exactly as any other model.
     81      // This is an example of a cube with Texture-Coordinates, but without explicite Vertex-Normals. (they are soft-created).
     82      /*
     83      obj = (OBJModel*) new Model();
     84      obj->setName("CUBE");
     85      obj->addVertex (-0.5, -0.5, 0.5);
     86      obj->addVertex (0.5, -0.5, 0.5);
     87      obj->addVertex (-0.5, 0.5, 0.5);
     88      obj->addVertex (0.5, 0.5, 0.5);
     89      obj->addVertex (-0.5, 0.5, -0.5);
     90      obj->addVertex (0.5, 0.5, -0.5);
     91      obj->addVertex (-0.5, -0.5, -0.5);
     92      obj->addVertex (0.5, -0.5, -0.5);
     93     
     94      obj->addVertexTexture (0.0, 0.0);
     95      obj->addVertexTexture (1.0, 0.0);
     96      obj->addVertexTexture (0.0, 1.0);
     97      obj->addVertexTexture (1.0, 1.0);
     98      obj->addVertexTexture (0.0, 2.0);
     99      obj->addVertexTexture (1.0, 2.0);
     100      obj->addVertexTexture (0.0, 3.0);
     101      obj->addVertexTexture (1.0, 3.0);
     102      obj->addVertexTexture (0.0, 4.0);
     103      obj->addVertexTexture (1.0, 4.0);
     104      obj->addVertexTexture (2.0, 0.0);
     105      obj->addVertexTexture (2.0, 1.0);
     106      obj->addVertexTexture (-1.0, 0.0);
     107      obj->addVertexTexture (-1.0, 1.0);
     108
     109      obj->addFace ("1 2 4 3");
     110      obj->addFace ("3 4 6 5");
     111      obj->addFace ("5 6 8 7");
     112      obj->addFace ("7 8 2 1");
     113      obj->addFace ("2 8 6 4");
     114      obj->addFace ("7 1 3 5");
     115      obj->finalize();
     116      */
     117      obj = (OBJModel*) new Model(CYLINDER);
     118    }
    79119  M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0);
    80120  rotAxis = Vector (0.0,1.0,0.0);
     
    215255          case SDLK_c:
    216256            if (!obj)
    217               obj = new Model(argv[1]);
     257              obj = new OBJModel(argv[1]);
    218258            break;
     259          case SDLK_a:
     260            zoomTo /=2;
     261            break;
     262          case SDLK_z:
     263            zoomTo *=2;
     264
    219265          }
    220266        break;
  • orxonox/branches/trackManager/src/importer/framework.h

    r3369 r3430  
    33 
    44#include "windowHandler.h" // Include the Whandler Basecode
    5 #include "model.h"
    6 #include "vector.h"
     5#include "objModel.h"
     6
     7class Vector;
    78
    89float rotatorP;
     
    3334
    3435WindowHandler wHandler;  // Create an instance of the whandler basecode class
    35 Model* obj;
     36OBJModel* obj;
    3637
    3738
  • orxonox/branches/trackManager/src/importer/material.cc

    r3369 r3430  
    1616
    1717#include "material.h"
     18
     19#include "texture.h"
     20#include <stdlib.h>
     21#include <string.h>
    1822
    1923using namespace std;
     
    112116  while (searcher != NULL)
    113117    {
    114       PRINTF(2)(".");
     118      PRINT(2)(".");
    115119      if (!strcmp (searcher->getName(), mtlName))
    116120        {
    117           PRINTF(2)("found.\n");
     121          PRINT(2)("found.\n");
    118122          return searcher;
    119123        }
    120124      searcher = searcher->nextMat;
    121125    }
    122   PRINTF(2)("not found\n");
     126  PRINT(2)("not found\n");
    123127  return NULL;
    124128}
  • orxonox/branches/trackManager/src/importer/material.h

    r3369 r3430  
    1313extern int verbose; //!< will be obsolete soon.
    1414
    15 #include "../stdincl.h"
    16 #include "texture.h"
    17 
    1815#if HAVE_CONFIG_H
    1916#include <config.h>
    2017#endif /* HAVE_CONFIG_H */
    2118
    22 
     19// FORWARD DEFINITIONS //
     20class Texture;
    2321
    2422
  • orxonox/branches/trackManager/src/importer/model.cc

    r3369 r3430  
    1515
    1616#include "model.h"
    17 int verbose = 1; //! \todo should be GLOBAL
     17
     18#include <math.h>
     19#include <stdarg.h>
     20
     21#include "array.h"
     22#include "../vector.h"
     23
    1824using namespace std;
    1925
    2026/**
    21    \brief Creates a 3D-Model, but does not load any 3D-models.
    22 
    23    This Constructor is pretty useless, because why load no model in an model-loader??
    24 */
    25 Model::Model ()
    26 {
    27 
     27   \brief Creates a 3D-Model.
     28
     29   This only initializes a 3D-Model, but does not cleanup the Faces.
     30*/
     31Model::Model(void)
     32{
    2833  this->initialize();
    29 
    30   this->BoxModel();
    31 
     34}
     35
     36/**
     37   \brief Creates a 3D-Model of Primitive-Type type
     38
     39   if you want to just display a Cube/Sphere/Cylinder/... without any material.
     40   
     41   \todo implement Cube/Sphere/Cylinder/...
     42*/
     43Model::Model(PRIMITIVE type)
     44{
     45  this->initialize();
     46
     47  switch (type)
     48    {
     49    default:
     50    case CUBE:
     51      this->cubeModel();
     52      break;
     53    case SPHERE:
     54      this->sphereModel();
     55      break;
     56    case CYLINDER:
     57      this->cylinderModel();
     58      break;
     59
     60    }
    3261  this->importToGL ();
    3362
     
    3665
    3766/**
    38    \brief Crates a 3D-Model and loads in a File.
    39    \param fileName file to parse and load (must be a .obj file)
    40 */
    41 Model::Model(char* fileName)
     67   \brief Creates a 3D-Model. and assigns it a Name.
     68*/
     69Model::Model(char* modelName)
    4270{
    4371  this->initialize();
    44 
    45   this->importFile (fileName);
    46 
    47   this->importToGL ();
    48 
    49   this->cleanup();
    50 }
    51 
    52 /**
    53    \brief Crates a 3D-Model, loads in a File and scales it.
    54    \param fileName file to parse and load (must be a .obj file)
    55    \param scaling The factor that the model will be scaled with.
    56 */
    57 Model::Model(char* fileName, float scaling)
    58 {
    59   this->initialize();
    60   this->scaleFactor = scaling;
    61 
    62   this->importFile (fileName);
    63 
    64   this->importToGL ();
    65 
    66   this->cleanup();
     72  this->setName(modelName);
    6773}
    6874
     
    7278   Looks if any from model allocated space is still in use, and if so deleted it.
    7379*/
    74 Model::~Model()
    75 {
    76   PRINTF(2)("Deleting display Lists.\n");
     80Model::~Model(void)
     81{
     82  PRINTF(3)("Deleting Model ");
     83  if (this->name)
     84    {
     85      PRINT(3)("%s\n", this->name);
     86      delete []this->name;
     87    }
     88  else
     89      PRINT(3)("\n");
     90
     91  PRINTF(3)("Deleting display Lists.\n");
    7792  Group* walker = this->firstGroup;
    7893  while (walker != NULL)
     
    8499    }
    85100
    86   if (this->objPath)
    87     delete []this->objPath;
    88   if (this->objFileName)
    89     delete []this->objFileName;
    90   if (this->mtlFileName)
    91     delete []this->mtlFileName;
    92   PRINTF(2)("Deleting Materials.\n");
     101  PRINTF(3)("Deleting Materials.\n");
    93102  if (this->material)
    94103    delete this->material;
    95104}
    96105
     106/**
     107   \brief Finalizes an Object. This can be done outside of the Class.
     108*/
     109void Model::finalize(void)
     110{
     111  this->importToGL ();
     112 
     113  this->cleanup();
     114
     115  this->finalized = true;
     116}
    97117
    98118/**
     
    139159      walker = walker->next;
    140160    }
    141   PRINTF(1)("Model number %i in %s not Found.\n", groupNumber, this->objFileName);
     161  PRINTF(1)("Model number %i in %s not Found.\n", groupNumber, this->name);
    142162  return;
    143163
     
    164184      walker = walker->next;
    165185    }
    166   PRINTF(1)("Model Named %s in %s not Found.\n", groupName, this->objFileName);
     186  PRINTF(1)("Model Named %s in %s not Found.\n", groupName, this->name);
    167187  return;
    168188}
     
    186206  PRINTF(2)("new 3D-Model is being created\n");
    187207
     208  this->name = NULL;
     209  this->finalized = false;
    188210  // setting the start group;
    189211  this->firstGroup = new Group;
     
    192214 
    193215  this->initGroup (this->currentGroup);
    194   this->objPath = NULL;
    195   this->objFileName = NULL;
    196   this->mtlFileName = NULL;
    197216  this->scaleFactor = 1;
    198217  this->material = new Material();
     
    205224}
    206225
     226void Model::setName(const char* name)
     227{
     228  if (this->name)
     229    delete this->name;
     230  this->name = new char[strlen(name)+1];
     231  strcpy(this->name, name);
     232}
    207233/**
    208234   \brief initializes a new Group model
     
    317343
    318344/**
    319    \brief Imports a obj file and handles the the relative location
    320    \param fileName The file to import
    321 */
    322 bool Model::importFile (char* fileName)
    323 {
    324   PRINTF(3)("preparing to read in file: %s\n", fileName);
    325 
    326 
    327 #ifdef __WIN32__
    328   // win32 path reading
    329   char pathSplitter= '\\';
    330 #else /* __WIN32__ */
    331   // unix path reading
    332   char pathSplitter='/';
    333 #endif /* __WIN32__ */
    334   char* tmpName = fileName;
    335   if (tmpName[0] == pathSplitter)
    336     tmpName++;
    337   char* name = tmpName;
    338   while (( tmpName = strchr (tmpName+1, pathSplitter)))
    339     {
    340       name = tmpName+1;
    341     }
    342   this->objPath = new char[name-fileName];
    343   strncpy(this->objPath, fileName, name-fileName);
    344   this->objPath[name-fileName] = '\0';
    345   if (verbose >=2)
    346     if (strlen(objPath)> 0)
    347       PRINTF(0)("Resolved file %s to folder: %s.\n", name, objPath);
    348     else
    349       PRINTF(0)("Resolved file %s.\n", name);
    350  
    351   if (this->material)
    352     this->material->addTexturePath(this->objPath);
    353   this->objFileName = new char[strlen(name)+1];
    354   strcpy (this->objFileName, name);
    355   this->readFromObjFile ();
    356   return true;
    357 }
    358 
    359 /**
    360    \brief Reads in the .obj File and sets all the Values.
    361    This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks
    362 */
    363 bool Model::readFromObjFile (void)
    364 {
    365   char* fileName = new char [strlen(objPath)+strlen(objFileName)+1];
    366   if (this->objFileName != NULL && !strcmp(this->objFileName, ""))
    367     return false;
    368   strcpy(fileName, this->objPath);
    369   strcat(fileName, this->objFileName);
    370 
    371   ifstream* OBJ_FILE = new ifstream(fileName);
    372   if (OBJ_FILE->fail())
    373     {
    374       PRINTF(1)("unable to open .OBJ file: %s\n Loading Box Model instead.\n", fileName);
    375       BoxModel();
    376       OBJ_FILE->close();
    377       delete []fileName;
    378       delete OBJ_FILE;
    379       return false;
    380     }
    381   PRINTF(2)("Reading from opened file %s\n", fileName);
    382   char Buffer[10000];
    383   while(!OBJ_FILE->eof())
    384     {
    385       OBJ_FILE->getline(Buffer, 10000);
    386       PRINTF(3)("Read input line: %s\n", Buffer);
    387      
    388 
    389       // case vertice
    390       if (!strncmp(Buffer, "v ", 2))
    391         {
    392           this->readVertex(Buffer+2);
    393         }
    394 
    395       // case face
    396       else if (!strncmp(Buffer, "f ", 2))
    397         {
    398           this->readFace (Buffer+2);
    399         }
    400      
    401       else if (!strncmp(Buffer, "mtllib ", 7))
    402         {
    403           this->readMtlLib (Buffer+7);
    404         }
    405 
    406       else if (!strncmp(Buffer, "usemtl ", 7))
    407         {
    408           this->readUseMtl (Buffer+7);
    409         }
    410 
    411       // case VertexNormal
    412       else if (!strncmp(Buffer, "vn ", 3))
    413         {
    414           this->readVertexNormal(Buffer+3);
    415         }
    416      
    417       // case VertexTextureCoordinate
    418       else if (!strncmp(Buffer, "vt ", 3))
    419         {
    420           this->readVertexTexture(Buffer+3);
    421         }
    422       // case group
    423       else if (!strncmp(Buffer, "g ", 2))
    424         {
    425           this->readGroup (Buffer+2);
    426         }
    427       else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented
    428         {
    429           if (verbose >= 2)
    430             PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer);
    431         }
    432     }
    433   OBJ_FILE->close();
    434   delete OBJ_FILE;
    435   delete []fileName;
    436   return true;
    437 
    438 }
    439 
    440 /**
    441345   \brief parses a group String
    442346   \param groupString the new Group to create
     
    445349   With it you should be able to import .obj-files with more than one Models inside.
    446350*/
    447 bool Model::readGroup (char* groupString)
     351bool Model::addGroup (char* groupString)
    448352{
    449353  PRINTF(3)("Read Group: %s.\n", groupString);
     
    470374   If a vertex line is found this function will inject it into the vertex-Array
    471375*/
    472 bool Model::readVertex (char* vertexString)
     376bool Model::addVertex (char* vertexString)
    473377{
    474378  float subbuffer1;
     
    482386
    483387/**
     388   \brief parses a vertex-String
     389   \param x the X-coordinate of the Vertex to add.
     390   \param y the Y-coordinate of the Vertex to add.
     391   \param z the Z-coordinate of the Vertex to add.
     392   
     393*/
     394bool Model::addVertex(const float x, const float y, const float z)
     395{
     396  PRINTF(4)("reading in a vertex: %f %f %f\n", x, y, z);
     397  this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor);
     398  return true;
     399}
     400
     401/**
    484402   \brief parses a face-string
    485403   \param faceString The String that will be parsed.
    486404
    487405   If a face line is found this function will add it to the glList.
    488    The function makes a difference between QUADS and TRIANGLES, and will if changed re-open, set and re-close the gl-processe.
    489 */
    490 bool Model::readFace (char* faceString)
     406*/
     407bool Model::addFace (char* faceString)
    491408{
    492409  if (this->currentGroup->faceCount >0)
     
    546463
    547464/**
     465   \brief adds a new Face
     466   \param faceElemCount the number of Vertices to add to the Face.
     467   \param type 0: vertex only, 1: vertex and normal, 2: vertex and Texture, 3 vertex, normal and texture
     468*/
     469bool Model::addFace(const float faceElemCount, int type, ...)
     470{
     471   if (this->currentGroup->faceCount > 0)
     472    this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face;
     473  this->initFace (this->currentGroup->currentFace);
     474
     475  FaceElement* tmpElem = this->currentGroup->currentFace->firstElem = new FaceElement;
     476  tmpElem->next = NULL;
     477 
     478  va_list itemlist;
     479  va_start (itemlist, type);
     480
     481  for (int i = 0; i < faceElemCount; i++)
     482    {
     483      if (this->currentGroup->currentFace->vertexCount>0)
     484          tmpElem = tmpElem->next = new FaceElement;
     485      tmpElem->next = NULL;
     486
     487      tmpElem->vertexNumber = va_arg (itemlist, int) -1;
     488      if (type >= 2)
     489        tmpElem->texCoordNumber = va_arg (itemlist, int) -1;
     490      if (type == 1 || type ==3)
     491        tmpElem->normalNumber = va_arg(itemlist, int) -1;
     492      this->currentGroup->currentFace->vertexCount++;
     493    }
     494  va_end(itemlist);
     495
     496  this->currentGroup->faceCount += this->currentGroup->currentFace->vertexCount - 2;
     497}
     498
     499/**
    548500   \brief parses a vertexNormal-String
    549501   \param normalString The String that will be parsed.
     
    551503   If a vertexNormal line is found this function will inject it into the vertexNormal-Array
    552504*/
    553 bool Model::readVertexNormal (char* normalString)
     505bool Model::addVertexNormal (char* normalString)
    554506{
    555507  float subbuffer1;
     
    563515
    564516/**
     517   \brief adds a VertexNormal.
     518   \param x The x coordinate of the Normal.
     519   \param y The y coordinate of the Normal.
     520   \param z The z coordinate of the Normal.
     521
     522   If a vertexNormal line is found this function will inject it into the vertexNormal-Array
     523*/
     524bool Model::addVertexNormal(const float x, const float y, const float z)
     525{
     526  PRINTF(3)("found vertex-Normal %f, %f, %f\n", x, y, z);
     527  this->normals->addEntry(x, y, z);
     528}
     529
     530/**
    565531   \brief parses a vertexTextureCoordinate-String
    566532   \param vTextureString The String that will be parsed.
     
    569535   this function will inject it into the vertexTexture-Array
    570536*/
    571 bool Model::readVertexTexture (char* vTextureString)
     537bool Model::addVertexTexture (char* vTextureString)
    572538{
    573539  float subbuffer1;
     
    580546}
    581547
    582 /**
    583     \brief Function to read in a mtl File.
    584     \param mtlFile The .mtl file to read
    585 
    586     This Function parses all Lines of an mtl File.
    587     The reason for it not to be in the materials-class is,
    588     that a material does not have to be able to read itself in from a File.
    589 
    590 */
    591 bool Model::readMtlLib (char* mtlFile)
    592 {
    593   this->mtlFileName = new char [strlen(mtlFile)+1];
    594   strcpy(this->mtlFileName, mtlFile);
    595   char* fileName = new char [strlen(objPath) + strlen(this->mtlFileName)+1];
    596   strcpy(fileName, this->objPath);
    597   strcat(fileName, this->mtlFileName);
    598  
    599 
    600   PRINTF(3)("Opening mtlFile: %s\n", fileName);
    601 
    602   ifstream* MTL_FILE = new ifstream (fileName);
    603   if (MTL_FILE->fail())
    604     {
    605       PRINTF(1)("unable to open file: %s\n", fileName);
    606       MTL_FILE->close();
    607       delete []fileName;
    608       delete MTL_FILE;
    609       return false;
    610     }
    611   char Buffer[500];
    612   Material* tmpMat = material;
    613   while(!MTL_FILE->eof())
    614     {
    615       MTL_FILE->getline(Buffer, 500);
    616       PRINTF(4)("found line in mtlFile: %s\n", Buffer);
    617      
    618 
    619       // create new Material
    620       if (!strncmp(Buffer, "newmtl ", 7))
    621         {
    622           tmpMat = tmpMat->addMaterial(Buffer+7);
    623           //      PRINTF(2)("%s, %p\n", tmpMat->getName(), tmpMat);
    624         }
    625       // setting a illumMode
    626       else if (!strncmp(Buffer, "illum ", 6))
    627         {
    628           tmpMat->setIllum(Buffer+6);
    629 
    630         }
    631       // setting Diffuse Color
    632       else if (!strncmp(Buffer, "Kd ", 3))
    633         {
    634           tmpMat->setDiffuse(Buffer+3);
    635         }
    636       // setting Ambient Color
    637       else if (!strncmp(Buffer, "Ka ", 3))
    638         {
    639           tmpMat->setAmbient(Buffer+3);
    640         }
    641       // setting Specular Color
    642       else if (!strncmp(Buffer, "Ks ", 3))
    643         {
    644           tmpMat->setSpecular(Buffer+3);
    645         }
    646       // setting The Specular Shininess
    647       else if (!strncmp(Buffer, "Ns ", 3))
    648         {
    649           tmpMat->setShininess(Buffer+3);
    650         }
    651       // setting up transparency
    652       else if (!strncmp(Buffer, "d ", 2))
    653         {
    654           tmpMat->setTransparency(Buffer+2);
    655         }
    656       else if (!strncmp(Buffer, "Tf ", 3))
    657         {
    658           tmpMat->setTransparency(Buffer+3);
    659         }
    660      
    661       else if (!strncmp(Buffer, "map_Kd ", 7))
    662         {
    663           tmpMat->setDiffuseMap(Buffer+7);
    664         }
    665       else if (!strncmp(Buffer, "map_Ka ", 7))
    666         {
    667           tmpMat->setAmbientMap(Buffer+7);
    668         }
    669       else if (!strncmp(Buffer, "map_Ks ", 7))
    670         {
    671           tmpMat->setSpecularMap(Buffer+7);
    672         }
    673       else if (!strncmp(Buffer, "bump ", 5))
    674         {
    675           tmpMat->setBump(Buffer+7);
    676         }
    677      
    678 
    679     }
    680   MTL_FILE->close();
    681   delete []fileName;
    682   delete MTL_FILE;
    683   return true;
     548/**
     549   \brief adds a Texture Coordinate
     550   \param u The u coordinate of the TextureCoordinate.
     551   \param v The y coordinate of the TextureCoordinate.
     552
     553   If a TextureCoordinate line is found this function will inject it into the TextureCoordinate-Array
     554*/
     555bool Model::addVertexTexture(const float u, const float v)
     556{
     557  PRINTF(3)("found vertex-Texture %f, %f\n", u, v);
     558  this->vTexture->addEntry(u);
     559  this->vTexture->addEntry(v);
    684560}
    685561
     
    688564   \param matString the Material that will be set.
    689565*/
    690 bool Model::readUseMtl (char* matString)
    691 {
     566bool Model::addUseMtl (char* matString)
     567{
     568  /*
    692569  if (!this->mtlFileName)
    693570    {
     
    695572      return false;
    696573    }
    697      
     574  */     
    698575  if (this->currentGroup->faceCount >0)
    699576    this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face;
     
    717594  this->vertices->finalizeArray();
    718595  this->vTexture->finalizeArray();
    719   if (normals->getCount() == 0) // vertices-Array must be uilt for this
     596  if (normals->getCount() == 0) // vertices-Array must be built for this
    720597    this->buildVertexNormals();
    721598  this->normals->finalizeArray();
     
    743620                glEnd();
    744621              this->currentGroup->faceMode = 0;
    745               PRINTF(2)("using material %s for coming Faces.\n", tmpFace->materialString);
    746622              Material* tmpMat;
    747623              if ((tmpMat = material->search(tmpFace->materialString)) != NULL)
    748                 tmpMat->select();
     624                {
     625                  tmpMat->select();
     626                  PRINTF(2)("using material %s for coming Faces.\n", tmpFace->materialString);
     627                }
     628              else
     629                PRINTF(1)("material %s not found.\n", tmpFace->materialString);
     630
    749631
    750632            }
     
    893775      normArray[i].normalize();
    894776      PRINTF(3)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
    895 
     777     
    896778      this->normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);
    897779
     
    907789   This will inject a Cube, because this is the most basic model.
    908790*/
    909 void Model::BoxModel(void)
    910 {
    911   this->readVertex ("-0.5 -0.5 0.5");
    912   this->readVertex ("0.5 -0.5 0.5");
    913   this->readVertex ("-0.5 0.5 0.5");
    914   this->readVertex ("0.5 0.5 0.5");
    915   this->readVertex ("-0.5 0.5 -0.5");
    916   this->readVertex ("0.5 0.5 -0.5");
    917   this->readVertex ("-0.5 -0.5 -0.5");
    918   this->readVertex ("0.5 -0.5 -0.5");
    919 
    920   this->readVertexTexture ("0.0 0.0");
    921   this->readVertexTexture ("1.0 0.0");
    922   this->readVertexTexture ("0.0 1.0");
    923   this->readVertexTexture ("1.0 1.0");
    924   this->readVertexTexture ("0.0 2.0");
    925   this->readVertexTexture ("1.0 2.0");
    926   this->readVertexTexture ("0.0 3.0");
    927   this->readVertexTexture ("1.0 3.0");
    928   this->readVertexTexture ("0.0 4.0");
    929   this->readVertexTexture ("1.0 4.0");
    930   this->readVertexTexture ("2.0 0.0");
    931   this->readVertexTexture ("2.0 1.0");
    932   this->readVertexTexture ("-1.0 0.0");
    933   this->readVertexTexture ("-1.0 1.0");
    934 
    935   this->readVertexNormal ("0.0 0.0 1.0");
    936   this->readVertexNormal ("0.0 0.0 1.0");
    937   this->readVertexNormal ("0.0 0.0 1.0");
    938   this->readVertexNormal ("0.0 0.0 1.0");
    939   this->readVertexNormal ("0.0 1.0 0.0");
    940   this->readVertexNormal ("0.0 1.0 0.0");
    941   this->readVertexNormal ("0.0 1.0 0.0");
    942   this->readVertexNormal ("0.0 1.0 0.0");
    943   this->readVertexNormal ("0.0 0.0 -1.0");
    944   this->readVertexNormal ("0.0 0.0 -1.0");
    945   this->readVertexNormal ("0.0 0.0 -1.0");
    946   this->readVertexNormal ("0.0 0.0 -1.0");
    947   this->readVertexNormal ("0.0 -1.0 0.0");
    948   this->readVertexNormal ("0.0 -1.0 0.0");
    949   this->readVertexNormal ("0.0 -1.0 0.0");
    950   this->readVertexNormal ("0.0 -1.0 0.0");
    951   this->readVertexNormal ("1.0 0.0 0.0");
    952   this->readVertexNormal ("1.0 0.0 0.0");
    953   this->readVertexNormal ("1.0 0.0 0.0");
    954   this->readVertexNormal ("1.0 0.0 0.0");
    955   this->readVertexNormal ("-1.0 0.0 0.0");
    956   this->readVertexNormal ("-1.0 0.0 0.0");
    957   this->readVertexNormal ("-1.0 0.0 0.0");
    958   this->readVertexNormal ("-1.0 0.0 0.0");
     791void Model::cubeModel(void)
     792{
     793  this->addVertex ("-0.5 -0.5 0.5");
     794  this->addVertex ("0.5 -0.5 0.5");
     795  this->addVertex ("-0.5 0.5 0.5");
     796  this->addVertex ("0.5 0.5 0.5");
     797  this->addVertex ("-0.5 0.5 -0.5");
     798  this->addVertex ("0.5 0.5 -0.5");
     799  this->addVertex ("-0.5 -0.5 -0.5");
     800  this->addVertex ("0.5 -0.5 -0.5");
     801
     802  this->addVertexTexture ("0.0 0.0");
     803  this->addVertexTexture ("1.0 0.0");
     804  this->addVertexTexture ("0.0 1.0");
     805  this->addVertexTexture ("1.0 1.0");
     806  this->addVertexTexture ("0.0 2.0");
     807  this->addVertexTexture ("1.0 2.0");
     808  this->addVertexTexture ("0.0 3.0");
     809  this->addVertexTexture ("1.0 3.0");
     810  this->addVertexTexture ("0.0 4.0");
     811  this->addVertexTexture ("1.0 4.0");
     812  this->addVertexTexture ("2.0 0.0");
     813  this->addVertexTexture ("2.0 1.0");
     814  this->addVertexTexture ("-1.0 0.0");
     815  this->addVertexTexture ("-1.0 1.0");
     816
     817  this->addVertexNormal ("0.0 0.0 1.0");
     818  this->addVertexNormal ("0.0 0.0 1.0");
     819  this->addVertexNormal ("0.0 0.0 1.0");
     820  this->addVertexNormal ("0.0 0.0 1.0");
     821  this->addVertexNormal ("0.0 1.0 0.0");
     822  this->addVertexNormal ("0.0 1.0 0.0");
     823  this->addVertexNormal ("0.0 1.0 0.0");
     824  this->addVertexNormal ("0.0 1.0 0.0");
     825  this->addVertexNormal ("0.0 0.0 -1.0");
     826  this->addVertexNormal ("0.0 0.0 -1.0");
     827  this->addVertexNormal ("0.0 0.0 -1.0");
     828  this->addVertexNormal ("0.0 0.0 -1.0");
     829  this->addVertexNormal ("0.0 -1.0 0.0");
     830  this->addVertexNormal ("0.0 -1.0 0.0");
     831  this->addVertexNormal ("0.0 -1.0 0.0");
     832  this->addVertexNormal ("0.0 -1.0 0.0");
     833  this->addVertexNormal ("1.0 0.0 0.0");
     834  this->addVertexNormal ("1.0 0.0 0.0");
     835  this->addVertexNormal ("1.0 0.0 0.0");
     836  this->addVertexNormal ("1.0 0.0 0.0");
     837  this->addVertexNormal ("-1.0 0.0 0.0");
     838  this->addVertexNormal ("-1.0 0.0 0.0");
     839  this->addVertexNormal ("-1.0 0.0 0.0");
     840  this->addVertexNormal ("-1.0 0.0 0.0");
    959841
    960842  /* normaleLess-testingMode
    961   this->readFace ("1 2 4 3");
    962   this->readFace ("3 4 6 5");
    963   this->readFace ("5 6 8 7");
    964   this->readFace ("7 8 2 1");
    965   this->readFace ("2 8 6 4");
    966   this->readFace ("7 1 3 5");
     843  this->addFace ("1 2 4 3");
     844  this->addFace ("3 4 6 5");
     845  this->addFace ("5 6 8 7");
     846  this->addFace ("7 8 2 1");
     847  this->addFace ("2 8 6 4");
     848  this->addFace ("7 1 3 5");
    967849  */
    968850
    969   this->readFace ("1/1/1 2/2/2 4/4/3 3/3/4");
    970   this->readFace ("3/3/5 4/4/6 6/6/7 5/5/8");
    971   this->readFace ("5/5/9 6/6/10 8/8/11 7/7/12");
    972   this->readFace ("7/7/13 8/8/14 2/10/15 1/9/16");
    973   this->readFace ("2/2/17 8/11/18 6/12/19 4/4/20");
    974   this->readFace ("7/13/21 1/1/22 3/3/23 5/14/24");
    975 
    976 }
     851  this->addFace ("1/1/1 2/2/2 4/4/3 3/3/4");
     852  this->addFace ("3/3/5 4/4/6 6/6/7 5/5/8");
     853  this->addFace ("5/5/9 6/6/10 8/8/11 7/7/12");
     854  this->addFace ("7/7/13 8/8/14 2/10/15 1/9/16");
     855  this->addFace ("2/2/17 8/11/18 6/12/19 4/4/20");
     856  this->addFace ("7/13/21 1/1/22 3/3/23 5/14/24");
     857
     858}
     859
     860
     861void Model::sphereModel()
     862{
     863  int detail = 30;
     864  if (detail <= 0) detail = 1;
     865  float df = (float)detail;
     866  for (float i = 0.0; i < df/2; i+=1.0)
     867    {
     868      for (float j = 0.0; j < df; j+=1.0)
     869      {
     870        float vz = i/df *2.0*PI - PI/2.0;
     871        this->addVertex(cos(j/df*2.0*PI) * cos(vz) ,
     872                        sin(j/df*2.0*PI) * cos(vz),
     873                        sin(vz));
     874        //if (j==0.0)
     875        //printf ("%f %f\n", vz, sin (vz));
     876        if (i==0.0)
     877                  printf("%f, %f\n", j/df*2.0*PI, cos(j/df*PI));
     878      }
     879    }
     880  vertices->debug();
     881  for (int i = 0; i < detail/2; i++)
     882    for (int j = 1; j < detail; j++)
     883      {
     884        unsigned int v1,v2,v3,v4;
     885        v1 = i*detail +j;
     886
     887        /*      if (j+1 == detail)
     888          {
     889            v2 = i*detail +1;
     890            v3 = i*detail+detail + 1;
     891          }
     892          else*/
     893          {
     894            v2 = i*detail +j+1;
     895            v3 = i*detail+detail + j+1;
     896          }
     897        v4 = i*detail+detail + j;
     898        //printf("%i %i %i %i\n", v1, v2, v3, v4);
     899        this->addFace(4, 0, v1, v2, v3, v4);
     900      }
     901}
     902
     903/**
     904   \brief Creates a Cylinder.
     905*/
     906void Model::cylinderModel(void)
     907{
     908  unsigned int detail = 20;
     909  float size = 1.0;
     910
     911  // check if devision by zero
     912  if (detail <= 3)
     913    detail = 3;
     914  int count = 0;
     915  // defining Points of the Cylinder.
     916  for (float phi = 0.0; phi < 2.0*PI; phi += 2.0*PI/(float)detail)
     917    {
     918      this->addVertex(size*cos(phi), size*sin(phi), -size);
     919      this->addVertex(size*cos(phi), size*sin(phi), size);
     920      count ++;
     921    }
     922  this->addVertex(0, 0, -size);
     923  this->addVertex(0, 0, size);
     924
     925 
     926  if (count != detail)
     927    cout << "calculation error, count should be " << detail << " but is " << count << endl;
     928  vertices->debug();
     929
     930  // adding Faces
     931  for (int i = 0; i < detail-1; i++)
     932    {
     933      int p1, p2, p3, p4;
     934      p1 = 2*i+1;
     935      p2 = 2*i+2;
     936      if (i <= detail);
     937      p3 = 2*i+4;
     938      p4 = 2*i+3;
     939      cout <<i+1 <<": "<< p1 <<" "<< p2 <<" "<< p3 <<" "<< p4 <<endl;
     940      this->addFace(4, 0, p1, p2, p3, p4);
     941      this->addFace(3, 0, p4, p1, 2*detail+1);
     942      this->addFace(3, 0, p2, p3, 2*detail+2);
     943    }
     944  addFace(4,0, 2*detail-1, 2*detail, 2, 1);
     945  this->addFace(3, 0, 1, 2*detail-1, 2*detail+1);
     946  this->addFace(3, 0, 2*detail, 2, 2*detail+2);
     947
     948}
  • orxonox/branches/trackManager/src/importer/model.h

    r3369 r3430  
    77#define _MODEL_H
    88
    9 #include "../stdincl.h"
     9//#include "../stdincl.h"
    1010
    11 #include "array.h"
    1211#include "material.h"
    13 #include "vector.h"
    14 #include <fstream>
     12
     13// FORWARD DEFINITION //
     14class Array;
     15class Vector;
    1516
    1617using namespace std;
    1718
    18 
     19enum PRIMITIVE {PLANE, CUBE, SPHERE, CYLINDER};
    1920
    2021//! Class that handles 3D-Models. it can also read them in and display them.
     
    2223{
    2324 public:
    24   Model ();
    25   Model (char* fileName);
    26   Model(char* fileName, float scaling);
    27   ~Model ();
     25  Model(void);
     26  Model(PRIMITIVE type);
     27  Model(char* modelName);
     28  virtual ~Model(void);
     29
     30  void setName(const char* name);
    2831 
    29   void draw (void) const;
    30   void draw (int groupNumber) const;
    31   void draw (char* groupName) const;
     32  void draw(void) const;
     33  void draw(int groupNumber) const;
     34  void draw(char* groupName) const;
    3235  int getGroupCount() const;
    3336
    34  private:
     37 protected:
     38  char* name;            //!< This is the name of the Model.
     39  bool finalized;        //!< Sets the Object to be finalized.
     40 
    3541  //! This is the placeholder of one Vertex beloning to a Face.
    36   struct FaceElement 
     42  struct FaceElement
    3743  {
    3844    int vertexNumber;    //!< The number of the Vertex out of the Array* vertices, this vertex points to.
     
    4349
    4450  //! This is the placeholder of a Face belonging to a Group of Faces.
    45   /**
    46      \todo take Material to a call for itself.
    47 
    48      This can also be a Material-Change switch.
    49      That means if you want to change a Material inside of a group,
    50      you can create an empty face and apply a material to it, and the Importer will cahnge Colors
    51   */
    52   struct Face
     51  struct Face
    5352  {
    5453    int vertexCount;        //!< The Count of vertices this Face has.
     
    6564    char* name;         //!< the Name of the Group. this is an identifier, that can be accessed via the draw (char* name) function.
    6665
    67     GLuint listNumber;  //!< The number of the GL-List this Group gets.
     66    unsigned int listNumber;//!< The number of the GL-List this Group gets.
    6867    Face* firstFace;    //!< The first Face in this group.
    6968    Face* currentFace;  //!< The current Face in this Group (the one we are currently working with.)
     
    8887  float scaleFactor;    //!< The Factor with which the Model should be scaled. \todo maybe one wants to scale the Model after Initialisation
    8988
    90   char* objPath;        //!< The Path wher the obj and mtl-file are located.
    91   char* objFileName;    //!< The Name of the obj-file.
    92   char* mtlFileName;    //!< The Name of the mtl-file (parsed out of the obj-file)
    93 
    94   bool initialize (void);
     89  bool initialize(void);
    9590  bool initGroup(Group* group);
    9691  bool initFace (Face* face);
     
    10095  bool cleanupFaceElement(FaceElement* faceElem);
    10196
    102   ///// readin ///
    103   bool importFile (char* fileName);
    104   bool readFromObjFile (void);
    105  
    106   bool readGroup (char* groupString);
    107   bool readVertex (char* vertexString);
    108   bool readFace (char* faceString);
    109   bool readVertexNormal (char* normalString);
    110   bool readVertexTexture (char* vTextureString);
    111   bool readMtlLib (char* matFile);
    112   bool readUseMtl (char* mtlString);
     97 public:
     98  bool addGroup(char* groupString);
     99  bool addVertex(char* vertexString);
     100  bool addVertex(const float x, const float y, const float z);
     101  bool addFace(char* faceString);
     102  bool addFace(const float faceElemCount, int type, ...);
     103  bool addVertexNormal(char* normalString);
     104  bool addVertexNormal(const float x, const float y, const float z);
     105  bool addVertexTexture(char* vTextureString);
     106  bool addVertexTexture(const float u, const float v);
     107  bool addUseMtl(char* mtlString);
     108  void finalize(void);
    113109
    114   bool importToGL (void);
    115   bool addGLElement (FaceElement* elem);
     110 protected:
     111  bool importToGL(void);
     112  bool addGLElement(FaceElement* elem);
    116113
    117   bool buildVertexNormals ();
     114  bool buildVertexNormals(void);
    118115
    119   void BoxModel (void);
     116  void cubeModel(void);
     117  void sphereModel(void);
     118  void cylinderModel(void);
    120119};
    121120
  • orxonox/branches/trackManager/src/orxonox.cc

    r3369 r3430  
    3131#include "game_loader.h"
    3232#include <string.h>
     33int verbose;
    3334
    3435using namespace std;
  • orxonox/branches/trackManager/src/player.cc

    r3369 r3430  
    1919#include "stdincl.h"
    2020#include "collision.h"
    21 #include "importer/model.h"
     21#include "importer/objModel.h"
    2222
    2323using namespace std;
     
    2727{
    2828
    29   this->model = new Model("reaplow.obj");
     29  this->model = new OBJModel("../data/models/reaplow.obj");
    3030  /*
    3131  objectList = glGenLists(1);
     
    104104  float matrix[4][4];
    105105 
    106   glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    107   //rotate
     106  /* translate */
     107  glTranslatef (this->getAbsCoor ().x,
     108                this->getAbsCoor ().y,
     109                this->getAbsCoor ().z);
     110  /* rotate */
    108111  this->getAbsDir ().matrix (matrix);
    109112  glMultMatrixf((float*)matrix);
  • orxonox/branches/trackManager/src/player.h

    r3369 r3430  
    99#include "world_entity.h"
    1010
    11 class Model;
     11class OBJModel;
    1212
    1313//! Basic controllable WorldEntity
  • orxonox/branches/trackManager/src/track_manager.cc

    r3376 r3430  
    376376  int tmpCurrentWorkingID = this->currentTrackElem->ID;
    377377  this->workOn(trackIDs[0]);
    378   float tmpLatestTime = this->currentTrackElem->endTime;
     378  float tmpLatestTime = 0;
    379379
    380380  TrackElement* firstJoint = this->currentTrackElem;
     
    392392      if (tmpJoinElem->childCount == 0
    393393          && tmpJoinElem->endTime > tmpLatestTime)
    394             tmpLatestTime = tmpJoinElem->endTime;
     394        tmpLatestTime = tmpJoinElem->endTime;
    395395    }
    396396  // Joining:
  • orxonox/branches/trackManager/src/track_manager.h

    r3376 r3430  
    6060//! The TrackManager handles the flow of the Players through the game.
    6161/**
    62    \todo write the methodes
    6362
    6463   <b>The TrackManager works as followed:</b> \n
  • orxonox/branches/trackManager/src/world.cc

    r3376 r3430  
    2727#include "helper_parent.h"
    2828#include "glmenu_imagescreen.h"
     29#include "skysphere.h"
    2930
    3031using namespace std;
     
    6566  this->localCamera->destroy();
    6667
    67   this->nullParent->destroy ();
     68  this->nullParent->destroy();
     69 
     70  delete this->skySphere;
    6871
    6972  //delete this->trackManager;
     
    148151 
    149152  //GLMenuImageScreen*
    150   glmis = new GLMenuImageScreen();
    151   glmis->init();
    152   glmis->draw();
     153  this->glmis = GLMenuImageScreen::getInstance();
     154  this->glmis->init();
     155  this->glmis->setMaximum(10);
     156  this->glmis->draw();
    153157 
    154158  printf ("World::displayLoadScreen - end\n");
     
    159163{
    160164  printf ("World::releaseLoadScreen - start\n");
    161 
     165  this->glmis->setValue(this->glmis->getMaximum());
     166  SDL_Delay(500);
    162167  printf ("World::releaseLoadScreen - end\n");
    163168}
     
    278283           
    279284
     285            // Create SkySphere
     286            skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
     287
     288            /*monitor progress*/
     289            this->glmis->step();
     290
    280291            Vector* es = new Vector (50, 2, 0);
    281292            Quaternion* qs = new Quaternion ();
     
    329340            this->getCamera()->bind (myPlayer);
    330341            this->localPlayer->addChild (this->localCamera);
     342
     343            // Create SkySphere
     344            skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
     345
    331346            break;
     347
     348
    332349          }
    333350        default:
     
    592609  // draw debug coord system
    593610  glCallList (objectList);
     611
     612  //! \todo skysphere is a WorldEntity and should be inside of the world-entity-list.
     613  skySphere->draw();
    594614
    595615}
     
    673693    }
    674694
     695  skySphere->updatePosition(localCamera->absCoordinate);
    675696  //for( int i = 0; i < tracklen; i++) track[i].tick (seconds);
    676697}
  • orxonox/branches/trackManager/src/world.h

    r3374 r3430  
    1616class PNode;
    1717class GLMenuImageScreen;
     18class Skysphere;
    1819
    1920//! The game environment
     
    7475  GLuint objectList;
    7576  SDL_Surface *loadImage;
     77  Skysphere* skySphere;
    7678
    7779  WorldEntity* localPlayer;
  • orxonox/branches/trackManager/src/world_entity.h

    r3369 r3430  
    1111
    1212class CollisionCluster;
    13 class Model;
     13class OBJModel;
    1414
    1515//! Basic class from which all interactive stuff in the world is derived from
     
    2222  virtual ~WorldEntity ();
    2323
    24   Model* model;
     24  OBJModel* model;
    2525 
    2626  void setCollision (CollisionCluster* newhull);
Note: See TracChangeset for help on using the changeset viewer.