Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 7, 2005, 3:54:49 PM (20 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: Merged trunk into branch… still not working though…

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  
    55AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib
    66AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data
    7 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gaphics
     7AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics
    88AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer
    99AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/lang
     
    2727                  model.cc \
    2828                  objModel.cc \
     29                  primitive_model.cc \
    2930                  array.cc \
    3031                  material.cc \
    3132                  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
    3337
    3438noinst_HEADERS= framework.h \
     
    3640                model.h \
    3741                objModel.h \
     42                primitive_model.h \
    3843                array.h \
    3944                material.h \
  • orxonox/branches/levelloader/src/lib/graphics/importer/Makefile.in

    r3605 r3746  
    1 # Makefile.in generated by automake 1.8.5 from Makefile.am.
     1# Makefile.in generated by automake 1.8.2 from Makefile.am.
    22# @configure_input@
    33
     
    4242subdir = src/lib/graphics/importer
    4343DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
    44         $(srcdir)/Makefile.in
     44        $(srcdir)/Makefile.in TODO
    4545ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    4646am__aclocal_m4_deps = $(top_srcdir)/configure.ac
     
    5050CONFIG_HEADER = $(top_builddir)/config.h
    5151CONFIG_CLEAN_FILES =
    52 am__installdirs = "$(DESTDIR)$(bindir)"
     52am__installdirs = $(DESTDIR)$(bindir)
    5353binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    5454PROGRAMS = $(bin_PROGRAMS)
    5555am_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)
    5860importer_OBJECTS = $(am_importer_OBJECTS)
    5961importer_LDADD = $(LDADD)
     
    6163depcomp = $(SHELL) $(top_srcdir)/depcomp
    6264am__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 \
    6469@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
    6775CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    6876        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    185193target_vendor = @target_vendor@
    186194MAINSRCDIR = ../../..
    187 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/gaphics -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
     195AM_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
    188196AM_LDFLAGS = $(MWINDOWS)
    189197importer_SOURCES = framework.cc \
     
    191199                  model.cc \
    192200                  objModel.cc \
     201                  primitive_model.cc \
    193202                  array.cc \
    194203                  material.cc \
    195204                  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
    197209
    198210noinst_HEADERS = framework.h \
     
    200212                model.h \
    201213                objModel.h \
     214                primitive_model.h \
    202215                array.h \
    203216                material.h \
     
    217230          esac; \
    218231        done; \
    219         echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile'; \
     232        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile'; \
    220233        cd $(top_srcdir) && \
    221           $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile
     234          $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile
    222235.PRECIOUS: Makefile
    223236Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
     
    239252install-binPROGRAMS: $(bin_PROGRAMS)
    240253        @$(NORMAL_INSTALL)
    241         test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
     254        $(mkdir_p) $(DESTDIR)$(bindir)
    242255        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    243256          p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
     
    245258          ; then \
    246259            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; \
    249262          else :; fi; \
    250263        done
     
    254267        @list='$(bin_PROGRAMS)'; for p in $$list; do \
    255268          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; \
    258271        done
    259272
     
    271284
    272285@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
     286@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@
    273287@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/framework.Po@am__quote@
     288@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics_engine.Po@am__quote@
    274289@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
    275290@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
    276291@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@
    277294@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
    278295@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
     
    295312@am__fastdepCXX_FALSE@  $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
    296313
     314graphics_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
     322graphics_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
     330base_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
     338base_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
    297346vector.o: $(MAINSRCDIR)/lib/math/vector.cc
    298347@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; \
     
    310359@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    311360@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
     362resource_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
     370resource_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`
    312377uninstall-info-am:
    313378
     
    332397          $(AWK) '    { files[$$0] = 1; } \
    333398               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
    339402ctags: CTAGS
    340403CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
     
    391454all-am: Makefile $(PROGRAMS) $(HEADERS)
    392455installdirs:
    393         for dir in "$(DESTDIR)$(bindir)"; do \
    394           test -z "$$dir" || $(mkdir_p) "$$dir"; \
    395         done
     456        $(mkdir_p) $(DESTDIR)$(bindir)
    396457install: install-am
    397458install-exec: install-exec-am
  • orxonox/branches/levelloader/src/lib/graphics/importer/framework.cc

    r3499 r3746  
    1717
    1818#include "vector.h"
     19
     20#include "primitive_model.h"
     21
    1922
    2023int verbose;
     
    7679    obj = new OBJModel(argv[1]);
    7780  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
    11983  M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0);
    12084  rotAxis = Vector (0.0,1.0,0.0);
     
    166130      switch (event.type) {
    167131      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",
    169133                  event.motion.xrel, event.motion.yrel,
    170134                  event.motion.x, event.motion.y);
     
    205169        if (event.button.button == 4)
    206170          {
    207             PRINTF(0)("MouseWheel up\n");
     171            PRINTF(4)("MouseWheel up\n");
    208172            zoomTo *= .5;
    209173          }
    210174        else if (event.button.button == 5)
    211175          {
    212             PRINTF(2)("MouseWheel down\n");
     176            PRINTF(4)("MouseWheel down\n");
    213177            zoomTo *= 2.0;
    214178          }
     
    240204        else
    241205            {
    242               PRINTF(2)("MouseButton %d released at (%d,%d).\n",
     206              PRINTF(4)("MouseButton %d released at (%d,%d).\n",
    243207                        event.button.button, event.button.x, event.button.y);
    244208            }
  • orxonox/branches/levelloader/src/lib/graphics/importer/framework.h

    r3499 r3746  
    44#include "windowHandler.h" // Include the Whandler Basecode
    55#include "objModel.h"
     6#include "vector.h"
    67
    78class Vector;
     
    3435
    3536WindowHandler wHandler;  // Create an instance of the whandler basecode class
    36 OBJModel* obj;
     37Model* obj;
    3738
    3839
  • orxonox/branches/levelloader/src/lib/graphics/importer/material.cc

    r3605 r3746  
    2121#include "texture.h"
    2222#include "debug.h"
     23#include "resource_manager.h"
    2324#include <stdlib.h>
    2425#include <string.h>
     26
     27//! \todo check if we are in RESOURCE MANAGER-mode
     28#include "resource_manager.h"
    2529
    2630using namespace std;
     
    5862    delete []this->name;
    5963  if (this->diffuseTexture)
    60     this->diffuseTexture;
     64    ResourceManager::getInstance()->unload(this->diffuseTexture);
    6165  if (this->nextMat)
    6266    delete this->nextMat;
     
    8993  this->nextMat = NULL;
    9094  this->name ="";
    91   this->setIllum(1);
     95  this->setIllum(3);
    9296  this->setDiffuse(0,0,0);
    9397  this->setAmbient(0,0,0);
     
    104108  this->ambientTextureSet = false;
    105109  this->specularTextureSet = false;
    106 
    107  
    108110}
    109111
     
    167169}
    168170
    169 
    170171/**
    171172   \brief Set the Name of the Material. (Important for searching)
     
    321322void Material::addTexturePath(char* pathName)
    322323{
    323   PathList::getInstance()->addPath(pathName);
     324  ResourceManager::getInstance()->addImageDir(pathName);
    324325}
    325326
     
    333334{
    334335  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);
    338342}
    339343
  • orxonox/branches/levelloader/src/lib/graphics/importer/model.cc

    r3605 r3746  
    3434{
    3535  this->initialize();
    36 }
    37 
    38 /**
    39    \brief Creates a 3D-Model of Primitive-Type type
    40 
    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();
    6636}
    6737
     
    492462
    493463      tmpElem->vertexNumber = va_arg (itemlist, int) -1;
    494       if (type >= 2)
     464      if (type & TEXCOORD)
    495465        tmpElem->texCoordNumber = va_arg (itemlist, int) -1;
    496       if (type == 1 || type ==3)
     466      if (type & NORMAL)
    497467        tmpElem->normalNumber = va_arg(itemlist, int) -1;
    498468      this->currentGroup->currentFace->vertexCount++;
     
    797767void Model::cubeModel(void)
    798768{
    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);
    847817
    848818  /* normaleLess-testingMode
     
    855825  */
    856826
    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  
    1515using namespace std;
    1616
    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
    1921
    2022//! Class that handles 3D-Models. it can also read them in and display them.
     
    2325 public:
    2426  Model(void);
    25   Model(PRIMITIVE type);
    2627  Model(char* modelName);
    2728  virtual ~Model(void);
     
    114115
    115116  void cubeModel(void);
    116   void sphereModel(void);
    117   void cylinderModel(void);
    118117};
    119118
  • orxonox/branches/levelloader/src/lib/graphics/importer/objModel.cc

    r3605 r3746  
    2121
    2222#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 }
    3823
    3924/**
     
    193178      else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented
    194179        {
    195           PRINTF(3)("smoothing groups not supportet yet. line: %s\n", Buffer);
     180          PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer);
    196181        }
    197182    }
     
    200185  delete []fileName;
    201186  return true;
    202 
    203187}
    204188
  • orxonox/branches/levelloader/src/lib/graphics/importer/objModel.h

    r3542 r3746  
    1313{
    1414 public:
    15   OBJModel(const char* fileName);
    16   OBJModel(const char* fileName, float scaling);
     15  OBJModel(const char* fileName, float scaling = 1.0);
    1716  virtual ~OBJModel();
    1817  void initializeOBJ(void);
     
    2827  bool readFromObjFile (void);
    2928  bool readMtlLib (const char* matFile);
    30 
    3129};
    3230
  • orxonox/branches/levelloader/src/lib/graphics/importer/texture.cc

    r3605 r3746  
    2222#include "texture.h"
    2323
    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"
    11825
    11926/**
     
    12734  this->texture = 0;
    12835}
     36
     37/**
     38   \brief Constructor for a Texture
     39*/
     40Texture::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
    12948
    13049/**
     
    14362
    14463/**
    145    \brief Searches for a Texture inside one of the defined Paths
    146    \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) const
    150 {
    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       else
    161         {
    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 /**
    17864   \brief a Simple function that switches two char values
    17965   \param a The first value
     
    19581bool Texture::loadTexToGL (Image* pImage)
    19682{
    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}
    21199
    212100#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());
     101bool 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);
    222142          return false;
    223143        }
    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   else
    251     {
    252       PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
    253       return false;
    254144    }
    255145}
     
    262152   \todo Checks where to find the Image
    263153*/
    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);
     154bool 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            }
    289186        }
    290187      else
    291188        {
    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);
    293190          return false;
    294191        }
    295192    }
    296   else
    297     {
    298       PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
    299       return false;
    300     }
    301 }
    302 
     193}
    303194/**
    304195   \brief reads in a Windows BMP-file, and imports it to openGL.
  • orxonox/branches/levelloader/src/lib/graphics/importer/texture.h

    r3605 r3746  
    2828#endif /* HAVE_SDL_SDL_IMAGE_H */
    2929
    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 PathList
    40 {
    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 
    5430//! A Class, that reads in Textures from different fileformats.
    5531class Texture
     
    7046  GLuint texture;   //!< The Texture-ID of opengl from this Texture.
    7147  SDL_Surface* map; //!< The map SDL initializes for this element.
    72   char* searchTextureInPaths(char* texName) const;
     48  char* searchTextureInPaths(const char* texName) const;
    7349  inline void swap(unsigned char &a, unsigned char &b);
    7450 public:
    7551  Texture(void);
     52  Texture(const char* imageName);
    7653  ~Texture(void);
    7754  /** \returns The textureID of this texture.  */
     
    7956  bool loadTexToGL (Image* pImage);
    8057
    81   bool loadImage(char* imageName);
     58  bool loadImage(const char* imageName);
    8259#ifndef HAVE_SDL_SDL_IMAGE_H
    8360
Note: See TracChangeset for help on using the changeset viewer.