Skip to content

Commit

Permalink
Restore EAX effects through OpenAL's EFX.
Browse files Browse the repository at this point in the history
  • Loading branch information
Deledrius committed Jun 13, 2021
1 parent 33811bd commit 939b9f4
Show file tree
Hide file tree
Showing 9 changed files with 422 additions and 395 deletions.
2 changes: 1 addition & 1 deletion Sources/Plasma/Apps/plClient/plClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ void plClient::IDetectAudioVideoSettings()
} else {
stream = plEncryptedStream::OpenEncryptedFileWrite(audioIniFile);
WriteBool(stream, "Audio.Initialize", true);
WriteBool(stream, "Audio.UseEAX", false);
WriteBool(stream, "Audio.UseEAX", true);
WriteInt(stream, "Audio.SetPriorityCutoff", 6);
WriteInt(stream, "Audio.MuteAll", false);
WriteInt(stream, "Audio.SetChannelVolume SoundFX", 1);
Expand Down
16 changes: 7 additions & 9 deletions Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ You can contact Cyan Worlds, Inc. by email [email protected]
#include "HeadSpin.h"
#include <al.h>
#include <efx.h>
#ifdef EAX_SDK_AVAILABLE
#include <eax.h>
#endif
#include <memory>
#include <array>

Expand Down Expand Up @@ -304,6 +301,7 @@ bool plAudioSystem::Init()
plStatusLog::AddLineSF("audio.log", "OpenAL version: {}", alGetString(AL_VERSION));
plStatusLog::AddLineSF("audio.log", "OpenAL renderer: {}", alGetString(AL_RENDERER));
plStatusLog::AddLineSF("audio.log", "OpenAL extensions: {}", alGetString(AL_EXTENSIONS));
plStatusLog::AddLineSF("audio.log", "OpenAL context extensions: {}", alcGetString(fPlaybackDevice, ALC_EXTENSIONS));
plStatusLog::AddLineS("audio.log", plStatusLog::kGreen, "ASYS: Detecting caps...");

// Detect maximum number of voices that can be created.
Expand All @@ -323,15 +321,15 @@ bool plAudioSystem::Init()
plStatusLog::AddLineSF("audio.log", "Max Number of sources: {}", fMaxNumSources);
SetMaxNumberOfActiveSounds();

// TODO: Detect EAX support. Not adding this in now until the replacement is implemented.
// TODO: Detect EFX support.

// attempt to init the EAX listener.
if (plgAudioSys::fEnableEAX) {
fUsingEAX = plEAXListener::GetInstance().Init();
// attempt to init the EFX listener.
if (true || plgAudioSys::fEnableEAX) {
fUsingEAX = plEAXListener::GetInstance().Init(fPlaybackDevice);
if (fUsingEAX)
plStatusLog::AddLineS("audio.log", plStatusLog::kGreen, "ASYS: EAX support detected and enabled.");
plStatusLog::AddLineS("audio.log", plStatusLog::kGreen, "ASYS: EFX support detected and enabled.");
else
plStatusLog::AddLineS("audio.log", plStatusLog::kRed, "ASYS: EAX support NOT detected. EAX effects disabled.");
plStatusLog::AddLineS("audio.log", plStatusLog::kRed, "ASYS: EFX support NOT detected. EAX effects disabled.");
} else {
fUsingEAX = false;
}
Expand Down
3 changes: 0 additions & 3 deletions Sources/Plasma/PubUtilLib/plAudio/plAudioSystem_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ You can contact Cyan Worlds, Inc. by email [email protected]
#include <al.h>
#include <alc.h>
#include <efx.h>
#ifdef EAX_SDK_AVAILABLE
#include <eax.h>
#endif
#include <memory>
#include <set>

Expand Down
Loading

0 comments on commit 939b9f4

Please sign in to comment.