diff --git a/scripts/DynamicLight.rb b/scripts/DynamicLight.rb index 42ae82d..7ddc252 100644 --- a/scripts/DynamicLight.rb +++ b/scripts/DynamicLight.rb @@ -149,7 +149,6 @@ class DynamicLight @plr_light_table end def plr_light_table=(val) - puts "aboba" @plr_light_table[0] = val&.[](0) || 0 @plr_light_table[1] = val&.[](1) || 0 @plr_light_table[2] = val&.[](2) || 1 @@ -166,6 +165,5 @@ class DynamicLight @plr_light_table[13] = val&.[](13) || 0 @plr_light_table[14] = val&.[](14) || 1 @plr_light_table[15] = val&.[](15) || 1 - puts "aboba2" end end \ No newline at end of file diff --git a/src/al-util.h b/src/al-util.h index 7edceee..50cec6b 100644 --- a/src/al-util.h +++ b/src/al-util.h @@ -26,6 +26,11 @@ #include #include #include "meow.h" + +#ifndef AL_DIRECT_CHANNELS_SOFT +#define AL_DIRECT_CHANNELS_SOFT 0x1033 +#endif + namespace AL{ #define DEF_AL_ID \ @@ -90,6 +95,7 @@ namespace Source{ inline Source::ID gen(){ Source::ID id; alGenSources(1, &id.al); + alSourcei(id.al, AL_DIRECT_CHANNELS_SOFT, AL_TRUE); return id; } diff --git a/src/sdlsoundsource.cpp b/src/sdlsoundsource.cpp index 09b8dfd..0149cdc 100644 --- a/src/sdlsoundsource.cpp +++ b/src/sdlsoundsource.cpp @@ -34,11 +34,17 @@ struct SDLSoundSource : ALDataSource{ ALenum alFormat; ALsizei alFreq; + SDL_AudioSpec spec; + SDLSoundSource(SDL_IOStream &ops, const char *extension, uint32_t maxBufSize, bool looped) : srcOps(ops), looped(looped) { - sample = Sound_NewSample(&srcOps, extension, 0, maxBufSize); + spec.format = SDL_AUDIO_S16LE; + spec.channels = 2; + spec.freq = 44100; + + sample = Sound_NewSample(&srcOps, extension, &spec, maxBufSize); if (!sample){ SDL_CloseIO(&ops); diff --git a/src/soundemitter.cpp b/src/soundemitter.cpp index 811a2e0..36996f0 100644 --- a/src/soundemitter.cpp +++ b/src/soundemitter.cpp @@ -174,12 +174,18 @@ void SoundEmitter::stop(){ struct SoundOpenHandler : FileSystem::OpenHandler{ SoundBuffer *buffer; + SDL_AudioSpec spec; + SoundOpenHandler() : buffer(0) - {} + { + spec.format = SDL_AUDIO_S16LE; + spec.channels = 2; + spec.freq = 44100; + } bool tryRead(SDL_IOStream* &ops, const char *ext){ - Sound_Sample *sample = Sound_NewSample(ops, ext, 0, STREAM_BUF_SIZE); + Sound_Sample *sample = Sound_NewSample(ops, ext, &spec, STREAM_BUF_SIZE); // df;lkjdsfl;kjgt;sjhdlhljkk;ljhgds;ljkglk;jdsl;fjgg;lhkjdsgklhjsdhl;jkg if (!sample){ SDL_CloseIO(ops);