Changeset 6328 in orxonox.OLD for branches/network/src
- Timestamp:
- Dec 28, 2005, 2:41:52 AM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/converter.cc
r6326 r6328 467 467 int n = Converter::byteArrayToInt( a, &length ); 468 468 469 s = new char[ n+1];469 s = new char[length+1]; 470 470 471 471 if ( !s ) -
branches/network/src/world_entities/skybox.cc
r6326 r6328 80 80 } 81 81 this->setParentMode(PNODE_MOVEMENT); 82 83 this->textureName = NULL; 82 84 } 83 85 … … 98 100 delete this->material[i]; 99 101 delete[] this->material; 102 if (this->textureName) 103 { 104 delete[] this->textureName; 105 this->textureName = NULL; 106 } 100 107 } 101 108 … … 220 227 SYNCHELP_READ_BEGIN(); 221 228 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 ); 223 235 224 236 PRINT(0)("GOT DATA: size=%f texture='%s'\n", size, textureName); -
branches/network/src/world_entities/skybox.h
r6273 r6328 35 35 void setSize(float size); 36 36 /** 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"); }; 38 38 39 39 void setTextureAndType(const char* name, const char* extension); … … 51 51 Material** material; //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back 52 52 float size; //!< Size of the SkyBox. This should match the frustum maximum range. 53 char textureName[1024];//!< Name of the Texture53 char* textureName; //!< Name of the Texture 54 54 55 55 }; -
branches/network/src/world_entities/world_entity.cc
r6326 r6328 349 349 loadModel( modelFileName ); 350 350 } 351 //delete []modelFileName;351 delete[] modelFileName; 352 352 } 353 353
Note: See TracChangeset
for help on using the changeset viewer.