mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-29 03:26:38 +00:00 
			
		
		
		
	Don't try to resume sound types that aren't paused
This commit is contained in:
		
							parent
							
								
									2f8daec379
								
							
						
					
					
						commit
						fe36cc1de7
					
				
					 2 changed files with 11 additions and 0 deletions
				
			
		|  | @ -52,6 +52,7 @@ namespace MWSound | ||||||
|         , mMusicVolume(1.0f) |         , mMusicVolume(1.0f) | ||||||
|         , mFootstepsVolume(1.0f) |         , mFootstepsVolume(1.0f) | ||||||
|         , mVoiceVolume(1.0f) |         , mVoiceVolume(1.0f) | ||||||
|  |         , mPausedSoundTypes(0) | ||||||
|     { |     { | ||||||
|         if(!useSound) |         if(!useSound) | ||||||
|             return; |             return; | ||||||
|  | @ -426,13 +427,21 @@ namespace MWSound | ||||||
|     void SoundManager::pauseSounds(int types) |     void SoundManager::pauseSounds(int types) | ||||||
|     { |     { | ||||||
|         if(mOutput->isInitialized()) |         if(mOutput->isInitialized()) | ||||||
|  |         { | ||||||
|  |             types &= Play_TypeMask; | ||||||
|             mOutput->pauseSounds(types); |             mOutput->pauseSounds(types); | ||||||
|  |             mPausedSoundTypes |= types; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     void SoundManager::resumeSounds(int types) |     void SoundManager::resumeSounds(int types) | ||||||
|     { |     { | ||||||
|         if(mOutput->isInitialized()) |         if(mOutput->isInitialized()) | ||||||
|  |         { | ||||||
|  |             types &= types&Play_TypeMask&mPausedSoundTypes; | ||||||
|             mOutput->resumeSounds(types); |             mOutput->resumeSounds(types); | ||||||
|  |             mPausedSoundTypes &= ~types; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -52,6 +52,8 @@ namespace MWSound | ||||||
|         Ogre::Vector3 mListenerDir; |         Ogre::Vector3 mListenerDir; | ||||||
|         Ogre::Vector3 mListenerUp; |         Ogre::Vector3 mListenerUp; | ||||||
| 
 | 
 | ||||||
|  |         int mPausedSoundTypes; | ||||||
|  | 
 | ||||||
|         std::string lookup(const std::string &soundId, |         std::string lookup(const std::string &soundId, | ||||||
|                   float &volume, float &min, float &max); |                   float &volume, float &min, float &max); | ||||||
|         void streamMusicFull(const std::string& filename); |         void streamMusicFull(const std::string& filename); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue