Changeset 5892 for code/branches/core5/src/orxonox/Level.cc
- Timestamp:
- Oct 6, 2009, 9:18:40 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/orxonox/Level.cc
r5836 r5892 39 39 #include "gametypes/Gametype.h" 40 40 #include "overlays/OverlayGroup.h" 41 #include "sound/SoundBase.h"42 41 #include "LevelManager.h" 43 42 … … 53 52 this->xmlfilename_ = this->getFilename(); 54 53 this->xmlfile_ = 0; 55 this->ambientsound_ = 0;56 54 } 57 55 … … 65 63 if (this->xmlfile_) 66 64 Loader::unload(this->xmlfile_); 67 68 if (this->ambientsound_ != NULL)69 delete this->ambientsound_;70 65 } 71 66 } … … 77 72 XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode); 78 73 XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype"); 79 80 XMLPortParamLoadOnly(Level, "ambientsound", loadAmbientSound, xmlelement, mode);81 74 82 75 XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false); … … 150 143 } 151 144 152 void Level::loadAmbientSound(const std::string& filename)153 {154 if(filename == "") return;155 else156 {157 if(this->ambientsound_ == NULL)158 {159 this->ambientsound_ = new SoundBase();160 }161 162 this->ambientsound_->loadFile(filename);163 this->ambientsound_->play(true);164 }165 }166 167 145 void Level::playerEntered(PlayerInfo* player) 168 146 {
Note: See TracChangeset
for help on using the changeset viewer.