Changeset 2950 for code/branches/sound/src/orxonox/objects/Level.cc
- Timestamp:
- May 4, 2009, 3:40:08 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound/src/orxonox/objects/Level.cc
r2826 r2950 77 77 XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode); 78 78 XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype"); 79 80 XMLPortParamLoadOnly(Level, "ambientsound", loadAmbientSound, xmlelement, mode); 79 81 80 82 XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false); … … 148 150 } 149 151 152 void Level::loadAmbientSound(const std::string& filename) 153 { 154 if(filename == "") return; 155 else 156 { 157 if(this->ambientsound_ == NULL) 158 { 159 this->ambientsound_ = new SoundBase(); 160 this->sndmgr_.addSound(this->ambientsound_); 161 } 162 163 this->ambientsound_->loadFile(filename); 164 this->ambientsound_->play(); 165 } 166 } 167 150 168 void Level::playerEntered(PlayerInfo* player) 151 169 {
Note: See TracChangeset
for help on using the changeset viewer.