Changeset 5929 for code/trunk/src/orxonox/items
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core5 (added) merged: 5768-5769,5772,5775-5780,5783-5785,5791-5792,5795-5807,5809-5814,5816-5832,5836-5839,5842-5853,5855-5899,5904-5922,5924-5928
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/items/Engine.cc
r5781 r5929 37 37 #include "pickup/ModifierType.h" 38 38 #include "tools/Shader.h" 39 #include "sound/SoundBase.h"40 39 41 40 namespace orxonox … … 68 67 this->setConfigValues(); 69 68 this->registerVariables(); 70 71 this->sound_ = NULL;72 69 } 73 70 … … 79 76 80 77 if (this->boostBlur_) 81 delete this->boostBlur_; 82 83 if(this->sound_ != NULL) 84 delete this->sound_; 78 this->boostBlur_->destroy(); 85 79 } 86 80 } … … 102 96 XMLPortParam(Engine, "accelerationleftright", setAccelerationLeftRight, setAccelerationLeftRight, xmlelement, mode); 103 97 XMLPortParam(Engine, "accelerationupdown", setAccelerationUpDown, setAccelerationUpDown, xmlelement, mode); 104 105 XMLPortParamLoadOnly(Engine, "sound", loadSound, xmlelement, mode);106 98 } 107 99 … … 237 229 if (this->boostBlur_) 238 230 { 239 delete this->boostBlur_;231 this->boostBlur_->destroy(); 240 232 this->boostBlur_ = 0; 241 233 } 242 243 if(this->sound_ != NULL)244 this->sound_->attachToEntity(ship);245 234 } 246 235 } … … 253 242 return Vector3::ZERO; 254 243 } 255 256 void Engine::loadSound(const std::string filename)257 {258 if(filename == "") return;259 else260 {261 if(this->sound_ == NULL)262 {263 this->sound_ = new SoundBase(this->ship_);264 }265 266 this->sound_->loadFile(filename);267 this->sound_->play(true);268 }269 }270 244 } -
code/trunk/src/orxonox/items/Engine.h
r5781 r5929 130 130 Shader* boostBlur_; 131 131 float blurStrength_; 132 133 SoundBase* sound_;134 132 }; 135 133 } -
code/trunk/src/orxonox/items/MultiStateEngine.cc
r5781 r5929 60 60 // We have no ship, so the effects are not attached and won't be destroyed automatically 61 61 for (std::list<WorldEntity*>::const_iterator it = this->activeEffects_.begin(); it != this->activeEffects_.end(); ++it) 62 delete (*it);62 (*it)->destroy(); 63 63 for (std::list<WorldEntity*>::const_iterator it = this->forwardEffects_.begin(); it != this->forwardEffects_.end(); ++it) 64 delete (*it);64 (*it)->destroy(); 65 65 for (std::list<WorldEntity*>::const_iterator it = this->boostEffects_.begin(); it != this->boostEffects_.end(); ++it) 66 delete (*it);66 (*it)->destroy(); 67 67 for (std::list<WorldEntity*>::const_iterator it = this->brakeEffects_.begin(); it != this->brakeEffects_.end(); ++it) 68 delete (*it);68 (*it)->destroy(); 69 69 } 70 70 } … … 91 91 if (this->getShip()->hasLocalController()) 92 92 { 93 this->set ObjectMode(ObjectDirection::Bidirectional);93 this->setSyncMode(ObjectDirection::Bidirectional); 94 94 95 95 const Vector3& direction = this->getDirection();
Note: See TracChangeset
for help on using the changeset viewer.