From d0f6a9b805b3f15744eb03e33d15b350f8cdc092 Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Mon, 9 Mar 2026 13:24:11 +0200 Subject: [PATCH] Fix: Sounds Problem: its not working xD --- src/client/Minecraft.cpp | 4 ++++ src/client/sound/Sound.h | 4 ++-- src/client/sound/SoundEngine.h | 4 ++-- src/platform/audio/SoundSystemAL.cpp | 10 +++++----- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 89a172f..0ccbdaa 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -737,6 +737,10 @@ void Minecraft::tickInput() { printf("%d\t%f\n", i, noise.grad2(i, 3, 8)); */ } + + // Change distance + if (key == Keyboard::KEY_F) + options.viewDistance = (options.viewDistance + 1) % 4; #endif #if defined(WIN32) if (key == Keyboard::KEY_F) { diff --git a/src/client/sound/Sound.h b/src/client/sound/Sound.h index 62f3db0..a6577e8 100755 --- a/src/client/sound/Sound.h +++ b/src/client/sound/Sound.h @@ -43,7 +43,7 @@ public: void destroy() const { if (isValid()) { - delete buffer; + delete buffer; buffer = 0; } } @@ -61,7 +61,7 @@ private: mutable char* buffer; }; -#if !defined(PRE_ANDROID23) && !defined(__APPLE__) && !defined(RPI) +#if !defined(PRE_ANDROID23) && !defined(__APPLE__) && !defined(RPI) extern SoundDesc SA_cloth1; extern SoundDesc SA_cloth2; diff --git a/src/client/sound/SoundEngine.h b/src/client/sound/SoundEngine.h index 21dd20a..1a59497 100755 --- a/src/client/sound/SoundEngine.h +++ b/src/client/sound/SoundEngine.h @@ -5,7 +5,7 @@ #if defined(ANDROID) && !defined(PRE_ANDROID23) #include "../../platform/audio/SoundSystemSL.h" -#elif defined(__APPLE__) +#elif defined(__APPLE__) || defined (PLATFORM_DESKTOP) #include "../../platform/audio/SoundSystemAL.h" #else #include "../../platform/audio/SoundSystem.h" @@ -23,7 +23,7 @@ class SoundEngine #if defined(ANDROID) && !defined(PRE_ANDROID23) && !defined(RPI) SoundSystemSL soundSystem; - #elif defined(__APPLE__) + #elif defined(__APPLE__) || defined (PLATFORM_DESKTOP) SoundSystemAL soundSystem; #else SoundSystem soundSystem; diff --git a/src/platform/audio/SoundSystemAL.cpp b/src/platform/audio/SoundSystemAL.cpp index 99de597..707ebe2 100755 --- a/src/platform/audio/SoundSystemAL.cpp +++ b/src/platform/audio/SoundSystemAL.cpp @@ -140,7 +140,7 @@ void SoundSystemAL::playAt( const SoundDesc& sound, float x, float y, float z, f { if (pitch < 0.01f) pitch = 1; - //LOGI("playing sound '%s' with volume/pitch: %f, %f @ %f, %f, %f\n", sound.name.c_str(), volume, pitch, x, y, z); + LOGI("playing sound '%s' with volume/pitch: %f, %f @ %f, %f, %f\n", sound.name.c_str(), volume, pitch, x, y, z); ALuint bufferID; if (!getBufferId(sound, &bufferID)) { @@ -151,7 +151,7 @@ void SoundSystemAL::playAt( const SoundDesc& sound, float x, float y, float z, f } errIdString = "Get buffer"; checkError(); - //LOGI("playing sound %d - '%s' with volume/pitch: %f, %f @ %f, %f, %f\n", bufferID, sound.name.c_str(), volume, pitch, x, y, z); + LOGI("playing sound %d - '%s' with volume/pitch: %f, %f @ %f, %f, %f\n", bufferID, sound.name.c_str(), volume, pitch, x, y, z); int sourceIndex; errIdString = "Get free index"; @@ -232,12 +232,12 @@ bool SoundSystemAL::getBufferId(const SoundDesc& sound, ALuint* buf) { : (sound.channels==2? AL_FORMAT_STEREO8 : AL_FORMAT_MONO8); alBufferData(bufferID, format, sound.frames, sound.size, sound.frameRate); - //LOGI("Creating %d (%p) from sound: '%s'\n", bufferID, sound.frames, sound.name.c_str()); + LOGI("Creating %d (%p) from sound: '%s'\n", bufferID, sound.frames, sound.name.c_str()); errIdString = "Buffer data"; - //LOGI("Creating buffer with data: %d (%d), %p, %d, %d\n", format, sound.byteWidth, sound.frames, sound.size, sound.frameRate); + LOGI("Creating buffer with data: %d (%d), %p, %d, %d\n", format, sound.byteWidth, sound.frames, sound.size, sound.frameRate); checkError(); - //LOGI("Sound ch: %d, fmt: %d, frames: %p, len: %f, fr: %d, sz: %d, numfr: %d\n", sound.channels, format, sound.frames, sound.length(), sound.frameRate, sound.size, sound.numFrames); + LOGI("Sound ch: %d, fmt: %d, frames: %p, len: %f, fr: %d, sz: %d, numfr: %d\n", sound.channels, format, sound.frames, sound.length(), sound.frameRate, sound.size, sound.numFrames); Buffer buffer;