Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4010 in orxonox.OLD for orxonox


Ignore:
Timestamp:
May 2, 2005, 3:14:57 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the levelloader from lltrunktemp to the trunk. Big thanks to fuzzy to make this so easy for us, and for implementing it in the first place.

Location:
orxonox/trunk
Files:
18 edited
11 copied

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/aclocal.m4

    r3099 r4010  
    1 # generated automatically by aclocal 1.8.5 -*- Autoconf -*-
     1# generated automatically by aclocal 1.8.2 -*- Autoconf -*-
    22
    33# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
     
    4141# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
    4242AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
    43          [AM_AUTOMAKE_VERSION([1.8.5])])
     43         [AM_AUTOMAKE_VERSION([1.8.2])])
    4444
    4545# AM_AUX_DIR_EXPAND
     
    150150fi])])
    151151
    152 # serial 7                                              -*- Autoconf -*-
     152# serial 6                                              -*- Autoconf -*-
    153153
    154154# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
     
    237237    for i in 1 2 3 4 5 6; do
    238238      echo '#include "conftst'$i'.h"' >> sub/conftest.c
    239       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
    240       # Solaris 8's {/usr,}/bin/sh.
    241       touch sub/conftst$i.h
     239      : > sub/conftst$i.h
    242240    done
    243241    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
     
    267265       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
    268266      # icc doesn't choke on unknown options, it will just issue warnings
    269       # or remarks (even with -Werror).  So we grep stderr for any message
    270       # that says an option was ignored or not supported.
    271       # When given -MP, icc 7.0 and 7.1 complain thusly:
    272       #   icc: Command line warning: ignoring option '-M'; no argument required
    273       # The diagnosis changed in icc 8.0:
    274       #   icc: Command line remark: option '-MP' not supported
    275       if (grep 'ignoring option' conftest.err ||
    276           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
     267      # (even with -Werror).  So we grep stderr for any message
     268      # that says an option was ignored.
     269      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
    277270        am_cv_$1_dependencies_compiler_type=$depmode
    278271        break
     
    320313# Generate code to set up dependency tracking.   -*- Autoconf -*-
    321314
    322 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
     315# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    323316
    324317# This program is free software; you can redistribute it and/or modify
     
    359352  # Extract the definition of DEP_FILES from the Makefile without
    360353  # running `make'.
    361   DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     354  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
    362355  test -z "$DEPDIR" && continue
    363356  # When using ansi2knr, U may be empty or an underscore; expand it
    364   U=`sed -n 's/^U = //p' < "$mf"`
     357  U=`sed -n -e '/^U = / s///p' < "$mf"`
    365358  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
    366359  # We invoke sed twice because it is the simplest approach to
    367360  # changing $(DEPDIR) to its actual value in the expansion.
    368   for file in `sed -n '
     361  for file in `sed -n -e '
    369362    /^DEP_FILES = .*\\\\$/ {
    370363      s/^DEP_FILES = //
     
    725718# Do not use -m 0755 and let people choose whatever they expect by
    726719# setting umask.
    727 #
    728 # We cannot accept any implementation of `mkdir' that recognizes `-p'.
    729 # Some implementations (such as Solaris 8's) are not thread-safe: if a
    730 # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
    731 # concurrently, both version can detect that a/ is missing, but only
    732 # one can create it and the other will error out.  Consequently we
    733 # restrict ourselves to GNU make (using the --version option ensures
    734 # this.)
    735720AC_DEFUN([AM_PROG_MKDIR_P],
    736 [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
     721[if mkdir -p -- . 2>/dev/null; then
    737722  # Keeping the `.' argument allows $(mkdir_p) to be used without
    738723  # argument.  Indeed, we sometimes output rules like
     
    747732  # directories to create, and then abort because `.' already
    748733  # exists.
    749   for d in ./-p ./--version;
     734  for d in ./-p ./--;
    750735  do
    751736    test -d $d && rmdir $d
  • orxonox/trunk/configure

    r3995 r4010  
    16041604fi
    16051605
    1606 if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
     1606if mkdir -p -- . 2>/dev/null; then
    16071607  # Keeping the `.' argument allows $(mkdir_p) to be used without
    16081608  # argument.  Indeed, we sometimes output rules like
     
    16171617  # directories to create, and then abort because `.' already
    16181618  # exists.
    1619   for d in ./-p ./--version;
     1619  for d in ./-p ./--;
    16201620  do
    16211621    test -d $d && rmdir $d
     
    25232523    for i in 1 2 3 4 5 6; do
    25242524      echo '#include "conftst'$i'.h"' >> sub/conftest.c
    2525       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
    2526       # Solaris 8's {/usr,}/bin/sh.
    2527       touch sub/conftst$i.h
     2525      : > sub/conftst$i.h
    25282526    done
    25292527    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
     
    25532551       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
    25542552      # icc doesn't choke on unknown options, it will just issue warnings
    2555       # or remarks (even with -Werror).  So we grep stderr for any message
    2556       # that says an option was ignored or not supported.
    2557       # When given -MP, icc 7.0 and 7.1 complain thusly:
    2558       #   icc: Command line warning: ignoring option '-M'; no argument required
    2559       # The diagnosis changed in icc 8.0:
    2560       #   icc: Command line remark: option '-MP' not supported
    2561       if (grep 'ignoring option' conftest.err ||
    2562           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
     2553      # (even with -Werror).  So we grep stderr for any message
     2554      # that says an option was ignored.
     2555      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
    25632556        am_cv_CXX_dependencies_compiler_type=$depmode
    25642557        break
     
    33613354    for i in 1 2 3 4 5 6; do
    33623355      echo '#include "conftst'$i'.h"' >> sub/conftest.c
    3363       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
    3364       # Solaris 8's {/usr,}/bin/sh.
    3365       touch sub/conftst$i.h
     3356      : > sub/conftst$i.h
    33663357    done
    33673358    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
     
    33913382       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
    33923383      # icc doesn't choke on unknown options, it will just issue warnings
    3393       # or remarks (even with -Werror).  So we grep stderr for any message
    3394       # that says an option was ignored or not supported.
    3395       # When given -MP, icc 7.0 and 7.1 complain thusly:
    3396       #   icc: Command line warning: ignoring option '-M'; no argument required
    3397       # The diagnosis changed in icc 8.0:
    3398       #   icc: Command line remark: option '-MP' not supported
    3399       if (grep 'ignoring option' conftest.err ||
    3400           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
     3384      # (even with -Werror).  So we grep stderr for any message
     3385      # that says an option was ignored.
     3386      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
    34013387        am_cv_CC_dependencies_compiler_type=$depmode
    34023388        break
     
    95399525  # Extract the definition of DEP_FILES from the Makefile without
    95409526  # running `make'.
    9541   DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     9527  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
    95429528  test -z "$DEPDIR" && continue
    95439529  # When using ansi2knr, U may be empty or an underscore; expand it
    9544   U=`sed -n 's/^U = //p' < "$mf"`
     9530  U=`sed -n -e '/^U = / s///p' < "$mf"`
    95459531  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
    95469532  # We invoke sed twice because it is the simplest approach to
    95479533  # changing $(DEPDIR) to its actual value in the expansion.
    9548   for file in `sed -n '
     9534  for file in `sed -n -e '
    95499535    /^DEP_FILES = .*\\\\$/ {
    95509536      s/^DEP_FILES = //
  • orxonox/trunk/src/Makefile.am

    r3966 r4010  
    3737                 track_manager.cc \
    3838                 track_node.cc \
     39                 factory.cc \
    3940                 util/animation/animation.cc \
    4041                 util/animation/animation3d.cc \
     
    8081                 lib/math/vector.cc \
    8182                 lib/math/curve.cc \
    82                  glmenu/glmenu_imagescreen.cc
     83                 glmenu/glmenu_imagescreen.cc \
     84                 lib/xmlparser/tinyxml.cc \
     85                 lib/xmlparser/tinystr.cc \
     86                 lib/xmlparser/tinyxmlerror.cc \
     87                 lib/xmlparser/tinyxmlparser.cc
     88                 
    8389
    8490noinst_HEADERS = orxonox.h \
  • orxonox/trunk/src/Makefile.in

    r3966 r4010  
    5555am_orxonox_OBJECTS = orxonox.$(OBJEXT) game_loader.$(OBJEXT) \
    5656        command_node.$(OBJEXT) keynames.$(OBJEXT) camera.$(OBJEXT) \
    57         track_manager.$(OBJEXT) track_node.$(OBJEXT) \
     57        track_manager.$(OBJEXT) track_node.$(OBJEXT) factory.$(OBJEXT) \
    5858        animation.$(OBJEXT) animation3d.$(OBJEXT) \
    5959        animation_player.$(OBJEXT) garbage_collector.$(OBJEXT) \
     
    7272        base_entity.$(OBJEXT) base_object.$(OBJEXT) \
    7373        ini_parser.$(OBJEXT) list.$(OBJEXT) resource_manager.$(OBJEXT) \
    74         vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT)
     74        vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \
     75        tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
     76        tinyxmlparser.$(OBJEXT)
    7577orxonox_OBJECTS = $(am_orxonox_OBJECTS)
    7678orxonox_LDADD = $(LDADD)
     
    8789@AMDEP_TRUE@    ./$(DEPDIR)/command_node.Po ./$(DEPDIR)/curve.Po \
    8890@AMDEP_TRUE@    ./$(DEPDIR)/data_tank.Po \
    89 @AMDEP_TRUE@    ./$(DEPDIR)/environment.Po \
     91@AMDEP_TRUE@    ./$(DEPDIR)/environment.Po ./$(DEPDIR)/factory.Po \
    9092@AMDEP_TRUE@    ./$(DEPDIR)/game_loader.Po \
    9193@AMDEP_TRUE@    ./$(DEPDIR)/garbage_collector.Po \
     
    110112@AMDEP_TRUE@    ./$(DEPDIR)/test_bullet.Po ./$(DEPDIR)/test_gun.Po \
    111113@AMDEP_TRUE@    ./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \
     114@AMDEP_TRUE@    ./$(DEPDIR)/tinystr.Po ./$(DEPDIR)/tinyxml.Po \
     115@AMDEP_TRUE@    ./$(DEPDIR)/tinyxmlerror.Po \
     116@AMDEP_TRUE@    ./$(DEPDIR)/tinyxmlparser.Po \
    112117@AMDEP_TRUE@    ./$(DEPDIR)/track_manager.Po \
    113118@AMDEP_TRUE@    ./$(DEPDIR)/track_node.Po ./$(DEPDIR)/vector.Po \
     
    251256                 track_manager.cc \
    252257                 track_node.cc \
     258                 factory.cc \
    253259                 util/animation/animation.cc \
    254260                 util/animation/animation3d.cc \
     
    294300                 lib/math/vector.cc \
    295301                 lib/math/curve.cc \
    296                  glmenu/glmenu_imagescreen.cc
     302                 glmenu/glmenu_imagescreen.cc \
     303                 lib/xmlparser/tinyxml.cc \
     304                 lib/xmlparser/tinystr.cc \
     305                 lib/xmlparser/tinyxmlerror.cc \
     306                 lib/xmlparser/tinyxmlparser.cc
    297307
    298308noinst_HEADERS = orxonox.h \
     
    450460@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_tank.Po@am__quote@
    451461@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environment.Po@am__quote@
     462@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/factory.Po@am__quote@
    452463@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/game_loader.Po@am__quote@
    453464@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/garbage_collector.Po@am__quote@
     
    481492@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text_engine.Po@am__quote@
    482493@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
     494@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinystr.Po@am__quote@
     495@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinyxml.Po@am__quote@
     496@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinyxmlerror.Po@am__quote@
     497@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinyxmlparser.Po@am__quote@
    483498@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@
    484499@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_node.Po@am__quote@
     
    12071222@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    12081223@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o glmenu_imagescreen.obj `if test -f 'glmenu/glmenu_imagescreen.cc'; then $(CYGPATH_W) 'glmenu/glmenu_imagescreen.cc'; else $(CYGPATH_W) '$(srcdir)/glmenu/glmenu_imagescreen.cc'; fi`
     1224
     1225tinyxml.o: lib/xmlparser/tinyxml.cc
     1226@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxml.o -MD -MP -MF "$(DEPDIR)/tinyxml.Tpo" -c -o tinyxml.o `test -f 'lib/xmlparser/tinyxml.cc' || echo '$(srcdir)/'`lib/xmlparser/tinyxml.cc; \
     1227@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/tinyxml.Tpo" "$(DEPDIR)/tinyxml.Po"; else rm -f "$(DEPDIR)/tinyxml.Tpo"; exit 1; fi
     1228@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/xmlparser/tinyxml.cc' object='tinyxml.o' libtool=no @AMDEPBACKSLASH@
     1229@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/tinyxml.Po' tmpdepfile='$(DEPDIR)/tinyxml.TPo' @AMDEPBACKSLASH@
     1230@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1231@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxml.o `test -f 'lib/xmlparser/tinyxml.cc' || echo '$(srcdir)/'`lib/xmlparser/tinyxml.cc
     1232
     1233tinyxml.obj: lib/xmlparser/tinyxml.cc
     1234@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxml.obj -MD -MP -MF "$(DEPDIR)/tinyxml.Tpo" -c -o tinyxml.obj `if test -f 'lib/xmlparser/tinyxml.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinyxml.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinyxml.cc'; fi`; \
     1235@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/tinyxml.Tpo" "$(DEPDIR)/tinyxml.Po"; else rm -f "$(DEPDIR)/tinyxml.Tpo"; exit 1; fi
     1236@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/xmlparser/tinyxml.cc' object='tinyxml.obj' libtool=no @AMDEPBACKSLASH@
     1237@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/tinyxml.Po' tmpdepfile='$(DEPDIR)/tinyxml.TPo' @AMDEPBACKSLASH@
     1238@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1239@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxml.obj `if test -f 'lib/xmlparser/tinyxml.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinyxml.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinyxml.cc'; fi`
     1240
     1241tinystr.o: lib/xmlparser/tinystr.cc
     1242@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinystr.o -MD -MP -MF "$(DEPDIR)/tinystr.Tpo" -c -o tinystr.o `test -f 'lib/xmlparser/tinystr.cc' || echo '$(srcdir)/'`lib/xmlparser/tinystr.cc; \
     1243@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/tinystr.Tpo" "$(DEPDIR)/tinystr.Po"; else rm -f "$(DEPDIR)/tinystr.Tpo"; exit 1; fi
     1244@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/xmlparser/tinystr.cc' object='tinystr.o' libtool=no @AMDEPBACKSLASH@
     1245@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/tinystr.Po' tmpdepfile='$(DEPDIR)/tinystr.TPo' @AMDEPBACKSLASH@
     1246@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1247@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinystr.o `test -f 'lib/xmlparser/tinystr.cc' || echo '$(srcdir)/'`lib/xmlparser/tinystr.cc
     1248
     1249tinystr.obj: lib/xmlparser/tinystr.cc
     1250@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinystr.obj -MD -MP -MF "$(DEPDIR)/tinystr.Tpo" -c -o tinystr.obj `if test -f 'lib/xmlparser/tinystr.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinystr.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinystr.cc'; fi`; \
     1251@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/tinystr.Tpo" "$(DEPDIR)/tinystr.Po"; else rm -f "$(DEPDIR)/tinystr.Tpo"; exit 1; fi
     1252@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/xmlparser/tinystr.cc' object='tinystr.obj' libtool=no @AMDEPBACKSLASH@
     1253@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/tinystr.Po' tmpdepfile='$(DEPDIR)/tinystr.TPo' @AMDEPBACKSLASH@
     1254@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1255@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinystr.obj `if test -f 'lib/xmlparser/tinystr.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinystr.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinystr.cc'; fi`
     1256
     1257tinyxmlerror.o: lib/xmlparser/tinyxmlerror.cc
     1258@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxmlerror.o -MD -MP -MF "$(DEPDIR)/tinyxmlerror.Tpo" -c -o tinyxmlerror.o `test -f 'lib/xmlparser/tinyxmlerror.cc' || echo '$(srcdir)/'`lib/xmlparser/tinyxmlerror.cc; \
     1259@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/tinyxmlerror.Tpo" "$(DEPDIR)/tinyxmlerror.Po"; else rm -f "$(DEPDIR)/tinyxmlerror.Tpo"; exit 1; fi
     1260@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/xmlparser/tinyxmlerror.cc' object='tinyxmlerror.o' libtool=no @AMDEPBACKSLASH@
     1261@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/tinyxmlerror.Po' tmpdepfile='$(DEPDIR)/tinyxmlerror.TPo' @AMDEPBACKSLASH@
     1262@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1263@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlerror.o `test -f 'lib/xmlparser/tinyxmlerror.cc' || echo '$(srcdir)/'`lib/xmlparser/tinyxmlerror.cc
     1264
     1265tinyxmlerror.obj: lib/xmlparser/tinyxmlerror.cc
     1266@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxmlerror.obj -MD -MP -MF "$(DEPDIR)/tinyxmlerror.Tpo" -c -o tinyxmlerror.obj `if test -f 'lib/xmlparser/tinyxmlerror.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinyxmlerror.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinyxmlerror.cc'; fi`; \
     1267@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/tinyxmlerror.Tpo" "$(DEPDIR)/tinyxmlerror.Po"; else rm -f "$(DEPDIR)/tinyxmlerror.Tpo"; exit 1; fi
     1268@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/xmlparser/tinyxmlerror.cc' object='tinyxmlerror.obj' libtool=no @AMDEPBACKSLASH@
     1269@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/tinyxmlerror.Po' tmpdepfile='$(DEPDIR)/tinyxmlerror.TPo' @AMDEPBACKSLASH@
     1270@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1271@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlerror.obj `if test -f 'lib/xmlparser/tinyxmlerror.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinyxmlerror.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinyxmlerror.cc'; fi`
     1272
     1273tinyxmlparser.o: lib/xmlparser/tinyxmlparser.cc
     1274@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxmlparser.o -MD -MP -MF "$(DEPDIR)/tinyxmlparser.Tpo" -c -o tinyxmlparser.o `test -f 'lib/xmlparser/tinyxmlparser.cc' || echo '$(srcdir)/'`lib/xmlparser/tinyxmlparser.cc; \
     1275@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/tinyxmlparser.Tpo" "$(DEPDIR)/tinyxmlparser.Po"; else rm -f "$(DEPDIR)/tinyxmlparser.Tpo"; exit 1; fi
     1276@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/xmlparser/tinyxmlparser.cc' object='tinyxmlparser.o' libtool=no @AMDEPBACKSLASH@
     1277@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/tinyxmlparser.Po' tmpdepfile='$(DEPDIR)/tinyxmlparser.TPo' @AMDEPBACKSLASH@
     1278@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1279@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlparser.o `test -f 'lib/xmlparser/tinyxmlparser.cc' || echo '$(srcdir)/'`lib/xmlparser/tinyxmlparser.cc
     1280
     1281tinyxmlparser.obj: lib/xmlparser/tinyxmlparser.cc
     1282@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tinyxmlparser.obj -MD -MP -MF "$(DEPDIR)/tinyxmlparser.Tpo" -c -o tinyxmlparser.obj `if test -f 'lib/xmlparser/tinyxmlparser.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinyxmlparser.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinyxmlparser.cc'; fi`; \
     1283@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/tinyxmlparser.Tpo" "$(DEPDIR)/tinyxmlparser.Po"; else rm -f "$(DEPDIR)/tinyxmlparser.Tpo"; exit 1; fi
     1284@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/xmlparser/tinyxmlparser.cc' object='tinyxmlparser.obj' libtool=no @AMDEPBACKSLASH@
     1285@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/tinyxmlparser.Po' tmpdepfile='$(DEPDIR)/tinyxmlparser.TPo' @AMDEPBACKSLASH@
     1286@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1287@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlparser.obj `if test -f 'lib/xmlparser/tinyxmlparser.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinyxmlparser.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinyxmlparser.cc'; fi`
    12091288uninstall-info-am:
    12101289
  • orxonox/trunk/src/defs/stdincl.h

    r3863 r4010  
    2727
    2828#include "compiler.h"
     29#include "xmlparser/tinyxml.h"
     30#include "factory.h"
    2931
    3032#endif /* _STDINCL_H */
  • orxonox/trunk/src/game_loader.cc

    r3727 r4010  
    2525#include "command_node.h"
    2626#include "vector.h"
     27#include "factory.h"
    2728
    2829#include <string.h>
     
    164165     can load everything it needs into memory then.
    165166  */
     167 
     168  if( name == NULL)
     169    {
     170      PRINTF0("No filename specified for loading");
     171      return NULL;
     172    }
     173 
     174  TiXmlDocument* XMLDoc = new TiXmlDocument( name);
     175  // load the campaign document
     176  if( !XMLDoc->LoadFile())
     177    {
     178      // report an error
     179      PRINTF0("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     180      delete XMLDoc;
     181      return NULL;
     182    }
     183       
     184  // check basic validity
     185  TiXmlElement* root = XMLDoc->RootElement();
     186  assert( root != NULL);
     187       
     188  if( strcmp( root->Value(), "Campaign"))
     189    {
     190      // report an error
     191      PRINTF(0)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
     192      delete XMLDoc;
     193      return NULL;
     194    }
     195       
     196  // construct campaign
     197  Campaign* c = new Campaign( root);
     198       
     199  // free the XML data
     200  delete XMLDoc;
     201       
     202  return c;
    166203}
    167204
     
    230267    this->currentCampaign->previousLevel();
    231268}
     269
     270/**
     271   \brief add a Factory to the Factory Q
     272   \param factory a Factory to be registered
     273*/
     274void GameLoader::registerFactory( Factory* factory)
     275{
     276        assert( factory != NULL);
     277       
     278        PRINTF0("Registered factory for '%s'\n", factory->getClassname());
     279       
     280        if( first == NULL) first = factory;
     281        else first->registerFactory( factory);
     282}
     283
     284/**
     285   \brief load a StoryEntity
     286   \param element a XMLElement containing all the needed info
     287*/
     288BaseObject* GameLoader::fabricate( TiXmlElement* element)
     289{
     290        assert( element != NULL);
     291       
     292        if( first == NULL)
     293        {
     294                PRINTF0("GameLoader does not know any factories, fabricate() failed\n");
     295                return NULL;
     296        }
     297       
     298        if( element->Value() != NULL)
     299        {
     300                PRINTF0("Attempting fabrication of a '%s'\n", element->Value());
     301                BaseObject* b = first->fabricate( element);
     302                if( b == NULL) PRINTF0("Failed to fabricate a '%s'\n", element->Value());
     303                else PRINTF0("Successfully fabricated a '%s'\n", element->Value());
     304                return b;
     305        }
     306       
     307        PRINTF0("Fabricate failed, TiXmlElement did not contain a value\n");
     308       
     309        return NULL;
     310}
  • orxonox/trunk/src/game_loader.h

    r3629 r4010  
    1010#include "story_def.h"
    1111#include "comincl.h"
     12
    1213
    1314//-----------------------------------------------------------------------------
     
    5152  ErrorMessage loadDebugCampaign(Uint32 campaignID);
    5253 
     54  void registerFactory( Factory* factory);
     55  BaseObject* fabricate( TiXmlElement* data);
     56
    5357 private:
    5458  GameLoader ();
     
    6266  Campaign* fileToCampaign(char* name);
    6367
     68  Factory* first;
    6469};
    6570
  • orxonox/trunk/src/orxonox.cc

    r4009 r4010  
    3434#include "resource_manager.h"
    3535#include "text_engine.h"
     36#include "factory.h"
    3637
    3738#include <string.h>
     
    200201 
    201202  this->gameLoader = GameLoader::getInstance();
    202   this->gameLoader->loadDebugCampaign(DEBUG_CAMPAIGN_0);
     203  this->gameLoader->loadCampaign("../data/worlds/DefaultCampaign.oxc");
     204  //  this->gameLoader->loadDebugCampaign(DEBUG_CAMPAIGN_0);
    203205  this->gameLoader->init();
    204206  this->gameLoader->start();
     
    346348#include "player.h"
    347349#include "base_object.h"
     350
    348351#include <asm/msr.h>
    349352#include <linux/timex.h>
  • orxonox/trunk/src/story_entities/campaign.cc

    r3832 r4010  
    1919#include "campaign.h"
    2020
     21#include "game_loader.h"
    2122#include "story_entity.h"
    2223
     
    3435  this->isInit = false;
    3536}
    36 
     37Campaign::Campaign ( TiXmlElement* root)
     38{
     39  TiXmlElement* element;
     40  const char* string;
     41  int id;
     42 
     43  PRINTF0("Loading Campaign...\n");
     44 
     45  assert( root != NULL);
     46  GameLoader* loader = GameLoader::getInstance();
     47 
     48  this->entities = new tList<StoryEntity>();
     49  this->isInit = false;
     50 
     51  // grab all the necessary parameters
     52  string = grabParameter( root, "identifier");
     53  if( string == NULL || sscanf(string, "%d", &id) != 1)
     54    {
     55      PRINTF0("Campaign is missing a proper 'identifier'\n");
     56      this->setStoryID( -1);
     57    }
     58  else this->setStoryID( id);
     59 
     60  // find WorldList
     61  element = root->FirstChildElement( "WorldList");
     62  if( element == NULL)
     63    {
     64      PRINTF0("Campaign is missing a proper 'WorldList'\n");
     65    }
     66  else
     67    element = element->FirstChildElement();
     68 
     69  // load Worlds/Subcampaigns/Whatever
     70  StoryEntity* lastCreated = NULL;
     71  while( element != NULL)
     72    {
     73      printf("Campaign: Constructor: adding a world\n");
     74      StoryEntity* created = (StoryEntity*) loader->fabricate( element);
     75      /*
     76      if( lastCreated != NULL)
     77        created->setNextStoryID( lastCreated->getStoryID());
     78      else
     79        created->setNextStoryID( WORLD_ID_GAMEEND);
     80      */
     81      if( created != NULL)
     82        {
     83          this->addEntity( created);   
     84          lastCreated = created;
     85        }
     86      element = element->NextSiblingElement();
     87    }
     88  //if( lastCreated != NULL)
     89  //lastCreated->setStoryID( WORLD_ID_GAMEEND);
     90}
    3791
    3892Campaign::~Campaign () {}
  • orxonox/trunk/src/story_entities/campaign.h

    r3608 r4010  
    1414 public:
    1515  Campaign ();
     16  Campaign ( TiXmlElement* root);
    1617  virtual ~Campaign ();
    1718
  • orxonox/trunk/src/story_entities/world.cc

    r3993 r4010  
     1
    12
    23/*
     
    4344#include "glmenu_imagescreen.h"
    4445#include "list.h"
     46#include "game_loader.h"
    4547
    4648#include "animation3d.h"
    4749
     50#include "substring.h"
    4851
    4952using namespace std;
    50 
    5153
    5254WorldInterface* WorldInterface::singletonRef = 0;
     
    114116}
    115117
    116 
     118CREATE_FACTORY(World);
     119
     120World::World( TiXmlElement* root)
     121{
     122  this->constuctorInit("", -1);
     123
     124  const char *string;
     125  char *name;
     126  int id;
     127 
     128  PRINTF0("Creating a World\n");
     129 
     130  // identifier
     131  string = grabParameter( root, "identifier");
     132  if( string == NULL || sscanf(string, "%d", &id) != 1)
     133    {
     134      PRINTF0("World is missing a proper 'identifier'\n");
     135      this->setStoryID( -1);
     136    }
     137  else setStoryID( id);
     138
     139  // next id
     140  string = grabParameter( root, "nextid");
     141  if( string == NULL || sscanf(string, "%d", &id) != 1)
     142    {
     143      PRINTF0("World is missing a proper 'nextid'\n");
     144      this->setStoryID( -1);
     145    }
     146  else setNextStoryID( id);
     147 
     148
     149  // path
     150  string = grabParameter( root, "path");
     151  if( string == NULL)
     152    {
     153      PRINTF0("World is missing a proper 'path'\n");
     154      this->setPath( NULL);
     155    }
     156  else
     157    {
     158      name = new char[strlen(string + 2)];
     159      strcpy( name, string);
     160      this->setPath( name);
     161    }
     162}
    117163
    118164/**
     
    123169World::World (char* name)
    124170{
    125   this->init(name, -1);
     171  this->constuctorInit(name, -1);
    126172  //NullParent* np = NullParent::getInstance();
    127173}
     
    133179World::World (int worldID)
    134180{
    135   this->init(NULL, worldID);
     181  this->constuctorInit(NULL, worldID);
    136182}
    137183
     
    178224   NO LEVEL LOADING HERE - NEVER!
    179225*/
    180 void World::init(char* name, int worldID)
     226void World::constuctorInit(char* name, int worldID)
    181227{
    182228  this->setClassName ("World");
    183229
    184   this->worldName = name;
     230  //this->worldName = name;
     231  //this->worldName = new char[strlen(name)+1];
     232  //strcpy(this->worldName, name);
    185233  this->debugWorldNr = worldID;
    186234  this->entities = new tList<WorldEntity>();
    187   AnimationPlayer::getInstance(); // initializes the animationPlayer
    188235}
    189236
     
    201248  wi->init(this);
    202249  this->garbageCollector = GarbageCollector::getInstance();
     250
    203251  this->trackManager = TrackManager::getInstance();
    204252  this->lightMan = LightManager::getInstance();
     
    206254  this->nullParent->setName ("NullParent");
    207255
     256  AnimationPlayer::getInstance(); // initializes the animationPlayer
     257
    208258}
    209259
     
    213263*/
    214264ErrorMessage World::load()
    215 {
    216   //  BezierCurve* tmpCurve = new BezierCurve();
    217   if(this->debugWorldNr != -1)
    218     {
    219       // initializing Font
    220       this->glmis->step();
     265{       
     266  PRINTF0("> Loading world: '%s'\n", getPath());
     267 
     268  GameLoader* loader = GameLoader::getInstance();
     269 
     270  if( getPath() == NULL)
     271    {
     272      PRINTF0("World has no path specified for loading");
     273      return (ErrorMessage){213,"Path not specified","World::load()"};
     274    }
     275 
     276  TiXmlDocument* XMLDoc = new TiXmlDocument( path);
     277  // load the campaign document
     278  if( !XMLDoc->LoadFile())
     279    //this->glmis->step();
     280 
     281  {
     282    // report an error
     283    PRINTF0("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     284    delete XMLDoc;
     285    return (ErrorMessage){213,"XML File parsing error","World::load()"};
     286  }
     287 
     288  // check basic validity
     289  TiXmlElement* root = XMLDoc->RootElement();
     290  assert( root != NULL);
     291 
     292  if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile"))
     293    {
     294      // report an error
     295      PRINTF0("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
     296      delete XMLDoc;
     297      return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"};
     298    }
     299 
     300  // load the parameters
     301  // name
     302  char* temp;
     303  const char* string = grabParameter( root, "name");
     304  if( string == NULL)
     305    {
     306      PRINTF0("World is missing a proper 'name'\n");
     307      string = "Unknown";
     308      temp = new char[strlen(string + 2)];
     309      strcpy( temp, string);
     310      this->worldName = temp;
     311    }
     312  else
     313    {
     314      temp = new char[strlen(string + 2)];
     315      strcpy( temp, string);
     316      this->worldName = temp;
     317    }
     318 
     319 
     320  // find WorldEntities
     321  TiXmlElement* element = root->FirstChildElement( "WorldEntities");
     322 
     323  if( element == NULL)
     324    {
     325      PRINTF0("World is missing 'WorldEntities'\n");
     326    }
     327  else
     328    {
     329      element = element->FirstChildElement();
     330      // load Players/Objects/Whatever
     331      PRINTF0("Loading WorldEntities\n");
     332      while( element != NULL)
     333        {
     334          WorldEntity* created = (WorldEntity*) loader->fabricate( element);
     335          if( created != NULL) this->spawn( created);
     336          // if we load a 'Player' we use it as localPlayer
     337          //todo do this more elegant
     338          if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created;
     339          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) skyBox = (SkyBox*) created;
     340          element = element->NextSiblingElement();
     341        }
     342      PRINTF0("Done loading WorldEntities\n");
     343    }
     344 
     345  // find Track
     346  /*element = root->FirstChildElement( "Track");
     347  if( element == NULL)
     348    {
     349      PRINTF0("============>>>>>>>>>>>>>>>>>World is missing a 'Track'\n");
     350    }
     351  else
     352    {   
     353      //load track
     354      PRINTF0("============>>>>>>>>>>>>>>>>Loading Track\n");
     355
     356      trackManager->loadTrack( element);
     357      trackManager->finalize();
     358      PRINTF0("============>>>>>>>>>>>>>>>>Done loading Track\n");
     359    }*/
     360 
     361  // free the XML data
     362  delete XMLDoc;
     363 
     364  // finalize world
     365  // initialize Font
     366//  testFont = new FontSet();
     367//  testFont->buildFont("../data/pictures/font.tga");
     368 
     369  // create null parent
     370  this->nullParent = NullParent::getInstance ();
     371  this->nullParent->setName ("NullParent");
     372 
     373  // finalize myPlayer
     374  if( localPlayer == NULL)
     375    {
     376      PRINTF0("No Player specified in World '%s'\n", this->worldName);
     377      return (ErrorMessage){213,"No Player defined","World::load()"};
     378    }
     379 
     380  // bind input
     381  Orxonox *orx = Orxonox::getInstance ();
     382  orx->getLocalInput()->bind (localPlayer);
     383 
     384  // bind camera
     385  this->localCamera = new Camera();
     386  this->localCamera->setName ("camera");
     387  //this->localCamera->bind (localPlayer);
     388  this->localPlayer->addChild (this->localCamera);
     389 
     390 
     391  // stuff beyond this point remains to be loaded properly
     392 
    221393      // initializing the TrackManager
    222 
     394  this->trackManager = TrackManager::getInstance();
    223395      //trackManager->addPoint(Vector(0,0,0));
    224396      trackManager->addPoint(Vector(150, -35, 5));
     
    278450
    279451     
    280       /*monitor progress*/
    281       this->glmis->step();
    282 
    283       // LIGHT initialisation
    284 
    285       lightMan->setAmbientColor(.1,.1,.1);
    286       lightMan->addLight();
    287       //      lightMan->setAttenuation(1.0, .01, 0.0);
    288       //      lightMan->setDiffuseColor(1,1,1);
    289       //  lightMan->addLight(1);
    290       //  lightMan->setPosition(20, 10, -20);
    291       //  lightMan->setDiffuseColor(0,0,0);
    292       lightMan->debug();
    293 
    294       switch(this->debugWorldNr)
    295         {
    296           /*
    297             this loads the hard-coded debug world. this only for simplicity and will be
    298             removed by a reald world-loader, which interprets a world-file.
    299             if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
    300             make whatever you want...
    301            */
    302         case DEBUG_WORLD_0:
    303           {
    304             lightMan->setPosition(-5.0, 10.0, -40.0);
    305 
    306             // !\todo old track-system has to be removed
    307 
    308             //create helper for player
    309             //HelperParent* hp = new HelperParent ();
    310             /* the player has to be added to this helper */
    311 
    312             // create a player
    313             this->localPlayer = new Player ();
    314             this->localPlayer->setName ("player");
    315             this->spawn (this->localPlayer);
    316             /*monitor progress*/
    317             //this->glmis->step();
    318             this->glmis->step();
    319 
    320             // bind input
    321             Orxonox *orx = Orxonox::getInstance ();
    322             orx->getLocalInput()->bind (this->localPlayer);
     452  // LIGHT initialisation
     453  lightMan = LightManager::getInstance();
     454  lightMan->setAmbientColor(.1,.1,.1);
     455  lightMan->addLight();
     456  //      lightMan->setAttenuation(1.0, .01, 0.0);
     457  //      lightMan->setDiffuseColor(1,1,1);
     458  //  lightMan->addLight(1);
     459  //  lightMan->setPosition(20, 10, -20);
     460  //  lightMan->setDiffuseColor(0,0,0);
     461  lightMan->debug();
     462  lightMan->setPosition(-5.0, 10.0, -40.0);
     463 
     464  //        trackManager->setBindSlave(env);
     465  PNode* tn = trackManager->getTrackNode();
     466  tn->addChild(this->localPlayer);
     467 
     468  //localCamera->setParent(TrackNode::getInstance());
     469  tn->addChild(this->localCamera);
     470  localCamera->lookAt(tn);
     471  this->localPlayer->setMode(PNODE_ALL);
     472  Vector* cameraOffset = new Vector (0, 5, -10);
     473  trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     474 
     475
     476  // initialize debug coord system
     477  objectList = glGenLists(1);
     478  glNewList (objectList, GL_COMPILE);
     479 
     480  //  trackManager->drawGraph(.01);
     481  trackManager->debug(2);
     482  glEndList();
     483
     484  terrain = new Terrain("../data/worlds/newGround.obj");
     485  terrain->setRelCoor(Vector(0,-10,0));
     486  this->spawn(terrain);
     487
     488}
     489
     490void World::loadDebugWorld(int worldID)
     491{
     492  /*monitor progress*/
     493  this->glmis->step();
     494
     495  // LIGHT initialisation
     496
     497  lightMan->setAmbientColor(.1,.1,.1);
     498  lightMan->addLight();
     499  //      lightMan->setAttenuation(1.0, .01, 0.0);
     500  //      lightMan->setDiffuseColor(1,1,1);
     501  //  lightMan->addLight(1);
     502  //  lightMan->setPosition(20, 10, -20);
     503  //  lightMan->setDiffuseColor(0,0,0);
     504  lightMan->debug();
     505
     506  switch(this->debugWorldNr)
     507    {
     508      /*
     509        this loads the hard-coded debug world. this only for simplicity and will be
     510        removed by a reald world-loader, which interprets a world-file.
     511        if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
     512        make whatever you want...
     513      */
     514    case DEBUG_WORLD_0:
     515      {
     516        lightMan->setPosition(-5.0, 10.0, -40.0);
     517
     518        // !\todo old track-system has to be removed
     519
     520        //create helper for player
     521        //HelperParent* hp = new HelperParent ();
     522        /* the player has to be added to this helper */
     523
     524        // create a player
     525        this->localPlayer = new Player ();
     526        this->localPlayer->setName ("player");
     527        this->spawn (this->localPlayer);
     528        /*monitor progress*/
     529        //this->glmis->step();
     530        this->glmis->step();
     531
     532        // bind input
     533        Orxonox *orx = Orxonox::getInstance ();
     534        orx->getLocalInput()->bind (this->localPlayer);
    323535           
    324             // bind camera
    325             this->localCamera = new Camera();
    326             this->localCamera->setName ("camera");
     536        // bind camera
     537        this->localCamera = new Camera();
     538        this->localCamera->setName ("camera");
    327539           
    328             /*monitor progress*/
    329             this->glmis->step();
    330 
    331             // Create SkySphere
    332             //      this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
    333             //      this->skySphere->setName("SkySphere");
    334             //      this->localCamera->addChild(this->skySphere);
    335             //      this->spawn(this->skySphere);
    336             skyBox = new SkyBox();
    337             skyBox->setTexture("pictures/sky/skybox", "jpg");
    338             skyBox->setParent(localCamera);
    339             this->spawn(skyBox);
    340 
    341             /*monitor progress*/
    342             this->glmis->step();
     540        /*monitor progress*/
     541        this->glmis->step();
     542
     543        // Create SkySphere
     544        //          this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
     545        //          this->skySphere->setName("SkySphere");
     546        //          this->localCamera->addChild(this->skySphere);
     547        //          this->spawn(this->skySphere);
     548        skyBox = new SkyBox();
     549        skyBox->setTexture("pictures/sky/skybox", "jpg");
     550        skyBox->setParent(localCamera);
     551        this->spawn(skyBox);
     552
     553        /*monitor progress*/
     554        this->glmis->step();
    343555
    344556           
    345             WorldEntity* env = new Environment();
    346             env->setName ("env");
    347             this->spawn(env);
     557        WorldEntity* env = new Environment();
     558        env->setName ("env");
     559        this->spawn(env);
    348560
    349561           
    350             /*
    351             Vector* es = new Vector (10, 5, 0);
    352             Quaternion* qs = new Quaternion ();
    353             WorldEntity* pr = new Primitive(P_CYLINDER);
    354             pr->setName("primitive");
    355             this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
    356             */
    357 
    358             /*monitor progress*/
    359             this->glmis->step();
    360 
    361             //      trackManager->setBindSlave(env);
    362             PNode* tn = trackManager->getTrackNode();
    363             tn->addChild(this->localPlayer);
    364             this->localCamera->lookAt(tn);
    365 
    366             //localCamera->setParent(TrackNode::getInstance());
    367             tn->addChild(this->localCamera);
    368             //      localCamera->lookAt(tn);
    369             this->localPlayer->setMode(PNODE_ALL);
    370             //Vector* cameraOffset = new Vector (0, 5, -10);
    371             trackManager->condition(2, LEFTRIGHT, this->localPlayer);
    372             this->glmis->step();
    373             break;
    374           }
    375         case DEBUG_WORLD_1:
    376           {
    377             lightMan->setPosition(.0, .0, .0);
    378             lightMan->setAttenuation(1.0, .01, 0.0);
    379             lightMan->setSpecularColor(1,0,0);
    380             this->nullParent = NullParent::getInstance ();
    381             this->nullParent->setName ("NullParent");
    382 
    383             // create a player
    384             WorldEntity* myPlayer = new Player();
    385             myPlayer->setName ("player");
    386             this->spawn(myPlayer);
    387             this->localPlayer = myPlayer;           
     562        /*
     563          Vector* es = new Vector (10, 5, 0);
     564          Quaternion* qs = new Quaternion ();
     565          WorldEntity* pr = new Primitive(P_CYLINDER);
     566          pr->setName("primitive");
     567          this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
     568        */
     569
     570        /*monitor progress*/
     571        this->glmis->step();
     572
     573        //          trackManager->setBindSlave(env);
     574        PNode* tn = trackManager->getTrackNode();
     575        tn->addChild(this->localPlayer);
     576        this->localCamera->lookAt(tn);
     577
     578        //localCamera->setParent(TrackNode::getInstance());
     579        tn->addChild(this->localCamera);
     580        //          localCamera->lookAt(tn);
     581        this->localPlayer->setMode(PNODE_ALL);
     582        //Vector* cameraOffset = new Vector (0, 5, -10);
     583        trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     584        this->glmis->step();
     585        break;
     586      }
     587    case DEBUG_WORLD_1:
     588      {
     589        lightMan->setPosition(.0, .0, .0);
     590        lightMan->setAttenuation(1.0, .01, 0.0);
     591        lightMan->setSpecularColor(1,0,0);
     592        this->nullParent = NullParent::getInstance ();
     593        this->nullParent->setName ("NullParent");
     594
     595        // create a player
     596        WorldEntity* myPlayer = new Player();
     597        myPlayer->setName ("player");
     598        this->spawn(myPlayer);
     599        this->localPlayer = myPlayer;       
    388600           
    389             // bind input
    390             Orxonox *orx = Orxonox::getInstance();
    391             orx->getLocalInput()->bind (myPlayer);
     601        // bind input
     602        Orxonox *orx = Orxonox::getInstance();
     603        orx->getLocalInput()->bind (myPlayer);
    392604           
    393             // bind camera
    394             this->localCamera = new Camera ();
    395             this->localCamera->setName ("camera");
    396             this->localCamera->lookAt(LightManager::getInstance()->getLight(0));
    397             this->localCamera->setParent(this->localPlayer);
    398 
    399             // Create SkySphere
    400             skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
    401             this->localPlayer->addChild(this->skySphere);
    402             this->spawn(this->skySphere);
    403             Vector* es = new Vector (20, 0, 0);
    404             Quaternion* qs = new Quaternion ();
    405 
    406             lightMan->getLight(0)->setParent(trackManager->getTrackNode());
    407             break;
    408           }
    409         case DEBUG_WORLD_2:
    410           {
    411             lightMan->setAmbientColor(.1,.1,.1);
    412             lightMan->addLight();
    413             lightMan->setPosition(-5.0, 10.0, -40.0);
    414             this->nullParent = NullParent::getInstance ();
    415             this->nullParent->setName ("NullParent");
    416 
    417             // !\todo old track-system has to be removed
    418 
    419             //create helper for player
    420             //HelperParent* hp = new HelperParent ();
    421             /* the player has to be added to this helper */
    422 
    423             // create a player
    424             this->localPlayer = new Player ();
    425             this->localPlayer->setName ("player");
    426             this->spawn (this->localPlayer);
    427             /*monitor progress*/
    428             //this->glmis->step();         
    429             this->glmis->step();
    430 
    431             // bind input
    432             Orxonox *orx = Orxonox::getInstance ();
    433             orx->getLocalInput()->bind (this->localPlayer);
     605        // bind camera
     606        this->localCamera = new Camera ();
     607        this->localCamera->setName ("camera");
     608        this->localCamera->lookAt(LightManager::getInstance()->getLight(0));
     609        this->localCamera->setParent(this->localPlayer);
     610
     611        // Create SkySphere
     612        skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
     613        this->localPlayer->addChild(this->skySphere);
     614        this->spawn(this->skySphere);
     615        Vector* es = new Vector (20, 0, 0);
     616        Quaternion* qs = new Quaternion ();
     617
     618        lightMan->getLight(0)->setParent(trackManager->getTrackNode());
     619        break;
     620      }
     621    case DEBUG_WORLD_2:
     622      {
     623        lightMan->setAmbientColor(.1,.1,.1);
     624        lightMan->addLight();
     625        lightMan->setPosition(-5.0, 10.0, -40.0);
     626        this->nullParent = NullParent::getInstance ();
     627        this->nullParent->setName ("NullParent");
     628
     629        // !\todo old track-system has to be removed
     630
     631        //create helper for player
     632        //HelperParent* hp = new HelperParent ();
     633        /* the player has to be added to this helper */
     634
     635        // create a player
     636        this->localPlayer = new Player ();
     637        this->localPlayer->setName ("player");
     638        this->spawn (this->localPlayer);
     639        /*monitor progress*/
     640        //this->glmis->step();     
     641        this->glmis->step();
     642
     643        // bind input
     644        Orxonox *orx = Orxonox::getInstance ();
     645        orx->getLocalInput()->bind (this->localPlayer);
    434646           
    435             // bind camera
    436             this->localCamera = new Camera();
    437             this->localCamera->setName ("camera");
    438             this->localCamera->lookAt(this->localPlayer);
    439             this->localCamera->setParent(this->localPlayer);
     647        // bind camera
     648        this->localCamera = new Camera();
     649        this->localCamera->setName ("camera");
     650        this->localCamera->lookAt(this->localPlayer);
     651        this->localCamera->setParent(this->localPlayer);
    440652           
    441             /*monitor progress*/
    442             this->glmis->step();
    443 
    444             // Create SkySphere
    445             this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
    446             this->skySphere->setName("SkySphere");
    447             this->spawn(this->skySphere);
    448             this->localCamera->addChild(this->skySphere);
    449             this->skySphere->setMode(PNODE_MOVEMENT);
    450             /*monitor progress*/
    451             this->glmis->step();
    452 
    453 
    454             WorldEntity* baseNode = new Satellite(Vector(1,0,1), 1.2);
    455             this->localPlayer->addChild(baseNode);
    456             baseNode->setRelCoor(Vector(10.0, 2.0, 1.0));
    457             this->spawn(baseNode);
    458 
    459             WorldEntity* secondNode = new Satellite(Vector(0,0,1), 2.0);
    460             baseNode->addChild(secondNode);
    461             secondNode->setRelCoor(Vector(0.0, 0.0, 3.0));
    462             this->spawn(secondNode);
    463 
    464 
    465             WorldEntity* thirdNode = new Satellite(Vector(0,0,1), 1.0);
    466             secondNode->addChild(thirdNode);
    467             thirdNode->setRelCoor(Vector(2.0, 0.0, 0.0));
    468             this->spawn(thirdNode);
     653        /*monitor progress*/
     654        this->glmis->step();
     655
     656        // Create SkySphere
     657        this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
     658        this->skySphere->setName("SkySphere");
     659        this->spawn(this->skySphere);
     660        this->localCamera->addChild(this->skySphere);
     661        this->skySphere->setMode(PNODE_MOVEMENT);
     662        /*monitor progress*/
     663        this->glmis->step();
     664
     665
     666        WorldEntity* baseNode = new Satellite(Vector(1,0,1), 1.2);
     667        this->localPlayer->addChild(baseNode);
     668        baseNode->setRelCoor(Vector(10.0, 2.0, 1.0));
     669        this->spawn(baseNode);
     670
     671        WorldEntity* secondNode = new Satellite(Vector(0,0,1), 2.0);
     672        baseNode->addChild(secondNode);
     673        secondNode->setRelCoor(Vector(0.0, 0.0, 3.0));
     674        this->spawn(secondNode);
     675
     676
     677        WorldEntity* thirdNode = new Satellite(Vector(0,0,1), 1.0);
     678        secondNode->addChild(thirdNode);
     679        thirdNode->setRelCoor(Vector(2.0, 0.0, 0.0));
     680        this->spawn(thirdNode);
    469681
    470682           
    471683   
    472             WorldEntity* c = new Environment();
    473             this->localPlayer->addChild(c);
    474             c->setRelCoor(Vector(10.0, 2.0, -1.0));
    475             this->spawn(c);
     684        WorldEntity* c = new Environment();
     685        this->localPlayer->addChild(c);
     686        c->setRelCoor(Vector(10.0, 2.0, -1.0));
     687        this->spawn(c);
    476688
    477689
    478690           
    479             Animation3D* animation = new Animation3D(c);
    480             animation->setInfinity(ANIM_INF_REPLAY);
    481 
    482 
    483             animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
    484             animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
    485             animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
    486 
    487 
    488 
    489 
    490 
    491 
    492             /*     
    493                   KeyFrame* f1 = new KeyFrame;
    494                   f1->position = new Vector(-1.1, 0.0, 2.6);
    495                   f1->direction = new Quaternion();
    496                   f1->time = 1.0;
    497                   f1->mode = NEG_EXP;
     691        Animation3D* animation = new Animation3D(c);
     692        animation->setInfinity(ANIM_INF_REPLAY);
     693
     694
     695        animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
     696        animation->addKeyFrame(Vector(0, 2, 0), Quaternion(M_PI, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
     697        animation->addKeyFrame(Vector(0, 0, 0), Quaternion(0, Vector(0,1,0)), 1.0, ANIM_NEG_EXP, ANIM_LINEAR);
     698
     699
     700
     701
     702
     703
     704        /*         
     705          KeyFrame* f1 = new KeyFrame;
     706          f1->position = new Vector(-1.1, 0.0, 2.6);
     707          f1->direction = new Quaternion();
     708          f1->time = 1.0;
     709          f1->mode = NEG_EXP;
    498710                 
    499711                 
    500                   KeyFrame* f2 = new KeyFrame;
    501                   f2->position = new Vector(-2.1, 0.0, 2.6);
    502                   f2->direction = new Quaternion();
    503                   f2->time = 0.1;
    504                   f2->mode = NEG_EXP;
     712          KeyFrame* f2 = new KeyFrame;
     713          f2->position = new Vector(-2.1, 0.0, 2.6);
     714          f2->direction = new Quaternion();
     715          f2->time = 0.1;
     716          f2->mode = NEG_EXP;
    505717                 
    506                   KeyFrame* f3 = new KeyFrame;
    507                   f3->position = new Vector(10.0, 2.0, -1.0);
    508                   f3->direction = new Quaternion();
    509                   f3->time = 0.2;
    510                   f3->mode = NEG_EXP;
     718          KeyFrame* f3 = new KeyFrame;
     719          f3->position = new Vector(10.0, 2.0, -1.0);
     720          f3->direction = new Quaternion();
     721          f3->time = 0.2;
     722          f3->mode = NEG_EXP;
    511723                 
    512                   KeyFrame* f4 = new KeyFrame;
    513                   f4->position = new Vector(10.0, 5.0, -1.0);
    514                   f4->direction = new Quaternion();
    515                   f4->time = 1.0;
    516                   f4->mode = NEG_EXP;
     724          KeyFrame* f4 = new KeyFrame;
     725          f4->position = new Vector(10.0, 5.0, -1.0);
     726          f4->direction = new Quaternion();
     727          f4->time = 1.0;
     728          f4->mode = NEG_EXP;
    517729                 
    518730                 
    519731                 
    520                   this->simpleAnimation->animatorBegin();
    521                   this->simpleAnimation->selectObject(b);
    522                   this->simpleAnimation->setAnimationMode(SINGLE);
    523                   this->simpleAnimation->addKeyFrame(f1);
    524                   this->simpleAnimation->addKeyFrame(f2);
    525                   this->simpleAnimation->start();
    526                   this->simpleAnimation->selectObject(c);
    527                   this->simpleAnimation->addKeyFrame(f3);
    528                   this->simpleAnimation->addKeyFrame(f4);
    529                   this->simpleAnimation->start();
    530                   this->simpleAnimation->animatorEnd();
    531             */
    532 
    533             /*
    534             Vector* es = new Vector (10, 5, 0);
    535             Quaternion* qs = new Quaternion ();
    536             WorldEntity* pr = new Primitive(P_CYLINDER);
    537             pr->setName("primitive");
    538             this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
    539             */
    540 
    541             /*monitor progress*/
    542             this->glmis->step();
    543 
    544             //      trackManager->setBindSlave(env);
    545             PNode* tn = trackManager->getTrackNode();
    546             tn->addChild(this->localPlayer);
    547 
    548             //localCamera->setParent(TrackNode::getInstance());
    549             tn->addChild(this->localCamera);
    550             //      localCamera->lookAt(tn);
    551             this->localPlayer->setMode(PNODE_ALL);
    552             //Vector* cameraOffset = new Vector (0, 5, -10);
    553             trackManager->condition(2, LEFTRIGHT, this->localPlayer);
    554             this->glmis->step();
    555 
    556             break;
    557           }
    558         default:
    559           printf("World::load() - no world with ID %i found", this->debugWorldNr );
    560         }
    561     }
    562   else if(this->worldName != NULL)
    563     {
    564 
    565     }
    566 
    567   // initialize debug coord system
    568   objectList = glGenLists(1);
    569   glNewList (objectList, GL_COMPILE);
    570  
    571   //  trackManager->drawGraph(.01);
    572   trackManager->debug(2);
    573   glEndList();
    574 
    575   terrain = new Terrain("../data/worlds/newGround.obj");
    576   terrain->setRelCoor(Vector(0,-10,0));
    577   this->spawn(terrain);
    578 
    579 }
     732          this->simpleAnimation->animatorBegin();
     733          this->simpleAnimation->selectObject(b);
     734          this->simpleAnimation->setAnimationMode(SINGLE);
     735          this->simpleAnimation->addKeyFrame(f1);
     736          this->simpleAnimation->addKeyFrame(f2);
     737          this->simpleAnimation->start();
     738          this->simpleAnimation->selectObject(c);
     739          this->simpleAnimation->addKeyFrame(f3);
     740          this->simpleAnimation->addKeyFrame(f4);
     741          this->simpleAnimation->start();
     742          this->simpleAnimation->animatorEnd();
     743        */
     744
     745        /*
     746          Vector* es = new Vector (10, 5, 0);
     747          Quaternion* qs = new Quaternion ();
     748          WorldEntity* pr = new Primitive(P_CYLINDER);
     749          pr->setName("primitive");
     750          this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
     751        */
     752
     753        /*monitor progress*/
     754        this->glmis->step();
     755
     756        //          trackManager->setBindSlave(env);
     757        PNode* tn = trackManager->getTrackNode();
     758        tn->addChild(this->localPlayer);
     759
     760        //localCamera->setParent(TrackNode::getInstance());
     761        tn->addChild(this->localCamera);
     762        //          localCamera->lookAt(tn);
     763        this->localPlayer->setMode(PNODE_ALL);
     764        //Vector* cameraOffset = new Vector (0, 5, -10);
     765        trackManager->condition(2, LEFTRIGHT, this->localPlayer);
     766        this->glmis->step();
     767
     768        break;
     769      }
     770    default:
     771      printf("World::load() - no world with ID %i found", this->debugWorldNr );
     772    }
     773}
     774
    580775
    581776
     
    8521047      this->tick ();
    8531048      // Update the state
    854       this->update ();      
     1049      this->update ();     
    8551050      // Process collision
    8561051      this->collide ();
     
    9351130        }
    9361131      delete iterator;
    937       //skySphere->updatePosition(localCamera->absCoordinate);
    938      
     1132
    9391133      /* update tick the rest */
    9401134      this->trackManager->tick(this->dt);
     
    10551249}
    10561250
     1251void World::setPath( const char* name)
     1252{
     1253  this->path = new char[strlen(name)+1];
     1254  strcpy(this->path, name);
     1255}
     1256
     1257const char* World::getPath( void)
     1258{
     1259  return path;
     1260}
  • orxonox/trunk/src/story_entities/world.h

    r3851 r4010  
    1111#include "story_entity.h"
    1212#include "p_node.h"
    13 
     13#include "xmlparser/tinyxml.h"
    1414
    1515class World;
     
    5757  World (char* name);
    5858  World (int worldID);
     59  World (TiXmlElement* root);
    5960  virtual ~World ();
    6061
     
    7071  virtual ErrorMessage resume ();
    7172  virtual ErrorMessage destroy ();
     73
     74  void loadDebugWorld(int worldID);
    7275
    7376  virtual void displayLoadScreen();
     
    8588             int parentingMode);
    8689
     90  const char* getPath();
     91  void setPath( const char* name);
    8792
    8893 private:
    89   void init(char* name, int worldID);
     94  void constuctorInit(char* name, int worldID);
    9095
    9196  Uint32 lastFrame;                   //!< last time of frame
     
    100105  char* worldName;                    //!< The name of this World
    101106  int debugWorldNr;                   //!< The Debug Nr. needed, if something goes wrong
     107  char* path;                         //!< The file from which this world is loaded
    102108
    103109  PNode* nullParent;                  //!< The zero-point, that everything has as its parent.
  • orxonox/trunk/src/world_entities/player.cc

    r4000 r4010  
    1 
    2 
    31/*
    42   orxonox - the future of 3D-vertical-scrollers
     
    3129
    3230using namespace std;
     31
     32CREATE_FACTORY(Player);
    3333
    3434/**
     
    7474}
    7575
     76/**
     77   \brief creates a new Player from Xml Data
     78   \param root the xml element containing player data
     79   
     80   \todo add more parameters to load
     81*/
     82Player::Player(TiXmlElement* root) : WorldEntity(root)
     83{
     84  /*
     85    char* temp;
     86    const char* string;
     87    string = grabParameter( root, "name");
     88    if( string == NULL)
     89    {
     90    PRINTF0("Player is missing a proper 'name'\n");
     91    string = "Unknown";
     92    temp = new char[strlen(string + 2)];
     93    strcpy( temp, string);
     94    this->setName( temp);
     95    }
     96    else
     97    {
     98    temp = new char[strlen(string + 2)];
     99    strcpy( temp, string);
     100    this->setName( temp);
     101    }
     102   
     103    this->model = NULL;
     104    string = grabParameter( root, "model");
     105    if( string != NULL)
     106    this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);
     107    else
     108    {
     109    PRINTF0("Player is missing a proper 'model'\n");
     110    this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
     111    }
     112    if( this->model == NULL)
     113    {
     114    PRINTF0("Player model '%s' could not be loaded\n", string);
     115    }
     116  */
     117  this->weapons = new tList<Weapon>();
     118  this->activeWeapon = NULL;
     119  /*
     120    this is the debug player - actualy we would have to make a new
     121     class derivated from Player for each player. for now, we just use
     122     the player.cc for debug also
     123  */
     124  travelSpeed = 15.0;
     125  velocity = new Vector();
     126  bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
     127  bFire = false;
     128  this->bWeaponChange = false;
     129  acceleration = 10.0;
     130  //weapons:
     131  this->weaponMan = new WeaponManager();
     132  Weapon* wpRight = new TestGun(this, Vector(-2.6, 0.1, 3.0), Quaternion(), 0);
     133  Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1);
     134 
     135  this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0);
     136  this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1);
     137  this->weaponMan->addWeapon(wpRight, W_CONFIG2);
     138  this->weaponMan->addWeapon(wpLeft, W_CONFIG2);
     139}
    76140
    77141/**
  • orxonox/trunk/src/world_entities/player.h

    r3873 r4010  
    2222 public:
    2323  Player();
     24  Player(TiXmlElement* root);
    2425  virtual ~Player();
    2526
  • orxonox/trunk/src/world_entities/skybox.cc

    r3913 r4010  
    2828
    2929#include "skybox.h"
     30
    3031#include "stdincl.h"
     32#include "factory.h"
    3133
    3234#include "material.h"
     
    3638//#include "world_entity.h"
    3739
     40CREATE_FACTORY(SkyBox);
    3841
    3942using namespace std;
     
    4447*/
    4548SkyBox::SkyBox(char* fileName)
     49{
     50  this->init();
     51}
     52
     53SkyBox::SkyBox(TiXmlElement* root) : WorldEntity(root)
     54{
     55  this->init();
     56
     57  // Name Setup
     58  char* temp;
     59  const char* string;
     60
     61  // Model Loading     
     62  this->model = NULL;
     63  string = grabParameter( root, "materialset");
     64  if( string != NULL)
     65    this->setTexture(string, "jpg");
     66  else
     67    {
     68      PRINTF(0)("SkyBox is missing a proper 'MaterialSet'\n");
     69      this->model = (Model*)ResourceManager::getInstance()->load("cube", OBJ, RP_CAMPAIGN);
     70    }
     71  if( this->model == NULL)
     72    {
     73      PRINTF(0)("SkyBox model '%s' could not be loaded\n", string);
     74    }
     75}
     76
     77void SkyBox::init(void)
    4678{
    4779  this->setClassName("SkyBox");
  • orxonox/trunk/src/world_entities/skybox.h

    r3807 r4010  
    2222 public:
    2323  SkyBox(char* fileName = NULL);
     24  SkyBox(TiXmlElement* root);
     25
    2426  virtual ~SkyBox();
     27
     28  void init(void);
    2529
    2630  void setSize(float size);
  • orxonox/trunk/src/world_entities/world_entity.cc

    r3832 r4010  
    3838   class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.
    3939*/
    40 WorldEntity::WorldEntity (bool isFree) : bFree(isFree)
     40WorldEntity::WorldEntity ()
    4141{
    4242  this->setClassName ("WorldEntity");
     
    4646}
    4747
     48WorldEntity::WorldEntity(TiXmlElement* root)
     49{
     50  // Name Setup
     51  char* temp;
     52  const char* string;
     53  string = grabParameter( root, "name");
     54  if( string == NULL)
     55    {
     56      PRINTF(0)("WorldEntity is missing a proper 'name'\n");
     57      string = "Unknown";
     58      temp = new char[strlen(string + 2)];
     59      strcpy( temp, string);
     60      this->setName( temp);
     61    }
     62  else
     63    {
     64      temp = new char[strlen(string + 2)];
     65      strcpy( temp, string);
     66      this->setName( temp);
     67    }
     68  // Model Loading     
     69  this->model = NULL;
     70  string = grabParameter( root, "model");
     71  if( string != NULL)
     72    this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);
     73  else
     74    {
     75      PRINTF(0)("WorldEntity is missing a proper 'model'\n");
     76      this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
     77    }
     78  if( this->model == NULL)
     79    {
     80      PRINTF(0)("WorldEntity model '%s' could not be loaded\n", string);
     81    }
     82
     83  this->bDraw = true;
     84}
     85
    4886/**
    4987   \brief standard destructor
     
    73111{}
    74112
    75 
    76 /**
    77    \brief query whether the WorldEntity in question is free
    78    \return true if the WorldEntity is free or false if it isn't
    79 */
    80 bool WorldEntity::isFree ()
    81 {
    82   return bFree;
    83 }
    84113
    85114/**
  • orxonox/trunk/src/world_entities/world_entity.h

    r3799 r4010  
    2323
    2424 public:
    25   WorldEntity (bool isFree = false);
     25  WorldEntity (void);
     26  WorldEntity(TiXmlElement* root);
    2627  virtual ~WorldEntity ();
    2728
     
    3233  //void removeAbility(Ability* ability);
    3334  void setDrawable (bool bDraw); 
    34   bool isFree ();
    3535  void setCharacterAttributes(CharacterAttributes* charAttr);
    3636  CharacterAttributes* getCharacterAttributes();
     
    5252 
    5353 private:
    54   const bool bFree;                   //!< If the entity is free.
    5554  bool bCollide;                      //!< If it should be considered for the collisiontest.
    5655  bool bDraw;                         //!< If it should be visible.
Note: See TracChangeset for help on using the changeset viewer.