Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Sep 21, 2005, 2:21:41 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: valgrind mem-leak-recovered

Location:
trunk/src/lib
Files:
9 edited

Legend:

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

    r5209 r5211  
    104104{
    105105  this->setClassID(CL_PARENT_NODE, "PNode");
     106
    106107  this->children = new tList<PNode>();
    107108  this->bRelCoorChanged = true;
  • trunk/src/lib/graphics/importer/model.cc

    r5115 r5211  
    350350    delete this->normals;
    351351  if (this->triangles)
    352     delete this->triangles;
     352    delete[] this->triangles;
    353353
    354354  this->vertices = NULL;
    355355  this->vTexture = NULL;
    356356  this->normals = NULL;
    357   this->triangles = NULL; this->triangleCount = 0;
     357  this->triangles = NULL;
     358  this->triangleCount = 0;
    358359}
    359360
  • trunk/src/lib/graphics/importer/texture.cc

    r4836 r5211  
    4545Texture::~Texture()
    4646{
    47   if (this->texture)
     47  if (this->texture != 0)
    4848    glDeleteTextures(1, &this->texture);
    4949}
  • trunk/src/lib/graphics/light.cc

    r5156 r5211  
    244244    if (this->lights[i])
    245245      delete lights[i];
    246   delete lights;
     246  delete[] lights;
    247247  LightManager::singletonRef = NULL;
    248248}
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r5118 r5211  
    9090  this->parent = NULL;
    9191  this->children = new tList<Element2D>;
     92  this->absDirection = 0.0;
    9293  this->relDirection = 0.0;
    9394  this->bRelCoorChanged = true;
     
    844845NullElement2D::~NullElement2D ()
    845846{
    846   //delete singletonRef;
    847847  NullElement2D::singletonRef = NULL;
    848848}
  • trunk/src/lib/graphics/render2D/element_2d.h

    r5113 r5211  
    193193    Vector                  absCoordinate;      //!< absolute coordinates in the world ( from (0,0,0) )
    194194    float                   relDirection;       //!< direction relative to the parent
    195     float                   absDirection;       //!< absolute direvtion in the world ( from (0,0,1) )
     195    float                   absDirection;       //!< absolute diretion in the world ( from (0,0,1) )
    196196
    197197    Vector                  prevRelCoordinate;  //!< The last Relative Coordinate from the last update-Cycle.
  • trunk/src/lib/math/curve.cc

    r4836 r5211  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    1313   co-programmer: Patrick Boenzli
    1414
    15    ADD: Patrick Boenzli           B-Spline 
    16 
    17 
    18    TODO: 
     15   ADD: Patrick Boenzli           B-Spline
     16
     17
     18   TODO:
    1919     local-Time implementation
    2020     NURBS
    2121     tList implementation
    22      
     22
    2323*/
    2424
     
    3333
    3434
    35 /** 
     35/**
    3636  *  default constructor for a Curve
    3737*/
     
    7171void Curve::addNode(const Vector& newNode, unsigned int insertPosition)
    7272{
    73 
    7473  if (this->nodeCount == 0 || insertPosition > this->nodeCount)
    7574    return addNode(newNode);
     
    8584    {
    8685      while (tmpNode->next->number != insertPosition)
    87         tmpNode= tmpNode->next;
     86        tmpNode= tmpNode->next;
    8887      insNode->next = tmpNode->next;
    8988      tmpNode->next = insNode;
     
    199198      tmpNode->factor = binCoef;
    200199      if (tmpNode =tmpNode->next)
    201         {
    202           binCoef *=(n-k)/(k+1);
    203           ++k;
    204         }
     200        {
     201          binCoef *=(n-k)/(k+1);
     202          ++k;
     203        }
    205204    }
    206205
     
    212211      dirCurve = new BezierCurve(1);
    213212      while(tmpNode->next)
    214         {
    215           Vector tmpVector = (tmpNode->next->position)- (tmpNode->position);
    216           tmpVector.x*=(float)nodeCount;
    217           tmpVector.y*=(float)nodeCount;
    218           tmpVector.z*=(float)nodeCount;
    219           tmpVector.normalize();
    220           this->dirCurve->addNode(tmpVector);
    221           tmpNode = tmpNode->next;
    222         }
     213        {
     214          Vector tmpVector = (tmpNode->next->position)- (tmpNode->position);
     215          tmpVector.x*=(float)nodeCount;
     216          tmpVector.y*=(float)nodeCount;
     217          tmpVector.z*=(float)nodeCount;
     218          tmpVector.normalize();
     219          this->dirCurve->addNode(tmpVector);
     220          tmpNode = tmpNode->next;
     221        }
    223222    }
    224223}
     
    229228 * @return the Position on the Path
    230229*/
    231 Vector BezierCurve::calcPos(float t) 
     230Vector BezierCurve::calcPos(float t)
    232231{
    233232  Vector ret = Vector(0.0,0.0,0.0);
     
    237236      double factor = pow(1.0-t,nodeCount-1);
    238237      while(tmpNode)
    239         {
    240           ret.x += tmpNode->factor * factor * tmpNode->position.x;
    241           ret.y += tmpNode->factor * factor * tmpNode->position.y;
    242           ret.z += tmpNode->factor * factor * tmpNode->position.z;
    243           factor *= t/(1.0-t); // same as pow but much faster.
    244          
    245           tmpNode = tmpNode->next;
    246         }
     238        {
     239          ret.x += tmpNode->factor * factor * tmpNode->position.x;
     240          ret.y += tmpNode->factor * factor * tmpNode->position.y;
     241          ret.z += tmpNode->factor * factor * tmpNode->position.z;
     242          factor *= t/(1.0-t); // same as pow but much faster.
     243
     244          tmpNode = tmpNode->next;
     245        }
    247246    }
    248247  else if (nodeCount == 2)
  • trunk/src/lib/physics/physics_engine.cc

    r5129 r5211  
    5858  }
    5959  delete itPC;
    60    delete this->connections;
     60  delete this->connections;
    6161//
    6262//   // delete all PhysicsInterfaces, still in existence (this could be dangerous)
  • trunk/src/lib/util/list.h

    r5209 r5211  
    8282    {
    8383      listElement<T>* le = this->currentEl->next;
    84       //delete this->currentEl->curr;
     84      //delete this->currentEl->curr;  //! THIS IS EXTREMELY UNSAFE (the list only stores pointers not instances) //
    8585      delete this->currentEl;
    8686      this->currentEl = le;
Note: See TracChangeset for help on using the changeset viewer.