196 Commits

Author SHA1 Message Date
Boris I. Bendovsky
7e9c0285b4
[EAX_SOURCE] Fix source's occlusion and exclusion contribution
Source's oclussion and exclusion properties should be taken into account only for listener's environment (see p. 16, p. 56, pp. 62-63 and p. 64 of "EAX® 4.0 Programmer’s Guide").
2022-07-17 21:06:41 +03:00
Boris I. Bendovsky
71ac63e5a8
[EAX_SOURCE] Skip occlusion calculation if occlusion property is zero 2022-07-17 20:59:06 +03:00
Boris I. Bendovsky
1f238a602f
[EAX_SOURCE] Fix Room and RoomHF contribution
Those properties should be taken into account only for environmental effect slot (see pp. 60-61 of "EAX® 4.0 Programmer’s Guide").
2022-07-17 20:59:06 +03:00
Boris I. Bendovsky
1a2f659d89
[EAX_SOURCE] Fix getting active FX slot IDs 2022-07-17 20:59:05 +03:00
Boris I. Bendovsky
74c923edce
[EAX_FX_SLOT] Fix slot's occlusion contribution 2022-07-17 20:59:05 +03:00
Chris Robinson
0b9fc03545 Dynamically allocate EffectSlot objects 2022-07-15 04:28:13 -07:00
Chris Robinson
e2f5ceba7b Don't always activate the EAX primary effect slot for sources
The context's primary effect slot should only be considered when the source's
active slot IDs include the primary effect slot.
2022-07-06 23:44:35 -07:00
Chris Robinson
af690871b1 Combine multiple individual flags 2022-06-19 08:04:30 -07:00
Chris Robinson
a6c099c63e Track EAX1 source changes
Even though it's only a single value, this allows for not having to explicitly
track version changes, since the version being changed to will always have a
property change, implicitly marking an EAX update/commit for the source.
2022-06-19 07:44:01 -07:00
Chris Robinson
ef8c7379ea Avoid changing the EAX version on failure 2022-06-18 15:58:21 -07:00
Chris Robinson
364e641142 Fix inverted checks 2022-06-18 15:53:59 -07:00
Chris Robinson
46be046ebb Don't mark the EAX version changed when getting properties 2022-06-18 15:02:53 -07:00
Chris Robinson
5cff007d33 Avoid a full struct compare to check for changes 2022-06-18 14:43:58 -07:00
Chris Robinson
83363e3332 Fix checking if the primary effect slot changed 2022-06-18 14:16:44 -07:00
Boris I. Bendovsky
d21ff67554
[EAX] Add separate source state for each version (#720) 2022-06-18 13:36:42 -07:00
Boris I. Bendovsky
074dbef2e3
[EAX] Add separate effect state for each version (#705)
* [EAX] Add separate effect state for each version

* [EAX] Don't use EAX call as data member
2022-05-24 02:19:14 -07:00
Chris Robinson
65e4c20c27 Move EAX files to their own sub-directory 2022-05-16 02:08:18 -07:00
Chris Robinson
d91b68ef8e Avoid some explicit extern "C"s on function definitions 2022-03-31 05:20:16 -07:00
Chris Robinson
6718a49486 Replace a few asserts with actual checks or ASSUME() 2022-03-30 05:01:06 -07:00
Chris Robinson
e53013a549 Inline a couple dispatch calls 2022-03-26 05:28:46 -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
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
9f44d99642 Revert "Use std::exchange instead of two swaps"
This reverts commit aa19223c65d8693dbaa8d8c9fa0c129d77eed4de.
2022-02-22 00:20:16 -08:00
Boris I. Bendovsky
4ffba10d51
Implement EAX v1.0 (#664) 2022-02-21 19:39:06 -08:00
Chris Robinson
39708f9831 Avoid a variable limit on EAX filters
I'll assume for now that the limits for the EAX properties will keep the filter
gain from getting out of hand. The filter's gainhf is relative to the gain and
is limited to 0dB max.
2022-02-18 07:02:38 -08:00
Chris Robinson
aa19223c65 Use std::exchange instead of two swaps 2022-02-15 23:15:42 -08:00
Chris Robinson
0591d90c10 Add missing closing brace 2022-02-14 05:04:49 -08:00
Chris Robinson
e0f87c44c0 Don't access a playing voice's mFlags outside of the mixer thread
It's updated asynchronously, and it's non-atomic, so it's unsafe to even read
since the mixer thread may be modifying it.
2022-02-14 04:18:48 -08:00
Chris Robinson
c6b301b72e Access the proper FX slot index 2022-02-14 03:04:46 -08:00
Chris Robinson
677ea00fa3 Avoid some messy type-punning 2022-02-14 02:18:53 -08:00
Chris Robinson
c156e30a48 Derive EaxFxSlotIndex from an optional 2022-02-14 00:20:45 -08:00
Chris Robinson
98de566bc8 Avoid an unnecessary check 2022-02-13 22:38:10 -08:00
Chris Robinson
3e6d210767 Avoid more unnecessary atomics 2022-02-13 21:00:57 -08:00
Chris Robinson
cdae6de689 Fix error messages for AL_STEREO_MODE_SOFT 2022-02-13 20:10:22 -08:00
Chris Robinson
7e485051c1 Remove unnecessary IsPlayingOrPaused calls
When followed by GetSourceVoice, a voice can only be returned if the source is
playing or paused, making it redundant.
2022-02-13 20:01:08 -08:00
Chris Robinson
3a450bacc7 Remove an unused return type 2022-02-13 19:54:09 -08:00
Chris Robinson
ea7c6f3e4e Don't make mPropsDirty atomic
It's only ever used under the ALCcontext::mPropLock mutex.
2022-02-13 19:37:45 -08:00
Chris Robinson
66f6cf121e Commit source EAX properties when not deferring
And make sure they get committed when resuming processing.
2022-02-13 17:22:41 -08:00
Chris Robinson
e04fd54206 Fix an exported symbol
The symbol only exists for compatibility due to it having been erroneously
exported in previous versions (even though it shouldn't have been used
directly, some apps could have).
2022-02-12 00:13:19 -08:00
Chris Robinson
3c9a705210 Handle AirAbsorptionGainHF as a native context property 2022-02-08 22:41:44 -08:00
Chris Robinson
7864895ab6 Ensure sources update together from EAX commits
... when a listener property change forces a commit.
2022-02-08 16:36:40 -08:00
Chris Robinson
6fb908bc38 Commit deferred EAX settings earlier when playing
Before the property update is supplied to the voice in InitVoice.
2022-02-08 11:00:12 -08:00
Chris Robinson
b2e0c3e002 Be less agressive with source updates on EAX changes 2022-02-08 10:00:34 -08:00
Boris I. Bendovsky
d420776808
EAX various fixes (#657)
* [EAX] Fix effect GUID validation

Only NULL and REVERB was valid.

* [EAX] Fix default FX slot flags

EAX4 and EAX5 both sets to ENVIRONMENT.

* [EAX] Set default values for legacy FX slots in the initialization

* [EAX] Fix FX slot locking policy

Fail on attempt to load an effect or change a lock for EAX4 "set" call.
Unlock legacy FX slots on any EAX5 call.

* [EAX] Allow DEFER flag for "get" calls.

* [EAX] Make speaker configuration read-only

* [EAX] Initialize speaker configuration

* [EAX] Commit EAX source on a 3D source parameter call

Reference: EAX 4.0 Programmer's Guide

* [EAX] Commit EAX source on a 3D listener parameter call

Reference: EAX 4.0 Programmer's Guide

* [EAX] Commit source when it begins to play

Reference: EAX 4.0 Programmer's Guide
2022-02-08 08:20:46 -08:00
Chris Robinson
f23c7fe8ba Avoid a proxy ALfilter object for EAX source properties 2022-02-07 13:53:57 -08:00
Chris Robinson
1807e083c8 Avoid eax_al_source_i/f wrappers 2022-02-07 11:44:14 -08:00
Chris Robinson
816bd8ab30 Move ALSOFT_EAX definition to config.h
And disable it by default for non-Windows targets
2022-01-30 05:42:44 -08:00
Boris I. Bendovsky
19ed994dc3
Add EAX extensions (EAX 2.0-5.0, X-RAM) (#632)
* Add EAX extensions (EAX 2.0-5.0, X-RAM)

* Comment out C++17 leftovers

* Remove everything related to patching

* Update alsoftrc.sample

* Rewrite integration

* Fix GCC compilation under Linux

* Always reset EAX effect properties when loading it into FX slot
2022-01-30 04:47:32 -08:00