Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6853 in orxonox.OLD for trunk/src/story_entities/story_entity.cc


Ignore:
Timestamp:
Jan 30, 2006, 3:40:05 AM (18 years ago)
Author:
patrick
Message:

trunk: safe load param reading, menu better

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/story_entity.cc

    r6848 r6853  
    4141  this->storyID = -1;
    4242  this->description = NULL;
    43   this->menuItemImage = "pictures/menu/DefaultMenuItem.png";
     43  this->menuItemImage = NULL;
    4444  this->nextStoryID = WORLD_ID_GAMEEND;
    4545  this->bMenuEntry = false;
     
    8282  PRINTF(4)("Loaded StoryEntity specific stuff\n");
    8383}
     84
     85
     86/**
     87 * sets the descroption of this StoryEntity
     88 * @param name name
     89 */
     90void StoryEntity::setDescription(const char* description)
     91{
     92  if (this->description)
     93    delete[] this->description;
     94  if (description!= NULL)
     95  {
     96    this->description= new char[strlen(description)+1];
     97    strcpy(this->description, description);
     98  }
     99  else this->description= NULL;
     100}
     101
     102
     103/**
     104 * sets the menu item image of this StoryEntity
     105 * @param name name
     106 */
     107void StoryEntity::setMenuItemImage(const char* image)
     108{
     109  if (this->menuItemImage)
     110    delete[] this->menuItemImage;
     111  if (image != NULL)
     112  {
     113    this->menuItemImage = new char[strlen(image)+1];
     114    strcpy(this->menuItemImage, image);
     115  }
     116  else this->menuItemImage = NULL;
     117}
     118
     119
     120/** sets the menu screenshoot of this StoryEntity @param name name */
     121void StoryEntity::setMenuScreenshoot(const char* image)
     122{
     123  if (this->menuScreenshoot)
     124    delete[] this->menuScreenshoot;
     125  if (image != NULL)
     126  {
     127    this->menuScreenshoot = new char[strlen(image)+1];
     128    strcpy(this->menuScreenshoot, image);
     129  }
     130  else this->menuScreenshoot = NULL;
     131}
     132
     133
Note: See TracChangeset for help on using the changeset viewer.