diff options
-rw-r--r-- | Alc/ALc.c | 19 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 15 | ||||
-rw-r--r-- | OpenAL32/alExtension.c | 1 | ||||
-rw-r--r-- | OpenAL32/alState.c | 45 |
4 files changed, 67 insertions, 13 deletions
@@ -275,6 +275,9 @@ static const ALCfunction alcFunctions[] = { { "alGetBufferSamplesSOFT", (ALCvoid *) alGetBufferSamplesSOFT }, { "alIsBufferFormatSupportedSOFT",(ALCvoid *) alIsBufferFormatSupportedSOFT}, + { "alDeferUpdatesSOFT", (ALCvoid *) alDeferUpdatesSOFT }, + { "alProcessUpdatesSOFT", (ALCvoid *) alProcessUpdatesSOFT }, + { NULL, (ALCvoid *) NULL } }; @@ -1539,7 +1542,6 @@ static ALvoid InitContext(ALCcontext *pContext) //Validate pContext pContext->LastError = AL_NO_ERROR; pContext->UpdateSources = AL_FALSE; - pContext->Suspended = AL_FALSE; pContext->ActiveSourceCount = 0; InitUIntMap(&pContext->SourceMap); InitUIntMap(&pContext->EffectSlotMap); @@ -1550,6 +1552,7 @@ static ALvoid InitContext(ALCcontext *pContext) pContext->DopplerFactor = 1.0f; pContext->DopplerVelocity = 1.0f; pContext->flSpeedOfSound = SPEEDOFSOUNDMETRESPERSEC; + pContext->DeferUpdates = AL_FALSE; pContext->ExtensionList = alExtList; } @@ -1759,12 +1762,9 @@ ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device) Not functional */ -ALC_API ALCvoid ALC_APIENTRY alcSuspendContext(ALCcontext *pContext) +ALC_API ALCvoid ALC_APIENTRY alcSuspendContext(ALCcontext *Context) { - LockLists(); - if(IsContext(pContext)) - pContext->Suspended = AL_TRUE; - UnlockLists(); + (void)Context; } @@ -1773,12 +1773,9 @@ ALC_API ALCvoid ALC_APIENTRY alcSuspendContext(ALCcontext *pContext) Not functional */ -ALC_API ALCvoid ALC_APIENTRY alcProcessContext(ALCcontext *pContext) +ALC_API ALCvoid ALC_APIENTRY alcProcessContext(ALCcontext *Context) { - LockLists(); - if(IsContext(pContext)) - pContext->Suspended = AL_FALSE; - UnlockLists(); + (void)Context; } diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index d9549cbf..a577db52 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -116,6 +116,17 @@ AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format); #define AL_VIRTUAL_CHANNELS_SOFT 0x1033 #endif +#ifndef AL_SOFT_deferred_updates +#define AL_SOFT_deferred_updates 1 +#define AL_DEFERRED_UPDATES_SOFT 0xC002 +typedef ALvoid (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void); +typedef ALvoid (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void); +#ifdef AL_ALEXT_PROTOTYPES +AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void); +AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void); +#endif +#endif + #if defined(HAVE_STDINT_H) #include <stdint.h> @@ -465,14 +476,14 @@ struct ALCcontext_struct ALenum LastError; ALboolean UpdateSources; - ALboolean Suspended; enum DistanceModel DistanceModel; - ALboolean SourceDistanceModel; + ALboolean SourceDistanceModel; ALfloat DopplerFactor; ALfloat DopplerVelocity; ALfloat flSpeedOfSound; + ALboolean DeferUpdates; struct ALsource **ActiveSources; ALsizei ActiveSourceCount; diff --git a/OpenAL32/alExtension.c b/OpenAL32/alExtension.c index ed6236b2..a986bc16 100644 --- a/OpenAL32/alExtension.c +++ b/OpenAL32/alExtension.c @@ -213,6 +213,7 @@ static const ALenums enumeration[] = { { "AL_DISTANCE_MODEL", AL_DISTANCE_MODEL }, { "AL_SPEED_OF_SOUND", AL_SPEED_OF_SOUND }, { "AL_SOURCE_DISTANCE_MODEL", AL_SOURCE_DISTANCE_MODEL }, + { "AL_DEFERRED_UPDATES_SOFT", AL_DEFERRED_UPDATES_SOFT }, // Distance Models { "AL_INVERSE_DISTANCE", AL_INVERSE_DISTANCE }, diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index 8bc50989..3c1ab9b8 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -138,6 +138,10 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname) value = AL_TRUE; break; + case AL_DEFERRED_UPDATES_SOFT: + value = Context->DeferUpdates; + break; + default: alSetError(Context, AL_INVALID_ENUM); break; @@ -174,6 +178,10 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname) value = (double)Context->flSpeedOfSound; break; + case AL_DEFERRED_UPDATES_SOFT: + value = (ALdouble)Context->DeferUpdates; + break; + default: alSetError(Context, AL_INVALID_ENUM); break; @@ -210,6 +218,10 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname) value = Context->flSpeedOfSound; break; + case AL_DEFERRED_UPDATES_SOFT: + value = (ALfloat)Context->DeferUpdates; + break; + default: alSetError(Context, AL_INVALID_ENUM); break; @@ -246,6 +258,10 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname) value = (ALint)Context->flSpeedOfSound; break; + case AL_DEFERRED_UPDATES_SOFT: + value = (ALint)Context->DeferUpdates; + break; + default: alSetError(Context, AL_INVALID_ENUM); break; @@ -268,6 +284,7 @@ AL_API ALvoid AL_APIENTRY alGetBooleanv(ALenum pname,ALboolean *data) case AL_DOPPLER_VELOCITY: case AL_DISTANCE_MODEL: case AL_SPEED_OF_SOUND: + case AL_DEFERRED_UPDATES_SOFT: *data = alGetBoolean(pname); return; } @@ -306,6 +323,7 @@ AL_API ALvoid AL_APIENTRY alGetDoublev(ALenum pname,ALdouble *data) case AL_DOPPLER_VELOCITY: case AL_DISTANCE_MODEL: case AL_SPEED_OF_SOUND: + case AL_DEFERRED_UPDATES_SOFT: *data = alGetDouble(pname); return; } @@ -344,6 +362,7 @@ AL_API ALvoid AL_APIENTRY alGetFloatv(ALenum pname,ALfloat *data) case AL_DOPPLER_VELOCITY: case AL_DISTANCE_MODEL: case AL_SPEED_OF_SOUND: + case AL_DEFERRED_UPDATES_SOFT: *data = alGetFloat(pname); return; } @@ -382,6 +401,7 @@ AL_API ALvoid AL_APIENTRY alGetIntegerv(ALenum pname,ALint *data) case AL_DOPPLER_VELOCITY: case AL_DISTANCE_MODEL: case AL_SPEED_OF_SOUND: + case AL_DEFERRED_UPDATES_SOFT: *data = alGetInteger(pname); return; } @@ -550,3 +570,28 @@ AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value) UnlockContext(Context); } + + +AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) +{ + ALCcontext *Context; + + Context = GetLockedContext(); + if(!Context) return; + + Context->DeferUpdates = AL_TRUE; + + UnlockContext(Context); +} + +AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void) +{ + ALCcontext *Context; + + Context = GetLockedContext(); + if(!Context) return; + + Context->DeferUpdates = AL_FALSE; + + UnlockContext(Context); +} |