Changeset 3746 in orxonox.OLD for orxonox/branches/levelloader/src/lib/graphics/importer
- Timestamp:
- Apr 7, 2005, 3:54:49 PM (20 years ago)
- Location:
- orxonox/branches/levelloader/src/lib/graphics/importer
- Files:
-
- 11 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/lib/graphics/importer/Makefile.am
r3499 r3746 5 5 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib 6 6 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data 7 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/g aphics7 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics 8 8 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer 9 9 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/lang … … 27 27 model.cc \ 28 28 objModel.cc \ 29 primitive_model.cc \ 29 30 array.cc \ 30 31 material.cc \ 31 32 texture.cc \ 32 $(MAINSRCDIR)/lib/math/vector.cc 33 $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \ 34 $(MAINSRCDIR)/lib/lang/base_object.cc \ 35 $(MAINSRCDIR)/lib/math/vector.cc \ 36 $(MAINSRCDIR)/lib/util/resource_manager.cc 33 37 34 38 noinst_HEADERS= framework.h \ … … 36 40 model.h \ 37 41 objModel.h \ 42 primitive_model.h \ 38 43 array.h \ 39 44 material.h \ -
orxonox/branches/levelloader/src/lib/graphics/importer/Makefile.in
r3605 r3746 1 # Makefile.in generated by automake 1.8. 5from Makefile.am.1 # Makefile.in generated by automake 1.8.2 from Makefile.am. 2 2 # @configure_input@ 3 3 … … 42 42 subdir = src/lib/graphics/importer 43 43 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ 44 $(srcdir)/Makefile.in 44 $(srcdir)/Makefile.in TODO 45 45 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 46 46 am__aclocal_m4_deps = $(top_srcdir)/configure.ac … … 50 50 CONFIG_HEADER = $(top_builddir)/config.h 51 51 CONFIG_CLEAN_FILES = 52 am__installdirs = "$(DESTDIR)$(bindir)"52 am__installdirs = $(DESTDIR)$(bindir) 53 53 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) 54 54 PROGRAMS = $(bin_PROGRAMS) 55 55 am_importer_OBJECTS = framework.$(OBJEXT) windowHandler.$(OBJEXT) \ 56 model.$(OBJEXT) objModel.$(OBJEXT) array.$(OBJEXT) \ 57 material.$(OBJEXT) texture.$(OBJEXT) vector.$(OBJEXT) 56 model.$(OBJEXT) objModel.$(OBJEXT) primitive_model.$(OBJEXT) \ 57 array.$(OBJEXT) material.$(OBJEXT) texture.$(OBJEXT) \ 58 graphics_engine.$(OBJEXT) base_object.$(OBJEXT) \ 59 vector.$(OBJEXT) resource_manager.$(OBJEXT) 58 60 importer_OBJECTS = $(am_importer_OBJECTS) 59 61 importer_LDADD = $(LDADD) … … 61 63 depcomp = $(SHELL) $(top_srcdir)/depcomp 62 64 am__depfiles_maybe = depfiles 63 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po ./$(DEPDIR)/framework.Po \ 65 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po \ 66 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po \ 67 @AMDEP_TRUE@ ./$(DEPDIR)/framework.Po \ 68 @AMDEP_TRUE@ ./$(DEPDIR)/graphics_engine.Po \ 64 69 @AMDEP_TRUE@ ./$(DEPDIR)/material.Po ./$(DEPDIR)/model.Po \ 65 @AMDEP_TRUE@ ./$(DEPDIR)/objModel.Po ./$(DEPDIR)/texture.Po \ 66 @AMDEP_TRUE@ ./$(DEPDIR)/vector.Po ./$(DEPDIR)/windowHandler.Po 70 @AMDEP_TRUE@ ./$(DEPDIR)/objModel.Po \ 71 @AMDEP_TRUE@ ./$(DEPDIR)/primitive_model.Po \ 72 @AMDEP_TRUE@ ./$(DEPDIR)/resource_manager.Po \ 73 @AMDEP_TRUE@ ./$(DEPDIR)/texture.Po ./$(DEPDIR)/vector.Po \ 74 @AMDEP_TRUE@ ./$(DEPDIR)/windowHandler.Po 67 75 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 68 76 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 185 193 target_vendor = @target_vendor@ 186 194 MAINSRCDIR = ../../.. 187 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/g aphics -I$(MAINSRCDIR)/lib/graphics/importer -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)/ai195 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -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 188 196 AM_LDFLAGS = $(MWINDOWS) 189 197 importer_SOURCES = framework.cc \ … … 191 199 model.cc \ 192 200 objModel.cc \ 201 primitive_model.cc \ 193 202 array.cc \ 194 203 material.cc \ 195 204 texture.cc \ 196 $(MAINSRCDIR)/lib/math/vector.cc 205 $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \ 206 $(MAINSRCDIR)/lib/lang/base_object.cc \ 207 $(MAINSRCDIR)/lib/math/vector.cc \ 208 $(MAINSRCDIR)/lib/util/resource_manager.cc 197 209 198 210 noinst_HEADERS = framework.h \ … … 200 212 model.h \ 201 213 objModel.h \ 214 primitive_model.h \ 202 215 array.h \ 203 216 material.h \ … … 217 230 esac; \ 218 231 done; \ 219 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- foreignsrc/lib/graphics/importer/Makefile'; \232 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/graphics/importer/Makefile'; \ 220 233 cd $(top_srcdir) && \ 221 $(AUTOMAKE) -- foreignsrc/lib/graphics/importer/Makefile234 $(AUTOMAKE) --gnu src/lib/graphics/importer/Makefile 222 235 .PRECIOUS: Makefile 223 236 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status … … 239 252 install-binPROGRAMS: $(bin_PROGRAMS) 240 253 @$(NORMAL_INSTALL) 241 test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"254 $(mkdir_p) $(DESTDIR)$(bindir) 242 255 @list='$(bin_PROGRAMS)'; for p in $$list; do \ 243 256 p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ … … 245 258 ; then \ 246 259 f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ 247 echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \248 $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f"|| exit 1; \260 echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ 261 $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ 249 262 else :; fi; \ 250 263 done … … 254 267 @list='$(bin_PROGRAMS)'; for p in $$list; do \ 255 268 f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ 256 echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \257 rm -f "$(DESTDIR)$(bindir)/$$f"; \269 echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ 270 rm -f $(DESTDIR)$(bindir)/$$f; \ 258 271 done 259 272 … … 271 284 272 285 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ 286 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@ 273 287 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/framework.Po@am__quote@ 288 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics_engine.Po@am__quote@ 274 289 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@ 275 290 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@ 276 291 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@ 292 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@ 293 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource_manager.Po@am__quote@ 277 294 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@ 278 295 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ … … 295 312 @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 296 313 314 graphics_engine.o: $(MAINSRCDIR)/lib/graphics/graphics_engine.cc 315 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.o -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/graphics_engine.cc; \ 316 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/graphics_engine.Tpo" "$(DEPDIR)/graphics_engine.Po"; else rm -f "$(DEPDIR)/graphics_engine.Tpo"; exit 1; fi 317 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' object='graphics_engine.o' libtool=no @AMDEPBACKSLASH@ 318 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/graphics_engine.Po' tmpdepfile='$(DEPDIR)/graphics_engine.TPo' @AMDEPBACKSLASH@ 319 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 320 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o graphics_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/graphics_engine.cc 321 322 graphics_engine.obj: $(MAINSRCDIR)/lib/graphics/graphics_engine.cc 323 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.obj -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; fi`; \ 324 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/graphics_engine.Tpo" "$(DEPDIR)/graphics_engine.Po"; else rm -f "$(DEPDIR)/graphics_engine.Tpo"; exit 1; fi 325 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' object='graphics_engine.obj' libtool=no @AMDEPBACKSLASH@ 326 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/graphics_engine.Po' tmpdepfile='$(DEPDIR)/graphics_engine.TPo' @AMDEPBACKSLASH@ 327 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 328 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o graphics_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; fi` 329 330 base_object.o: $(MAINSRCDIR)/lib/lang/base_object.cc 331 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_object.o -MD -MP -MF "$(DEPDIR)/base_object.Tpo" -c -o base_object.o `test -f '$(MAINSRCDIR)/lib/lang/base_object.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/lang/base_object.cc; \ 332 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/base_object.Tpo" "$(DEPDIR)/base_object.Po"; else rm -f "$(DEPDIR)/base_object.Tpo"; exit 1; fi 333 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/lang/base_object.cc' object='base_object.o' libtool=no @AMDEPBACKSLASH@ 334 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/base_object.Po' tmpdepfile='$(DEPDIR)/base_object.TPo' @AMDEPBACKSLASH@ 335 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 336 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_object.o `test -f '$(MAINSRCDIR)/lib/lang/base_object.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/lang/base_object.cc 337 338 base_object.obj: $(MAINSRCDIR)/lib/lang/base_object.cc 339 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_object.obj -MD -MP -MF "$(DEPDIR)/base_object.Tpo" -c -o base_object.obj `if test -f '$(MAINSRCDIR)/lib/lang/base_object.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/lang/base_object.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/lang/base_object.cc'; fi`; \ 340 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/base_object.Tpo" "$(DEPDIR)/base_object.Po"; else rm -f "$(DEPDIR)/base_object.Tpo"; exit 1; fi 341 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/lang/base_object.cc' object='base_object.obj' libtool=no @AMDEPBACKSLASH@ 342 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/base_object.Po' tmpdepfile='$(DEPDIR)/base_object.TPo' @AMDEPBACKSLASH@ 343 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 344 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_object.obj `if test -f '$(MAINSRCDIR)/lib/lang/base_object.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/lang/base_object.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/lang/base_object.cc'; fi` 345 297 346 vector.o: $(MAINSRCDIR)/lib/math/vector.cc 298 347 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vector.o -MD -MP -MF "$(DEPDIR)/vector.Tpo" -c -o vector.o `test -f '$(MAINSRCDIR)/lib/math/vector.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/math/vector.cc; \ … … 310 359 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 311 360 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.obj `if test -f '$(MAINSRCDIR)/lib/math/vector.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/math/vector.cc'; fi` 361 362 resource_manager.o: $(MAINSRCDIR)/lib/util/resource_manager.cc 363 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.o -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.o `test -f '$(MAINSRCDIR)/lib/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/resource_manager.cc; \ 364 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi 365 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/resource_manager.cc' object='resource_manager.o' libtool=no @AMDEPBACKSLASH@ 366 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@ 367 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 368 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.o `test -f '$(MAINSRCDIR)/lib/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/resource_manager.cc 369 370 resource_manager.obj: $(MAINSRCDIR)/lib/util/resource_manager.cc 371 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.obj -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/lib/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/resource_manager.cc'; fi`; \ 372 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi 373 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/resource_manager.cc' object='resource_manager.obj' libtool=no @AMDEPBACKSLASH@ 374 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@ 375 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 376 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/lib/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/resource_manager.cc'; fi` 312 377 uninstall-info-am: 313 378 … … 332 397 $(AWK) ' { files[$$0] = 1; } \ 333 398 END { for (i in files) print i; }'`; \ 334 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ 335 test -n "$$unique" || unique=$$empty_fix; \ 336 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 337 $$tags $$unique; \ 338 fi 399 test -z "$(ETAGS_ARGS)$$tags$$unique" \ 400 || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 401 $$tags $$unique 339 402 ctags: CTAGS 340 403 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ … … 391 454 all-am: Makefile $(PROGRAMS) $(HEADERS) 392 455 installdirs: 393 for dir in "$(DESTDIR)$(bindir)"; do \ 394 test -z "$$dir" || $(mkdir_p) "$$dir"; \ 395 done 456 $(mkdir_p) $(DESTDIR)$(bindir) 396 457 install: install-am 397 458 install-exec: install-exec-am -
orxonox/branches/levelloader/src/lib/graphics/importer/framework.cc
r3499 r3746 17 17 18 18 #include "vector.h" 19 20 #include "primitive_model.h" 21 19 22 20 23 int verbose; … … 76 79 obj = new OBJModel(argv[1]); 77 80 else 78 { 79 // This is an example, of how it is possible, to create a new Model, and adding some vertex-information. 80 // This also packs everything into a DisplayList, and can be handled exactly as any other model. 81 // This is an example of a cube with Texture-Coordinates, but without explicite Vertex-Normals. (they are soft-created). 82 /* 83 obj = (OBJModel*) new Model(); 84 obj->setName("CUBE"); 85 obj->addVertex (-0.5, -0.5, 0.5); 86 obj->addVertex (0.5, -0.5, 0.5); 87 obj->addVertex (-0.5, 0.5, 0.5); 88 obj->addVertex (0.5, 0.5, 0.5); 89 obj->addVertex (-0.5, 0.5, -0.5); 90 obj->addVertex (0.5, 0.5, -0.5); 91 obj->addVertex (-0.5, -0.5, -0.5); 92 obj->addVertex (0.5, -0.5, -0.5); 93 94 obj->addVertexTexture (0.0, 0.0); 95 obj->addVertexTexture (1.0, 0.0); 96 obj->addVertexTexture (0.0, 1.0); 97 obj->addVertexTexture (1.0, 1.0); 98 obj->addVertexTexture (0.0, 2.0); 99 obj->addVertexTexture (1.0, 2.0); 100 obj->addVertexTexture (0.0, 3.0); 101 obj->addVertexTexture (1.0, 3.0); 102 obj->addVertexTexture (0.0, 4.0); 103 obj->addVertexTexture (1.0, 4.0); 104 obj->addVertexTexture (2.0, 0.0); 105 obj->addVertexTexture (2.0, 1.0); 106 obj->addVertexTexture (-1.0, 0.0); 107 obj->addVertexTexture (-1.0, 1.0); 108 109 obj->addFace ("1 2 4 3"); 110 obj->addFace ("3 4 6 5"); 111 obj->addFace ("5 6 8 7"); 112 obj->addFace ("7 8 2 1"); 113 obj->addFace ("2 8 6 4"); 114 obj->addFace ("7 1 3 5"); 115 obj->finalize(); 116 */ 117 obj = (OBJModel*) new Model(CYLINDER); 118 } 81 obj = new PrimitiveModel(SPHERE); 82 119 83 M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0); 120 84 rotAxis = Vector (0.0,1.0,0.0); … … 166 130 switch (event.type) { 167 131 case SDL_MOUSEMOTION: 168 PRINTF( 3)("Mouse motion about %d,%d Pixels to (%d,%d).\n",132 PRINTF(4)("Mouse motion about %d,%d Pixels to (%d,%d).\n", 169 133 event.motion.xrel, event.motion.yrel, 170 134 event.motion.x, event.motion.y); … … 205 169 if (event.button.button == 4) 206 170 { 207 PRINTF( 0)("MouseWheel up\n");171 PRINTF(4)("MouseWheel up\n"); 208 172 zoomTo *= .5; 209 173 } 210 174 else if (event.button.button == 5) 211 175 { 212 PRINTF( 2)("MouseWheel down\n");176 PRINTF(4)("MouseWheel down\n"); 213 177 zoomTo *= 2.0; 214 178 } … … 240 204 else 241 205 { 242 PRINTF( 2)("MouseButton %d released at (%d,%d).\n",206 PRINTF(4)("MouseButton %d released at (%d,%d).\n", 243 207 event.button.button, event.button.x, event.button.y); 244 208 } -
orxonox/branches/levelloader/src/lib/graphics/importer/framework.h
r3499 r3746 4 4 #include "windowHandler.h" // Include the Whandler Basecode 5 5 #include "objModel.h" 6 #include "vector.h" 6 7 7 8 class Vector; … … 34 35 35 36 WindowHandler wHandler; // Create an instance of the whandler basecode class 36 OBJModel* obj;37 Model* obj; 37 38 38 39 -
orxonox/branches/levelloader/src/lib/graphics/importer/material.cc
r3605 r3746 21 21 #include "texture.h" 22 22 #include "debug.h" 23 #include "resource_manager.h" 23 24 #include <stdlib.h> 24 25 #include <string.h> 26 27 //! \todo check if we are in RESOURCE MANAGER-mode 28 #include "resource_manager.h" 25 29 26 30 using namespace std; … … 58 62 delete []this->name; 59 63 if (this->diffuseTexture) 60 this->diffuseTexture;64 ResourceManager::getInstance()->unload(this->diffuseTexture); 61 65 if (this->nextMat) 62 66 delete this->nextMat; … … 89 93 this->nextMat = NULL; 90 94 this->name =""; 91 this->setIllum( 1);95 this->setIllum(3); 92 96 this->setDiffuse(0,0,0); 93 97 this->setAmbient(0,0,0); … … 104 108 this->ambientTextureSet = false; 105 109 this->specularTextureSet = false; 106 107 108 110 } 109 111 … … 167 169 } 168 170 169 170 171 /** 171 172 \brief Set the Name of the Material. (Important for searching) … … 321 322 void Material::addTexturePath(char* pathName) 322 323 { 323 PathList::getInstance()->addPath(pathName);324 ResourceManager::getInstance()->addImageDir(pathName); 324 325 } 325 326 … … 333 334 { 334 335 PRINTF(4)("setting Diffuse Map %s\n", dMap); 335 diffuseTexture = new Texture(); 336 this->diffuseTextureSet = diffuseTexture->loadImage(dMap); 337 336 // diffuseTexture = new Texture(); 337 // this->diffuseTextureSet = diffuseTexture->loadImage(dMap); 338 339 //! \todo check if RESOURCE MANAGER is availiable 340 //! \todo Textures from .mtl-file need special care. 341 this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE); 338 342 } 339 343 -
orxonox/branches/levelloader/src/lib/graphics/importer/model.cc
r3605 r3746 34 34 { 35 35 this->initialize(); 36 }37 38 /**39 \brief Creates a 3D-Model of Primitive-Type type40 41 if you want to just display a Cube/Sphere/Cylinder/... without any material.42 43 \todo implement Cube/Sphere/Cylinder/...44 */45 Model::Model(PRIMITIVE type)46 {47 this->initialize();48 49 switch (type)50 {51 default:52 case CUBE:53 this->cubeModel();54 break;55 case SPHERE:56 this->sphereModel();57 break;58 case CYLINDER:59 this->cylinderModel();60 break;61 62 }63 this->importToGL ();64 65 this->cleanup();66 36 } 67 37 … … 492 462 493 463 tmpElem->vertexNumber = va_arg (itemlist, int) -1; 494 if (type >= 2)464 if (type & TEXCOORD) 495 465 tmpElem->texCoordNumber = va_arg (itemlist, int) -1; 496 if (type == 1 || type ==3)466 if (type & NORMAL) 497 467 tmpElem->normalNumber = va_arg(itemlist, int) -1; 498 468 this->currentGroup->currentFace->vertexCount++; … … 797 767 void Model::cubeModel(void) 798 768 { 799 this->addVertex ( "-0.5 -0.5 0.5");800 this->addVertex ( "0.5 -0.5 0.5");801 this->addVertex ( "-0.5 0.5 0.5");802 this->addVertex ( "0.5 0.5 0.5");803 this->addVertex ( "-0.5 0.5 -0.5");804 this->addVertex ( "0.5 0.5 -0.5");805 this->addVertex ( "-0.5 -0.5 -0.5");806 this->addVertex ( "0.5 -0.5 -0.5");807 808 this->addVertexTexture ( "0.0 0.0");809 this->addVertexTexture ( "1.0 0.0");810 this->addVertexTexture ( "0.0 1.0");811 this->addVertexTexture ( "1.0 1.0");812 this->addVertexTexture ( "0.0 2.0");813 this->addVertexTexture ( "1.0 2.0");814 this->addVertexTexture ( "0.0 3.0");815 this->addVertexTexture ( "1.0 3.0");816 this->addVertexTexture ( "0.0 4.0");817 this->addVertexTexture ( "1.0 4.0");818 this->addVertexTexture ( "2.0 0.0");819 this->addVertexTexture ( "2.0 1.0");820 this->addVertexTexture ( "-1.0 0.0");821 this->addVertexTexture ( "-1.0 1.0");822 823 this->addVertexNormal ( "0.0 0.0 1.0");824 this->addVertexNormal ( "0.0 0.0 1.0");825 this->addVertexNormal ( "0.0 0.0 1.0");826 this->addVertexNormal ( "0.0 0.0 1.0");827 this->addVertexNormal ( "0.0 1.0 0.0");828 this->addVertexNormal ( "0.0 1.0 0.0");829 this->addVertexNormal ( "0.0 1.0 0.0");830 this->addVertexNormal ( "0.0 1.0 0.0");831 this->addVertexNormal ( "0.0 0.0 -1.0");832 this->addVertexNormal ( "0.0 0.0 -1.0");833 this->addVertexNormal ( "0.0 0.0 -1.0");834 this->addVertexNormal ( "0.0 0.0 -1.0");835 this->addVertexNormal ( "0.0 -1.0 0.0");836 this->addVertexNormal ( "0.0 -1.0 0.0");837 this->addVertexNormal ( "0.0 -1.0 0.0");838 this->addVertexNormal ( "0.0 -1.0 0.0");839 this->addVertexNormal ( "1.0 0.0 0.0");840 this->addVertexNormal ( "1.0 0.0 0.0");841 this->addVertexNormal ( "1.0 0.0 0.0");842 this->addVertexNormal ( "1.0 0.0 0.0");843 this->addVertexNormal ( "-1.0 0.0 0.0");844 this->addVertexNormal ( "-1.0 0.0 0.0");845 this->addVertexNormal ( "-1.0 0.0 0.0");846 this->addVertexNormal ( "-1.0 0.0 0.0");769 this->addVertex (-0.5, -0.5, 0.5); 770 this->addVertex (0.5, -0.5, 0.5); 771 this->addVertex (-0.5, 0.5, 0.5); 772 this->addVertex (0.5, 0.5, 0.5); 773 this->addVertex (-0.5, 0.5, -0.5); 774 this->addVertex (0.5, 0.5, -0.5); 775 this->addVertex (-0.5, -0.5, -0.5); 776 this->addVertex (0.5, -0.5, -0.5); 777 778 this->addVertexTexture (0.0, 0.0); 779 this->addVertexTexture (1.0, 0.0); 780 this->addVertexTexture (0.0, 1.0); 781 this->addVertexTexture (1.0, 1.0); 782 this->addVertexTexture (0.0, 2.0); 783 this->addVertexTexture (1.0, 2.0); 784 this->addVertexTexture (0.0, 3.0); 785 this->addVertexTexture (1.0, 3.0); 786 this->addVertexTexture (0.0, 4.0); 787 this->addVertexTexture (1.0, 4.0); 788 this->addVertexTexture (2.0, 0.0); 789 this->addVertexTexture (2.0, 1.0); 790 this->addVertexTexture (-1.0, 0.0); 791 this->addVertexTexture (-1.0, 1.0); 792 793 this->addVertexNormal (0.0, 0.0, 1.0); 794 this->addVertexNormal (0.0, 0.0, 1.0); 795 this->addVertexNormal (0.0, 0.0, 1.0); 796 this->addVertexNormal (0.0, 0.0, 1.0); 797 this->addVertexNormal (0.0, 1.0, 0.0); 798 this->addVertexNormal (0.0, 1.0, 0.0); 799 this->addVertexNormal (0.0, 1.0, 0.0); 800 this->addVertexNormal (0.0, 1.0, 0.0); 801 this->addVertexNormal (0.0, 0.0, -1.0); 802 this->addVertexNormal (0.0, 0.0, -1.0); 803 this->addVertexNormal (0.0, 0.0, -1.0); 804 this->addVertexNormal (0.0, 0.0, -1.0); 805 this->addVertexNormal (0.0, -1.0, 0.0); 806 this->addVertexNormal (0.0, -1.0, 0.0); 807 this->addVertexNormal (0.0, -1.0, 0.0); 808 this->addVertexNormal (0.0, -1.0, 0.0); 809 this->addVertexNormal (1.0, 0.0, 0.0); 810 this->addVertexNormal (1.0, 0.0, 0.0); 811 this->addVertexNormal (1.0, 0.0, 0.0); 812 this->addVertexNormal (1.0, 0.0, 0.0); 813 this->addVertexNormal (-1.0, 0.0, 0.0); 814 this->addVertexNormal (-1.0, 0.0, 0.0); 815 this->addVertexNormal (-1.0, 0.0, 0.0); 816 this->addVertexNormal (-1.0, 0.0, 0.0); 847 817 848 818 /* normaleLess-testingMode … … 855 825 */ 856 826 857 this->addFace ("1/1/1 2/2/2 4/4/3 3/3/4"); 858 this->addFace ("3/3/5 4/4/6 6/6/7 5/5/8"); 859 this->addFace ("5/5/9 6/6/10 8/8/11 7/7/12"); 860 this->addFace ("7/7/13 8/8/14 2/10/15 1/9/16"); 861 this->addFace ("2/2/17 8/11/18 6/12/19 4/4/20"); 862 this->addFace ("7/13/21 1/1/22 3/3/23 5/14/24"); 863 864 } 865 866 /** 867 \brief Builds a Sphere into the Model 868 */ 869 void Model::sphereModel() 870 { 871 int detail = 30; 872 if (detail <= 0) detail = 1; 873 float df = (float)detail; 874 for (float i = 0.0; i < df/2; i+=1.0) 875 { 876 for (float j = 0.0; j < df; j+=1.0) 877 { 878 float vz = i/df *2.0*PI - PI/2.0; 879 this->addVertex(cos(j/df*2.0*PI) * cos(vz) , 880 sin(j/df*2.0*PI) * cos(vz), 881 sin(vz)); 882 //if (j==0.0) 883 //printf ("%f %f\n", vz, sin (vz)); 884 if (i==0.0) 885 PRINTF(0)("%f, %f\n", j/df*2.0*PI, cos(j/df*PI)); 886 } 887 } 888 vertices->debug(); 889 for (int i = 0; i < detail/2; i++) 890 for (int j = 1; j < detail; j++) 891 { 892 unsigned int v1,v2,v3,v4; 893 v1 = i*detail +j; 894 895 /* if (j+1 == detail) 896 { 897 v2 = i*detail +1; 898 v3 = i*detail+detail + 1; 899 } 900 else*/ 901 { 902 v2 = i*detail +j+1; 903 v3 = i*detail+detail + j+1; 904 } 905 v4 = i*detail+detail + j; 906 //printf("%i %i %i %i\n", v1, v2, v3, v4); 907 this->addFace(4, 0, v1, v2, v3, v4); 908 } 909 } 910 911 /** 912 \brief Creates a Cylinder. 913 */ 914 void Model::cylinderModel(void) 915 { 916 unsigned int detail = 20; 917 float size = 1.0; 918 919 // check if devision by zero 920 if (detail <= 3) 921 detail = 3; 922 int count = 0; 923 // defining Points of the Cylinder. 924 for (float phi = 0.0; phi < 2.0*PI; phi += 2.0*PI/(float)detail) 925 { 926 this->addVertex(size*cos(phi), size*sin(phi), -size); 927 this->addVertex(size*cos(phi), size*sin(phi), size); 928 count ++; 929 } 930 this->addVertex(0, 0, -size); 931 this->addVertex(0, 0, size); 932 933 934 if (count != detail) 935 PRINTF(1)("calculation error, count should be %d but is %d.\n", detail, count); 936 vertices->debug(); 937 938 // adding Faces 939 for (int i = 0; i < detail-1; i++) 940 { 941 int p1, p2, p3, p4; 942 p1 = 2*i+1; 943 p2 = 2*i+2; 944 if (i <= detail); 945 p3 = 2*i+4; 946 p4 = 2*i+3; 947 // something is wrong here 948 this->addFace(4, 0, p1, p2, p3, p4); 949 this->addFace(3, 0, p4, p1, 2*detail+1); 950 this->addFace(3, 0, p2, p3, 2*detail+2); 951 } 952 addFace(4,0, 2*detail-1, 2*detail, 2, 1); 953 this->addFace(3, 0, 1, 2*detail-1, 2*detail+1); 954 this->addFace(3, 0, 2*detail, 2, 2*detail+2); 955 956 } 827 this->addFace (4, 3, 1,1,1, 2,2,2, 4,4,3, 3,3,4); 828 this->addFace (4, 3, 3,3,5, 4,4,6, 6,6,7, 5,5,8); 829 this->addFace (4, 3, 5,5,9, 6,6,10, 8,8,11, 7,7,12); 830 this->addFace (4, 3, 7,7,13, 8,8,14, 2,10,15, 1,9,16); 831 this->addFace (4, 3, 2,2,17, 8,11,18, 6,12,19, 4,4,20); 832 this->addFace (4, 3, 7,13,21, 1,1,22, 3,3,23, 5,14,24); 833 834 } -
orxonox/branches/levelloader/src/lib/graphics/importer/model.h
r3499 r3746 15 15 using namespace std; 16 16 17 //! Specification of different primitives the Model knows 18 enum PRIMITIVE {PLANE, CUBE, SPHERE, CYLINDER}; 17 // definition of different modes for setting up Faces 18 #define VERTEX 0 //!< If Faces are created WITH Vertex-Coordinate 19 #define NORMAL 1 //!< If Faces are created WITH Normals (otherwise autocalculate) 20 #define TEXCOORD 2 //!< If Faces are created WITH TextureCoordinate 19 21 20 22 //! Class that handles 3D-Models. it can also read them in and display them. … … 23 25 public: 24 26 Model(void); 25 Model(PRIMITIVE type);26 27 Model(char* modelName); 27 28 virtual ~Model(void); … … 114 115 115 116 void cubeModel(void); 116 void sphereModel(void);117 void cylinderModel(void);118 117 }; 119 118 -
orxonox/branches/levelloader/src/lib/graphics/importer/objModel.cc
r3605 r3746 21 21 22 22 #include "debug.h" 23 24 /**25 \brief Crates a 3D-Model and loads in a File.26 \param fileName file to parse and load (must be a .obj file)27 */28 OBJModel::OBJModel(const char* fileName)29 {30 this->initializeOBJ();31 32 this->importFile (fileName);33 34 this->importToGL ();35 36 this->cleanup();37 }38 23 39 24 /** … … 193 178 else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented 194 179 { 195 PRINTF( 3)("smoothing groups not supportet yet. line: %s\n", Buffer);180 PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer); 196 181 } 197 182 } … … 200 185 delete []fileName; 201 186 return true; 202 203 187 } 204 188 -
orxonox/branches/levelloader/src/lib/graphics/importer/objModel.h
r3542 r3746 13 13 { 14 14 public: 15 OBJModel(const char* fileName); 16 OBJModel(const char* fileName, float scaling); 15 OBJModel(const char* fileName, float scaling = 1.0); 17 16 virtual ~OBJModel(); 18 17 void initializeOBJ(void); … … 28 27 bool readFromObjFile (void); 29 28 bool readMtlLib (const char* matFile); 30 31 29 }; 32 30 -
orxonox/branches/levelloader/src/lib/graphics/importer/texture.cc
r3605 r3746 22 22 #include "texture.h" 23 23 24 // headers only for PathList 25 #include <unistd.h> 26 #include <sys/types.h> 27 #include <sys/stat.h> 28 #include <stdlib.h> 29 #include <fstream> 30 31 /** 32 \brief creates a ned PathList. 33 34 It is a good idea to use this as an initial List, 35 because if you give on a name the Path will not be checked for its existence. 36 */ 37 PathList::PathList() 38 { 39 this->pathName = NULL; 40 this->next = NULL; 41 } 42 43 /** 44 \brief Creates a new PathList with a Name. 45 \param pName the Name of The Path. 46 47 This function just adds the Path without checking if it exists. 48 */ 49 PathList::PathList(char* pName) 50 { 51 this->pathName = new char [strlen(pName)+1]; 52 strcpy (this->pathName, pName); 53 this->next = NULL; 54 } 55 56 /** 57 \brief destroys a PathList 58 59 It does this by deleting the Name and then delete its preceding PathList. 60 */ 61 PathList::~PathList() 62 { 63 if (this->pathName) 64 delete []this->pathName; 65 if (this->next) 66 delete this->next; 67 } 68 69 PathList* PathList::firstPath = NULL; 70 71 /** 72 \returns A Pointer to the first Path of the Pathlist 73 */ 74 PathList* PathList::getInstance(void) 75 { 76 if (firstPath) 77 return firstPath; 78 firstPath = new PathList(); 79 } 80 /** 81 \brief Adds a new Pathlist Element. 82 \param pName 83 84 Adding a Path automatically checks if the Path exists, 85 and if it does not it will not add it to the List. 86 */ 87 void PathList::addPath (char* pName) 88 { 89 if (pName[0] == '\0') 90 { 91 PRINTF(2)("not Adding empty Path to the List.\n"); 92 return; 93 } 94 char* tmpPName = new char[strlen(pName)]; 95 strncpy(tmpPName, pName, strlen(pName)-1); 96 tmpPName[strlen(pName)-1] = '\0'; 97 if (access (tmpPName, F_OK) == 0) 98 { 99 struct stat status; 100 stat(tmpPName, &status); 101 if (status.st_mode & S_IFDIR) 102 { 103 PRINTF(4)("Adding Path %s to the PathList.\n", pName); 104 PathList* tmpPathList = this; 105 while (tmpPathList->next) 106 tmpPathList = tmpPathList->next; 107 tmpPathList->next = new PathList(pName); 108 } 109 else 110 PRINTF(2)("You tried to add non-folder %s to a PathList.\n", tmpPName); 111 } 112 else 113 PRINTF(2)("You tried to add non-existing folder %s to a PathList.\n", tmpPName); 114 delete []tmpPName; 115 } 116 117 24 #include "graphics_engine.h" 118 25 119 26 /** … … 127 34 this->texture = 0; 128 35 } 36 37 /** 38 \brief Constructor for a Texture 39 */ 40 Texture::Texture(const char* imageName) 41 { 42 this->pImage = new Image; 43 this->pImage->data = NULL; 44 this->map = NULL; 45 this->texture = 0; 46 this->loadImage(imageName); 47 } 129 48 130 49 /** … … 143 62 144 63 /** 145 \brief Searches for a Texture inside one of the defined Paths146 \param texName The name of the texture o search for.147 \returns pathName+texName if texName was found in the pathList. NULL if the Texture is not found.148 */149 char* Texture::searchTextureInPaths(char* texName) const150 {151 char* tmpName = NULL;152 PathList* pList = PathList::getInstance();153 while (pList)154 {155 if (pList->pathName)156 {157 tmpName = new char [strlen(pList->pathName)+strlen(texName)+1];158 strcpy(tmpName, pList->pathName);159 }160 else161 {162 tmpName = new char [strlen(texName)+1];163 tmpName[0]='\0';164 }165 strcat(tmpName, texName);166 if (access (tmpName, F_OK) == 0)167 return tmpName;168 169 if (tmpName)170 delete []tmpName;171 tmpName = NULL;172 pList = pList->next;173 }174 return NULL;175 }176 177 /**178 64 \brief a Simple function that switches two char values 179 65 \param a The first value … … 195 81 bool Texture::loadTexToGL (Image* pImage) 196 82 { 197 PRINTF(4)("Loading texture to OpenGL-Environment.\n"); 198 glGenTextures(1, &this->texture); 199 glBindTexture(GL_TEXTURE_2D, this->texture); 200 /* not Working, and not needed. 201 glTexImage2D( GL_TEXTURE_2D, 0, 3, width, 202 height, 0, GL_BGR, 203 GL_UNSIGNED_BYTE, map->pixels ); 204 */ 205 gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImage->width, pImage->height, pImage->format, GL_UNSIGNED_BYTE, pImage->data); 206 207 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); 208 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR); 209 } 210 83 if (GraphicsEngine::texturesEnabled) 84 { 85 PRINTF(4)("Loading texture to OpenGL-Environment.\n"); 86 glGenTextures(1, &this->texture); 87 glBindTexture(GL_TEXTURE_2D, this->texture); 88 /* not Working, and not needed. 89 glTexImage2D( GL_TEXTURE_2D, 0, 3, width, 90 height, 0, GL_BGR, 91 GL_UNSIGNED_BYTE, map->pixels ); 92 */ 93 gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImage->width, pImage->height, pImage->format, GL_UNSIGNED_BYTE, pImage->data); 94 95 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); 96 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR); 97 } 98 } 211 99 212 100 #ifdef HAVE_SDL_SDL_IMAGE_H 213 bool Texture::loadImage(char* imageName) 214 { 215 char* imgNameWithPath = searchTextureInPaths(imageName); 216 if (imgNameWithPath) 217 { 218 this->map=IMG_Load(imgNameWithPath); 219 if(!map) 220 { 221 PRINTF(1)("IMG_Load: %s\n", IMG_GetError()); 101 bool Texture::loadImage(const char* imageName) 102 { 103 if (GraphicsEngine::texturesEnabled) 104 { 105 if (imageName) 106 { 107 this->map=IMG_Load(imageName); 108 if(!map) 109 { 110 PRINTF(1)("IMG_Load: %s\n", IMG_GetError()); 111 return false; 112 } 113 pImage->height = map->h; 114 pImage->width = map->w; 115 pImage->data = (GLubyte*)map->pixels; 116 pImage->bpp = map->format->BytesPerPixel; 117 if (pImage->bpp == 3) 118 pImage->format = GL_RGB; 119 else if (pImage->bpp == 4) 120 pImage->format = GL_RGBA; 121 122 if( !IMG_isPNG(SDL_RWFromFile(imageName, "rb")) && !IMG_isJPG(SDL_RWFromFile(imageName, "rb"))) 123 for (int i=0;i<map->h * map->w *3;i+=3) 124 { 125 GLuint temp = pImage->data[i]; 126 pImage->data[i] = pImage->data[i+2]; 127 pImage->data[i+2] = temp; 128 } 129 /* this is the real swapping algorithm */ 130 for( int i = 0 ; i < (pImage->height / 2) ; ++i ) 131 for( int j = 0 ; j < pImage->width * pImage->bpp; j += pImage->bpp ) 132 for(int k = 0; k < pImage->bpp; ++k) 133 swap( pImage->data[ (i * pImage->width * pImage->bpp) + j + k], pImage->data[ ( (pImage->height - i - 1) * pImage->width * pImage->bpp ) + j + k]); 134 135 this->loadTexToGL (this->pImage); 136 SDL_FreeSurface(map); 137 this->pImage->data = NULL; 138 } 139 else 140 { 141 PRINTF(2)("Image not Found: %s\n", imageName); 222 142 return false; 223 143 } 224 pImage->height = map->h;225 pImage->width = map->w;226 pImage->data = (GLubyte*)map->pixels;227 pImage->bpp = map->format->BytesPerPixel;228 if (pImage->bpp == 3)229 pImage->format = GL_RGB;230 else if (pImage->bpp == 4)231 pImage->format = GL_RGBA;232 233 if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb")))234 for (int i=0;i<map->h * map->w *3;i+=3)235 {236 GLuint temp = pImage->data[i];237 pImage->data[i] = pImage->data[i+2];238 pImage->data[i+2] = temp;239 }240 /* this is the real swapping algorithm */241 for( int i = 0 ; i < (pImage->height / 2) ; ++i )242 for( int j = 0 ; j < pImage->width * pImage->bpp; j += pImage->bpp )243 for(int k = 0; k < pImage->bpp; ++k)244 swap( pImage->data[ (i * pImage->width * pImage->bpp) + j + k], pImage->data[ ( (pImage->height - i - 1) * pImage->width * pImage->bpp ) + j + k]);245 246 this->loadTexToGL (this->pImage);247 SDL_FreeSurface(map);248 this->pImage->data = NULL;249 }250 else251 {252 PRINTF(2)("Image not Found: %s\n", imgNameWithPath);253 return false;254 144 } 255 145 } … … 262 152 \todo Checks where to find the Image 263 153 */ 264 bool Texture::loadImage(char* imageName) 265 { 266 char* imgNameWithPath = searchTextureInPaths(imageName); 267 if (imgNameWithPath) 268 { 269 if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".bmp", 4)) 270 { 271 PRINTF(4)("Requested bmp-image. Trying to Import.\n"); 272 return this->loadBMP(imgNameWithPath); 273 } 274 275 else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".jpg", 4) || !strncmp(imgNameWithPath+strlen(imgNameWithPath)-5, ".jpg", 5)) 276 { 277 PRINTF(4)("Requested jpeg-image. Trying to Import\n"); 278 return this->loadJPG(imgNameWithPath); 279 } 280 else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".tga", 4)) 281 { 282 PRINTF(4)("Requested tga-image. Trying to Import\n"); 283 return this->loadTGA(imgNameWithPath); 284 } 285 else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".png", 4)) 286 { 287 PRINTF(4)("Requested png-image. Trying to Import\n"); 288 return this->loadPNG(imgNameWithPath); 154 bool Texture::loadImage(const char* imageName) 155 { 156 if (GraphicsEngine::texturesEnabled) 157 { 158 if (imageName) 159 { 160 if (!strncmp(imageName+strlen(imageName)-4, ".bmp", 4)) 161 { 162 PRINTF(4)("Requested bmp-image. Trying to Import.\n"); 163 return this->loadBMP(imageName); 164 } 165 166 else if (!strncmp(imageName+strlen(imageName)-4, ".jpg", 4) || !strncmp(imageName+strlen(imageName)-5, ".jpg", 5)) 167 { 168 PRINTF(4)("Requested jpeg-image. Trying to Import\n"); 169 return this->loadJPG(imageName); 170 } 171 else if (!strncmp(imageName+strlen(imageName)-4, ".tga", 4)) 172 { 173 PRINTF(4)("Requested tga-image. Trying to Import\n"); 174 return this->loadTGA(imageName); 175 } 176 else if (!strncmp(imageName+strlen(imageName)-4, ".png", 4)) 177 { 178 PRINTF(4)("Requested png-image. Trying to Import\n"); 179 return this->loadPNG(imageName); 180 } 181 else 182 { 183 PRINTF(2)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imageName); 184 return false; 185 } 289 186 } 290 187 else 291 188 { 292 PRINTF(2)(" Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);189 PRINTF(2)("Image not Found: %s\n", imageName); 293 190 return false; 294 191 } 295 192 } 296 else 297 { 298 PRINTF(2)("Image not Found: %s\n", imgNameWithPath); 299 return false; 300 } 301 } 302 193 } 303 194 /** 304 195 \brief reads in a Windows BMP-file, and imports it to openGL. -
orxonox/branches/levelloader/src/lib/graphics/importer/texture.h
r3605 r3746 28 28 #endif /* HAVE_SDL_SDL_IMAGE_H */ 29 29 30 31 32 //! Class to handle lists of paths.33 /**34 \todo Ability to return Paths by itself.35 36 It is simple to use, and good, for all PathList you want.37 just create a new Pathlist, and add Paths.38 */39 class PathList40 {41 private:42 PathList();43 static PathList* firstPath; //!< A static Pointer to the first PathList in the List.44 public:45 PathList(char* pName);46 ~PathList();47 static PathList* getInstance(void);48 49 void addPath (char* pName);50 char* pathName; //!< The Name of the current Path.51 PathList* next; //!< Pointer to the next Pathlist.52 };53 54 30 //! A Class, that reads in Textures from different fileformats. 55 31 class Texture … … 70 46 GLuint texture; //!< The Texture-ID of opengl from this Texture. 71 47 SDL_Surface* map; //!< The map SDL initializes for this element. 72 char* searchTextureInPaths(c har* texName) const;48 char* searchTextureInPaths(const char* texName) const; 73 49 inline void swap(unsigned char &a, unsigned char &b); 74 50 public: 75 51 Texture(void); 52 Texture(const char* imageName); 76 53 ~Texture(void); 77 54 /** \returns The textureID of this texture. */ … … 79 56 bool loadTexToGL (Image* pImage); 80 57 81 bool loadImage(c har* imageName);58 bool loadImage(const char* imageName); 82 59 #ifndef HAVE_SDL_SDL_IMAGE_H 83 60
Note: See TracChangeset
for help on using the changeset viewer.