Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 10, 2006, 7:18:03 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: now the branche works again, as it did before

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/story_entities/story_entity.cc

    r7203 r7214  
    4242  this->loadFile = "";
    4343  this->storyID = -1;
    44   this->description = NULL;
    45   this->menuItemImage = NULL;
    46   this->menuScreenshoot = NULL;
     44  this->description = "";
     45  this->menuItemImage = "";
     46  this->menuScreenshoot = "";
    4747  this->nextStoryID = WORLD_ID_GAMEEND;
    4848  this->bMenuEntry = false;
     
    117117 * @param name name
    118118 */
    119 void StoryEntity::setDescription(const char* description)
     119void StoryEntity::setDescription(const std::string& description)
    120120{
    121   if (this->description)
    122     delete[] this->description;
    123   if (description!= NULL)
    124   {
    125     this->description= new char[strlen(description)+1];
    126     strcpy(this->description, description);
    127   }
    128   else this->description= NULL;
     121  this->description = description;
    129122}
    130123
     
    178171 * @param name name
    179172 */
    180 void StoryEntity::setMenuItemImage(const char* image)
     173void StoryEntity::setMenuItemImage(const std::string& image)
    181174{
    182   if (this->menuItemImage)
    183     delete[] this->menuItemImage;
    184   if (image != NULL)
    185   {
    186     this->menuItemImage = new char[strlen(image)+1];
    187     strcpy(this->menuItemImage, image);
    188   }
    189   else this->menuItemImage = NULL;
     175  this->menuItemImage = image;
    190176}
    191177
    192178
    193 /** sets the menu screenshoot of this StoryEntity @param name name */
    194 void StoryEntity::setMenuScreenshoot(const char* image)
     179/** sets the menu screenshoot of this StoryEntity
     180 * @param name name
     181 */
     182void StoryEntity::setMenuScreenshoot(const std::string& image)
    195183{
    196   if (this->menuScreenshoot)
    197     delete[] this->menuScreenshoot;
    198   if (image != NULL)
    199   {
    200     this->menuScreenshoot = new char[strlen(image)+1];
    201     strcpy(this->menuScreenshoot, image);
    202   }
    203   else this->menuScreenshoot = NULL;
     184  this->menuScreenshoot = image;
    204185}
    205186
Note: See TracChangeset for help on using the changeset viewer.