Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4336 in orxonox.OLD for orxonox/branches/physics/src/lib


Ignore:
Timestamp:
May 27, 2005, 8:22:54 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/physics: segfault-prevention

Location:
orxonox/branches/physics/src/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/lib/graphics/particles/particle_system.cc

    r4332 r4336  
    4242ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type)
    4343{
    44    this->setClassID(CL_PARTICLE_SYSTEM, "ParticleSystem");
     44  this->setClassID(CL_PARTICLE_SYSTEM, "ParticleSystem");
    4545  this->material = NULL;
    4646  this->name = NULL;
     
    123123
    124124  //  glID[0] = glGenLists(count);
    125   if (material)
    126     delete material;
     125  if (this->material)
     126    delete this->material;
    127127  material = NULL;
    128128
    129   if (particleType == PARTICLE_SPRITE)
    130     {
    131       material = new Material("transperencyMap");
    132       material->setDiffuseMap("pictures/radialTransparency.png");
     129  if (this->particleType == PARTICLE_SPRITE)
     130    {
     131      this->material = new Material("transperencyMap");
     132      this->material->setDiffuseMap("pictures/radialTransparency.png");
    133133      //  material->setTransparency(.5);
    134134    }
  • orxonox/branches/physics/src/lib/gui/gui/gui_gtk.cc

    r4325 r4336  
    14191419{
    14201420  MenuItem* tmpItem = this->firstItem;
    1421   for (int i = 0; i<this->value; i++)
    1422     tmpItem = tmpItem->next;
    1423      
    1424   return tmpItem->name;
     1421  for (int i = 0; i < this->value; i++)
     1422    if (tmpItem)
     1423      tmpItem = tmpItem->next;
     1424    else
     1425      break;
     1426  if (tmpItem)
     1427    {
     1428      char* tmpName = new char[strlen(tmpItem->name)+1];
     1429      strcpy(tmpName, tmpItem->name);
     1430      return tmpName;
     1431    }
     1432  else
     1433    return NULL;
    14251434}
    14261435
     
    15031512
    15041513#endif /* HAVE_GTK2 */
    1505   PRINT(5)("%s set to: %d\n", this->title, this->value);
     1514  PRINT(1)("%s set to: %d\n", this->title, this->value);
    15061515}
    15071516
Note: See TracChangeset for help on using the changeset viewer.