Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4488 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 3, 2005, 1:00:10 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: started cleaning up the list classes

Location:
orxonox/trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/Makefile.am

    r4484 r4488  
    3333                 util/object_manager.cc \
    3434                 util/garbage_collector.cc \
    35                  util/common/list.cc \
    3635                 util/resource_manager.cc \
    3736                 util/loading/factory.cc \
     
    137136                 lib/lang/base_object.h \
    138137                 util/common/list.h \
    139                  util/common/list_template.h \
    140138                 util/resource_manager.h \
    141139                 util/loading/factory.h \
  • orxonox/trunk/src/Makefile.in

    r4484 r4488  
    5757        pilot_node.$(OBJEXT) animation.$(OBJEXT) animation3d.$(OBJEXT) \
    5858        animation_player.$(OBJEXT) object_manager.$(OBJEXT) \
    59         garbage_collector.$(OBJEXT) list.$(OBJEXT) \
    60         resource_manager.$(OBJEXT) factory.$(OBJEXT) \
    61         load_param.$(OBJEXT) state.$(OBJEXT) story_entity.$(OBJEXT) \
    62         campaign.$(OBJEXT) world.$(OBJEXT) world_entity.$(OBJEXT) \
    63         camera.$(OBJEXT) player.$(OBJEXT) environment.$(OBJEXT) \
    64         skysphere.$(OBJEXT) skybox.$(OBJEXT) terrain.$(OBJEXT) \
    65         weapon.$(OBJEXT) projectile.$(OBJEXT) satellite.$(OBJEXT) \
    66         character_attributes.$(OBJEXT) test_gun.$(OBJEXT) \
    67         test_bullet.$(OBJEXT) test_entity.$(OBJEXT) p_node.$(OBJEXT) \
    68         null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \
     59        garbage_collector.$(OBJEXT) resource_manager.$(OBJEXT) \
     60        factory.$(OBJEXT) load_param.$(OBJEXT) state.$(OBJEXT) \
     61        story_entity.$(OBJEXT) campaign.$(OBJEXT) world.$(OBJEXT) \
     62        world_entity.$(OBJEXT) camera.$(OBJEXT) player.$(OBJEXT) \
     63        environment.$(OBJEXT) skysphere.$(OBJEXT) skybox.$(OBJEXT) \
     64        terrain.$(OBJEXT) weapon.$(OBJEXT) projectile.$(OBJEXT) \
     65        satellite.$(OBJEXT) character_attributes.$(OBJEXT) \
     66        test_gun.$(OBJEXT) test_bullet.$(OBJEXT) test_entity.$(OBJEXT) \
     67        p_node.$(OBJEXT) null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \
    6968        graphics_engine.$(OBJEXT) light.$(OBJEXT) \
    7069        text_engine.$(OBJEXT) array.$(OBJEXT) objModel.$(OBJEXT) \
     
    9392@AMDEP_TRUE@    ./$(DEPDIR)/helper_parent.Po \
    9493@AMDEP_TRUE@    ./$(DEPDIR)/ini_parser.Po ./$(DEPDIR)/light.Po \
    95 @AMDEP_TRUE@    ./$(DEPDIR)/list.Po ./$(DEPDIR)/load_param.Po \
    96 @AMDEP_TRUE@    ./$(DEPDIR)/material.Po ./$(DEPDIR)/md2Model.Po \
    97 @AMDEP_TRUE@    ./$(DEPDIR)/model.Po ./$(DEPDIR)/null_parent.Po \
    98 @AMDEP_TRUE@    ./$(DEPDIR)/objModel.Po \
     94@AMDEP_TRUE@    ./$(DEPDIR)/load_param.Po ./$(DEPDIR)/material.Po \
     95@AMDEP_TRUE@    ./$(DEPDIR)/md2Model.Po ./$(DEPDIR)/model.Po \
     96@AMDEP_TRUE@    ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
    9997@AMDEP_TRUE@    ./$(DEPDIR)/object_manager.Po \
    10098@AMDEP_TRUE@    ./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \
     
    264262                 util/object_manager.cc \
    265263                 util/garbage_collector.cc \
    266                  util/common/list.cc \
    267264                 util/resource_manager.cc \
    268265                 util/loading/factory.cc \
     
    368365                 lib/lang/base_object.h \
    369366                 util/common/list.h \
    370                  util/common/list_template.h \
    371367                 util/resource_manager.h \
    372368                 util/loading/factory.h \
     
    478474@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ini_parser.Po@am__quote@
    479475@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/light.Po@am__quote@
    480 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
    481476@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_param.Po@am__quote@
    482477@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
     
    671666@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    672667@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o garbage_collector.obj `if test -f 'util/garbage_collector.cc'; then $(CYGPATH_W) 'util/garbage_collector.cc'; else $(CYGPATH_W) '$(srcdir)/util/garbage_collector.cc'; fi`
    673 
    674 list.o: util/common/list.cc
    675 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT list.o -MD -MP -MF "$(DEPDIR)/list.Tpo" -c -o list.o `test -f 'util/common/list.cc' || echo '$(srcdir)/'`util/common/list.cc; \
    676 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/list.Tpo" "$(DEPDIR)/list.Po"; else rm -f "$(DEPDIR)/list.Tpo"; exit 1; fi
    677 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/common/list.cc' object='list.o' libtool=no @AMDEPBACKSLASH@
    678 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/list.Po' tmpdepfile='$(DEPDIR)/list.TPo' @AMDEPBACKSLASH@
    679 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    680 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o list.o `test -f 'util/common/list.cc' || echo '$(srcdir)/'`util/common/list.cc
    681 
    682 list.obj: util/common/list.cc
    683 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT list.obj -MD -MP -MF "$(DEPDIR)/list.Tpo" -c -o list.obj `if test -f 'util/common/list.cc'; then $(CYGPATH_W) 'util/common/list.cc'; else $(CYGPATH_W) '$(srcdir)/util/common/list.cc'; fi`; \
    684 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/list.Tpo" "$(DEPDIR)/list.Po"; else rm -f "$(DEPDIR)/list.Tpo"; exit 1; fi
    685 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/common/list.cc' object='list.obj' libtool=no @AMDEPBACKSLASH@
    686 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/list.Po' tmpdepfile='$(DEPDIR)/list.TPo' @AMDEPBACKSLASH@
    687 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    688 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o list.obj `if test -f 'util/common/list.cc'; then $(CYGPATH_W) 'util/common/list.cc'; else $(CYGPATH_W) '$(srcdir)/util/common/list.cc'; fi`
    689668
    690669resource_manager.o: util/resource_manager.cc
  • orxonox/trunk/src/lib/graphics/importer/md2Model.cc

    r4462 r4488  
    266266  PRINT(0)("=  Number of Frames: \t%i\n", this->data->header->numFrames);
    267267  PRINT(0)("=  Height, Width:\t%i, %i\n", this->data->header->skinHeight, this->data->header->skinWidth);
     268  PRINT(0)("=  Pointer to the data object: %p\n", this->data);
    268269  PRINT(0)("===================================================\n\n");
    269270}
  • orxonox/trunk/src/lib/graphics/importer/md2Model.h

    r4461 r4488  
    6767
    6868//! animation names enumeration
    69 typedef enum
     69typedef enum animType
    7070  {
    7171    STAND,
     
    9292 
    9393    MAX_ANIMATIONS
    94   } animType;
     94  };
    9595
    9696
  • orxonox/trunk/src/story_entities/world.cc

    r4444 r4488  
    5050#include "fields.h"
    5151
     52#include "md2Model.h"
     53
    5254#include "glmenu_imagescreen.h"
    5355#include "list.h"
     
    501503  TestEntity* testEntity = new TestEntity();
    502504  testEntity->setRelCoor(Vector(570, 10, -15));
    503   //testEntity->setRelCoor(Vector(25, -10, -20));
    504505  testEntity->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
    505506  this->spawn(testEntity);
    506   //  this->localPlayer->addChild(testEntity);
     507
     508  TestEntity* testEntity2 = new TestEntity();
     509  testEntity2->setAnim(RUN);
     510  testEntity2->setRelCoor(Vector(570, 30, 15));
     511  testEntity2->setRelDir(Quaternion(M_PI, Vector(0, 1, 0)));
     512  this->spawn(testEntity2);
     513
    507514
    508515  new PhysicsConnection(testEntity, gravity);
  • orxonox/trunk/src/util/common/list.h

    r4486 r4488  
    1212#endif
    1313
    14 //! An enum to list all the modes available when adding an object to a List
    15 //enum ADDMODE {LIST_ADD_FIRST, LIST_ADD_LAST};
    16 //! An enum to list the two searching directions available when removing an object from a List
    17 //enum FINDMODE {LIST_FIND_BW, LIST_FIND_FW};
    18 
    19 
    20 
    21 class WorldEntity;
    22 
    23 class List {
    24 
    25  public:
    26   List ();
    27   ~List ();
    28 
    29   void add(WorldEntity* entity);
    30   void remove(WorldEntity* entity);
    31   void destroy();
    32   WorldEntity* firstElement();
    33   bool isEmpty();
    34   int getSize();
    35   WorldEntity* enumerate();
    36   WorldEntity* nextElement();
    37   WorldEntity* toArray();
    38   void debug();
    39 
    40  private:
    41   struct listElement
    42   {
    43     listElement* prev;
    44     WorldEntity* curr;
    45     listElement* next;
    46   };
    47   unsigned int size;
    48   listElement* first;
    49   listElement* last;
    50   listElement* currentEl;
    51 
    52 
     14
     15
     16//! a list element of the tList,
     17template<class T> struct listElement
     18{
     19  listElement*        prev;                          //!< pointer to the previous listElement in the list
     20  T*                  curr;                          //!< pointer to the list payload/container
     21  listElement*        next;                          //!< pointer to the next listElement
    5322};
    5423
    55 
    56 
    57 template<class T> struct listElement
    58 {
    59   listElement* prev;
    60   T* curr;
    61   listElement* next;
    62 };
    63 
     24/**
     25   \brief an iterator class
     26
     27   this enables the user to iterate through a list very easely
     28*/
    6429template<class T> class tIterator
    6530{
     
    7136
    7237 private:
    73   listElement<T>* currentEl;
    74   listElement<T>* tmpEl;
     38  listElement<T>*    currentEl;                      //!< pointer to the current list element in the iterator
     39  listElement<T>*    tmpEl;                          //!< temp listElemnt pointer
    7540};
    7641
    7742
     43/**
     44   \brief iterator constructor
     45   \param startElement:  the first list element from the tList
     46
     47   normaly you will use it like this:
     48
     49   tIterator<char>* nameIterator = nameList->getIterator();
     50   char name* = nameIterator->nextElement();
     51   while( name != NULL)
     52   {
     53     PRINTF(3)("found name: %s in list\n", name);
     54     name = nameIterator->nextElement();
     55   }
     56   delete nameIterator;       
     57*/
    7858template<class T>
    7959inline tIterator<T>::tIterator (listElement<T>* startElement)
     
    8464
    8565
     66/**
     67   \brief the destructor
     68*/
    8669template<class T>
    8770inline tIterator<T>::~tIterator ()
     
    9174
    9275
     76/**
     77   \brief use it to iterate through the list
     78   \returns next list element
     79*/
    9380template<class T>
    9481inline T* tIterator<T>::nextElement ()
  • orxonox/trunk/src/world_entities/test_entity.cc

    r4462 r4488  
    4141
    4242
     43void  TestEntity::setAnim(int animationIndex)
     44{
     45  this->md2Model->setAnim(animationIndex);
     46}
     47
     48
    4349void TestEntity::tick (float time)
    4450{
  • orxonox/trunk/src/world_entities/test_entity.h

    r4397 r4488  
    1919  virtual ~TestEntity ();
    2020
    21  
     21  void setAnim(int animationIndex);
     22
    2223  virtual void tick (float time);
    2324  virtual void hit (WorldEntity* weapon, Vector* loc);
Note: See TracChangeset for help on using the changeset viewer.