We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f0aec4 commit 471a840Copy full SHA for 471a840
1 file changed
sp/src/public/soundflags.h
@@ -102,6 +102,10 @@ enum soundlevel_t
102
#define MAX_SNDLVL_VALUE ((1<<MAX_SNDLVL_BITS)-1)
103
104
105
+#if !defined(LINUX)
106
+#define ATTN_TO_SNDLVL( a ) (soundlevel_t)(int)((a) ? (50 + 20 / ((float)a)) : 0 )
107
+#define SNDLVL_TO_ATTN( a ) ((a > 50) ? (20.0f / (float)(a - 50)) : 4.0 )
108
+#else
109
inline soundlevel_t ATTN_TO_SNDLVL(float a)
110
{
111
soundlevel_t sndlvl = soundlevel_t::SNDLVL_NONE;
@@ -118,6 +122,7 @@ inline float SNDLVL_TO_ATTN(soundlevel_t s)
118
122
119
123
return (s > soundlevel_t::SNDLVL_50dB)? (20.0f / float(s - soundlevel_t::SNDLVL_50dB)) : 4.0f;
120
124
}
125
+#endif
121
126
127
// This is a limit due to network encoding.
128
// It encodes attenuation * 64 in 8 bits, so the maximum is (255 / 64)
0 commit comments