Changeset 3790 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Apr 13, 2005, 12:33:07 PM (20 years ago)
- Location:
- orxonox/trunk
- Files:
-
- 1 deleted
- 20 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/ChangeLog
r3601 r3790 1 2005-03-31 Benjamin Grauer <bensch@orxonox.ethz.ch> 2 Added Text Engine 3 4 2005-03-26 Benjamin Grauer <bensch@orxonox.ethz.ch> 5 Added ResourceManager 6 7 2005-03-24 Patrick Boenzli <patrick@orxonox.ethz.ch> 8 Reimplemented shooting. 9 1 10 2005-03-16 orxonox 2 11 Finished work on version 0.2.1-pre-alpha released 0.2.2-pre-alpha -
orxonox/trunk/config.h.in
r3592 r3790 53 53 #undef HAVE_PTHREAD_H 54 54 55 /* Define to 1 if you have the <SDL /SDL.h> header file. */56 #undef HAVE_SDL_ SDL_H55 /* Define to 1 if you have the <SDL.h> header file. */ 56 #undef HAVE_SDL_H 57 57 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 60 63 61 64 /* Define to 1 if you have the `sqrt' function. */ -
orxonox/trunk/configure
r3789 r3790 4205 4205 echo "mingw-WINDOWS detected" 4206 4206 4207 CPPFLAGS="-I/usr/include/SDL -I/mingw/include/SDL" 4208 4207 4209 mingw="yes" 4208 4210 MSBITFIELDS="-mms-bitfields" … … 4811 4813 # checking for SDL-headers 4812 4814 4813 for ac_header in SDL /SDL.h4815 for ac_header in SDL.h 4814 4816 do 4815 4817 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 5118 5120 Linux="yes" 5119 5121 5120 CPPFLAGS="-I/usr/X11R6/include "5122 CPPFLAGS="-I/usr/X11R6/include -I/usr/include/SDL" 5121 5123 LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS" 5122 5124 # checking gl header … … 5591 5593 # checking for SDL-headers 5592 5594 5593 for ac_header in SDL /SDL.h5595 for ac_header in SDL.h 5594 5596 do 5595 5597 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 6180 6182 ################################### 6181 6183 6184 #---------# 6185 # SDL_ttf # 6186 #---------# 6187 # checking for SDL_ttf-headers 6188 6189 for ac_header in SDL_ttf.h 6190 do 6191 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 6192 if eval "test \"\${$as_ac_Header+set}\" = set"; then 6193 echo "$as_me:$LINENO: checking for $ac_header" >&5 6194 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 6195 if eval "test \"\${$as_ac_Header+set}\" = set"; then 6196 echo $ECHO_N "(cached) $ECHO_C" >&6 6197 fi 6198 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 6199 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 6200 else 6201 # Is the header compilable? 6202 echo "$as_me:$LINENO: checking $ac_header usability" >&5 6203 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 6204 cat >conftest.$ac_ext <<_ACEOF 6205 /* confdefs.h. */ 6206 _ACEOF 6207 cat confdefs.h >>conftest.$ac_ext 6208 cat >>conftest.$ac_ext <<_ACEOF 6209 /* end confdefs.h. */ 6210 $ac_includes_default 6211 #include <$ac_header> 6212 _ACEOF 6213 rm -f conftest.$ac_objext 6214 if { (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 6236 else 6237 echo "$as_me: failed program was:" >&5 6238 sed 's/^/| /' conftest.$ac_ext >&5 6239 6240 ac_header_compiler=no 6241 fi 6242 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext 6243 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 6244 echo "${ECHO_T}$ac_header_compiler" >&6 6245 6246 # Is the header present? 6247 echo "$as_me:$LINENO: checking $ac_header presence" >&5 6248 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 6249 cat >conftest.$ac_ext <<_ACEOF 6250 /* confdefs.h. */ 6251 _ACEOF 6252 cat confdefs.h >>conftest.$ac_ext 6253 cat >>conftest.$ac_ext <<_ACEOF 6254 /* end confdefs.h. */ 6255 #include <$ac_header> 6256 _ACEOF 6257 if { (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 6271 else 6272 ac_cpp_err=yes 6273 fi 6274 if test -z "$ac_cpp_err"; then 6275 ac_header_preproc=yes 6276 else 6277 echo "$as_me: failed program was:" >&5 6278 sed 's/^/| /' conftest.$ac_ext >&5 6279 6280 ac_header_preproc=no 6281 fi 6282 rm -f conftest.err conftest.$ac_ext 6283 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 6284 echo "${ECHO_T}$ac_header_preproc" >&6 6285 6286 # So? What about this header? 6287 case $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 6290 echo "$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 6292 echo "$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 6297 echo "$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 6299 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} 6300 { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 6301 echo "$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 6303 echo "$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 6305 echo "$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 6307 echo "$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 ;; 6317 esac 6318 echo "$as_me:$LINENO: checking for $ac_header" >&5 6319 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 6320 if eval "test \"\${$as_ac_Header+set}\" = set"; then 6321 echo $ECHO_N "(cached) $ECHO_C" >&6 6322 else 6323 eval "$as_ac_Header=\$ac_header_preproc" 6324 fi 6325 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 6326 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 6327 6328 fi 6329 if 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 6334 else 6335 { { echo "$as_me:$LINENO: error: cannot find SDL_ttf header." >&5 6336 echo "$as_me: error: cannot find SDL_ttf header." >&2;} 6337 { (exit 1); exit 1; }; } 6338 fi 6339 6340 done 6341 6342 #fi 6343 # checking for SDL_ttf-lib 6344 echo "$as_me:$LINENO: checking for main in -lSDL_ttf" >&5 6345 echo $ECHO_N "checking for main in -lSDL_ttf... $ECHO_C" >&6 6346 if test "${ac_cv_lib_SDL_ttf_main+set}" = set; then 6347 echo $ECHO_N "(cached) $ECHO_C" >&6 6348 else 6349 ac_check_lib_save_LIBS=$LIBS 6350 LIBS="-lSDL_ttf $LIBS" 6351 cat >conftest.$ac_ext <<_ACEOF 6352 /* confdefs.h. */ 6353 _ACEOF 6354 cat confdefs.h >>conftest.$ac_ext 6355 cat >>conftest.$ac_ext <<_ACEOF 6356 /* end confdefs.h. */ 6357 6358 6359 int 6360 main () 6361 { 6362 main (); 6363 ; 6364 return 0; 6365 } 6366 _ACEOF 6367 rm -f conftest.$ac_objext conftest$ac_exeext 6368 if { (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 6390 else 6391 echo "$as_me: failed program was:" >&5 6392 sed 's/^/| /' conftest.$ac_ext >&5 6393 6394 ac_cv_lib_SDL_ttf_main=no 6395 fi 6396 rm -f conftest.err conftest.$ac_objext \ 6397 conftest$ac_exeext conftest.$ac_ext 6398 LIBS=$ac_check_lib_save_LIBS 6399 fi 6400 echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_ttf_main" >&5 6401 echo "${ECHO_T}$ac_cv_lib_SDL_ttf_main" >&6 6402 if test $ac_cv_lib_SDL_ttf_main = yes; then 6403 FOUND_SDL_ttf=yes 6404 fi 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 6182 6416 #-----------# 6183 6417 # SDL_Image # … … 6186 6420 # checking for SDL_image-headers 6187 6421 6188 for ac_header in SDL /SDL_image.h6422 for ac_header in SDL_image.h 6189 6423 do 6190 6424 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -
orxonox/trunk/configure.ac
r3789 r3790 235 235 echo "mingw-WINDOWS detected" 236 236 237 CPPFLAGS="-I/usr/include/SDL -I/mingw/include/SDL" 238 237 239 mingw="yes" 238 240 MSBITFIELDS="-mms-bitfields" … … 279 281 fi 280 282 # checking for SDL-headers 281 AC_CHECK_HEADERS([SDL /SDL.h] ,,283 AC_CHECK_HEADERS([SDL.h] ,, 282 284 [AC_MSG_ERROR([cannot find SDL headers]) ]) 283 285 … … 313 315 Linux="yes" 314 316 315 CPPFLAGS="-I/usr/X11R6/include "317 CPPFLAGS="-I/usr/X11R6/include -I/usr/include/SDL" 316 318 LDFLAGS="-L/usr/lib/opengl/xorg-x11/lib -L/usr/Mesa-6.0.1/lib -L/usr/X11R6/lib $LDFLAGS" 317 319 # checking gl header … … 347 349 348 350 # checking for SDL-headers 349 AC_CHECK_HEADERS([SDL /SDL.h] ,,351 AC_CHECK_HEADERS([SDL.h] ,, 350 352 [AC_MSG_ERROR([cannot find SDL headers]) ]) 351 353 … … 420 422 ################################### 421 423 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 422 443 #-----------# 423 444 # SDL_Image # … … 425 446 if test x$def_sdl_image = xyes; then 426 447 # checking for SDL_image-headers 427 AC_CHECK_HEADERS([SDL /SDL_image.h] ,,448 AC_CHECK_HEADERS([SDL_image.h] ,, 428 449 [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ]) 429 450 fi -
orxonox/trunk/src/Makefile.am
r3761 r3790 7 7 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data 8 8 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics 9 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/font10 9 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer 11 10 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui … … 34 33 track_manager.cc \ 35 34 track_node.cc \ 35 animation.cc \ 36 36 simple_animation.cc \ 37 37 garbage_collector.cc \ … … 57 57 lib/graphics/graphics_engine.cc \ 58 58 lib/graphics/light.cc \ 59 lib/graphics/ font/fontset.cc \59 lib/graphics/text_engine.cc \ 60 60 lib/graphics/importer/array.cc \ 61 61 lib/graphics/importer/objModel.cc \ … … 83 83 track_manager.h \ 84 84 track_node.h \ 85 animation.h \ 85 86 simple_animation.h \ 86 87 garbage_collector.h \ … … 114 115 lib/graphics/graphics_engine.h \ 115 116 lib/graphics/light.h \ 116 lib/graphics/ font/fontset.h \117 lib/graphics/text_engine.h \ 117 118 lib/data/data_tank.h \ 118 119 lib/lang/base_entity.h \ -
orxonox/trunk/src/Makefile.in
r3789 r3790 56 56 command_node.$(OBJEXT) keynames.$(OBJEXT) camera.$(OBJEXT) \ 57 57 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) \ 66 66 data_tank.$(OBJEXT) graphics_engine.$(OBJEXT) light.$(OBJEXT) \ 67 fontset.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \67 text_engine.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \ 68 68 primitive_model.$(OBJEXT) model.$(OBJEXT) material.$(OBJEXT) \ 69 69 texture.$(OBJEXT) base_entity.$(OBJEXT) base_object.$(OBJEXT) \ … … 75 75 depcomp = $(SHELL) $(top_srcdir)/depcomp 76 76 am__depfiles_maybe = depfiles 77 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ai.Po ./$(DEPDIR)/a rray.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 \ 79 79 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \ 80 80 @AMDEP_TRUE@ ./$(DEPDIR)/campaign.Po \ … … 82 82 @AMDEP_TRUE@ ./$(DEPDIR)/command_node.Po ./$(DEPDIR)/curve.Po \ 83 83 @AMDEP_TRUE@ ./$(DEPDIR)/data_tank.Po \ 84 @AMDEP_TRUE@ ./$(DEPDIR)/environment.Po ./$(DEPDIR)/fontset.Po\84 @AMDEP_TRUE@ ./$(DEPDIR)/environment.Po \ 85 85 @AMDEP_TRUE@ ./$(DEPDIR)/game_loader.Po \ 86 86 @AMDEP_TRUE@ ./$(DEPDIR)/garbage_collector.Po \ … … 102 102 @AMDEP_TRUE@ ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/terrain.Po \ 103 103 @AMDEP_TRUE@ ./$(DEPDIR)/test_bullet.Po ./$(DEPDIR)/test_gun.Po \ 104 @AMDEP_TRUE@ ./$(DEPDIR)/text ure.Po \104 @AMDEP_TRUE@ ./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \ 105 105 @AMDEP_TRUE@ ./$(DEPDIR)/track_manager.Po \ 106 106 @AMDEP_TRUE@ ./$(DEPDIR)/track_node.Po ./$(DEPDIR)/vector.Po \ … … 235 235 target_vendor = @target_vendor@ 236 236 MAINSRCDIR = . 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)/ai237 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/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 238 238 AM_LDFLAGS = $(MWINDOWS) 239 239 orxonox_SOURCES = orxonox.cc \ … … 244 244 track_manager.cc \ 245 245 track_node.cc \ 246 animation.cc \ 246 247 simple_animation.cc \ 247 248 garbage_collector.cc \ … … 267 268 lib/graphics/graphics_engine.cc \ 268 269 lib/graphics/light.cc \ 269 lib/graphics/ font/fontset.cc \270 lib/graphics/text_engine.cc \ 270 271 lib/graphics/importer/array.cc \ 271 272 lib/graphics/importer/objModel.cc \ … … 293 294 track_manager.h \ 294 295 track_node.h \ 296 animation.h \ 295 297 simple_animation.h \ 296 298 garbage_collector.h \ … … 324 326 lib/graphics/graphics_engine.h \ 325 327 lib/graphics/light.h \ 326 lib/graphics/ font/fontset.h \328 lib/graphics/text_engine.h \ 327 329 lib/data/data_tank.h \ 328 330 lib/lang/base_entity.h \ … … 416 418 417 419 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ai.Po@am__quote@ 420 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation.Po@am__quote@ 418 421 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ 419 422 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@ … … 426 429 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_tank.Po@am__quote@ 427 430 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environment.Po@am__quote@ 428 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontset.Po@am__quote@429 431 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/game_loader.Po@am__quote@ 430 432 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/garbage_collector.Po@am__quote@ … … 453 455 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_bullet.Po@am__quote@ 454 456 @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@ 455 458 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@ 456 459 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@ … … 813 816 @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` 814 817 815 fontset.o: lib/graphics/font/fontset.cc816 @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; fi818 @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.cc822 823 fontset.obj: lib/graphics/font/fontset.cc824 @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; fi826 @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`818 text_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 826 text_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` 830 833 831 834 array.o: lib/graphics/importer/array.cc … … 1175 1178 1176 1179 distdir: $(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_entities1180 $(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 1178 1181 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 1179 1182 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ -
orxonox/trunk/src/defs/debug.h
r3752 r3790 71 71 #define DEBUG_MODULE_PLAYER 1 72 72 #define DEBUG_MODULE_MATH 0 73 #define DEBUG_MODULE_FONT 4 73 74 74 75 #define DEBUG_MODULE_NULL_PARENT 0 -
orxonox/trunk/src/defs/glincl.h
r3492 r3790 9 9 #define _GLINCL_H 10 10 11 #include <SDL.h> 12 11 13 #ifndef __APPLE__ 12 #include <SDL/SDL.h>13 14 #include <GL/gl.h> 14 15 #include <GL/glu.h> 15 16 #else 16 #include <SDL.h>17 17 #include <OpenGL/gl.h> 18 18 #include <OpenGL/glu.h> -
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r3622 r3790 167 167 168 168 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 */ 174 void 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 */ 209 void GraphicsEngine::leave2DMode(void) 210 { 211 glMatrixMode(GL_MODELVIEW); 212 glPopMatrix(); 213 214 glMatrixMode(GL_PROJECTION); 215 glPopMatrix(); 216 217 glPopAttrib(); 218 } 169 219 170 220 -
orxonox/trunk/src/lib/graphics/graphics_engine.h
r3619 r3790 26 26 int setGLattribs(void); 27 27 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;} 28 34 int resolutionChanged(SDL_ResizeEvent* resizeInfo); 29 35 void listModes(void); 30 36 31 37 static bool texturesEnabled; 38 39 static void enter2DMode(void); 40 static void leave2DMode(void); 32 41 33 42 private: -
orxonox/trunk/src/lib/graphics/importer/material.cc
r3672 r3790 30 30 using namespace std; 31 31 32 33 /**34 \brief creates a default Material with no Name35 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 44 32 /** 45 33 \brief creates a Material. … … 48 36 Material::Material (char* mtlName) 49 37 { 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(""); 53 61 } 54 62 … … 86 94 87 95 /** 88 \brief initializes a new Material with its default Values89 */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 /**113 96 \brief Search for a Material called mtlName 114 97 \param mtlName the Name of the Material to search for … … 151 134 glMaterialf(GL_FRONT, GL_SHININESS, this->shininess); 152 135 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 153 148 // setting illumination Model 154 149 if (this->illumModel == 1) //! \todo make this work, if no vertex-normals are read. -
orxonox/trunk/src/lib/graphics/importer/material.h
r3590 r3790 22 22 { 23 23 public: 24 Material (); 25 Material (char* mtlName); 24 Material (char* mtlName = ""); 26 25 Material* addMaterial(char* mtlName); 27 26 ~Material (); 28 void init(void);29 27 30 28 Material* search(char* mtlName); -
orxonox/trunk/src/lib/graphics/importer/texture.cc
r3660 r3790 98 98 } 99 99 100 #ifdef HAVE_SDL_ SDL_IMAGE_H100 #ifdef HAVE_SDL_IMAGE_H 101 101 bool Texture::loadImage(const char* imageName) 102 102 { … … 118 118 pImage->format = GL_RGB; 119 119 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 122 125 if( !IMG_isPNG(SDL_RWFromFile(imageName, "rb")) && !IMG_isJPG(SDL_RWFromFile(imageName, "rb"))) 123 126 for (int i=0;i<map->h * map->w *3;i+=3) … … 146 149 147 150 148 #else /* HAVE_SDL_ SDL_IMAGE_H */151 #else /* HAVE_SDL_IMAGE_H */ 149 152 /** 150 153 \brief Makes the Programm ready to Read-in a texture-File … … 832 835 833 836 } 834 #endif /* HAVE_SDL_ SDL_IMAGE_H */837 #endif /* HAVE_SDL_IMAGE_H */ -
orxonox/trunk/src/lib/graphics/importer/texture.h
r3660 r3790 14 14 #include "debug.h" 15 15 16 #ifdef HAVE_SDL_ SDL_IMAGE_H17 #include <SDL /SDL_image.h>16 #ifdef HAVE_SDL_IMAGE_H 17 #include <SDL_image.h> 18 18 #else 19 19 // IMAGE LIBS // … … 26 26 #include <png.h> 27 27 #endif /* HAVE_PNG_H */ 28 #endif /* HAVE_SDL_ SDL_IMAGE_H */28 #endif /* HAVE_SDL_IMAGE_H */ 29 29 30 30 //! A Class, that reads in Textures from different fileformats. … … 57 57 58 58 bool loadImage(const char* imageName); 59 #ifndef HAVE_SDL_ SDL_IMAGE_H59 #ifndef HAVE_SDL_IMAGE_H 60 60 61 61 bool loadBMP (char* bmpName); … … 74 74 75 75 }; 76 77 78 79 76 #endif /* _TEXTURE_H */ -
orxonox/trunk/src/lib/util/list.h
r3669 r3790 107 107 void destroy(); 108 108 T* firstElement(); 109 T* lastElement(); 109 110 bool isEmpty(); 110 111 int getSize(); … … 217 218 } 218 219 220 template<class T> 221 T* tList<T>::lastElement() 222 { 223 return this->last->curr; 224 } 225 219 226 220 227 template<class T> -
orxonox/trunk/src/lib/util/resource_manager.cc
r3677 r3790 22 22 #include "primitive_model.h" 23 23 #include "texture.h" 24 #include "text_engine.h" 24 25 25 26 #include "list.h" … … 141 142 \returns a pointer to a desired Resource. 142 143 */ 143 void* ResourceManager::load(const char* fileName, ResourcePriority prio )144 void* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3) 144 145 { 145 146 ResourceType tmpType; … … 158 159 !strcmp(fileName, "cone")) 159 160 tmpType = PRIM; 161 else if (!strncmp(fileName+(strlen(fileName)-4), ".ttf", 4)) 162 tmpType = TTF; 160 163 else 161 164 tmpType = IMAGE; 162 165 163 return this->load(fileName, tmpType, prio );166 return this->load(fileName, tmpType, prio, param1, param2, param3); 164 167 } 165 168 … … 171 174 \returns a pointer to a desired Resource. 172 175 */ 173 void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio )176 void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio, void* param1, void* param2, void* param3) 174 177 { 175 178 // searching if the resource was loaded before. 176 Resource* tmpResource = this->locateResourceBy Name(fileName);179 Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3); 177 180 if (tmpResource) // if the resource was not loaded before. 178 181 { … … 201 204 { 202 205 case OBJ: 206 if (param1) 207 tmpResource->modelSize = *(float*)param1; 208 else 209 tmpResource->modelSize = 1.0; 210 203 211 if(isFile(fullName)) 204 tmpResource->pointer = new OBJModel(fullName );212 tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize); 205 213 else 206 214 { 207 215 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); 209 217 } 210 218 break; 211 219 case PRIM: 220 if (param1) 221 tmpResource->modelSize = *(float*)param1; 222 else 223 tmpResource->modelSize = 1.0; 224 212 225 if (!strcmp(tmpResource->name, "cube")) 213 tmpResource->pointer = new PrimitiveModel(CUBE );226 tmpResource->pointer = new PrimitiveModel(CUBE, tmpResource->modelSize); 214 227 else if (!strcmp(tmpResource->name, "sphere")) 215 tmpResource->pointer = new PrimitiveModel(SPHERE );228 tmpResource->pointer = new PrimitiveModel(SPHERE, tmpResource->modelSize); 216 229 else if (!strcmp(tmpResource->name, "plane")) 217 tmpResource->pointer = new PrimitiveModel(PLANE );230 tmpResource->pointer = new PrimitiveModel(PLANE, tmpResource->modelSize); 218 231 else if (!strcmp(tmpResource->name, "cylinder")) 219 tmpResource->pointer = new PrimitiveModel(CYLINDER );232 tmpResource->pointer = new PrimitiveModel(CYLINDER, tmpResource->modelSize); 220 233 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); 222 263 break; 223 264 case IMAGE: … … 259 300 delete []fullName; 260 301 } 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 } 263 310 } 264 311 … … 299 346 case IMAGE: 300 347 delete (Texture*)resource->pointer; 348 break; 349 case TTF: 350 delete (Font*)resource->pointer; 301 351 break; 302 352 default: … … 342 392 343 393 /** 344 \brief Searches for a Resource by Name394 \brief Searches for a Resource by some information 345 395 \param fileName The name to look for 346 396 \returns a Pointer to the Resource if found, NULL otherwise. 347 397 */ 348 Resource* ResourceManager::locateResourceBy Name(const char* fileName)398 Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3) 349 399 { 350 400 // Resource* enumRes = resourceList->enumerate(); … … 353 403 while (enumRes) 354 404 { 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 } 359 455 } 360 456 enumRes = iterator->nextElement(); … … 396 492 struct stat status; 397 493 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 )) 399 499 return true; 400 500 else … … 411 511 struct stat status; 412 512 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 )) 414 518 return true; 415 519 else -
orxonox/trunk/src/lib/util/resource_manager.h
r3676 r3790 19 19 20 20 //! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support 21 enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, IMAGE};21 enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, TTF, IMAGE}; 22 22 //! An enumerator for different UNLOAD-types. 23 23 /** … … 33 33 { 34 34 void* pointer; //!< Pointer to the Resource. 35 int count; //!< How many times this Resource has been loaded. 35 36 36 37 char* name; //!< Name of the Resource. 37 38 ResourceType type; //!< ResourceType of this Resource. 38 39 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; 40 47 }; 41 48 … … 49 56 50 57 It does it by looking, if a desired file has already been loaded. 58 59 \todo loading also dependant by parameters. 51 60 */ 52 61 class ResourceManager : public BaseObject … … 58 67 bool setDataDir(char* dataDir); 59 68 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); 62 73 bool unload(void* pointer, ResourcePriority prio = RP_NO); 63 74 bool unload(Resource* resource, ResourcePriority = RP_NO); … … 74 85 75 86 76 Resource* locateResourceBy Name(const char* fileName);87 Resource* locateResourceByInfo(const char* fileName, ResourceType type, void* param1, void* param2, void* param3); 77 88 Resource* locateResourceByPointer(const void* pointer); 78 89 -
orxonox/trunk/src/orxonox.cc
r3779 r3790 33 33 #include "graphics_engine.h" 34 34 #include "resource_manager.h" 35 #include "text_engine.h" 35 36 36 37 #include <string.h> … … 58 59 delete GraphicsEngine::getInstance(); // deleting the Graphics 59 60 delete ResourceManager::getInstance(); // deletes the Resource Manager 61 delete TextEngine::getInstance(); 60 62 } 61 63 … … 167 169 resourceManager->setDataDir("../data/"); 168 170 return 0; 171 PRINT(3)("initializing TextEngine\n"); 172 TextEngine::getInstance(); 169 173 } 170 174 -
orxonox/trunk/src/story_entities/world.cc
r3763 r3790 33 33 #include "terrain.h" 34 34 #include "light.h" 35 #include "text_engine.h" 35 36 36 37 #include "track_manager.h" … … 40 41 #include "command_node.h" 41 42 #include "glmenu_imagescreen.h" 42 #include "fontset.h"43 43 #include "list.h" 44 44 … … 157 157 delete this->lightMan; 158 158 delete this->trackManager; 159 TextEngine::getInstance()->flush(); 159 160 160 161 delete this->simpleAnimation; 161 162 //delete garbagecollecor 162 163 //delete animator 164 165 163 166 } 164 167 … … 207 210 { 208 211 // initializing Font 209 testFont = new FontSet();210 testFont->buildFont("../data/pictures/font.tga");211 212 this->glmis->step(); 212 213 213 // initializing the TrackManager 214 214 trackManager = TrackManager::getInstance(); … … 309 309 this->spawn (this->localPlayer); 310 310 /*monitor progress*/ 311 //this->glmis->step(); 311 //this->glmis->step(); 312 312 this->glmis->step(); 313 313 … … 363 363 this->glmis->step(); 364 364 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 */ 365 378 break; 366 379 } … … 553 566 glNewList (objectList, GL_COMPILE); 554 567 555 trackManager->drawGraph(.01);568 // trackManager->drawGraph(.01); 556 569 trackManager->debug(2); 557 570 glEndList(); … … 740 753 glCallList (objectList); 741 754 742 testFont->printText(0, 0, 1, "orxonox_" PACKAGE_VERSION); 743 755 TextEngine::getInstance()->draw(); 744 756 lightMan->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes // 745 757 } … … 892 904 { 893 905 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); 895 910 } 896 911 else … … 924 939 this->garbageCollector->tick(seconds); 925 940 this->simpleAnimation->tick(seconds); 941 926 942 } 927 943 this->lastFrame = currentFrame; -
orxonox/trunk/src/story_entities/world.h
r3727 r3790 21 21 class Skysphere; 22 22 class LightManager; 23 class FontSet;24 23 class Terrain; 25 24 class GarbageCollector; 26 25 class SimpleAnimation; 26 27 class Text; 27 28 28 29 //! The game world Interface … … 96 97 bool bPause; //!< pause mode 97 98 98 FontSet* testFont; //!< A test Font. \todo fix this, so it is for real.99 99 GLMenuImageScreen* glmis; //!< The Level-Loader Display 100 101 Text* testText; //!< A text to Test the TextEngine; 100 102 101 103 char* worldName; //!< The name of this World
Note: See TracChangeset
for help on using the changeset viewer.