Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4838 in orxonox.OLD


Ignore:
Timestamp:
Jul 12, 2005, 12:09:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Element2D added → will be moved to lib/graphics afterwards
ProtoClass update
EventListeners do not have to be unsubscribed externally, but still one listener won't unsubscribe

Location:
orxonox/trunk/src
Files:
1 added
15 edited
4 copied

Legend:

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

    r4826 r4838  
    6868                  lib/graphics/light.cc \
    6969                  lib/graphics/text_engine.cc \
     70                  lib/graphics/render2D/element_2D.cc \
    7071                  lib/lang/base_object.cc \
    7172                  lib/lang/class_list.cc \
  • orxonox/trunk/src/Makefile.in

    r4826 r4838  
    7575        orxonox-null_parent.$(OBJEXT) \
    7676        orxonox-graphics_engine.$(OBJEXT) orxonox-light.$(OBJEXT) \
    77         orxonox-text_engine.$(OBJEXT) orxonox-base_object.$(OBJEXT) \
    78         orxonox-class_list.$(OBJEXT) orxonox-ini_parser.$(OBJEXT) \
    79         orxonox-substring.$(OBJEXT) orxonox-vector.$(OBJEXT) \
    80         orxonox-curve.$(OBJEXT) orxonox-glmenu_imagescreen.$(OBJEXT) \
     77        orxonox-text_engine.$(OBJEXT) orxonox-element_2D.$(OBJEXT) \
     78        orxonox-base_object.$(OBJEXT) orxonox-class_list.$(OBJEXT) \
     79        orxonox-ini_parser.$(OBJEXT) orxonox-substring.$(OBJEXT) \
     80        orxonox-vector.$(OBJEXT) orxonox-curve.$(OBJEXT) \
     81        orxonox-glmenu_imagescreen.$(OBJEXT) \
    8182        orxonox-benchmark.$(OBJEXT)
    8283orxonox_OBJECTS = $(am_orxonox_OBJECTS)
     
    9697@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-crosshair.Po \
    9798@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-curve.Po \
     99@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-element_2D.Po \
    98100@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-environment.Po \
    99101@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-factory.Po \
     
    316318                  lib/graphics/light.cc \
    317319                  lib/graphics/text_engine.cc \
     320                  lib/graphics/render2D/element_2D.cc \
    318321                  lib/lang/base_object.cc \
    319322                  lib/lang/class_list.cc \
     
    479482@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-crosshair.Po@am__quote@
    480483@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-curve.Po@am__quote@
     484@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-element_2D.Po@am__quote@
    481485@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-environment.Po@am__quote@
    482486@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-factory.Po@am__quote@
     
    11381142@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    11391143@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-text_engine.obj `if test -f 'lib/graphics/text_engine.cc'; then $(CYGPATH_W) 'lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/text_engine.cc'; fi`
     1144
     1145orxonox-element_2D.o: lib/graphics/render2D/element_2D.cc
     1146@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-element_2D.o -MD -MP -MF "$(DEPDIR)/orxonox-element_2D.Tpo" -c -o orxonox-element_2D.o `test -f 'lib/graphics/render2D/element_2D.cc' || echo '$(srcdir)/'`lib/graphics/render2D/element_2D.cc; \
     1147@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-element_2D.Tpo" "$(DEPDIR)/orxonox-element_2D.Po"; else rm -f "$(DEPDIR)/orxonox-element_2D.Tpo"; exit 1; fi
     1148@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/render2D/element_2D.cc' object='orxonox-element_2D.o' libtool=no @AMDEPBACKSLASH@
     1149@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-element_2D.Po' tmpdepfile='$(DEPDIR)/orxonox-element_2D.TPo' @AMDEPBACKSLASH@
     1150@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1151@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-element_2D.o `test -f 'lib/graphics/render2D/element_2D.cc' || echo '$(srcdir)/'`lib/graphics/render2D/element_2D.cc
     1152
     1153orxonox-element_2D.obj: lib/graphics/render2D/element_2D.cc
     1154@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-element_2D.obj -MD -MP -MF "$(DEPDIR)/orxonox-element_2D.Tpo" -c -o orxonox-element_2D.obj `if test -f 'lib/graphics/render2D/element_2D.cc'; then $(CYGPATH_W) 'lib/graphics/render2D/element_2D.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/render2D/element_2D.cc'; fi`; \
     1155@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-element_2D.Tpo" "$(DEPDIR)/orxonox-element_2D.Po"; else rm -f "$(DEPDIR)/orxonox-element_2D.Tpo"; exit 1; fi
     1156@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/render2D/element_2D.cc' object='orxonox-element_2D.obj' libtool=no @AMDEPBACKSLASH@
     1157@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-element_2D.Po' tmpdepfile='$(DEPDIR)/orxonox-element_2D.TPo' @AMDEPBACKSLASH@
     1158@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1159@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-element_2D.obj `if test -f 'lib/graphics/render2D/element_2D.cc'; then $(CYGPATH_W) 'lib/graphics/render2D/element_2D.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/render2D/element_2D.cc'; fi`
    11401160
    11411161orxonox-base_object.o: lib/lang/base_object.cc
  • orxonox/trunk/src/defs/class_id.h

    r4837 r4838  
    6868  CL_EVENT_LISTENER             =    0x20000000,
    6969
     70  CL_ELEMENT_2D                 =    0x40000000,
     71
    7072  // subsuper-classes
    7173  CL_MASK_SUBSUPER_CLASS        =    0x00fff000,
     
    7880  CL_PROJECTILE                 =    0x00110000,
    7981  CL_WEAPON                     =    0x00120000,
     82
     83  // subsuper-classes derivations taken : 1, a.     << THIS IS A LIST OF ALL THE DCL_MASK_SUBSUPERCLASS_ID's taken
    8084
    8185  // lowest level classes
     
    145149  CL_BV_TREE_NODE               =    0x00a02613,
    146150  CL_OBB_TREE                   =    0x00a04614,
    147   //! @todo !!!!THIS IS A HACK!!!!! DELETE THESE extensions.
    148151  CL_OBB_TREE_NODE              =    0x00a08615,
    149152  CL_BOUNDING_VOLUME            =    0x00a10616,
  • orxonox/trunk/src/lib/event/event_handler.cc

    r4836 r4838  
    7272      if( this->listeners[i][j] != NULL)
    7373      {
    74         PRINTF(2)("Someone forgot to unsubscribe an EventListener!\n");
     74        PRINTF(2)("forgot to unsubscribe an EventListener %s!\n");//, this->listeners[i][j]->getName());
    7575      }
    7676    }
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4836 r4838  
    5858{
    5959  // delete what has to be deleted here
    60   EventHandler::getInstance()->unsubscribe(this);
    6160}
    6261
  • orxonox/trunk/src/lib/graphics/render2D/element_2D.cc

    r4837 r4838  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Benjamin Grauer
    1313   co-programmer: ...
    1414*/
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "element_2D.h"
    1919
    2020using namespace std;
     
    2222
    2323/**
    24    \brief standard constructor
    25    \todo this constructor is not jet implemented - do it
     24 * standard constructor
     25 * @todo this constructor is not jet implemented - do it
    2626*/
    27 ProtoClass::ProtoClass ()
     27Element2D::Element2D ()
    2828{
    29    this->setClassID(CL_PROTO_ID, "ProtoClass");
     29   this->setClassID(CL_ELEMENT_2D, "Element2D");
    3030
    3131   /* If you make a new class, what is most probably the case when you write this file
     
    4343
    4444/**
    45    \brief standard deconstructor
    46 
     45 * standard deconstructor
    4746*/
    48 ProtoClass::~ProtoClass ()
     47Element2D::~Element2D ()
    4948{
    5049  // delete what has to be deleted here
  • orxonox/trunk/src/lib/graphics/render2D/element_2D.h

    r4837 r4838  
    1 /*!
    2     \file proto_class.h
    3     \brief Definition of ...
    4 
     1/*!
     2 * @file element_2D.h
     3 * @brief Definition of the 2D elements rendered on top through the GraphicsEngine
    54*/
    65
    7 #ifndef _PROTO_CLASS_H
    8 #define _PROTO_CLASS_H
     6#ifndef _ELEMENT_2D_H
     7#define _ELEMENT_2D_H
    98
    109#include "base_object.h"
    1110
    12 // FORWARD DEFINITION
    13 
    14 
     11// FORWARD DECLARATION
    1512
    1613//! A class for ...
    17 class ProtoClass : public BaseObject {
     14class Element2D : public BaseObject {
    1815
    1916 public:
    20   ProtoClass();
    21   virtual ~ProtoClass();
     17  Element2D();
     18  virtual ~Element2D();
    2219
    2320
     
    2623};
    2724
    28 #endif /* _PROTO_CLASS_H */
     25#endif /* _ELEMENT_2D_H */
  • orxonox/trunk/src/lib/graphics/render2D/render_2d.cc

    r4837 r4838  
    2222
    2323/**
    24    \brief standard constructor
    25 */
     24 * standard constructor
     25 */
    2626ProtoSingleton::ProtoSingleton ()
    2727{
     
    4242
    4343/**
    44    \brief the singleton reference to this class
    45 */
     44 * the singleton reference to this class
     45 */
    4646ProtoSingleton* ProtoSingleton::singletonRef = NULL;
    4747
    4848/**
    49    \brief standard deconstructor
    50 
    51 */
     49   @brief standard deconstructor
     50 */
    5251ProtoSingleton::~ProtoSingleton ()
    5352{
    5453  ProtoSingleton::singletonRef = NULL;
    55 
    5654}
  • orxonox/trunk/src/lib/graphics/render2D/render_2d.h

    r4837 r4838  
    1 /*!
    2     \file proto_singleton.h
    3     \brief Definition of the ... singleton Class
    4    
     1/*!
     2 * @file proto_singleton.h
     3 * @brief Definition of the ... singleton Class
    54*/
    65
     
    1716 public:
    1817  virtual ~ProtoSingleton(void);
    19   /** \returns a Pointer to the only object of this Class */
     18  /** @returns a Pointer to the only object of this Class */
    2019  inline static ProtoSingleton* getInstance(void) { if (!singletonRef) singletonRef = new ProtoSingleton();  return singletonRef; };
    2120
  • orxonox/trunk/src/proto/proto_class.cc

    r4744 r4838  
    2222
    2323/**
    24    \brief standard constructor
    25    \todo this constructor is not jet implemented - do it
     24 * standard constructor
     25 * @todo this constructor is not jet implemented - do it
    2626*/
    2727ProtoClass::ProtoClass ()
     
    4343
    4444/**
    45    \brief standard deconstructor
    46 
     45 * standard deconstructor
    4746*/
    4847ProtoClass::~ProtoClass ()
  • orxonox/trunk/src/proto/proto_class.h

    r3955 r4838  
    1 /*!
    2     \file proto_class.h
    3     \brief Definition of ...
    4 
     1/*!
     2 * @file proto_class.h
     3 * @brief Definition of ...
    54*/
    65
     
    109#include "base_object.h"
    1110
    12 // FORWARD DEFINITION
     11// FORWARD DECLARATION
    1312
    1413
  • orxonox/trunk/src/proto/proto_singleton.cc

    r4744 r4838  
    2222
    2323/**
    24    \brief standard constructor
    25 */
     24 * standard constructor
     25 */
    2626ProtoSingleton::ProtoSingleton ()
    2727{
     
    4242
    4343/**
    44    \brief the singleton reference to this class
    45 */
     44 * the singleton reference to this class
     45 */
    4646ProtoSingleton* ProtoSingleton::singletonRef = NULL;
    4747
    4848/**
    49    \brief standard deconstructor
    50 
    51 */
     49   @brief standard deconstructor
     50 */
    5251ProtoSingleton::~ProtoSingleton ()
    5352{
    5453  ProtoSingleton::singletonRef = NULL;
    55 
    5654}
  • orxonox/trunk/src/proto/proto_singleton.h

    r4519 r4838  
    1 /*!
    2     \file proto_singleton.h
    3     \brief Definition of the ... singleton Class
    4    
     1/*!
     2 * @file proto_singleton.h
     3 * @brief Definition of the ... singleton Class
    54*/
    65
     
    1716 public:
    1817  virtual ~ProtoSingleton(void);
    19   /** \returns a Pointer to the only object of this Class */
     18  /** @returns a Pointer to the only object of this Class */
    2019  inline static ProtoSingleton* getInstance(void) { if (!singletonRef) singletonRef = new ProtoSingleton();  return singletonRef; };
    2120
  • orxonox/trunk/src/proto/proto_world_entity.cc

    r4483 r4838  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    2222using namespace std;
    2323
    24 /**
    25    \brief standard constructor
    26 
    27 */
    28 ProtoWorldEntity::ProtoWorldEntity ()
    29 {
    30   this->init();
    31 }
    3224
    3325/**
    34    \brief constructs and loads a ProtoWorldEntity from a XML-element
    35    \param root the XML-element to load from
    36 */
     26 * constructs and loads a ProtoWorldEntity from a XML-element
     27 * @param root the XML-element to load from
     28 */
    3729ProtoWorldEntity::ProtoWorldEntity(const TiXmlElement* root)
    3830{
    3931  this->init();
    40   this->loadParams(root);
     32  if (root != NULL)
     33    this->loadParams(root);
    4134}
    4235
    4336
    4437/**
    45    \brief standard deconstructor
    46 */
    47 ProtoWorldEntity::~ProtoWorldEntity () 
     38 * standard deconstructor
     39 */
     40ProtoWorldEntity::~ProtoWorldEntity ()
    4841{
    4942
     
    5144
    5245/**
    53    \brief initializes the ProtoWorldEntity
    54 */
     46 * initializes the ProtoWorldEntity
     47 * @todo change this to what you wish
     48 */
    5549void ProtoWorldEntity::init(void)
    5650{
     51  this->setClassID(CL_PROTO_WORLD_ENTITY, )
    5752  ...
    5853}
    5954
    6055/**
    61    \brief loads a ProtoWorldEntity from a XML-element
    62    \param root the XML-element to load from
    63 */
     56 * loads a ProtoWorldEntity from a XML-element
     57 * @param root the XML-element to load from
     58 * @todo make the class Loadable
     59 */
    6460void ProtoWorldEntity::loadParams(const TiXmlElement* root)
    6561{
     62  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
    6663  static_cast<WorldEntity*>(this)->loadParam(root);
    6764
     
    7168
    7269/**
    73    \brief advances the ProtoWorldEntity about time seconds
    74    \param time the Time to step
    75 */
     70 * advances the ProtoWorldEntity about time seconds
     71 * @param time the Time to step
     72 */
    7673ProtoWorldEntity::tick(float time)
    7774{
     
    8077
    8178/**
    82    \brief draws this worldEntity
    83 */
     79 * draws this worldEntity
     80 */
    8481void ProtoWorldEntity::draw ()
    85 { 
     82{
    8683  glMatrixMode(GL_MODELVIEW);
    8784  glPushMatrix();
    8885  float matrix[4][4];
    89  
     86
    9087  /* translate */
    91   glTranslatef (this->getAbsCoor ().x, 
    92                 this->getAbsCoor ().y,
    93                 this->getAbsCoor ().z);
     88  glTranslatef (this->getAbsCoor ().x,
     89                this->getAbsCoor ().y,
     90                this->getAbsCoor ().z);
    9491  /* rotate */
    9592  this->getAbsDir().matrix(matrix);
  • orxonox/trunk/src/proto/proto_world_entity.h

    r4483 r4838  
    1 /*!
    2     \file proto_world_entity.h
    3 
    4     description
     1/*!
     2 * @file proto_world_entity.h
     3 * @brief description
    54*/
    65
     
    1110
    1211//! A Class to ...
    13 class ProtoWorldEntity : public WorldEntity 
     12class ProtoWorldEntity : public WorldEntity
    1413{
    1514
    1615 public:
    17   ProtoWorldEntity();
    18   ProtoWorldEntity(const TiXmlElement* root);
     16  ProtoWorldEntity(const TiXmlElement* root = NULL);
    1917  virtual ~ProtoWorldEntity();
    20  
     18
    2119  void loadParams(const TiXmlElement* root);
    2220  void init();
    23  
     21
    2422  virtual void draw();
    2523  virtual void tick(float time);
  • orxonox/trunk/src/story_entities/world.cc

    r4837 r4838  
    169169
    170170/**
    171   *  remove the World from memory
     171 *  remove the World from memory
    172172
    173173    delete everything explicitly, that isn't contained in the parenting tree!
    174174    things contained in the tree are deleted automaticaly
    175 */
     175 */
    176176World::~World ()
    177177{
     
    179179
    180180  ParticleEngine::getInstance()->debug();
    181 
    182   EventHandler::getInstance()->unsubscribe(this->localPlayer);
    183181
    184182  delete WorldInterface::getInstance();
  • orxonox/trunk/src/util/loading/game_loader.cc

    r4836 r4838  
    5454    delete this->currentCampaign;
    5555  this->currentCampaign = NULL;
    56   this->eventHandler->unsubscribe(this, ES_ALL);
    5756}
    5857
  • orxonox/trunk/src/world_entities/camera.cc

    r4836 r4838  
    5757Camera::~Camera()
    5858{
    59   EventHandler::getInstance()->unsubscribe(this);
    6059}
    6160
  • orxonox/trunk/src/world_entities/weapons/crosshair.cc

    r4834 r4838  
    5252
    5353  // delete what has to be deleted here
    54   EventHandler::getInstance()->unsubscribe(this);
    5554
    5655  GraphicsEngine::showMouse(true);
Note: See TracChangeset for help on using the changeset viewer.