Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6073 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Dec 12, 2005, 7:42:48 PM (19 years ago)
Author:
bensch
Message:

trunk: sync

Location:
trunk/src/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/coord/null_parent.cc

    r6070 r6073  
    3333  this->setName("NullParent");
    3434
    35   while (!this->getNodesChildren().empty())
    36     delete this->getNodesChildren().front();
    37 
    3835  this->setParentMode(PNODE_ALL);
    3936  NullParent::singletonRef = this;
  • trunk/src/lib/coord/p_node.cc

    r6071 r6073  
    3636PNode::PNode ()
    3737{
    38   init(NULL);
     38  init();
    3939
    4040  NullParent::getInstance()->addChild(this);
    4141}
    4242
    43 /**
    44  * @param root the load-Element for the PNode
    45  */
    46 PNode::PNode(const TiXmlElement* root)
    47 {
    48   this->init(NULL);
    49   this->loadParams(root);
    50 
    51   if (this->parent == NULL)
    52     NullParent::getInstance()->addChild(this);
    53 }
    5443
    5544/**
     
    6049PNode::PNode (const Vector& absCoor, PNode* parent )
    6150{
    62   this->init(parent);
     51  this->init();
    6352
    6453  if (likely(parent != NULL))
     
    6756  this->setAbsCoor(absCoor);
    6857}
     58
    6959
    7060/**
     
    7767 *    (danger if you still need the children's instance somewhere else!!)
    7868 *
    79  * 2. instance->remove2D(); delete instance;
     69 * 2. instance->removeNode(); delete instance;
    8070 *   -> result:
    8171 *    moves its children to the NullParent
     
    8474PNode::~PNode ()
    8575{
     76  // remove the Node, delete it's children (if required).
     77  std::list<PNode*>::iterator tmp = this->children.begin();
     78  std::list<PNode*>::iterator deleteNode;
     79  while(!this->children.empty())
     80    while (tmp != this->children.end())
     81    {
     82      deleteNode = tmp;
     83      ++tmp;
     84      printf("TEST::%s(%s) %s\n", (*deleteNode)->getName(), (*deleteNode)->getClassName(), this->getName());
     85      if ((this->parentMode & PNODE_PROHIBIT_CHILD_DELETE) ||
     86          ((*deleteNode)->parentMode & PNODE_PROHIBIT_DELETE_WITH_PARENT))
     87      {
     88        if (this == NullParent::getInstance() && (*deleteNode)->parentMode & PNODE_REPARENT_TO_NULLPARENT)
     89          delete (*deleteNode);
     90        else
     91          (*deleteNode)->reparent();
     92      }
     93      else
     94        delete (*deleteNode);
     95    }
     96
    8697  if (this->parent != NULL)
    8798   {
     
    90101   }
    91102
    92   // remove the Node, delete it's children (if required).
    93   std::list<PNode*>::iterator tmp = this->children.begin();
    94   std::list<PNode*>::iterator deleteNode;
    95   while (tmp != this->children.end())
    96   {
    97     deleteNode = tmp++;
    98     if ((this->parentMode & PNODE_PROHIBIT_CHILD_DELETE) || ((*deleteNode)->parentMode & PNODE_PROHIBIT_DELETE_WITH_PARENT) )
    99       (*deleteNode)->reparent();
    100     else
    101       delete (*deleteNode);
    102   }
    103 
    104103  // remove all other allocated memory.
    105104  if (this->toCoordinate != NULL)
     
    114113 * @param parent the parent for this PNode
    115114 */
    116 void PNode::init(PNode* parent)
     115void PNode::init()
    117116{
    118117  this->setClassID(CL_PARENT_NODE, "PNode");
     
    120119  this->bRelCoorChanged = true;
    121120  this->bRelDirChanged = true;
    122   this->parent = parent;
     121  this->parent = NULL;
    123122  this->parentMode = PNODE_PARENT_MODE_DEFAULT;
    124123  this->bActive = true;
  • trunk/src/lib/coord/p_node.h

    r6071 r6073  
    7373 public:
    7474  PNode ();
    75   PNode(const TiXmlElement* root);
    7675  PNode (const Vector& absCoor, PNode* pNode);
    7776  virtual ~PNode ();
     
    170169
    171170 private:
    172   void init(PNode* parent);
     171  void init();
    173172  /** tells the child that the parent's Coordinate has changed */
    174173  inline void parentCoorChanged () { this->bRelCoorChanged = true; }
  • trunk/src/lib/graphics/importer/model.cc

    r6033 r6073  
    3131  this->pModelInfo.numVertices = 0;
    3232  this->pModelInfo.numTriangles = 0;
     33  this->pModelInfo.numNormals = 0;
    3334  this->pModelInfo.numTexCoor = 0;
    3435
  • trunk/src/lib/sound/sound_engine.cc

    r6070 r6073  
    184184      if (source->isPlaying())
    185185      {
    186         int play;
     186        int play = 0x000;
    187187        alGetSourcei(source->getID(), AL_SOURCE_STATE, &play);
    188188        if(play == AL_PLAYING)
Note: See TracChangeset for help on using the changeset viewer.