diff options
author | Chris Robinson <[email protected]> | 2013-10-27 16:20:47 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-10-27 16:20:47 -0700 |
commit | 3ed425d7ef2f9e3e06e579c5965ad6188ce1c19e (patch) | |
tree | 19114deec431441b1e105c6ba4b6b5fb974fb32e | |
parent | af8be56f17b5f00838be11d93c42cf0b69ba5af7 (diff) |
Move the ALCdevice handle to the ALCbackend base
-rw-r--r-- | Alc/ALc.c | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -110,10 +110,8 @@ static struct BackendInfo CaptureBackend; /* Wrapper to use an old-style backend with the new interface. */ typedef struct BackendWrapper { DERIVE_FROM_TYPE(ALCbackend); - - ALCdevice *mDevice; } BackendWrapper; -#define BACKENDWRAPPER_INITIALIZER { { GET_VTABLE2(ALCbackend, BackendWrapper) }, NULL } +#define BACKENDWRAPPER_INITIALIZER { { GET_VTABLE2(ALCbackend, BackendWrapper) } } static void BackendWrapper_Destruct(BackendWrapper* UNUSED(self)) { @@ -121,37 +119,37 @@ static void BackendWrapper_Destruct(BackendWrapper* UNUSED(self)) static ALCenum BackendWrapper_open(BackendWrapper *self, const ALCchar *name) { - ALCdevice *device = self->mDevice; + ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; return device->Funcs->OpenPlayback(device, name); } static void BackendWrapper_close(BackendWrapper *self) { - ALCdevice *device = self->mDevice; + ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; device->Funcs->ClosePlayback(device); } static ALCboolean BackendWrapper_reset(BackendWrapper *self) { - ALCdevice *device = self->mDevice; + ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; return device->Funcs->ResetPlayback(device); } static ALCboolean BackendWrapper_start(BackendWrapper *self) { - ALCdevice *device = self->mDevice; + ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; return device->Funcs->StartPlayback(device); } static void BackendWrapper_stop(BackendWrapper *self) { - ALCdevice *device = self->mDevice; + ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; device->Funcs->StopPlayback(device); } static ALint64 BackendWrapper_getLatency(BackendWrapper *self) { - ALCdevice *device = self->mDevice; + ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; return device->Funcs->GetLatency(device); } @@ -171,7 +169,7 @@ ALCbackend *create_backend_wrapper(ALCdevice *device) if(!backend) return NULL; SET_VTABLE2(BackendWrapper, ALCbackend, backend); - backend->mDevice = device; + STATIC_CAST(ALCbackend, backend)->mDevice = device; return STATIC_CAST(ALCbackend, backend); } |