mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 04:56:39 +00:00 
			
		
		
		
	avoid starting sound updates more than necessary
This commit is contained in:
		
							parent
							
								
									7b8278ae45
								
							
						
					
					
						commit
						546352dbe3
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		| 
						 | 
					@ -938,6 +938,8 @@ namespace MWSound
 | 
				
			||||||
            env
 | 
					            env
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        updateMusic(duration);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Check if any sounds are finished playing, and trash them
 | 
					        // Check if any sounds are finished playing, and trash them
 | 
				
			||||||
        SoundMap::iterator snditer = mActiveSounds.begin();
 | 
					        SoundMap::iterator snditer = mActiveSounds.begin();
 | 
				
			||||||
        while(snditer != mActiveSounds.end())
 | 
					        while(snditer != mActiveSounds.end())
 | 
				
			||||||
| 
						 | 
					@ -1048,9 +1050,7 @@ namespace MWSound
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            mMusic->updateFade(duration);
 | 
					            mMusic->updateFade(duration);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            mOutput->startUpdate();
 | 
					 | 
				
			||||||
            mOutput->updateStream(mMusic);
 | 
					            mOutput->updateStream(mMusic);
 | 
				
			||||||
            mOutput->finishUpdate();
 | 
					 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            if (mMusic->getRealVolume() <= 0.f)
 | 
					            if (mMusic->getRealVolume() <= 0.f)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -1072,7 +1072,6 @@ namespace MWSound
 | 
				
			||||||
            updateSounds(duration);
 | 
					            updateSounds(duration);
 | 
				
			||||||
            updateRegionSound(duration);
 | 
					            updateRegionSound(duration);
 | 
				
			||||||
            updateWaterSound(duration);
 | 
					            updateWaterSound(duration);
 | 
				
			||||||
            updateMusic(duration);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue