Skip to content

Commit

Permalink
Force an EAX2 call to "initialize" EAX with 2.0 paramaeters
Browse files Browse the repository at this point in the history
This feels like an unnecessarily gross hack, but currently OpenAL Soft
initializes effects differently depending on what property version is used on
the first EAX call with the device (in part because EAX2 and EAX3/4/5 have
different default reverb values, with 2 being silent and 3/4/5 not, yet reverb
is silent by default in DSound).
  • Loading branch information
kcat committed Jun 16, 2022
1 parent e7bc895 commit a16c19f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dsound8.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,14 @@ static HRESULT DSShare_Create(REFIID guid, DeviceShare **out)
}
if(share->sources.maxhw_alloc > 0 && HAS_EXTENSION(share, EXT_EAX))
{
EAXSet(&DSPROPSETID_EAX20_BufferProperties, DSPROPERTY_EAX20BUFFER_COMMITDEFERREDSETTINGS,
share->sources.ids[0], NULL, 0);
EAXGet(&EAXPROPERTYID_EAX40_Source, EAXSOURCE_ALLPARAMETERS, share->sources.ids[0],
&share->default_srcprops, sizeof(share->default_srcprops));
EAXGet(&EAXPROPERTYID_EAX40_Source, EAXSOURCE_ALLSENDPARAMETERS, share->sources.ids[0],
&share->default_srcsend, sizeof(share->default_srcsend));
EAXGet(&EAXPROPERTYID_EAX40_Source, EAXSOURCE_ACTIVEFXSLOTID, share->sources.ids[0],
&share->default_srcslots, sizeof(share->default_srcslots));
share->default_srcslots[0] = GUID_NULL;
share->default_srcslots[1] = EAXPROPERTYID_EAX40_FXSlot0;
}
popALContext();

Expand Down

0 comments on commit a16c19f

Please sign in to comment.