aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alSource.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-08-23 18:56:01 -0700
committerChris Robinson <[email protected]>2016-08-23 18:56:01 -0700
commitdc8b7814c771d08abe61656b745e7763a010a3a3 (patch)
tree9d1f91b7829d2a7d29654d708a837bbf6cfb99c3 /OpenAL32/Include/alSource.h
parentbd054632e0ba42ad93dd3bcad54042a126a65646 (diff)
Avoid resupplying unneeded source updates
The source's voice holds a copy of the last properties it received, so listener updates can make sources recalculate internal properties from that stored copy.
Diffstat (limited to 'OpenAL32/Include/alSource.h')
-rw-r--r--OpenAL32/Include/alSource.h71
1 files changed, 37 insertions, 34 deletions
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
index 74987b34..b288937a 100644
--- a/OpenAL32/Include/alSource.h
+++ b/OpenAL32/Include/alSource.h
@@ -22,40 +22,6 @@ typedef struct ALbufferlistitem {
} ALbufferlistitem;
-typedef struct ALvoice {
- struct ALsource *volatile Source;
-
- /** Current target parameters used for mixing. */
- ALint Step;
-
- /* If not 'moving', gain/coefficients are set directly without fading. */
- ALboolean Moving;
-
- ALboolean IsHrtf;
-
- ALuint Offset; /* Number of output samples mixed since starting. */
-
- alignas(16) ALfloat PrevSamples[MAX_INPUT_CHANNELS][MAX_PRE_SAMPLES];
-
- BsincState SincState;
-
- struct {
- ALfloat (*Buffer)[BUFFERSIZE];
- ALuint Channels;
- } DirectOut;
-
- struct {
- ALfloat (*Buffer)[BUFFERSIZE];
- ALuint Channels;
- } SendOut[MAX_SENDS];
-
- struct {
- DirectParams Direct;
- SendParams Send[MAX_SENDS];
- } Chan[MAX_INPUT_CHANNELS];
-} ALvoice;
-
-
struct ALsourceProps {
ATOMIC(ALfloat) Pitch;
ATOMIC(ALfloat) Gain;
@@ -108,6 +74,43 @@ struct ALsourceProps {
ATOMIC(struct ALsourceProps*) next;
};
+
+typedef struct ALvoice {
+ struct ALsourceProps Props;
+
+ struct ALsource *volatile Source;
+
+ /** Current target parameters used for mixing. */
+ ALint Step;
+
+ /* If not 'moving', gain/coefficients are set directly without fading. */
+ ALboolean Moving;
+
+ ALboolean IsHrtf;
+
+ ALuint Offset; /* Number of output samples mixed since starting. */
+
+ alignas(16) ALfloat PrevSamples[MAX_INPUT_CHANNELS][MAX_PRE_SAMPLES];
+
+ BsincState SincState;
+
+ struct {
+ ALfloat (*Buffer)[BUFFERSIZE];
+ ALuint Channels;
+ } DirectOut;
+
+ struct {
+ ALfloat (*Buffer)[BUFFERSIZE];
+ ALuint Channels;
+ } SendOut[MAX_SENDS];
+
+ struct {
+ DirectParams Direct;
+ SendParams Send[MAX_SENDS];
+ } Chan[MAX_INPUT_CHANNELS];
+} ALvoice;
+
+
typedef struct ALsource {
/** Source properties. */
ALfloat Pitch;