Changeset 2980 for code/branches/sound/src/orxonox/objects/items/Engine.cc
- Timestamp:
- May 18, 2009, 2:24:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound/src/orxonox/objects/items/Engine.cc
r2662 r2980 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 … … 95 96 XMLPortParam(Engine, "accelerationleftright", setAccelerationLeftRight, setAccelerationLeftRight, xmlelement, mode); 96 97 XMLPortParam(Engine, "accelerationupdown", setAccelerationUpDown, setAccelerationUpDown, xmlelement, mode); 98 99 XMLPortParamLoadOnly(Engine, "sound", loadSound, xmlelement, mode); 97 100 } 98 101 … … 219 222 { 220 223 this->ship_ = ship; 224 this->sound_->attachToEntity(ship); 225 221 226 if (ship) 222 227 { … … 240 245 return Vector3::ZERO; 241 246 } 247 248 void Engine::loadSound(const std::string filename) 249 { 250 if(filename == "") return; 251 else 252 { 253 if(this->sound_ == NULL) 254 { 255 this->sound_ = new SoundBase(this->ship_); 256 } 257 258 this->sound_->loadFile(filename); 259 this->sound_->play(true); 260 } 261 } 242 262 }
Note: See TracChangeset
for help on using the changeset viewer.