Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3790 in orxonox.OLD


Ignore:
Timestamp:
Apr 13, 2005, 12:33:07 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the textEngine back into the trunk.
merged with command:
svn merge -r 3681:HEAD branches/textEngine/ trunk/

conflicts in:
world.cc/h orxonox.cc NEWS
changed in favor of the trunk

Location:
orxonox/trunk
Files:
1 deleted
20 edited
4 copied

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/ChangeLog

    r3601 r3790  
     12005-03-31      Benjamin Grauer <bensch@orxonox.ethz.ch>
     2        Added Text Engine
     3
     42005-03-26      Benjamin Grauer <bensch@orxonox.ethz.ch>
     5        Added ResourceManager
     6
     72005-03-24      Patrick Boenzli <patrick@orxonox.ethz.ch>
     8        Reimplemented shooting.
     9
    1102005-03-16      orxonox
    211        Finished work on version 0.2.1-pre-alpha released 0.2.2-pre-alpha
  • orxonox/trunk/config.h.in

    r3592 r3790  
    5353#undef HAVE_PTHREAD_H
    5454
    55 /* Define to 1 if you have the <SDL/SDL.h> header file. */
    56 #undef HAVE_SDL_SDL_H
     55/* Define to 1 if you have the <SDL.h> header file. */
     56#undef HAVE_SDL_H
    5757
    58 /* Define to 1 if you have the <SDL/SDL_image.h> header file. */
    59 #undef HAVE_SDL_SDL_IMAGE_H
     58/* Define to 1 if you have the <SDL_image.h> header file. */
     59#undef HAVE_SDL_IMAGE_H
     60
     61/* Define to 1 if you have the <SDL_ttf.h> header file. */
     62#undef HAVE_SDL_TTF_H
    6063
    6164/* Define to 1 if you have the `sqrt' function. */
  • orxonox/trunk/configure

    r3789 r3790  
    42054205echo "mingw-WINDOWS detected"
    42064206
     4207CPPFLAGS="-I/usr/include/SDL -I/mingw/include/SDL"
     4208
    42074209    mingw="yes"
    42084210    MSBITFIELDS="-mms-bitfields"
     
    48114813# checking for SDL-headers
    48124814
    4813 for ac_header in SDL/SDL.h
     4815for ac_header in SDL.h
    48144816do
    48154817as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    51185120 Linux="yes"
    51195121
    5120 CPPFLAGS="-I/usr/X11R6/include"
     5122CPPFLAGS="-I/usr/X11R6/include -I/usr/include/SDL"
    51215123LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
    51225124# checking gl header
     
    55915593# checking for SDL-headers
    55925594
    5593 for ac_header in SDL/SDL.h
     5595for ac_header in SDL.h
    55945596do
    55955597as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    61806182###################################
    61816183
     6184#---------#
     6185# SDL_ttf #
     6186#---------#
     6187# checking for SDL_ttf-headers
     6188
     6189for ac_header in SDL_ttf.h
     6190do
     6191as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     6192if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6193  echo "$as_me:$LINENO: checking for $ac_header" >&5
     6194echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6195if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6196  echo $ECHO_N "(cached) $ECHO_C" >&6
     6197fi
     6198echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6199echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6200else
     6201  # Is the header compilable?
     6202echo "$as_me:$LINENO: checking $ac_header usability" >&5
     6203echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
     6204cat >conftest.$ac_ext <<_ACEOF
     6205/* confdefs.h.  */
     6206_ACEOF
     6207cat confdefs.h >>conftest.$ac_ext
     6208cat >>conftest.$ac_ext <<_ACEOF
     6209/* end confdefs.h.  */
     6210$ac_includes_default
     6211#include <$ac_header>
     6212_ACEOF
     6213rm -f conftest.$ac_objext
     6214if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6215  (eval $ac_compile) 2>conftest.er1
     6216  ac_status=$?
     6217  grep -v '^ *+' conftest.er1 >conftest.err
     6218  rm -f conftest.er1
     6219  cat conftest.err >&5
     6220  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6221  (exit $ac_status); } &&
     6222         { ac_try='test -z "$ac_c_werror_flag"
     6223                         || test ! -s conftest.err'
     6224  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6225  (eval $ac_try) 2>&5
     6226  ac_status=$?
     6227  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6228  (exit $ac_status); }; } &&
     6229         { ac_try='test -s conftest.$ac_objext'
     6230  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6231  (eval $ac_try) 2>&5
     6232  ac_status=$?
     6233  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6234  (exit $ac_status); }; }; then
     6235  ac_header_compiler=yes
     6236else
     6237  echo "$as_me: failed program was:" >&5
     6238sed 's/^/| /' conftest.$ac_ext >&5
     6239
     6240ac_header_compiler=no
     6241fi
     6242rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6243echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     6244echo "${ECHO_T}$ac_header_compiler" >&6
     6245
     6246# Is the header present?
     6247echo "$as_me:$LINENO: checking $ac_header presence" >&5
     6248echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
     6249cat >conftest.$ac_ext <<_ACEOF
     6250/* confdefs.h.  */
     6251_ACEOF
     6252cat confdefs.h >>conftest.$ac_ext
     6253cat >>conftest.$ac_ext <<_ACEOF
     6254/* end confdefs.h.  */
     6255#include <$ac_header>
     6256_ACEOF
     6257if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     6258  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     6259  ac_status=$?
     6260  grep -v '^ *+' conftest.er1 >conftest.err
     6261  rm -f conftest.er1
     6262  cat conftest.err >&5
     6263  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6264  (exit $ac_status); } >/dev/null; then
     6265  if test -s conftest.err; then
     6266    ac_cpp_err=$ac_c_preproc_warn_flag
     6267    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     6268  else
     6269    ac_cpp_err=
     6270  fi
     6271else
     6272  ac_cpp_err=yes
     6273fi
     6274if test -z "$ac_cpp_err"; then
     6275  ac_header_preproc=yes
     6276else
     6277  echo "$as_me: failed program was:" >&5
     6278sed 's/^/| /' conftest.$ac_ext >&5
     6279
     6280  ac_header_preproc=no
     6281fi
     6282rm -f conftest.err conftest.$ac_ext
     6283echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     6284echo "${ECHO_T}$ac_header_preproc" >&6
     6285
     6286# So?  What about this header?
     6287case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     6288  yes:no: )
     6289    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
     6290echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     6291    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
     6292echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     6293    ac_header_preproc=yes
     6294    ;;
     6295  no:yes:* )
     6296    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
     6297echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     6298    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
     6299echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
     6300    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
     6301echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
     6302    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
     6303echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     6304    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
     6305echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     6306    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
     6307echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     6308    (
     6309      cat <<\_ASBOX
     6310## ---------------------------------------------- ##
     6311## Report this to orxonox-dev at mail.datacore.ch ##
     6312## ---------------------------------------------- ##
     6313_ASBOX
     6314    ) |
     6315      sed "s/^/$as_me: WARNING:     /" >&2
     6316    ;;
     6317esac
     6318echo "$as_me:$LINENO: checking for $ac_header" >&5
     6319echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6320if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6321  echo $ECHO_N "(cached) $ECHO_C" >&6
     6322else
     6323  eval "$as_ac_Header=\$ac_header_preproc"
     6324fi
     6325echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6326echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6327
     6328fi
     6329if test `eval echo '${'$as_ac_Header'}'` = yes; then
     6330  cat >>confdefs.h <<_ACEOF
     6331#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     6332_ACEOF
     6333
     6334else
     6335  { { echo "$as_me:$LINENO: error: cannot find SDL_ttf header." >&5
     6336echo "$as_me: error: cannot find SDL_ttf header." >&2;}
     6337   { (exit 1); exit 1; }; }
     6338fi
     6339
     6340done
     6341
     6342#fi
     6343# checking for SDL_ttf-lib
     6344  echo "$as_me:$LINENO: checking for main in -lSDL_ttf" >&5
     6345echo $ECHO_N "checking for main in -lSDL_ttf... $ECHO_C" >&6
     6346if test "${ac_cv_lib_SDL_ttf_main+set}" = set; then
     6347  echo $ECHO_N "(cached) $ECHO_C" >&6
     6348else
     6349  ac_check_lib_save_LIBS=$LIBS
     6350LIBS="-lSDL_ttf  $LIBS"
     6351cat >conftest.$ac_ext <<_ACEOF
     6352/* confdefs.h.  */
     6353_ACEOF
     6354cat confdefs.h >>conftest.$ac_ext
     6355cat >>conftest.$ac_ext <<_ACEOF
     6356/* end confdefs.h.  */
     6357
     6358
     6359int
     6360main ()
     6361{
     6362main ();
     6363  ;
     6364  return 0;
     6365}
     6366_ACEOF
     6367rm -f conftest.$ac_objext conftest$ac_exeext
     6368if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
     6369  (eval $ac_link) 2>conftest.er1
     6370  ac_status=$?
     6371  grep -v '^ *+' conftest.er1 >conftest.err
     6372  rm -f conftest.er1
     6373  cat conftest.err >&5
     6374  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6375  (exit $ac_status); } &&
     6376         { ac_try='test -z "$ac_c_werror_flag"
     6377                         || test ! -s conftest.err'
     6378  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6379  (eval $ac_try) 2>&5
     6380  ac_status=$?
     6381  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6382  (exit $ac_status); }; } &&
     6383         { ac_try='test -s conftest$ac_exeext'
     6384  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6385  (eval $ac_try) 2>&5
     6386  ac_status=$?
     6387  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6388  (exit $ac_status); }; }; then
     6389  ac_cv_lib_SDL_ttf_main=yes
     6390else
     6391  echo "$as_me: failed program was:" >&5
     6392sed 's/^/| /' conftest.$ac_ext >&5
     6393
     6394ac_cv_lib_SDL_ttf_main=no
     6395fi
     6396rm -f conftest.err conftest.$ac_objext \
     6397      conftest$ac_exeext conftest.$ac_ext
     6398LIBS=$ac_check_lib_save_LIBS
     6399fi
     6400echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_ttf_main" >&5
     6401echo "${ECHO_T}$ac_cv_lib_SDL_ttf_main" >&6
     6402if test $ac_cv_lib_SDL_ttf_main = yes; then
     6403  FOUND_SDL_ttf=yes
     6404fi
     6405
     6406     if test x$FOUND_SDL_ttf = xyes ; then
     6407       LIBS="$LIBS -lSDL_ttf"
     6408     else
     6409        echo "------------------"
     6410        echo "SDL_ttf library not found."
     6411        echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/"
     6412        echo "------------------"
     6413        exit -1
     6414     fi
     6415
    61826416#-----------#
    61836417# SDL_Image #
     
    61866420# checking for SDL_image-headers
    61876421
    6188 for ac_header in SDL/SDL_image.h
     6422for ac_header in SDL_image.h
    61896423do
    61906424as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
  • orxonox/trunk/configure.ac

    r3789 r3790  
    235235echo "mingw-WINDOWS detected"
    236236
     237CPPFLAGS="-I/usr/include/SDL -I/mingw/include/SDL"
     238
    237239    mingw="yes"
    238240    MSBITFIELDS="-mms-bitfields"
     
    279281    fi
    280282# checking for SDL-headers
    281     AC_CHECK_HEADERS([SDL/SDL.h] ,,
     283    AC_CHECK_HEADERS([SDL.h] ,,
    282284      [AC_MSG_ERROR([cannot find SDL headers]) ])
    283285
     
    313315 Linux="yes"
    314316
    315 CPPFLAGS="-I/usr/X11R6/include"
     317CPPFLAGS="-I/usr/X11R6/include -I/usr/include/SDL"
    316318LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS"
    317319# checking gl header
     
    347349
    348350# checking for SDL-headers
    349     AC_CHECK_HEADERS([SDL/SDL.h] ,,
     351    AC_CHECK_HEADERS([SDL.h] ,,
    350352      [AC_MSG_ERROR([cannot find SDL headers]) ])
    351353
     
    420422###################################
    421423
     424#---------#
     425# SDL_ttf #
     426#---------#
     427# checking for SDL_ttf-headers
     428  AC_CHECK_HEADERS([SDL_ttf.h] ,,
     429      [AC_MSG_ERROR([cannot find SDL_ttf header.])])
     430#fi
     431# checking for SDL_ttf-lib
     432  AC_CHECK_LIB([SDL_ttf], [main], [FOUND_SDL_ttf=yes])
     433     if test x$FOUND_SDL_ttf = xyes ; then
     434       LIBS="$LIBS -lSDL_ttf"
     435     else
     436        echo "------------------"
     437        echo "SDL_ttf library not found."
     438        echo "please install the SDL_ttf library, which can be found at http://www.libsdl.org/projects/SDL_ttf/"
     439        echo "------------------"
     440        exit -1
     441     fi   
     442
    422443#-----------#
    423444# SDL_Image #
     
    425446if test x$def_sdl_image = xyes; then
    426447# checking for SDL_image-headers
    427   AC_CHECK_HEADERS([SDL/SDL_image.h] ,,
     448  AC_CHECK_HEADERS([SDL_image.h] ,,
    428449      [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
    429450fi
  • orxonox/trunk/src/Makefile.am

    r3761 r3790  
    77AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data
    88AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics
    9 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/font
    109AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer
    1110AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui
     
    3433                 track_manager.cc \
    3534                 track_node.cc \
     35                 animation.cc \
    3636                 simple_animation.cc \
    3737                 garbage_collector.cc \
     
    5757                 lib/graphics/graphics_engine.cc \
    5858                 lib/graphics/light.cc \
    59                  lib/graphics/font/fontset.cc \
     59                 lib/graphics/text_engine.cc \
    6060                 lib/graphics/importer/array.cc \
    6161                 lib/graphics/importer/objModel.cc \
     
    8383                 track_manager.h \
    8484                 track_node.h \
     85                 animation.h \
    8586                 simple_animation.h \
    8687                 garbage_collector.h \
     
    114115                 lib/graphics/graphics_engine.h \
    115116                 lib/graphics/light.h \
    116                  lib/graphics/font/fontset.h \
     117                 lib/graphics/text_engine.h \
    117118                 lib/data/data_tank.h \
    118119                 lib/lang/base_entity.h \
  • orxonox/trunk/src/Makefile.in

    r3789 r3790  
    5656        command_node.$(OBJEXT) keynames.$(OBJEXT) camera.$(OBJEXT) \
    5757        track_manager.$(OBJEXT) track_node.$(OBJEXT) \
    58         simple_animation.$(OBJEXT) garbage_collector.$(OBJEXT) \
    59         story_entity.$(OBJEXT) campaign.$(OBJEXT) world.$(OBJEXT) \
    60         world_entity.$(OBJEXT) player.$(OBJEXT) environment.$(OBJEXT) \
    61         skysphere.$(OBJEXT) terrain.$(OBJEXT) weapon.$(OBJEXT) \
    62         projectile.$(OBJEXT) satellite.$(OBJEXT) \
    63         character_attributes.$(OBJEXT) test_gun.$(OBJEXT) \
    64         test_bullet.$(OBJEXT) ai.$(OBJEXT) p_node.$(OBJEXT) \
    65         null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \
     58        animation.$(OBJEXT) simple_animation.$(OBJEXT) \
     59        garbage_collector.$(OBJEXT) story_entity.$(OBJEXT) \
     60        campaign.$(OBJEXT) world.$(OBJEXT) world_entity.$(OBJEXT) \
     61        player.$(OBJEXT) environment.$(OBJEXT) skysphere.$(OBJEXT) \
     62        terrain.$(OBJEXT) weapon.$(OBJEXT) projectile.$(OBJEXT) \
     63        satellite.$(OBJEXT) character_attributes.$(OBJEXT) \
     64        test_gun.$(OBJEXT) test_bullet.$(OBJEXT) ai.$(OBJEXT) \
     65        p_node.$(OBJEXT) null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \
    6666        data_tank.$(OBJEXT) graphics_engine.$(OBJEXT) light.$(OBJEXT) \
    67         fontset.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \
     67        text_engine.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \
    6868        primitive_model.$(OBJEXT) model.$(OBJEXT) material.$(OBJEXT) \
    6969        texture.$(OBJEXT) base_entity.$(OBJEXT) base_object.$(OBJEXT) \
     
    7575depcomp = $(SHELL) $(top_srcdir)/depcomp
    7676am__depfiles_maybe = depfiles
    77 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ai.Po ./$(DEPDIR)/array.Po \
    78 @AMDEP_TRUE@    ./$(DEPDIR)/base_entity.Po \
     77@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ai.Po ./$(DEPDIR)/animation.Po \
     78@AMDEP_TRUE@    ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_entity.Po \
    7979@AMDEP_TRUE@    ./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \
    8080@AMDEP_TRUE@    ./$(DEPDIR)/campaign.Po \
     
    8282@AMDEP_TRUE@    ./$(DEPDIR)/command_node.Po ./$(DEPDIR)/curve.Po \
    8383@AMDEP_TRUE@    ./$(DEPDIR)/data_tank.Po \
    84 @AMDEP_TRUE@    ./$(DEPDIR)/environment.Po ./$(DEPDIR)/fontset.Po \
     84@AMDEP_TRUE@    ./$(DEPDIR)/environment.Po \
    8585@AMDEP_TRUE@    ./$(DEPDIR)/game_loader.Po \
    8686@AMDEP_TRUE@    ./$(DEPDIR)/garbage_collector.Po \
     
    102102@AMDEP_TRUE@    ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/terrain.Po \
    103103@AMDEP_TRUE@    ./$(DEPDIR)/test_bullet.Po ./$(DEPDIR)/test_gun.Po \
    104 @AMDEP_TRUE@    ./$(DEPDIR)/texture.Po \
     104@AMDEP_TRUE@    ./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \
    105105@AMDEP_TRUE@    ./$(DEPDIR)/track_manager.Po \
    106106@AMDEP_TRUE@    ./$(DEPDIR)/track_node.Po ./$(DEPDIR)/vector.Po \
     
    235235target_vendor = @target_vendor@
    236236MAINSRCDIR = .
    237 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/font -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai
     237AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai
    238238AM_LDFLAGS = $(MWINDOWS)
    239239orxonox_SOURCES = orxonox.cc \
     
    244244                 track_manager.cc \
    245245                 track_node.cc \
     246                 animation.cc \
    246247                 simple_animation.cc \
    247248                 garbage_collector.cc \
     
    267268                 lib/graphics/graphics_engine.cc \
    268269                 lib/graphics/light.cc \
    269                  lib/graphics/font/fontset.cc \
     270                 lib/graphics/text_engine.cc \
    270271                 lib/graphics/importer/array.cc \
    271272                 lib/graphics/importer/objModel.cc \
     
    293294                 track_manager.h \
    294295                 track_node.h \
     296                 animation.h \
    295297                 simple_animation.h \
    296298                 garbage_collector.h \
     
    324326                 lib/graphics/graphics_engine.h \
    325327                 lib/graphics/light.h \
    326                  lib/graphics/font/fontset.h \
     328                 lib/graphics/text_engine.h \
    327329                 lib/data/data_tank.h \
    328330                 lib/lang/base_entity.h \
     
    416418
    417419@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ai.Po@am__quote@
     420@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation.Po@am__quote@
    418421@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
    419422@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@
     
    426429@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_tank.Po@am__quote@
    427430@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environment.Po@am__quote@
    428 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontset.Po@am__quote@
    429431@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/game_loader.Po@am__quote@
    430432@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/garbage_collector.Po@am__quote@
     
    453455@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bullet.Po@am__quote@
    454456@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gun.Po@am__quote@
     457@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text_engine.Po@am__quote@
    455458@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
    456459@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@
     
    813816@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o light.obj `if test -f 'lib/graphics/light.cc'; then $(CYGPATH_W) 'lib/graphics/light.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/light.cc'; fi`
    814817
    815 fontset.o: lib/graphics/font/fontset.cc
    816 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fontset.o -MD -MP -MF "$(DEPDIR)/fontset.Tpo" -c -o fontset.o `test -f 'lib/graphics/font/fontset.cc' || echo '$(srcdir)/'`lib/graphics/font/fontset.cc; \
    817 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/fontset.Tpo" "$(DEPDIR)/fontset.Po"; else rm -f "$(DEPDIR)/fontset.Tpo"; exit 1; fi
    818 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/font/fontset.cc' object='fontset.o' libtool=no @AMDEPBACKSLASH@
    819 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/fontset.Po' tmpdepfile='$(DEPDIR)/fontset.TPo' @AMDEPBACKSLASH@
    820 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    821 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fontset.o `test -f 'lib/graphics/font/fontset.cc' || echo '$(srcdir)/'`lib/graphics/font/fontset.cc
    822 
    823 fontset.obj: lib/graphics/font/fontset.cc
    824 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fontset.obj -MD -MP -MF "$(DEPDIR)/fontset.Tpo" -c -o fontset.obj `if test -f 'lib/graphics/font/fontset.cc'; then $(CYGPATH_W) 'lib/graphics/font/fontset.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/font/fontset.cc'; fi`; \
    825 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/fontset.Tpo" "$(DEPDIR)/fontset.Po"; else rm -f "$(DEPDIR)/fontset.Tpo"; exit 1; fi
    826 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/font/fontset.cc' object='fontset.obj' libtool=no @AMDEPBACKSLASH@
    827 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/fontset.Po' tmpdepfile='$(DEPDIR)/fontset.TPo' @AMDEPBACKSLASH@
    828 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    829 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fontset.obj `if test -f 'lib/graphics/font/fontset.cc'; then $(CYGPATH_W) 'lib/graphics/font/fontset.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/font/fontset.cc'; fi`
     818text_engine.o: lib/graphics/text_engine.cc
     819@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.o -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.o `test -f 'lib/graphics/text_engine.cc' || echo '$(srcdir)/'`lib/graphics/text_engine.cc; \
     820@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi
     821@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/text_engine.cc' object='text_engine.o' libtool=no @AMDEPBACKSLASH@
     822@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.TPo' @AMDEPBACKSLASH@
     823@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     824@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o text_engine.o `test -f 'lib/graphics/text_engine.cc' || echo '$(srcdir)/'`lib/graphics/text_engine.cc
     825
     826text_engine.obj: lib/graphics/text_engine.cc
     827@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.obj -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.obj `if test -f 'lib/graphics/text_engine.cc'; then $(CYGPATH_W) 'lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/text_engine.cc'; fi`; \
     828@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi
     829@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/text_engine.cc' object='text_engine.obj' libtool=no @AMDEPBACKSLASH@
     830@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.TPo' @AMDEPBACKSLASH@
     831@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     832@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o text_engine.obj `if test -f 'lib/graphics/text_engine.cc'; then $(CYGPATH_W) 'lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/text_engine.cc'; fi`
    830833
    831834array.o: lib/graphics/importer/array.cc
     
    11751178
    11761179distdir: $(DISTFILES)
    1177         $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/font $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/world_entities
     1180        $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/world_entities
    11781181        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
    11791182        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  • orxonox/trunk/src/defs/debug.h

    r3752 r3790  
    7171#define DEBUG_MODULE_PLAYER             1
    7272#define DEBUG_MODULE_MATH               0
     73#define DEBUG_MODULE_FONT               4
    7374
    7475#define DEBUG_MODULE_NULL_PARENT        0
  • orxonox/trunk/src/defs/glincl.h

    r3492 r3790  
    99#define _GLINCL_H
    1010
     11#include <SDL.h>
     12
    1113#ifndef __APPLE__
    12 #include <SDL/SDL.h>
    1314#include <GL/gl.h>
    1415#include <GL/glu.h>
    1516#else
    16 #include <SDL.h>
    1717#include <OpenGL/gl.h>
    1818#include <OpenGL/glu.h>
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r3622 r3790  
    167167
    168168
     169/**
     170   \brief entering 2D Mode
     171   
     172   this is a GL-Projection-mode, that is orthogonal, for placing the font in fron of everything else
     173*/
     174void GraphicsEngine::enter2DMode(void)
     175{
     176  SDL_Surface *screen = SDL_GetVideoSurface();
     177 
     178  /* Note, there may be other things you need to change,
     179     depending on how you have your OpenGL state set up.
     180  */
     181  glPushAttrib(GL_ENABLE_BIT);
     182  glDisable(GL_DEPTH_TEST);
     183  glDisable(GL_CULL_FACE);
     184  glDisable(GL_LIGHTING);  // will be set back when leaving 2D-mode
     185  glEnable(GL_TEXTURE_2D);
     186
     187  /* This allows alpha blending of 2D textures with the scene */
     188  glEnable(GL_BLEND);
     189  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     190 
     191  glViewport(0, 0, screen->w, screen->h);
     192 
     193  glMatrixMode(GL_PROJECTION);
     194  glPushMatrix();
     195  glLoadIdentity();
     196 
     197  glOrtho(0.0, (GLdouble)screen->w, (GLdouble)screen->h, 0.0, 0.0, 1.0);
     198 
     199  glMatrixMode(GL_MODELVIEW);
     200  glPushMatrix();
     201  glLoadIdentity();
     202 
     203  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
     204}
     205
     206/**
     207   \brief leaves the 2DMode again also \see Font::enter2DMode(void)
     208*/
     209void GraphicsEngine::leave2DMode(void)
     210{
     211  glMatrixMode(GL_MODELVIEW);
     212  glPopMatrix();
     213 
     214  glMatrixMode(GL_PROJECTION);
     215  glPopMatrix();
     216 
     217  glPopAttrib();
     218}
    169219
    170220
  • orxonox/trunk/src/lib/graphics/graphics_engine.h

    r3619 r3790  
    2626  int setGLattribs(void);
    2727  int setResolution(int width, int height, int bpp);
     28  /** \returns the x resolution */
     29  inline int getResolutionX(void) {return this->resolutionX;}
     30  /** \returns the y resolution */
     31  inline int getResolutionY(void) {return this->resolutionY;}
     32  /** \returns the Bits Per Pixel */
     33  inline int getbbp(void) {return this->bitsPerPixel;}
    2834  int resolutionChanged(SDL_ResizeEvent* resizeInfo);
    2935  void listModes(void);
    3036
    3137  static bool texturesEnabled;
     38
     39  static void enter2DMode(void);
     40  static void leave2DMode(void);
    3241
    3342 private:
  • orxonox/trunk/src/lib/graphics/importer/material.cc

    r3672 r3790  
    3030using namespace std;
    3131
    32 
    33 /**
    34    \brief creates a default Material with no Name
    35    normally you call this to create a material List (for an obj-file) and then append with addMaterial()
    36 */
    37 Material::Material()
    38 {
    39   this->init();
    40  
    41   this->setName ("");
    42 }
    43 
    4432/**
    4533   \brief creates a Material.
     
    4836Material::Material (char* mtlName)
    4937{
    50   this->init();
    51  
    52   this->setName (mtlName);
     38   PRINTF(4)("initializing new Material.\n");
     39  this->nextMat = NULL;
     40  this->name ="";
     41  this->setIllum(3);
     42  this->setDiffuse(0,0,0);
     43  this->setAmbient(0,0,0);
     44  this->setSpecular(.5,.5,.5);
     45  this->setShininess(2.0);
     46  this->setTransparency(1.0);
     47
     48
     49  this->diffuseTexture = NULL;
     50  this->ambientTexture = NULL;
     51  this->specularTexture = NULL;
     52
     53  this->diffuseTextureSet = false;
     54  this->ambientTextureSet = false;
     55  this->specularTextureSet = false;
     56
     57  if (mtlName)
     58    this->setName (mtlName);
     59  else
     60    this->setName("");
    5361}
    5462
     
    8694
    8795/**
    88    \brief initializes a new Material with its default Values
    89 */
    90 void Material::init(void)
    91 {
    92   PRINTF(4)("initializing new Material.\n");
    93   this->nextMat = NULL;
    94   this->name ="";
    95   this->setIllum(3);
    96   this->setDiffuse(0,0,0);
    97   this->setAmbient(0,0,0);
    98   this->setSpecular(.5,.5,.5);
    99   this->setShininess(2.0);
    100   this->setTransparency(0.0);
    101 
    102 
    103   this->diffuseTexture = NULL;
    104   this->ambientTexture = NULL;
    105   this->specularTexture = NULL;
    106 
    107   this->diffuseTextureSet = false;
    108   this->ambientTextureSet = false;
    109   this->specularTextureSet = false;
    110 }
    111 
    112 /**
    11396   \brief Search for a Material called mtlName
    11497   \param mtlName the Name of the Material to search for
     
    151134  glMaterialf(GL_FRONT, GL_SHININESS, this->shininess);
    152135 
     136  // setting the transparency
     137  if (this->transparency == 1.0)
     138    {
     139      glDisable(GL_BLEND);
     140    }
     141  else
     142    {
     143      glEnable(GL_BLEND);
     144      glColor4f(1.0f, 1.0f, 1.0f, this->transparency);
     145      glBlendFunc(GL_SRC_ALPHA, GL_ONE);
     146    }
     147
    153148  // setting illumination Model
    154149  if (this->illumModel == 1) //! \todo make this work, if no vertex-normals are read.
  • orxonox/trunk/src/lib/graphics/importer/material.h

    r3590 r3790  
    2222{
    2323 public:
    24   Material ();
    25   Material (char* mtlName);
     24  Material (char* mtlName = "");
    2625  Material* addMaterial(char* mtlName);
    2726  ~Material ();
    28   void init(void);
    2927
    3028  Material* search(char* mtlName);
  • orxonox/trunk/src/lib/graphics/importer/texture.cc

    r3660 r3790  
    9898}
    9999
    100 #ifdef HAVE_SDL_SDL_IMAGE_H
     100#ifdef HAVE_SDL_IMAGE_H
    101101bool Texture::loadImage(const char* imageName)
    102102{
     
    118118            pImage->format = GL_RGB;
    119119          else if (pImage->bpp == 4)
    120             pImage->format = GL_RGBA;
    121          
     120            {
     121              pImage->format = GL_RGBA;
     122              SDL_SetAlpha(this->map, 0, 0);
     123            }
     124
    122125          if( !IMG_isPNG(SDL_RWFromFile(imageName, "rb")) && !IMG_isJPG(SDL_RWFromFile(imageName, "rb")))
    123126            for (int i=0;i<map->h * map->w *3;i+=3)
     
    146149
    147150
    148 #else /* HAVE_SDL_SDL_IMAGE_H */
     151#else /* HAVE_SDL_IMAGE_H */
    149152/**
    150153   \brief Makes the Programm ready to Read-in a texture-File
     
    832835
    833836}
    834 #endif /* HAVE_SDL_SDL_IMAGE_H */
     837#endif /* HAVE_SDL_IMAGE_H */
  • orxonox/trunk/src/lib/graphics/importer/texture.h

    r3660 r3790  
    1414#include "debug.h"
    1515
    16 #ifdef HAVE_SDL_SDL_IMAGE_H
    17 #include <SDL/SDL_image.h>
     16#ifdef HAVE_SDL_IMAGE_H
     17#include <SDL_image.h>
    1818#else
    1919// IMAGE LIBS //
     
    2626#include <png.h>
    2727#endif /* HAVE_PNG_H */
    28 #endif /* HAVE_SDL_SDL_IMAGE_H */
     28#endif /* HAVE_SDL_IMAGE_H */
    2929
    3030//! A Class, that reads in Textures from different fileformats.
     
    5757
    5858  bool loadImage(const char* imageName);
    59 #ifndef HAVE_SDL_SDL_IMAGE_H
     59#ifndef HAVE_SDL_IMAGE_H
    6060
    6161  bool loadBMP (char* bmpName);
     
    7474
    7575};
    76 
    77 
    78 
    7976#endif /* _TEXTURE_H */
  • orxonox/trunk/src/lib/util/list.h

    r3669 r3790  
    107107  void destroy();
    108108  T* firstElement();
     109  T* lastElement();
    109110  bool isEmpty();
    110111  int getSize();
     
    217218}
    218219
     220template<class T>
     221T* tList<T>::lastElement()
     222{
     223  return this->last->curr;
     224}
     225
    219226
    220227template<class T>
  • orxonox/trunk/src/lib/util/resource_manager.cc

    r3677 r3790  
    2222#include "primitive_model.h"
    2323#include "texture.h"
     24#include "text_engine.h"
    2425
    2526#include "list.h"
     
    141142   \returns a pointer to a desired Resource.
    142143*/
    143 void* ResourceManager::load(const char* fileName, ResourcePriority prio)
     144void* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
    144145{
    145146  ResourceType tmpType;
     
    158159           !strcmp(fileName, "cone"))
    159160    tmpType = PRIM;
     161  else if (!strncmp(fileName+(strlen(fileName)-4), ".ttf", 4))
     162    tmpType = TTF;
    160163  else
    161164    tmpType = IMAGE;
    162165
    163   return this->load(fileName, tmpType, prio);
     166  return this->load(fileName, tmpType, prio, param1, param2, param3);
    164167}
    165168
     
    171174   \returns a pointer to a desired Resource.
    172175*/
    173 void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio)
     176void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio, void* param1, void* param2, void* param3)
    174177{
    175178  // searching if the resource was loaded before.
    176   Resource* tmpResource = this->locateResourceByName(fileName);
     179  Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3);
    177180  if (tmpResource) // if the resource was not loaded before.
    178181    {
     
    201204        {
    202205        case OBJ:
     206          if (param1)
     207            tmpResource->modelSize = *(float*)param1;
     208          else
     209            tmpResource->modelSize = 1.0;
     210
    203211          if(isFile(fullName))
    204             tmpResource->pointer = new OBJModel(fullName);
     212            tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
    205213          else
    206214            {
    207215              PRINTF(2)("Sorry, %s does not exist. Loading a cube-Model instead\n", fullName);
    208               tmpResource->pointer = ResourceManager::load("cube", PRIM);
     216              tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
    209217            }
    210218          break;
    211219        case PRIM:
     220          if (param1)
     221            tmpResource->modelSize = *(float*)param1;
     222          else
     223            tmpResource->modelSize = 1.0;
     224
    212225          if (!strcmp(tmpResource->name, "cube"))
    213             tmpResource->pointer = new PrimitiveModel(CUBE);
     226            tmpResource->pointer = new PrimitiveModel(CUBE, tmpResource->modelSize);
    214227          else if (!strcmp(tmpResource->name, "sphere"))
    215             tmpResource->pointer = new PrimitiveModel(SPHERE);
     228            tmpResource->pointer = new PrimitiveModel(SPHERE, tmpResource->modelSize);
    216229          else if (!strcmp(tmpResource->name, "plane"))
    217             tmpResource->pointer = new PrimitiveModel(PLANE);
     230            tmpResource->pointer = new PrimitiveModel(PLANE, tmpResource->modelSize);
    218231          else if (!strcmp(tmpResource->name, "cylinder"))
    219             tmpResource->pointer = new PrimitiveModel(CYLINDER);
     232            tmpResource->pointer = new PrimitiveModel(CYLINDER, tmpResource->modelSize);
    220233          else if (!strcmp(tmpResource->name, "cone"))
    221             tmpResource->pointer = new PrimitiveModel(CONE);
     234            tmpResource->pointer = new PrimitiveModel(CONE, tmpResource->modelSize);
     235          break;
     236        case TTF:
     237            if (param1)
     238              tmpResource->ttfSize = *(int*)param1;
     239            else
     240              tmpResource->ttfSize = FONT_DEFAULT_SIZE;
     241            if (param2)
     242              {
     243                Vector* tmpVec = (Vector*)param2;
     244                tmpResource->ttfColorR = (int)tmpVec->x;
     245                tmpResource->ttfColorG = (int)tmpVec->y;
     246                tmpResource->ttfColorB = (int)tmpVec->z;
     247              }
     248            else
     249              {
     250                tmpResource->ttfColorR = FONT_DEFAULT_COLOR_R;
     251                tmpResource->ttfColorG = FONT_DEFAULT_COLOR_G;
     252                tmpResource->ttfColorB = FONT_DEFAULT_COLOR_B;
     253              }
     254           
     255          if(isFile(fullName))
     256            tmpResource->pointer = new Font(fullName,
     257                                            tmpResource->ttfSize,
     258                                            tmpResource->ttfColorR,
     259                                            tmpResource->ttfColorG,
     260                                            tmpResource->ttfColorB);
     261          else
     262            PRINTF(2)("Sorry, %s does not exist. Not loading Font\n", fullName);
    222263          break;
    223264        case IMAGE:
     
    259300      delete []fullName;
    260301    }
    261 
    262   return tmpResource->pointer;
     302  if (tmpResource->pointer)
     303    return tmpResource->pointer;
     304  else
     305    {
     306      PRINTF(2)("Resource %s could not be loaded\n", fileName);
     307      delete tmpResource;
     308      return NULL;
     309    }
    263310}
    264311
     
    299346            case IMAGE:
    300347              delete (Texture*)resource->pointer;
     348              break;
     349            case TTF:
     350              delete (Font*)resource->pointer;
    301351              break;
    302352            default:
     
    342392
    343393/**
    344    \brief Searches for a Resource by Name
     394   \brief Searches for a Resource by some information
    345395   \param fileName The name to look for
    346396   \returns a Pointer to the Resource if found, NULL otherwise.
    347397*/
    348 Resource* ResourceManager::locateResourceByName(const char* fileName)
     398Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3)
    349399{
    350400  //  Resource* enumRes = resourceList->enumerate();
     
    353403  while (enumRes)
    354404    {
    355       if (!strcmp(fileName, enumRes->name))
    356         {
    357           delete iterator;
    358           return enumRes;
     405      if (enumRes->type == type && !strcmp(fileName, enumRes->name))
     406        {
     407          bool match = false;
     408          bool subMatch = false;
     409          switch (type)
     410            {
     411            case PRIM:
     412            case OBJ:
     413              if (!param1)
     414                {
     415                  if (enumRes->modelSize == 1.0)
     416                    match = true;
     417                }
     418              else if (enumRes->modelSize == *(float*)param1)
     419                match = true;
     420              break;
     421            case TTF:
     422              if (!param1)
     423                {
     424                  if (enumRes->ttfSize == FONT_DEFAULT_SIZE)
     425                    subMatch = true;
     426                }
     427              else if (enumRes->modelSize =- *(int*)param1)
     428                subMatch = true;
     429              if(subMatch)
     430                {
     431                  Vector* tmpVec = (Vector*)param2;
     432                  if (!param2)
     433                    {
     434                      if(enumRes->ttfColorR == FONT_DEFAULT_COLOR_R &&
     435                         enumRes->ttfColorG == FONT_DEFAULT_COLOR_G &&
     436                         enumRes->ttfColorB == FONT_DEFAULT_COLOR_B )
     437                        match = true;
     438                    }
     439                  else if (enumRes->ttfColorR == (int)tmpVec->x &&
     440                           enumRes->ttfColorG == (int)tmpVec->y &&
     441                           enumRes->ttfColorB == (int)tmpVec->z )
     442                    match = true;
     443                }
     444
     445              break;
     446            default:
     447              match = true;
     448              break;
     449            }
     450          if (match)
     451            {
     452              delete iterator;
     453              return enumRes;
     454            }
    359455        }
    360456      enumRes = iterator->nextElement();
     
    396492  struct stat status;
    397493  stat(directoryName, &status);
    398   if (status.st_mode & (S_IFDIR | S_IFLNK))
     494  if (status.st_mode & (S_IFDIR
     495#ifndef __WIN32__
     496                        | S_IFLNK
     497#endif
     498                        ))
    399499    return true;
    400500  else
     
    411511  struct stat status;
    412512  stat(fileName, &status);
    413   if (status.st_mode & (S_IFREG | S_IFLNK))
     513  if (status.st_mode & (S_IFREG
     514#ifndef __WIN32__
     515                        | S_IFLNK
     516#endif
     517                        ))
    414518    return true;
    415519  else
  • orxonox/trunk/src/lib/util/resource_manager.h

    r3676 r3790  
    1919
    2020//! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support
    21 enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, IMAGE};
     21enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, TTF, IMAGE};
    2222//! An enumerator for different UNLOAD-types.
    2323/**
     
    3333{
    3434  void* pointer;             //!< Pointer to the Resource.
     35  int count;                 //!< How many times this Resource has been loaded.
    3536 
    3637  char* name;                //!< Name of the Resource.
    3738  ResourceType type;         //!< ResourceType of this Resource.
    3839  ResourcePriority prio;     //!< The Priority of this resource. (This will only be increased)
    39   int count;                 //!< How many times this Resource has been loaded.
     40
     41  // more specific
     42  float modelSize;
     43  unsigned int ttfSize;
     44  unsigned char ttfColorR;
     45  unsigned char ttfColorG;
     46  unsigned char ttfColorB;
    4047};
    4148
     
    4956
    5057   It does it by looking, if a desired file has already been loaded.
     58
     59   \todo loading also dependant by parameters.
    5160*/
    5261class ResourceManager : public BaseObject
     
    5867  bool setDataDir(char* dataDir);
    5968  bool addImageDir(char* imageDir);
    60   void* load(const char* fileName, ResourcePriority prio = RP_NO);
    61   void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO);
     69  void* load(const char* fileName, ResourcePriority prio = RP_NO,
     70             void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
     71  void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO,
     72             void* param1 = NULL, void* param2 = NULL, void* param3 = NULL);
    6273  bool unload(void* pointer, ResourcePriority prio = RP_NO);
    6374  bool unload(Resource* resource, ResourcePriority = RP_NO);
     
    7485
    7586
    76   Resource* locateResourceByName(const char* fileName);
     87  Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3);
    7788  Resource* locateResourceByPointer(const void* pointer);
    7889 
  • orxonox/trunk/src/orxonox.cc

    r3779 r3790  
    3333#include "graphics_engine.h"
    3434#include "resource_manager.h"
     35#include "text_engine.h"
    3536
    3637#include <string.h>
     
    5859  delete GraphicsEngine::getInstance(); // deleting the Graphics
    5960  delete ResourceManager::getInstance(); // deletes the Resource Manager
     61  delete TextEngine::getInstance();
    6062}
    6163
     
    167169  resourceManager->setDataDir("../data/");
    168170  return 0;
     171  PRINT(3)("initializing TextEngine\n");
     172  TextEngine::getInstance();
    169173}
    170174
  • orxonox/trunk/src/story_entities/world.cc

    r3763 r3790  
    3333#include "terrain.h"
    3434#include "light.h"
     35#include "text_engine.h"
    3536
    3637#include "track_manager.h"
     
    4041#include "command_node.h"
    4142#include "glmenu_imagescreen.h"
    42 #include "fontset.h"
    4343#include "list.h"
    4444
     
    157157  delete this->lightMan;
    158158  delete this->trackManager;
     159  TextEngine::getInstance()->flush();
    159160
    160161  delete this->simpleAnimation;
    161162  //delete garbagecollecor
    162163  //delete animator
     164
     165
    163166}
    164167
     
    207210    {
    208211      // initializing Font
    209       testFont = new FontSet();
    210       testFont->buildFont("../data/pictures/font.tga");
    211212      this->glmis->step();
    212 
    213213      // initializing the TrackManager
    214214      trackManager = TrackManager::getInstance();
     
    309309            this->spawn (this->localPlayer);
    310310            /*monitor progress*/
    311             //this->glmis->step();         
     311            //this->glmis->step();
    312312            this->glmis->step();
    313313
     
    363363            this->glmis->step();
    364364
     365            this->testText = TextEngine::getInstance()->createText("fonts/earth.ttf", 30, TEXT_DYNAMIC, 0, 255, 0);
     366            testText->setText("TEXT  rocks");
     367            testText->setBlending(1.0);
     368            testText->setBindNode(tn);
     369
     370            /*     
     371                   tmpAnim = new Animation<Text>(testText, &Text::setBlending);
     372                   tmpAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR);
     373                   tmpAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR);
     374                   tmpAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR);
     375                   tmpAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR);
     376                   tmpAnim->setInfinity(ANIM_INF_CONSTANT, ANIM_INF_REWIND);
     377            */
    365378            break;
    366379          }
     
    553566  glNewList (objectList, GL_COMPILE);
    554567 
    555   trackManager->drawGraph(.01);
     568  //  trackManager->drawGraph(.01);
    556569  trackManager->debug(2);
    557570  glEndList();
     
    740753  glCallList (objectList);
    741754
    742   testFont->printText(0, 0, 1, "orxonox_" PACKAGE_VERSION);
    743 
     755  TextEngine::getInstance()->draw();
    744756  lightMan->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes //
    745757}
     
    892904        {
    893905          float fps = 1000/dt;
    894           PRINTF(3)("fps = %f\n", fps);
     906
     907          // temporary, only for showing how fast the text-engine is
     908          char tmpChar[20];
     909          sprintf(tmpChar, "fps: %4.0f", fps);
    895910        }
    896911      else
     
    924939      this->garbageCollector->tick(seconds);
    925940      this->simpleAnimation->tick(seconds);
     941
    926942    }
    927943  this->lastFrame = currentFrame;
  • orxonox/trunk/src/story_entities/world.h

    r3727 r3790  
    2121class Skysphere;
    2222class LightManager;
    23 class FontSet;
    2423class Terrain;
    2524class GarbageCollector;
    2625class SimpleAnimation;
     26
     27class Text;
    2728
    2829//! The game world Interface
     
    9697  bool bPause;                        //!< pause mode
    9798
    98   FontSet* testFont;                  //!< A test Font. \todo fix this, so it is for real.
    9999  GLMenuImageScreen* glmis;           //!< The Level-Loader Display
     100
     101  Text* testText;                     //!< A text to Test the TextEngine;
    100102
    101103  char* worldName;                    //!< The name of this World
Note: See TracChangeset for help on using the changeset viewer.