mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	macOS: make mute sound actually work (#15128)
This commit is contained in:
		@@ -29,6 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 | 
			
		||||
#include "filesys.h"
 | 
			
		||||
#include "porting.h"
 | 
			
		||||
 | 
			
		||||
#include <limits>
 | 
			
		||||
 | 
			
		||||
namespace sound {
 | 
			
		||||
 | 
			
		||||
void OpenALSoundManager::stepStreams(f32 dtime)
 | 
			
		||||
@@ -347,6 +349,13 @@ void OpenALSoundManager::updateListener(const v3f &pos_, const v3f &vel_,
 | 
			
		||||
 | 
			
		||||
void OpenALSoundManager::setListenerGain(f32 gain)
 | 
			
		||||
{
 | 
			
		||||
#if defined(__APPLE__)
 | 
			
		||||
	/* macOS OpenAL implementation ignore setting AL_GAIN to zero
 | 
			
		||||
	 * so we use smallest possible value
 | 
			
		||||
	 */
 | 
			
		||||
	if (gain == 0.0f)
 | 
			
		||||
		gain = std::numeric_limits<f32>::min();
 | 
			
		||||
#endif
 | 
			
		||||
	alListenerf(AL_GAIN, gain);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user