From 4b7ac4a6ed290182de945274afd90fc4cece0283 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 30 Nov 2018 16:56:23 -0800 Subject: Don't bother making ALvoiceProps dynamically sized --- OpenAL32/Include/alu.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'OpenAL32/Include/alu.h') diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index e178a5a6..2ff69058 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -17,11 +17,13 @@ #include "math_defs.h" #include "filters/defs.h" #include "filters/nfc.h" +#include "almalloc.h" enum class DistanceModel; -#define MAX_PITCH (255) +#define MAX_PITCH 255 +#define MAX_SENDS 16 /* Maximum number of samples to pad on either end of a buffer for resampling. * Note that both the beginning and end need padding! @@ -29,10 +31,6 @@ enum class DistanceModel; #define MAX_RESAMPLE_PADDING 24 -#ifdef __cplusplus -extern "C" { -#endif - struct BSincTable; struct ALsource; struct ALbufferlistitem; @@ -144,8 +142,6 @@ typedef struct SendParams { struct ALvoiceProps { - std::atomic next; - ALfloat Pitch; ALfloat Gain; ALfloat OuterGain; @@ -194,7 +190,11 @@ struct ALvoiceProps { ALfloat HFReference; ALfloat GainLF; ALfloat LFReference; - } Send[]; + } Send[MAX_SENDS]; + + std::atomic next; + + DEF_NEWDEL(ALvoiceProps) }; #define VOICE_IS_STATIC (1<<0) @@ -203,13 +203,13 @@ struct ALvoiceProps { #define VOICE_HAS_NFC (1<<3) typedef struct ALvoice { - ALvoiceProps *Props; - std::atomic Update; std::atomic SourceID; std::atomic Playing; + ALvoiceProps Props; + /** * Source offset in samples, relative to the currently playing buffer, NOT * the whole queue, and the fractional (fixed-point) offset to the next @@ -487,8 +487,4 @@ extern ALfloat ConeScale; extern ALfloat ZScale; extern ALboolean OverrideReverbSpeedOfSound; -#ifdef __cplusplus -} -#endif - #endif -- cgit v1.2.3