diff options
Diffstat (limited to 'al/state.cpp')
-rw-r--r-- | al/state.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/al/state.cpp b/al/state.cpp index 10c7bc74..0ec0e280 100644 --- a/al/state.cpp +++ b/al/state.cpp @@ -46,6 +46,13 @@ #include "opthelpers.h" #include "strutils.h" +#if ALSOFT_EAX +#include "alc/device.h" + +#include "eax_globals.h" +#include "eax_x_ram.h" +#endif // ALSOFT_EAX + namespace { @@ -427,6 +434,41 @@ START_API_FUNC value = static_cast<int>(ResamplerDefault); break; +#if ALSOFT_EAX + +#define EAX_ERROR "[alGetInteger] EAX not enabled." + + case AL_EAX_RAM_SIZE: + if (eax_g_is_enabled) + { + value = eax_x_ram_max_size; + } + else + { + context->setError(AL_INVALID_VALUE, EAX_ERROR); + } + + break; + + case AL_EAX_RAM_FREE: + if (eax_g_is_enabled) + { + auto device = context->mALDevice.get(); + std::lock_guard<std::mutex> device_lock{device->BufferLock}; + + value = device->eax_x_ram_free_size; + } + else + { + context->setError(AL_INVALID_VALUE, EAX_ERROR); + } + + break; + +#undef EAX_ERROR + +#endif // ALSOFT_EAX + default: context->setError(AL_INVALID_VALUE, "Invalid integer property 0x%04x", pname); } |