Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6130 in orxonox.OLD for branches


Ignore:
Timestamp:
Dec 16, 2005, 4:06:38 PM (19 years ago)
Author:
bensch
Message:

om: valgrind sweep, also in Element2D

Location:
branches/objectmanager/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/objectmanager/src/lib/graphics/render2D/element_2d.cc

    r5944 r6130  
    1818#include "element_2d.h"
    1919#include "render_2d.h"
     20
     21#include <algorithm>
    2022
    2123#include "p_node.h"
     
    8284  if (this->parent != NULL)
    8385  {
    84     this->parent->children.remove(this);
     86    this->parent->eraseChild(this);
    8587    this->parent = NULL;
    8688  }
     
    512514  {
    513515    PRINTF(5)("Element2D::addChild() - reparenting node: removing it and adding it again\n");
    514     child->parent->children.remove(child);
     516    child->parent->eraseChild(child);
    515517  }
    516518  child->parent = this;
     
    581583  if (this->parent != NULL)
    582584  {
    583     this->parent->children.remove(this);
     585    this->parent->eraseChild(this);
    584586    this->parent = NULL;
    585587  }
     
    655657  if (parentNode != NULL)
    656658    this->setParentSoft2D(parentNode, bias);
     659}
     660
     661/** @param child the child to be erased from this Nodes List */
     662void Element2D::eraseChild(Element2D* child)
     663{
     664  std::list<Element2D*>::iterator childIT = std::find(this->children.begin(), this->children.end(), child);
     665  this->children.erase(childIT);
    657666}
    658667
     
    733742    else if (unlikely(this->bindNode != NULL))
    734743    {
    735       GLdouble projectPos[3];
     744      GLdouble projectPos[3] = {0, 0, 0};
    736745      gluProject(this->bindNode->getAbsCoor().x,
    737746                 this->bindNode->getAbsCoor().y,
  • branches/objectmanager/src/lib/graphics/render2D/element_2d.h

    r5775 r6130  
    195195
    196196  private:
     197    void eraseChild(Element2D* child);
    197198    /** tells the child that the parent's Coordinate has changed */
    198199    inline void parentCoorChanged () { this->bRelCoorChanged = true; }
  • branches/objectmanager/src/lib/sound/sound_engine.cc

    r6076 r6130  
    141141    if (!this->ALSources.empty())
    142142    {
    143 
    144143      source = this->ALSources.top();
    145       printf("test: : %d\n", source);
    146144      this->ALSources.pop();
    147145    }
  • branches/objectmanager/src/lib/sound/sound_source.cc

    r5930 r6130  
    6969    SoundEngine::getInstance()->popALSource(this->sourceID);
    7070
    71   printf("%d\n",sourceID);
    7271  alSourceStop(this->sourceID);
    7372  alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
  • branches/objectmanager/src/world_entities/space_ships/space_ship.cc

    r6078 r6130  
    112112  PRINTF(4)("SPACESHIP INIT\n");
    113113
    114   EventHandler::getInstance()->grabEvents(true);
     114  EventHandler::getInstance()->grabEvents(false);
    115115
    116116  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
Note: See TracChangeset for help on using the changeset viewer.