Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6328 in orxonox.OLD


Ignore:
Timestamp:
Dec 28, 2005, 2:41:52 AM (18 years ago)
Author:
rennerc
Message:

fixed some bugs

Location:
branches/network/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/converter.cc

    r6326 r6328  
    467467  int n = Converter::byteArrayToInt( a, &length );
    468468
    469   s = new char[n+1];
     469  s = new char[length+1];
    470470
    471471  if ( !s )
  • branches/network/src/world_entities/skybox.cc

    r6326 r6328  
    8080    }
    8181  this->setParentMode(PNODE_MOVEMENT);
     82
     83  this->textureName = NULL;
    8284}
    8385
     
    98100    delete this->material[i];
    99101  delete[] this->material;
     102  if (this->textureName)
     103  {
     104    delete[] this->textureName;
     105    this->textureName = NULL;
     106  }
    100107 }
    101108
     
    220227  SYNCHELP_READ_BEGIN();
    221228  SYNCHELP_READ_FLOAT( size );
    222   SYNCHELP_READ_STRING( textureName, 1024 );
     229  if ( textureName )
     230  {
     231    delete[] textureName;
     232    textureName = NULL;
     233  }
     234  SYNCHELP_READ_STRINGM( textureName );
    223235
    224236  PRINT(0)("GOT DATA: size=%f texture='%s'\n", size, textureName);
  • branches/network/src/world_entities/skybox.h

    r6273 r6328  
    3535  void setSize(float size);
    3636  /** assumes jpg as input-format */
    37   void setTexture(const char* name) { strncpy(textureName, name, 1024); this->setTextureAndType (name, "jpg"); };
     37  void setTexture(const char* name) { if (textureName) delete[] textureName; textureName = new char[strlen(name)+1]; strcpy(textureName, name); this->setTextureAndType (name, "jpg"); };
    3838
    3939  void setTextureAndType(const char* name, const char* extension);
     
    5151  Material**      material;          //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
    5252  float           size;              //!< Size of the SkyBox. This should match the frustum maximum range.
    53   char            textureName[1024]; //!< Name of the Texture
     53  char*           textureName;      //!< Name of the Texture
    5454
    5555};
  • branches/network/src/world_entities/world_entity.cc

    r6326 r6328  
    349349    loadModel( modelFileName );
    350350  }
    351   //delete []modelFileName;
     351  delete[] modelFileName;
    352352}
    353353
Note: See TracChangeset for help on using the changeset viewer.