mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-25 06:15:30 +03:00
Fix soundlevel_t compile error on VS2013
This commit is contained in:
parent
7f0aec4371
commit
471a840ed9
@ -102,6 +102,10 @@ enum soundlevel_t
|
||||
#define MAX_SNDLVL_VALUE ((1<<MAX_SNDLVL_BITS)-1)
|
||||
|
||||
|
||||
#if !defined(LINUX)
|
||||
#define ATTN_TO_SNDLVL( a ) (soundlevel_t)(int)((a) ? (50 + 20 / ((float)a)) : 0 )
|
||||
#define SNDLVL_TO_ATTN( a ) ((a > 50) ? (20.0f / (float)(a - 50)) : 4.0 )
|
||||
#else
|
||||
inline soundlevel_t ATTN_TO_SNDLVL(float a)
|
||||
{
|
||||
soundlevel_t sndlvl = soundlevel_t::SNDLVL_NONE;
|
||||
@ -118,6 +122,7 @@ inline float SNDLVL_TO_ATTN(soundlevel_t s)
|
||||
{
|
||||
return (s > soundlevel_t::SNDLVL_50dB)? (20.0f / float(s - soundlevel_t::SNDLVL_50dB)) : 4.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
// This is a limit due to network encoding.
|
||||
// It encodes attenuation * 64 in 8 bits, so the maximum is (255 / 64)
|
||||
|
Loading…
Reference in New Issue
Block a user