Changeset 6031 for code/branches/sound3/src/orxonox/sound/SoundManager.cc
- Timestamp:
- Nov 4, 2009, 4:03:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound3/src/orxonox/sound/SoundManager.cc
r5982 r6031 34 34 #include "util/Math.h" 35 35 #include "util/ScopeGuard.h" 36 #include "util/StringUtils.h" 36 37 #include "core/GameMode.h" 37 38 #include "core/ScopedSingletonManager.h" 39 #include "core/Resource.h" 38 40 #include "BaseSound.h" 41 #include "MoodManager.h" 39 42 40 43 namespace orxonox … … 127 130 void SoundManager::unregisterAmbientSound(BaseSound* currentAmbient) 128 131 { 132 if(currentAmbient == NULL || ambientSounds_.empty()) 133 { 134 return; 135 } 129 136 if(this->ambientSounds_.front() == currentAmbient) 130 137 { 131 138 this->ambientSounds_.pop_front(); 132 this->ambientSounds_.front()->replay(); 139 if(!(this->ambientSounds_.empty())) 140 { 141 this->ambientSounds_.front()->replay(); 142 } 133 143 } 134 144 else … … 144 154 } 145 155 } 156 157 // Get the current mood and return the full path string to the requested sound. 158 const std::string& SoundManager::getAmbientPath(const std::string& source) 159 { 160 lastReqPath = "ambient/" + MoodManager::getInstance().getMood() + "/" + source; 161 shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(lastReqPath); 162 if(fileInfo == NULL) 163 { 164 return BLANKSTRING; 165 } 166 return lastReqPath; 167 } 146 168 }
Note: See TracChangeset
for help on using the changeset viewer.