Changeset 3013 for code/branches/sound2/src/orxonox/objects/items/Engine.cc
- Timestamp:
- May 21, 2009, 9:25:16 PM (15 years ago)
- Location:
- code/branches/sound2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound2
- Property svn:mergeinfo changed
/code/branches/sound (added) merged: 2829,2866,2899,2930-2932,2950,2955,2966-2968,2980,2982,2984,2998-2999,3010
- Property svn:mergeinfo changed
-
code/branches/sound2/src/orxonox/objects/items/Engine.cc
r2662 r3013 36 36 #include "objects/worldentities/pawns/SpaceShip.h" 37 37 #include "tools/Shader.h" 38 #include "sound/SoundBase.h" 38 39 39 40 namespace orxonox … … 66 67 this->setConfigValues(); 67 68 this->registerVariables(); 69 70 this->sound_ = NULL; 68 71 } 69 72 … … 76 79 if (this->boostBlur_) 77 80 delete this->boostBlur_; 81 82 if(this->sound_ != NULL) 83 delete this->sound_; 78 84 } 79 85 } … … 95 101 XMLPortParam(Engine, "accelerationleftright", setAccelerationLeftRight, setAccelerationLeftRight, xmlelement, mode); 96 102 XMLPortParam(Engine, "accelerationupdown", setAccelerationUpDown, setAccelerationUpDown, xmlelement, mode); 103 104 XMLPortParamLoadOnly(Engine, "sound", loadSound, xmlelement, mode); 97 105 } 98 106 … … 219 227 { 220 228 this->ship_ = ship; 229 221 230 if (ship) 222 231 { … … 230 239 this->boostBlur_ = 0; 231 240 } 241 242 if(this->sound_ != NULL) 243 this->sound_->attachToEntity(ship); 232 244 } 233 245 } … … 240 252 return Vector3::ZERO; 241 253 } 254 255 void Engine::loadSound(const std::string filename) 256 { 257 if(filename == "") return; 258 else 259 { 260 if(this->sound_ == NULL) 261 { 262 this->sound_ = new SoundBase(this->ship_); 263 } 264 265 this->sound_->loadFile(filename); 266 this->sound_->play(true); 267 } 268 } 242 269 }
Note: See TracChangeset
for help on using the changeset viewer.