mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 06:32:23 +01:00
macOS: make mute sound actually work (#15128)
This commit is contained in:
parent
2208fc0632
commit
733a019bf5
@ -29,6 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
#include "filesys.h"
|
#include "filesys.h"
|
||||||
#include "porting.h"
|
#include "porting.h"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
namespace sound {
|
namespace sound {
|
||||||
|
|
||||||
void OpenALSoundManager::stepStreams(f32 dtime)
|
void OpenALSoundManager::stepStreams(f32 dtime)
|
||||||
@ -347,6 +349,13 @@ void OpenALSoundManager::updateListener(const v3f &pos_, const v3f &vel_,
|
|||||||
|
|
||||||
void OpenALSoundManager::setListenerGain(f32 gain)
|
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);
|
alListenerf(AL_GAIN, gain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user