Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4739 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Jun 30, 2005, 4:05:23 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: factory is now registered in Factory, not in Gameloader

Location:
orxonox/trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4733 r4739  
    9191    VideoFlags |= SDL_HWACCEL;
    9292  */
    93 
    94   // setting up the Resolution
    95   this->setResolution(1400, 1050, 16);
    96 
     93    // setting up the Resolution
     94  this->setResolution(800, 450, 16);
    9795
    9896  // TO DO: Create a cool icon and use it here
     
    152150  this->resolutionY = height;
    153151  this->bitsPerPixel = bpp;
     152
    154153  if (this->fullscreen)
    155154    fullscreenFlag = SDL_FULLSCREEN;
  • orxonox/trunk/src/lib/graphics/light.cc

    r4738 r4739  
    238238{
    239239  glDisable(GL_LIGHTING);
     240  this->setAmbientColor(.0,.0,.0);
    240241
    241242  for (int i = 0; i < NUMBEROFLIGHTS; i++)
  • orxonox/trunk/src/subprojects/importer/Makefile.am

    r4653 r4739  
    2727                  $(MAINSRCDIR)/lib/coord/null_parent.cc \
    2828                  $(MAINSRCDIR)/util/loading/load_param.cc \
    29                   $(MAINSRCDIR)/lib/util/substring.cc
     29                  $(MAINSRCDIR)/lib/util/substring.cc \
     30                  $(MAINSRCDIR)/util/loading/factory.cc
  • orxonox/trunk/src/subprojects/importer/Makefile.in

    r4653 r4739  
    5959        importer-ini_parser.$(OBJEXT) importer-text_engine.$(OBJEXT) \
    6060        importer-p_node.$(OBJEXT) importer-null_parent.$(OBJEXT) \
    61         importer-load_param.$(OBJEXT) importer-substring.$(OBJEXT)
     61        importer-load_param.$(OBJEXT) importer-substring.$(OBJEXT) \
     62        importer-factory.$(OBJEXT)
    6263importer_OBJECTS = $(am_importer_OBJECTS)
    6364importer_DEPENDENCIES = $(MAINSRCDIR)/lib/event/libORXevent.a \
     
    7071@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/importer-base_object.Po \
    7172@AMDEP_TRUE@    ./$(DEPDIR)/importer-camera.Po \
     73@AMDEP_TRUE@    ./$(DEPDIR)/importer-factory.Po \
    7274@AMDEP_TRUE@    ./$(DEPDIR)/importer-framework.Po \
    7375@AMDEP_TRUE@    ./$(DEPDIR)/importer-graphics_engine.Po \
     
    223225                  $(MAINSRCDIR)/lib/coord/null_parent.cc \
    224226                  $(MAINSRCDIR)/util/loading/load_param.cc \
    225                   $(MAINSRCDIR)/lib/util/substring.cc
     227                  $(MAINSRCDIR)/lib/util/substring.cc \
     228                  $(MAINSRCDIR)/util/loading/factory.cc
    226229
    227230all: all-am
     
    293296@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-base_object.Po@am__quote@
    294297@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-camera.Po@am__quote@
     298@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-factory.Po@am__quote@
    295299@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-framework.Po@am__quote@
    296300@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-graphics_engine.Po@am__quote@
     
    562566@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    563567@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer-substring.obj `if test -f '$(MAINSRCDIR)/lib/util/substring.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/substring.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/substring.cc'; fi`
     568
     569importer-factory.o: $(MAINSRCDIR)/util/loading/factory.cc
     570@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT importer-factory.o -MD -MP -MF "$(DEPDIR)/importer-factory.Tpo" -c -o importer-factory.o `test -f '$(MAINSRCDIR)/util/loading/factory.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/loading/factory.cc; \
     571@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/importer-factory.Tpo" "$(DEPDIR)/importer-factory.Po"; else rm -f "$(DEPDIR)/importer-factory.Tpo"; exit 1; fi
     572@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/util/loading/factory.cc' object='importer-factory.o' libtool=no @AMDEPBACKSLASH@
     573@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/importer-factory.Po' tmpdepfile='$(DEPDIR)/importer-factory.TPo' @AMDEPBACKSLASH@
     574@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     575@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer-factory.o `test -f '$(MAINSRCDIR)/util/loading/factory.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/loading/factory.cc
     576
     577importer-factory.obj: $(MAINSRCDIR)/util/loading/factory.cc
     578@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT importer-factory.obj -MD -MP -MF "$(DEPDIR)/importer-factory.Tpo" -c -o importer-factory.obj `if test -f '$(MAINSRCDIR)/util/loading/factory.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/loading/factory.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/loading/factory.cc'; fi`; \
     579@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/importer-factory.Tpo" "$(DEPDIR)/importer-factory.Po"; else rm -f "$(DEPDIR)/importer-factory.Tpo"; exit 1; fi
     580@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/util/loading/factory.cc' object='importer-factory.obj' libtool=no @AMDEPBACKSLASH@
     581@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/importer-factory.Po' tmpdepfile='$(DEPDIR)/importer-factory.TPo' @AMDEPBACKSLASH@
     582@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     583@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer-factory.obj `if test -f '$(MAINSRCDIR)/util/loading/factory.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/loading/factory.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/loading/factory.cc'; fi`
    564584uninstall-info-am:
    565585
  • orxonox/trunk/src/subprojects/importer/importer.cc

    r4653 r4739  
    5050  LightManager* lightMan = LightManager::getInstance();
    5151  lightMan->setAmbientColor(.1,.1,.1);
    52   lightMan->addLight();
    53   //  lightMan->setAttenuation(1.0, .01, 0.0);
    54   //  lightMan->setDiffuseColor(1,1,1);
    55   //  lightMan->addLight(1);
    56   //  lightMan->setPosition(20, 10, -20);
    57   //  lightMan->setDiffuseColor(0,0,0);
    58   //  lightMan->debug();
    59   lightMan->setPosition(5.0, 10.0, 40.0);
    60   lightMan->addLight();
    61   lightMan->setPosition(-10, -20, -100);
     52  new Light();
     53
     54  lightMan->getLight()->setAbsCoor(5.0, 10.0, 40.0);
     55  new Light();
     56  lightMan->getLight()->setAbsCoor(-10, -20, -100);
    6257}
    6358
  • orxonox/trunk/src/util/loading/factory.cc

    r4730 r4739  
    3535  this->setName(factoryName);
    3636
    37   if (Factory::first == NULL)
    38     Factory::first = this;
    39   next = NULL;
     37  this->next = NULL;
    4038
    41   initialize();
     39  Factory::registerFactory(this);
    4240}
    4341
     42/** a reference to the First Factory */
    4443Factory* Factory::first = NULL;
    4544
     
    5958
    6059/**
    61    \brief make this particular factory known to the LevelFactory
    62 */
    63 void Factory::initialize()
    64 {
    65   GameLoader::getInstance()->registerFactory( this);
    66 }
    67 
    68 /**
    69    \brief add a Factory to the Q
     60   \brief add a Factory to the Factory Queue
     61   \param factory a Factory to be registered
    7062*/
    7163void Factory::registerFactory( Factory* factory)
    7264{
    73   if( next == NULL) setNext( factory);
    74   else next->registerFactory( factory);
     65  assert( factory != NULL);
     66
     67  PRINTF(4)("Registered factory for '%s'\n", factory->getName());
     68
     69  if( Factory::first == NULL)
     70    Factory::first = factory;
     71  else
     72  {
     73    Factory* tmpFac = Factory::first;
     74    while( tmpFac->next != NULL)
     75    {
     76      tmpFac = tmpFac->next;
     77    }
     78    tmpFac->setNext(factory);
     79  }
    7580}
    76 
  • orxonox/trunk/src/util/loading/factory.h

    r4730 r4739  
    4646
    4747  virtual BaseObject* fabricate(const TiXmlElement* root) = NULL;
    48   void initialize();
    49   void registerFactory( Factory* factory);
     48
     49  static void registerFactory( Factory* factory);
    5050  /** \brief sets the Next factory in the list \param nextFactory the next factory */
    5151  inline void setNext( Factory* nextFactory) { this->next = nextFactory; };
    5252  /** \returns the first factory */
    53   static Factory* getFirst(void) { return Factory::first; };
     53  static Factory* getFirst() { return Factory::first; };
    5454  /** \returns the next factory */
    5555  Factory* getNext(void) const { return this->next; };
    5656
    5757
    58  private:
    59   Factory*          next;                 //!< pointer to the next factory.
    60   static Factory*   first;                //!< A pointer to the first factory.
     58  private:
     59
     60  private:
     61    Factory*          next;                 //!< pointer to the next factory.
     62    static Factory*   first;                //!< A pointer to the first factory.
    6163};
    6264
  • orxonox/trunk/src/util/loading/game_loader.cc

    r4729 r4739  
    4343  this->setClassID(CL_GAME_LOADER, "GameLoader");
    4444  this->setName("GameLoader");
    45   first = NULL;
    4645}
    4746
     
    317316}
    318317
    319 
    320 /**
    321    \brief add a Factory to the Factory Q
    322    \param factory a Factory to be registered
    323 */
    324 void GameLoader::registerFactory( Factory* factory)
    325 {
    326         assert( factory != NULL);
    327 
    328         PRINTF(4)("Registered factory for '%s'\n", factory->getName());
    329 
    330         if( first == NULL) first = factory;
    331         else first->registerFactory( factory);
    332 }
    333 
    334 
    335318/**
    336319   \brief load a StoryEntity
     
    341324  assert( element != NULL);
    342325
    343   if( first == NULL)
     326  if( Factory::getFirst() == NULL)
    344327    {
    345328      PRINTF(1)("GameLoader does not know any factories, fabricate() failed\n");
     
    350333    {
    351334      PRINTF(4)("Attempting fabrication of a '%s'\n", element->Value());
    352       BaseObject* b = first->fabricate( element);
     335      BaseObject* b = Factory::getFirst()->fabricate( element);
    353336      if( b == NULL)
    354337        PRINTF(2)("Failed to fabricate a '%s'\n", element->Value());
  • orxonox/trunk/src/util/loading/game_loader.h

    r4598 r4739  
    8080
    8181  EventHandler*          eventHandler;         //!< reference to the eventHandler
    82 
    83   Factory*               first;                //!< the first factory of them all
    8482};
    8583
Note: See TracChangeset for help on using the changeset viewer.