From f286c3fa3857579a6c7cf84f32ff953e498577bf Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 30 Jul 2019 21:32:05 -0700 Subject: Move another function to a ALCcontext method --- alc/alcontext.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'alc/alcontext.h') diff --git a/alc/alcontext.h b/alc/alcontext.h index 9c2ce4a3..833d4c5b 100644 --- a/alc/alcontext.h +++ b/alc/alcontext.h @@ -9,16 +9,16 @@ #include "AL/al.h" #include "AL/alc.h" #include "AL/alext.h" -#include "inprogext.h" -#include "atomic.h" -#include "vector.h" -#include "threads.h" +#include "al/listener.h" #include "almalloc.h" #include "alnumeric.h" - -#include "al/listener.h" #include "alu.h" +#include "atomic.h" +#include "inprogext.h" +#include "logging.h" +#include "threads.h" +#include "vector.h" struct ALsource; @@ -159,9 +159,17 @@ struct ALCcontext { /** Resumes update processing after being deferred. */ void processUpdates(); + void setError(ALenum errorCode, const char *msg, ...) DECL_FORMAT(printf, 3, 4); + DEF_NEWDEL(ALCcontext) }; +#define SETERR_RETURN(ctx, err, retval, ...) do { \ + (ctx)->setError((err), __VA_ARGS__); \ + return retval; \ +} while(0) + + void UpdateContextProps(ALCcontext *context); @@ -224,4 +232,7 @@ struct ALcontextProps { std::atomic next; }; + +extern bool TrapALError; + #endif /* ALCONTEXT_H */ -- cgit v1.2.3