7974 Commits

Author SHA1 Message Date
Glyn Leine
a752d920d1
constexpr functions are not allowed to have static variables, and if they are constexpr anyways then them being static has no benifit (#677) 2022-03-29 08:46:49 -07:00
Chris Robinson
b9ff9fa6d9 Avoid a variable to subscript an array in offsetof 2022-03-26 17:25:57 -07:00
Chris Robinson
e53013a549 Inline a couple dispatch calls 2022-03-26 05:28:46 -07:00
Chris Robinson
6d0bd1a532 Simplify some move assignments 2022-03-25 16:36:46 -07:00
Chris Robinson
b80dc50495 Protect intrusive_ptr and ComPtr from moving to itself 2022-03-25 03:47:43 -07:00
Chris Robinson
1ee34556a6 Try to improve assume_aligned for other compilers 2022-03-25 00:13:06 -07:00
Chris Robinson
96c151b45b Don't expose EAX reverb preset duplicates
The presets are already in their respective arrays, which makes the individual
globals redundant.
2022-03-24 16:13:16 -07:00
Chris Robinson
88d5c47e37 Simplify a couple offsetof statements 2022-03-24 16:12:23 -07:00
Chris Robinson
b168482ea3 Revert "Set the proper reverb effect defaults for EAX"
This reverts commit 964a11ef629fa3a89e827516a47949c858ce864c.
2022-03-24 00:51:02 -07:00
Chris Robinson
bdf18d60db Be more careful about checking compiler flags
Certain combinations of MSVC and CMake seem to allow all compiler flag checks
to pass, which was causing certain GCC attributes to be used on MSVC.
2022-03-23 23:40:54 -07:00
Chris Robinson
3b09b7761f Handle more modes with the ALC_OUTPUT_MODE_SOFT attribute 2022-03-23 19:13:21 -07:00
Chris Robinson
964a11ef62 Set the proper reverb effect defaults for EAX 2022-03-23 17:38:45 -07:00
Chris Robinson
8239e4c845 Better ensure attributes are properly traced 2022-03-17 13:26:49 -07:00
Chris Robinson
3d0500f823 Fix tracing the ALC_OUTPUT_MODE_SOFT attribute 2022-03-17 12:21:31 -07:00
Chris Robinson
8ca3186bac Ensure the EAX functions are suitably aligned on 32-bit 2022-03-16 20:32:09 -07:00
Chris Robinson
f903c1ea11 Make sure FX slots that aren't made active are disabled 2022-03-13 10:38:36 -07:00
Chris Robinson
e28937d1f6 Add options to reverse local X and Y coordinates
To go along with reverse-z on the other axii. This is only for games that have
position/orientation errors causing top-bottom (or left-right) inversion.
2022-03-10 22:37:02 -08:00
Chris Robinson
a2d34e4c2a Update comments about where to put config files 2022-03-10 20:53:16 -08:00
Chris Robinson
8e0164df96 Fix for some missing macros 2022-03-10 18:05:07 -08:00
Chris Robinson
609ee74211 Add a config option for reverse-z
The same as the __ALSOFT_REVERSE_Z env var, but in the config file. Should only
be used for per-game config files (either along side the executable, or setting
the ALSOFT_CONF env var when launching the app).
2022-03-10 17:47:42 -08:00
Chris Robinson
cfae2cc254 Use proper macros instead of magic numbers 2022-03-09 16:11:47 -08:00
Chris Robinson
90db129d60 Avoid a divide-by-zero in UhjDecoder::decodeStereo 2022-03-07 17:32:13 -08:00
Chris Robinson
1369a081a0 Fix X-RAM tracking 2022-03-06 01:19:41 -08:00
Chris Robinson
be3b37b7c9 Avoid a stateful unique_ptr deleter 2022-03-05 18:49:46 -08:00
Chris Robinson
776d62c1d1 Fix EAXSOURCE_ROLLOFFFACTOR
It should be added to AL_ROLLOFF_FACTOR.
2022-03-05 17:39:18 -08:00
Chris Robinson
cc3cae87b2 Set the MacroFXFactor default 2022-03-05 01:32:20 -08:00
Chris Robinson
2dc9cf170c Simplify committing EAX properties
Based on DirectSound's EAX behavior, committing any EAX property commits *all*
deferred property changes, not just the object being changed. So applying EAX
changes can be handled in one place.
2022-03-05 01:14:26 -08:00
Chris Robinson
7bec22abb6 Handle deferring for EAX 1 reverb
I don't know if EAX 1 actually handles deferring updates, but it will simplify
future changes.
2022-03-04 18:24:29 -08:00
Chris Robinson
2492d76896 Ensure deferred EAX effect properties are committed 2022-03-04 13:19:00 -08:00
Chris Robinson
240171a53d Fix the UHJ decoder parameters in uhjdecoder 2022-03-02 21:19:53 -08:00
Chris Robinson
63ac9c0b5d Fix applying the EAX context AirAbsorptionHF property 2022-03-02 21:18:13 -08:00
Chris Robinson
a98d6b2417 Fix applying air absorption 2022-03-02 16:58:26 -08:00
Chris Robinson
eea679eada Move some temp variables closer to where they're used 2022-03-02 15:34:09 -08:00
Chris Robinson
43682a8c3e Rework source send distance attenuation handling
Specifically, AL_[EAX]REVERB_ROOM_ROLLOFF_FACTOR always applies to an inverse
distance rolloff model, where the source's AL_ROOM_ROLLOFF_FACTOR applies to
the selected distance model. Consequently, the normal distance and cone
attenuation only needs to be calculated once for all sends, with the effect's
room rolloff calculated and applied separately.
2022-03-02 11:14:59 -08:00
Chris Robinson
fbac67a6a0 Rework the initial reverb decay
The idea here is that the initial reverb decay can't become less than the dry
path distance attenuation, as the dry attenuation represents the audio that has
not yet had a chance to start reflecting in the environment. As well, the
reference distance indicates where there is no distance attenuation, with any
initial attenuation set by the environment itself.

So what we do is use the dry path attenuation as the baseline for what's mixed
to the reverb, with the decay rate indicating how much of the remaining room
(non-direct) energy attenuates with distance.

This may be over-complicating it. Other sources hint at a more typical XdB per
doubling of distance, with X varying depending on environment properties (room
size, absorbancy, etc). This could be handled by applying a normal inverse
distance attenuation model, with a rolloff factor generated from the reverb
properties (density, decay rate, etc). Will need more testing and research.
2022-03-01 15:38:04 -08:00
Chris Robinson
d86f1ab476 Remove AL_SOFTX_filter_gain_ex
It was only added to try to help DSOAL, and it's not clear if it's even
necessary. But with native EAX API support, it certainly isn't necessary
anymore.
2022-02-28 12:57:18 -08:00
Chris Robinson
410f08c4e4 Forward the DriverIface constructor's name 2022-02-26 12:06:12 -08:00
Chris Robinson
c2d2ef2c0e Don't handle EFX functions in the router
Creative's wrapper driver doesn't handle them through alcGetProcAddress, at
least with a null device. For this to work properly, they'd have to be loaded
per-context instead of per-driver.
2022-02-26 10:41:06 -08:00
Chris Robinson
ab8b828c57 Use a more C99-compliant function cast 2022-02-26 07:42:28 -08:00
Chris Robinson
f9c45eac1a Use a more compatible method to check for EFX effects
Creative's wrapper driver doesn't seem to handle EFX enums for alGetEnumValue,
let alone return values only for what's supported. The only way to check which
filter and effect types it supports is try to set them and check for errors.
2022-02-26 07:38:36 -08:00
Chris Robinson
843a5aac6b Forward the (un)likely expression being cast to bool 2022-02-24 06:43:14 -08:00
Chris Robinson
b1559227b0 Make some structs nested 2022-02-23 10:37:09 -08:00
Chris Robinson
2564a3750f Remove unused atomic_invflag 2022-02-23 06:42:09 -08:00
Chris Robinson
625b0d380a Use function overloading to handle pthread_setname_np differences 2022-02-23 05:56:29 -08:00
Chris Robinson
598c1aa224 Default initialize a union
To silence an errant GCC warning
2022-02-23 03:03:20 -08:00
Chris Robinson
42bacc399b Fix an unused parameter warning
... when either pthread_setschedparam or RTKit aren't available.
2022-02-23 02:39:17 -08:00
Chris Robinson
357fb467fe Define the CoreAudio default name only when needed 2022-02-23 02:26:25 -08:00
Chris Robinson
cadf0d1de5 Make some local constexpr variables static 2022-02-23 01:29:28 -08:00
Chris Robinson
7176247529 Avoid an implicit char-to-bool conversion 2022-02-23 00:04:29 -08:00
Chris Robinson
234e55cc3c Explicitly define AmbDecConf's destructor
GCC complains it can't inline the destructor because it's "unlikely" to be
called and would bloat code size, despite being implicitly defined. Technically
accurate, but rather annoying since it's not explicitly called or defined.
2022-02-22 21:23:53 -08:00