34 Commits

Author SHA1 Message Date
Chris Robinson
053599b243 Avoid using the ATOMIC() macro 2018-11-26 14:48:26 -08:00
Chris Robinson
191ea90de3 Use atomic_flags and atomic<bools>s where appropriate 2018-11-20 10:45:01 -08:00
Chris Robinson
ad82a70a65 Use cleaner constructor/destructor calls for ALCcontext
Note that the actual type name is ALCcontext_struct, because of how it's
defined in AL/alc.h (ALCcontext is just an alias to struct ALCcontext_struct).
2018-11-18 05:40:00 -08:00
Chris Robinson
7433cb5f4c Avoid naming a struct member the same as an enum type 2018-11-18 03:39:32 -08:00
Chris Robinson
38d6df9c1d Store the listener directly in the context 2018-11-17 23:41:11 -08:00
Chris Robinson
e79d9bdd1a Move the vector and matrix declarations to a separate header 2018-11-17 23:21:37 -08:00
Chris Robinson
fa3c34268d Move the ALCcontext definition to its own header 2018-11-17 23:02:27 -08:00
Chris Robinson
a5f68c2121 Avoid using ATOMIC_FLAG
Although it cant potentially be better than a regular atomic, it presents
compatibility issues when non-C11 atomics are mixed with C++
2018-11-13 20:26:32 -08:00
Chris Robinson
1ab8902621 Re-update effect slots when context properties change
Also keep all free property update structs together in the context instead of
per-object.
2017-09-27 11:13:18 -07:00
Chris Robinson
fd70b0bca6 Don't update context and listener props unnecessarily 2017-09-27 09:36:34 -07:00
Chris Robinson
101d284a18 Update the context state properties separately
The context state properties are less likely to change compared to the listener
state, and future changes may prefer more infrequent updates to the context
state.

Note that this puts the MetersPerUnit in as a context state, even though it's
handled through the listener functions. Considering the infrequency that it's
updated at (generally set just once for the context's lifetime), it makes more
sense to put it there than with the more frequently updated listener
properties. The aforementioned future changes would also prefer MetersPerUnit
to not be updated unnecessarily.
2017-09-27 08:55:42 -07:00
Chris Robinson
369f52a0d7 Add an option to ignore the app's speed of sound for reverb decay 2017-09-22 05:42:04 -07:00
Chris Robinson
22d77b87a3 Store the default effect slot in the context 2017-07-13 21:44:25 -07:00
Chris Robinson
5ffb0842ac Remove unnecessary atomic members 2017-03-08 04:59:22 -08:00
Chris Robinson
c7eb0b7393 Don't pass the context's distance model as the source's 2016-08-23 19:17:17 -07:00
Chris Robinson
aff725cba3 Avoid redundantly storing distance model settings 2016-05-17 20:02:46 -07:00
Chris Robinson
aea7c85daa Use floats for the listener transforms 2016-05-16 18:28:46 -07:00
Chris Robinson
f751f5e25e Store the remaining context properties with the listener properties 2016-05-13 20:21:20 -07:00
Chris Robinson
186b54aa3d Use a lockless method for updating listener and context properties
This uses a separate container to provide the relevant properties to the
internal update method, using atomic pointer swaps. A free-list is used to
avoid having too many individual containers.

This allows the mixer to update the internal listener properties without
requiring the lock to protect against async updates. It also allows concurrent
read access to the user-facing property values, even the multi-value ones (e.g.
the vectors).
2016-05-11 21:02:11 -07:00
Chris Robinson
c2611f10ab Store more "active" listener and context properties separately
This helps ensure async listener/context property changes affect all playing
sources at the same time.
2016-05-09 11:26:49 -07:00
Chris Robinson
5d039309b3 Use doubles for the constructed listener matrix
This helps the stability of transforms to local space for sources that are at
or near the listener. With a single-precision matrix, even FLT_EPSILON might
not be enough to detect matching positions.
2015-11-11 08:19:33 -08:00
Chris Robinson
3b8f54d572 Use aluVector in some more places 2014-12-16 07:20:27 -08:00
Chris Robinson
97f6d302fe Add explicit matrix and vector types to operate with 2014-12-16 06:29:31 -08:00
Chris Robinson
815b03855b Apply the listener matrix to the listener velocity once 2012-10-12 07:56:37 -07:00
Chris Robinson
39bc2ba65c Build the listener matrix separately 2012-10-09 06:19:36 -07:00
Chris Robinson
d598f82722 Don't include alListener.h from alMain.h 2012-10-09 04:48:12 -07:00
Chris Robinson
9f58edd7a8 Fix up some more header includes 2012-09-14 02:42:36 -07:00
Chris Robinson
fcf9034c2b Calculate the listener matrix when a new orientation is specified
This is so the matrix isn't derived each time a source is updated, and it will
make supporting user-defined matrices easier.
2011-10-30 08:27:24 -07:00
Chris Robinson
ccd8cbc2a9 Make some listener properties volatile 2011-09-11 01:26:09 -07:00
Chris Robinson
ab0b5d9890 Hold the context lock only as needed when handling the listener 2011-08-31 00:33:33 -07:00
Chris Robinson
a337a59fb8 Use alext.h for extension definitions 2010-03-16 16:25:30 -07:00
Chris Robinson
28f80fa113 Add AL_METERS_PER_UNIT listener property 2007-12-17 19:40:43 -08:00
Chris Robinson
7086f5f84c Add new listener property definition 2007-12-17 17:55:27 -08:00
Chris Robinson
ae5f4e9a74 Initial import 2007-11-13 18:02:18 -08:00