diff options
author | Chris Robinson <[email protected]> | 2009-08-16 16:02:13 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-08-16 16:02:13 -0700 |
commit | c8f700930a08c2652c2fee312f1de20a14433af1 (patch) | |
tree | 54367054115ce389f0fd1a9f2fb18139be49df4d /OpenAL32/alError.c | |
parent | decbe4df454214a9f68ad5c7a19379d9ceb80413 (diff) |
More modifications and fixes for context checks
Diffstat (limited to 'OpenAL32/alError.c')
-rw-r--r-- | OpenAL32/alError.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/OpenAL32/alError.c b/OpenAL32/alError.c index 0ffb5e6b..f6c430a2 100644 --- a/OpenAL32/alError.c +++ b/OpenAL32/alError.c @@ -26,32 +26,29 @@ ALAPI ALenum ALAPIENTRY alGetError(ALvoid) { - ALCcontext *Context; - ALenum errorCode; + ALCcontext *Context; + ALenum errorCode; - Context = GetContextSuspended(); + Context = GetContextSuspended(); + if(!Context) return AL_INVALID_OPERATION; - if (Context) - { - errorCode = Context->LastError; - Context->LastError = AL_NO_ERROR; - } - else - errorCode = AL_INVALID_OPERATION; + errorCode = Context->LastError; + Context->LastError = AL_NO_ERROR; - ProcessContext(Context); + ProcessContext(Context); - return errorCode; + return errorCode; } ALvoid alSetError(ALenum errorCode) { - ALCcontext *Context; - - Context=GetContextSuspended(); - - if (Context && Context->LastError == AL_NO_ERROR) - Context->LastError = errorCode; - - ProcessContext(Context); + ALCcontext *Context; + + Context = GetContextSuspended(); + if(Context) + { + if(Context->LastError == AL_NO_ERROR) + Context->LastError = errorCode; + ProcessContext(Context); + } } |