Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5111 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Aug 23, 2005, 11:13:56 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: reverted the last steps, because they created a huge pack of seg-faults

Location:
trunk/src/lib/graphics
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/model.cc

    r5110 r5111  
    192192
    193193    tIterator<Material>* tmpIt = this->materialList->getIterator();
    194     Material* material = tmpIt->firstElement();
     194    Material* material = tmpIt->nextElement();
    195195  //! @todo do we really have to delete this material??
    196196    while(material)
     
    413413{
    414414  tIterator<Material>* tmpIt = this->materialList->getIterator();
    415   Material* material = tmpIt->firstElement();
     415  Material* material = tmpIt->nextElement();
    416416  while(material)
    417417    {
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r5110 r5111  
    5555
    5656  tIterator<Element2D>* iterator = this->children->getIterator();
    57   Element2D* pn = iterator->firstElement();
     57  Element2D* pn = iterator->nextElement();
    5858  while( pn != NULL)
    5959  {
     
    214214void Element2D::setRelCoor2D (const Vector& relCoord)
    215215{
    216   if (this->toCoordinate!= NULL)
    217   {
    218     delete this->toCoordinate;
    219     this->toCoordinate = NULL;
    220   }
    221216  this->relCoordinate = relCoord;
    222217  this->bRelCoorChanged = true;
     
    232227void Element2D::setRelCoor2D (float x, float y, float z)
    233228{
    234   this->setRelCoor2D(Vector(x,y,z));
     229  this->setAbsCoor2D(Vector(x,y,z));
    235230}
    236231
     
    293288void Element2D::setAbsCoor2D (const Vector& absCoord)
    294289{
    295   if (this->toCoordinate!= NULL)
    296   {
    297     delete this->toCoordinate;
    298     this->toCoordinate = NULL;
    299   }
    300 
    301290  if( likely(this->parentMode & E2D_PARENT_MOVEMENT))
    302291  {
     
    373362void Element2D::setRelDir2D (float relDir)
    374363{
    375   if (this->toDirection!= NULL)
    376   {
    377     delete this->toDirection;
    378     this->toDirection = NULL;
    379   }
    380 
    381364  this->relDirection = relDir;
    382365  this->bRelDirChanged = true;
     
    403386void Element2D::setAbsDir2D (float absDir)
    404387{
    405   if (this->toDirection!= NULL)
    406   {
    407     delete this->toDirection;
    408     this->toDirection = NULL;
    409   }
    410 
    411388  if (likely(this->parent != NULL))
    412389    this->relDirection = absDir - this->parent->getAbsDir2D();
     
    479456{
    480457  tIterator<Element2D>* iterator = this->children->getIterator();
    481   Element2D* pn = iterator->firstElement();
     458  Element2D* pn = iterator->nextElement();
    482459
    483460  while( pn != NULL)
     
    687664  {
    688665    tIterator<Element2D>* iterator = this->children->getIterator();
    689     Element2D* pn = iterator->firstElement();
     666    Element2D* pn = iterator->nextElement();
    690667    while( pn != NULL)
    691668    {
     
    697674
    698675      pn->update2D(dt);
     676          //pn = this->children->nextElement();
    699677      pn = iterator->nextElement();
    700678    }
     
    734712  {
    735713    tIterator<Element2D>* iterator = this->children->getIterator();
    736     Element2D* pn = iterator->firstElement();
     714      //PNode* pn = this->children->enumerate ();
     715    Element2D* pn = iterator->nextElement();
    737716    while( pn != NULL)
    738717    {
  • trunk/src/lib/graphics/render2D/element_2d.h

    r5109 r5111  
    108108    /** @returns the relative position */
    109109    inline const Vector& getRelCoor2D () const { return this->prevRelCoordinate; };
    110     /** @returns the Relative Coordinate Destination */
    111     inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)?*this->toCoordinate:this->relCoordinate; };
    112110    const Vector& getRelCoor2Dpx() const;
    113111    void setAbsCoor2D (const Vector& absCoord);
     
    125123    /** @returns the relative Direction */
    126124    inline float getRelDir2D () const { return this->prevRelDirection; };
    127     /** @returns the Relative Directional Destination */
    128     inline float getRelDirSoft2D() const { return (this->toDirection)?*this->toDirection:this->relDirection; };
    129125    void setAbsDir2D (float absDir);
    130126    /** @returns the absolute Direction */
  • trunk/src/lib/graphics/render2D/render_2d.cc

    r5110 r5111  
    105105  {
    106106    tIterator<Element2D>* iterator = this->element2DList[i]->getIterator();
    107     Element2D* elem = iterator->firstElement();
     107    Element2D* elem = iterator->nextElement();
    108108    while (elem != NULL)
    109109    {
     
    131131    {
    132132      tIterator<Element2D>* iterator = this->element2DList[i]->getIterator();
    133       Element2D* elem = iterator->firstElement();
     133      Element2D* elem = iterator->nextElement();
    134134      while (elem != NULL)
    135135      {
  • trunk/src/lib/graphics/spatial_separation/quadtree_node.cc

    r5110 r5111  
    253253  counter = 0;
    254254  iterator = listA->getIterator();
    255   tempTri = iterator->firstElement();
     255  tempTri = iterator->nextElement();
    256256  while( tempTri)
    257257  {
     
    262262  counter = 0;
    263263  iterator = listB->getIterator();
    264   tempTri = iterator->firstElement();
     264  tempTri = iterator->nextElement();
    265265  while( tempTri)
    266266  {
     
    271271  counter = 0;
    272272  iterator = listC->getIterator();
    273   tempTri = iterator->firstElement();
     273  tempTri = iterator->nextElement();
    274274  while( tempTri)
    275275  {
     
    280280  counter = 0;
    281281  iterator = listD->getIterator();
    282   tempTri = iterator->firstElement();
     282  tempTri = iterator->nextElement();
    283283  while( tempTri)
    284284  {
  • trunk/src/lib/graphics/text_engine.cc

    r5110 r5111  
    592592          if( glyphSurf != NULL )
    593593            {
     594
    594595              SDL_SetAlpha(glyphSurf, 0, 0);
    595596
     
    597598              TexCoord tmpTexCoord;
    598599              tmpTexCoord.minU = (float)tmpRect.x/(float)tmpSurf->w;
    599               tmpTexCoord.maxU = (float)(tmpRect.x +1 + tmpGlyph->width)/(float)tmpSurf->w;
     600              tmpTexCoord.maxU = (float)(tmpRect.x +1 +tmpGlyph->width)/(float)tmpSurf->w;
    600601              tmpTexCoord.minV = (float)tmpRect.y/(float)tmpSurf->w;
    601602              tmpTexCoord.maxV = (float)(tmpRect.y+tmpGlyph->height)/(float)tmpSurf->w;
     
    619620
    620621              // Outputting Glyphs to BMP-files.
    621 /*
    622                 char outname[512];
     622              /*
     623                char outname[64];
    623624                if (i < 10)
    624                 sprintf( outname, "%s-glyph-00%d.bmp", this->getName(), i );
     625                sprintf( outname, "glyph-00%d.bmp", i );
    625626                else if (i <100)
    626                   sprintf( outname, "%s-glyph-0%d.bmp", this->getName(), i );
     627                sprintf( outname, "glyph-0%d.bmp", i );
    627628                else
    628                   sprintf( outname, "%s-glyph-%d.bmp", this->getName(), i );
    629                 SDL_SaveBMP(tmpSurf, outname);*/
    630 
     629                sprintf( outname, "glyph-%d.bmp", i );
     630                SDL_SaveBMP(tmpSurf, outname);
     631              */
    631632            }
    632633        }
     
    711712                  x = 0;
    712713                  y = y + maxLineHeight;
    713                   //maxLineHeight = 0;
     714                  maxLineHeight = 0;
    714715                }
    715716              if (y + maxLineHeight + 1 > size)
     
    845846
    846847  tIterator<BaseObject>* textIterator = ClassList::getList(CL_TEXT)->getIterator();
    847   Text* text = dynamic_cast<Text*>(textIterator->firstElement());
     848  Text* text = dynamic_cast<Text*>(textIterator->nextElement());
    848849  while( text != NULL)
    849850    {
Note: See TracChangeset for help on using the changeset viewer.