Commit Graph

8196 Commits (master)

Author SHA1 Message Date
Chris Robinson a1faa5d311 Change an inline function to a class method 2022-08-02 18:26:49 -07:00
Chris Robinson 810821a221 Simplify calculating nearest HRIR index 2022-08-02 18:26:49 -07:00
Chris Robinson a700edc171 Check the channel count for a valid DecoderView
Ambisonic decoders can be zeroth order, but they need at least one output
channel.
2022-08-02 18:26:49 -07:00
Eir W 5bea47915a
Add media class for Audio/Source/Virtual as a valid node (#747) 2022-08-02 18:26:29 -07:00
Chris Robinson b26ca6b65e Add missing include for FreeBSD 2022-07-29 03:06:07 -07:00
Chris Robinson 81b739abc1 AllocEffectSlot can't fail 2022-07-29 02:59:10 -07:00
Chris Robinson 339465c91f Use an intrusive_ptr to hold on to the EffectState 2022-07-29 01:49:30 -07:00
Chris Robinson f35eb64619 Ensure some mixing buffers are aligned for SIMD 2022-07-26 02:21:47 -07:00
Chris Robinson fdc0132f44 Mark the EffectSlot in use after getting one 2022-07-26 01:48:40 -07:00
Chris Robinson 7dcd2a86b8 Avoid __try on ARMv7 targets with MSVC 2022-07-24 17:09:50 -07:00
Chris Robinson e5786ceb59 Fix a typo in a comment 2022-07-22 18:31:32 -07:00
Chris Robinson 1b28a24f6e Don't assume rlim_t is unsigned 2022-07-22 17:29:50 -07:00
Chris Robinson 3f94e1c70a Update a config comment about the default sample rate 2022-07-21 12:48:44 -07:00
Chris Robinson a6ca55ca4e Use the reverb air absorption for the send paths 2022-07-19 22:38:36 -07:00
Chris Robinson 10eca3e7c3 Silence an inline failure warning with GCC 2022-07-19 15:48:40 -07:00
Chris Robinson 650a6d49e9 Declare variables closer to where they're used 2022-07-18 11:10:27 -07:00
Chris Robinson 0650d4ee70 Remove a redundant check
If src_occlusion_mb is 0, it'll be multiplied with whatever the ratio ends up
being, which will result in 0 anyway. A number of uses also already check the
occlusion value before calling the method.
2022-07-17 20:02:54 -07:00
Chris Robinson 0d2eeda9c1 Fix parameter signedness 2022-07-17 18:12:21 -07:00
Chris Robinson 263e9aab11 Update some outdated docs 2022-07-17 18:12:21 -07:00
Chris Robinson 4cbb271819 Avoid duplicate initializations for multiple filters
Just initialize the first and copy it to the others.
2022-07-17 18:12:21 -07:00
Edoardo Lolletti e28a49363e
Fix possible C2084 compiler error (#735)
* Fix possible C2084 compiler error

Guiddef.h uses a separate header guard to define the GUID operators, in the current codebase this won't cause any issue, but i got such error while fiddling a bit with the program and including something that ended up including all the various windows headers, that ended up including Guiddef.h, causing the error as by not finding the macro declared, it ended up declaring the inline operators as well.

* Update api.h
2022-07-17 18:11:32 -07:00
kcat c6064a2034
Merge pull request #734 from bibendovsky/wip_20220714
[EAX] Various fixes
2022-07-17 13:28:47 -07:00
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 6f3500f458
[EAX_FX_SLOT] Fix setting EAX5 flags 2022-07-17 20:59:07 +03:00
Boris I. Bendovsky 51a48e32ba
[EAX_CONTEXT] Fix defaults for current properties 2022-07-17 20:59:07 +03:00
Boris I. Bendovsky e24f124a89
[EAX_FX_SLOT] Fix defaults for current properties 2022-07-17 20:59:06 +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 f7b4dd002f
[EAX_CONTEXT] Fix committing of a property value 2022-07-17 20:59:05 +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
Boris I. Bendovsky 8de2a56068
[EAX_CALL] Clear defer flag for immediate-only properties
EAX allow to set "defer" flag on immediate-only properties. If we don't clear our flag then "applyAllUpdates" in EAX context won't be called.
2022-07-17 20:59:04 +03:00
Boris I. Bendovsky c88c5e6189
[EAX_FX_SLOT] Mark sources as changed instead of commiting them to catch up with changes in FX slot 2022-07-17 20:59:04 +03:00
Boris I. Bendovsky e9bb078806
[EAX_FX_SLOT] Fix EAXGet for EAX5 2022-07-17 20:58:55 +03:00
Chris Robinson 7b0776e33f Don't pass an EaxCall to initialize_fx_slots 2022-07-15 11:54:54 -07:00
Chris Robinson af5d4fb77d Don't store and manage wet buffers separately 2022-07-15 06:58:15 -07:00
Chris Robinson 0f4679981b Allocate EffectSlots in clusters 2022-07-15 06:14:25 -07:00
Chris Robinson 0b9fc03545 Dynamically allocate EffectSlot objects 2022-07-15 04:28:13 -07:00
Chris Robinson 07c2e786f5 Make a member function static 2022-07-13 05:28:42 -07:00
Chris Robinson c843efd322 Don't track dirty flags per EAX version
Only the current version's flags are used, and they're all reset when changing
versions, making it unnecessary to track non-current version flags.
2022-07-13 05:19:51 -07:00
Chris Robinson 86094e87a5 Don't commit EAX properties when not initialized 2022-07-13 04:49:39 -07:00
Boris I. Bendovsky 10c22f6f82
[EAX] Add separate context state for each version (#731) 2022-07-13 04:45:25 -07:00
Boris I. Bendovsky 6fb5cb553f
[EAX] Use separate FX slot state for each version (#730)
* [EAX] Use separate FX slot state for each version
[EAX] Don't defer FX slot properties

* [EAX_FXSLOT] Use mPropsDirty to defer update
[EAX_CONTEXT] Commit all updates on first initialization
2022-07-12 02:46:51 -07:00
Chris Robinson fa51c89549 Fix building on some MinGW systems
Some systems don't like having a space in the export declaration, with windres
interpreting the extra attributes as input files. GCC seems to accept the
attributes being "packed" together, which avoids the problem with windres.
2022-07-08 17:28:48 -07:00
Chris Robinson 1ad553b5a9 Add a config compat option for NFC distance scaling
Currently there's no way for an application to specify the "real world" scale
for in-game units. If the game doesn't use one unit to represent what should be
perceived as one meter to the user, the NFC filter's effect will be too near or
too far sounding. This allows adjusting the unit scale as applied to the NFC
filters only, correcting the misalignment.

This also removes the influence of EFX's MetersPerUnit from the NFC filters,
since many games don't use it, and those that do won't know it also influences
the perceived wave curvature along with the air absorption strength.
2022-07-07 22:11:38 -07:00
Chris Robinson edadd221ea Add a speaker-dist config option
This can be used to specify an average speaker distance without having the
modify the decoder config files. This also sets a default value of 1, letting
near-field effects work (if imprecisely) without an explicitly-configured
distance.
2022-07-07 14:58:09 -07:00
Chris Robinson 43b0afdab4 Properly update the Super Stereo width
Previously it would just keep using the set target, instead of tracking and
interpolating changes.
2022-07-07 02:01:20 -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 74b2e3b349 Remove an unused struct
And minor formatting cleanup
2022-07-05 09:27:44 -07:00
Chris Robinson 3ac78307ec Avoid separate lines for logging exceptions 2022-07-05 09:27:44 -07:00