diff options
author | Chris Robinson <[email protected]> | 2009-08-16 00:54:08 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-08-16 00:54:08 -0700 |
commit | 0b7eb9f118a259f4bc666140093b6be7dcf01158 (patch) | |
tree | 808f71536e3df4b38d0b9e9eae76e25a372ef33d /OpenAL32/alBuffer.c | |
parent | dc26261065a7ff78657ac79accc993c78069deca (diff) |
Add in-progress working extension AL_EXTX_sample_buffer_object
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r-- | OpenAL32/alBuffer.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index cfac55d7..ebd4cf20 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -28,6 +28,7 @@ #include "AL/alc.h" #include "alError.h" #include "alBuffer.h" +#include "alDatabuffer.h" #include "alThunk.h" @@ -270,6 +271,22 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d if (alIsBuffer(buffer) && (buffer != 0)) { ALBuf=((ALbuffer *)ALTHUNK_LOOKUPENTRY(buffer)); + + if(Context->SampleSource) + { + ALuint offset; + + if(Context->SampleSource->state == MAPPED) + { + alSetError(AL_INVALID_OPERATION); + ProcessContext(Context); + return; + } + + offset = (ALuint)data; + data = Context->SampleSource->data + offset; + } + if ((ALBuf->refcount==0)&&(data)) { switch(format) @@ -422,6 +439,22 @@ ALvoid ALAPIENTRY alBufferSubDataEXT(ALuint buffer,ALenum format,const ALvoid *d if(alIsBuffer(buffer) && buffer != 0) { ALBuf = (ALbuffer*)ALTHUNK_LOOKUPENTRY(buffer); + + if(Context->SampleSource) + { + ALuint offset; + + if(Context->SampleSource->state == MAPPED) + { + alSetError(AL_INVALID_OPERATION); + ProcessContext(Context); + return; + } + + offset = (ALuint)data; + data = Context->SampleSource->data + offset; + } + if(ALBuf->data == NULL) { // buffer does not have any data |