Changeset 5892 for code/branches/core5/src/orxonox
- Timestamp:
- Oct 6, 2009, 9:18:40 AM (15 years ago)
- Location:
- code/branches/core5/src/orxonox
- Files:
-
- 2 deleted
- 7 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 { -
code/branches/core5/src/orxonox/Level.h
r5738 r5892 53 53 { return this->description_; } 54 54 55 void loadAmbientSound(const std::string& filename);56 57 55 void playerEntered(PlayerInfo* player); 58 56 void playerLeft(PlayerInfo* player); … … 73 71 XMLFile* xmlfile_; 74 72 std::list<BaseObject*> objects_; 75 76 SoundBase* ambientsound_;77 73 }; 78 74 } -
code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc
r5878 r5892 39 39 #include "core/GUIManager.h" 40 40 #include "Scene.h" 41 #include "sound/Sound MainMenu.h"41 #include "sound/SoundBase.h" 42 42 43 43 namespace orxonox … … 62 62 { 63 63 // Load sound 64 this->ambient_ = new SoundMainMenu(); 64 this->ambient_ = new SoundBase(0); 65 this->ambient_->loadFile("ambient/mainmenu.wav"); 65 66 } 66 67 } … … 69 70 { 70 71 if (GameMode::playsSound()) 71 { 72 this->ambient_->destroy(); 73 } 72 delete this->ambient_; 74 73 75 74 InputManager::getInstance().destroyState("mainMenu"); -
code/branches/core5/src/orxonox/gamestates/GSMainMenu.h
r5876 r5892 59 59 60 60 // ambient sound for the main menu 61 Sound MainMenu*ambient_;61 SoundBase* ambient_; 62 62 }; 63 63 } -
code/branches/core5/src/orxonox/items/Engine.cc
r5801 r5892 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 … … 80 77 if (this->boostBlur_) 81 78 this->boostBlur_->destroy(); 82 83 if(this->sound_ != NULL)84 delete this->sound_;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 … … 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/branches/core5/src/orxonox/items/Engine.h
r5738 r5892 130 130 Shader* boostBlur_; 131 131 float blurStrength_; 132 133 SoundBase* sound_;134 132 }; 135 133 } -
code/branches/core5/src/orxonox/sound/CMakeLists.txt
r3196 r5892 2 2 SoundManager.cc 3 3 SoundBase.cc 4 SoundMainMenu.cc5 4 ) 6 5
Note: See TracChangeset
for help on using the changeset viewer.