summaryrefslogtreecommitdiffstats
path: root/src/audio/sampman_oal.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-01-04 21:46:50 +0100
committerSergeanur <s.anureev@yandex.ua>2021-01-04 21:48:43 +0100
commit150f5302b735331780815194fb7d397a477fcb19 (patch)
treedd731ae44e542b91090009bddff4dc17e9f4cdcc /src/audio/sampman_oal.cpp
parentFix CEntity::UpdateRwFrame (diff)
downloadre3-150f5302b735331780815194fb7d397a477fcb19.tar
re3-150f5302b735331780815194fb7d397a477fcb19.tar.gz
re3-150f5302b735331780815194fb7d397a477fcb19.tar.bz2
re3-150f5302b735331780815194fb7d397a477fcb19.tar.lz
re3-150f5302b735331780815194fb7d397a477fcb19.tar.xz
re3-150f5302b735331780815194fb7d397a477fcb19.tar.zst
re3-150f5302b735331780815194fb7d397a477fcb19.zip
Diffstat (limited to 'src/audio/sampman_oal.cpp')
-rw-r--r--src/audio/sampman_oal.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp
index 7d6f429d..5579644c 100644
--- a/src/audio/sampman_oal.cpp
+++ b/src/audio/sampman_oal.cpp
@@ -102,7 +102,7 @@ CChannel aChannel[MAXCHANNELS+MAX2DCHANNELS];
uint8 nChannelVolume[MAXCHANNELS+MAX2DCHANNELS];
uint32 nStreamLength[TOTAL_STREAMED_SOUNDS];
-ALuint ALStreamSources[MAX_STREAMS];
+ALuint ALStreamSources[MAX_STREAMS][2];
ALuint ALStreamBuffers[MAX_STREAMS][NUM_STREAMBUFFERS];
struct tMP3Entry
@@ -245,9 +245,9 @@ release_existing()
if (stream)
stream->ProviderTerm();
- alDeleteSources(1, &ALStreamSources[i]);
alDeleteBuffers(NUM_STREAMBUFFERS, ALStreamBuffers[i]);
}
+ alDeleteSources(MAX_STREAMS*2, ALStreamSources[0]);
CChannel::DestroyChannels();
@@ -287,7 +287,10 @@ set_new_provider(int index)
//TODO:
_maxSamples = MAXCHANNELS;
- ALCint attr[] = {ALC_FREQUENCY,MAX_FREQ,0};
+ ALCint attr[] = {ALC_FREQUENCY,MAX_FREQ,
+ ALC_MONO_SOURCES, MAX_STREAMS * 2 + MAXCHANNELS,
+ 0,
+ };
ALDevice = alcOpenDevice(providers[index].id);
ASSERT(ALDevice != NULL);
@@ -319,11 +322,17 @@ set_new_provider(int index)
alGenAuxiliaryEffectSlots(1, &ALEffectSlot);
alGenEffects(1, &ALEffect);
}
-
+
+ alGenSources(MAX_STREAMS*2, ALStreamSources[0]);
for ( int32 i = 0; i < MAX_STREAMS; i++ )
{
- alGenSources(1, &ALStreamSources[i]);
- alGenBuffers(NUM_STREAMBUFFERS, ALStreamBuffers[i]);
+ alGenBuffers(NUM_STREAMBUFFERS, ALStreamBuffers[i]);
+ alSourcei(ALStreamSources[i][0], AL_SOURCE_RELATIVE, AL_TRUE);
+ alSource3f(ALStreamSources[i][0], AL_POSITION, 0.0f, 0.0f, 0.0f);
+ alSourcef(ALStreamSources[i][0], AL_GAIN, 1.0f);
+ alSourcei(ALStreamSources[i][1], AL_SOURCE_RELATIVE, AL_TRUE);
+ alSource3f(ALStreamSources[i][1], AL_POSITION, 0.0f, 0.0f, 0.0f);
+ alSourcef(ALStreamSources[i][1], AL_GAIN, 1.0f);
CStream *stream = aStream[i];
if (stream)