Changeset 7214 in orxonox.OLD for branches/std/src/story_entities/story_entity.cc
- Timestamp:
- Mar 10, 2006, 7:18:03 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/story_entities/story_entity.cc
r7203 r7214 42 42 this->loadFile = ""; 43 43 this->storyID = -1; 44 this->description = NULL;45 this->menuItemImage = NULL;46 this->menuScreenshoot = NULL;44 this->description = ""; 45 this->menuItemImage = ""; 46 this->menuScreenshoot = ""; 47 47 this->nextStoryID = WORLD_ID_GAMEEND; 48 48 this->bMenuEntry = false; … … 117 117 * @param name name 118 118 */ 119 void StoryEntity::setDescription(const char*description)119 void StoryEntity::setDescription(const std::string& description) 120 120 { 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; 129 122 } 130 123 … … 178 171 * @param name name 179 172 */ 180 void StoryEntity::setMenuItemImage(const char*image)173 void StoryEntity::setMenuItemImage(const std::string& image) 181 174 { 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; 190 176 } 191 177 192 178 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 */ 182 void StoryEntity::setMenuScreenshoot(const std::string& image) 195 183 { 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; 204 185 } 205 186
Note: See TracChangeset
for help on using the changeset viewer.