aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.cpp
diff options
context:
space:
mode:
authorBoris I. Bendovsky <[email protected]>2022-07-14 21:45:06 +0300
committerBoris I. Bendovsky <[email protected]>2022-07-17 20:59:05 +0300
commit1a2f659d89c116896dd6dcb0a4dd1b44bed37934 (patch)
treedaa2df3fd503ba2540b1fe93a1ad0ab85c787c06 /al/source.cpp
parent74c923edcebc5e6b4931ccf47b8292d828df653c (diff)
[EAX_SOURCE] Fix getting active FX slot IDs
Diffstat (limited to 'al/source.cpp')
-rw-r--r--al/source.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/al/source.cpp b/al/source.cpp
index 3bf65586..3d3c80b1 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -4488,6 +4488,15 @@ void ALsource::eax_set(const EaxCall& call)
eax_version_ = eax_version;
}
+void ALsource::eax_get_active_fx_slot_id(const EaxCall& call, const GUID* ids, int max_count)
+{
+ assert(ids != nullptr);
+ assert(max_count == EAX40_MAX_ACTIVE_FXSLOTS || max_count == EAX50_MAX_ACTIVE_FXSLOTS);
+ const auto dst_ids = call.get_values<GUID>(max_count);
+ const auto count = dst_ids.size();
+ std::uninitialized_copy_n(ids, count, dst_ids.begin());
+}
+
void ALsource::eax1_get(const EaxCall& call, const Eax1Props& props)
{
switch (call.get_property_id()) {
@@ -4733,7 +4742,7 @@ void ALsource::eax4_get(const EaxCall& call, const Eax4Props& props)
break;
case EAXSOURCE_ACTIVEFXSLOTID:
- call.set_value<Exception>(props.active_fx_slots);
+ eax_get_active_fx_slot_id(call, props.active_fx_slots.guidActiveFXSlots, EAX40_MAX_ACTIVE_FXSLOTS);
break;
default:
@@ -4805,7 +4814,7 @@ void ALsource::eax5_get(const EaxCall& call, const Eax5Props& props)
break;
case EAXSOURCE_ACTIVEFXSLOTID:
- call.set_value<Exception>(props.active_fx_slots);
+ eax_get_active_fx_slot_id(call, props.active_fx_slots.guidActiveFXSlots, EAX50_MAX_ACTIVE_FXSLOTS);
break;
case EAXSOURCE_MACROFXFACTOR: