Fixes and enhancements from my MCPE repository. (https://github.com/mschiller890/mcpe64)

This commit is contained in:
Michal Schiller
2026-03-10 19:31:40 +01:00
parent 0c97ceb340
commit 2fc323639a
69 changed files with 2509 additions and 639 deletions

View File

@@ -43,6 +43,7 @@ public:
void destroy() const {
if (isValid()) {
delete buffer;
buffer = 0;
}
}
@@ -60,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;

View File

@@ -230,10 +230,13 @@ void SoundEngine::playUI(const std::string& name, float volume, float pitch) {}
void SoundEngine::play(const std::string& name, float x, float y, float z, float volume, float pitch) {
if ((volume *= options->sound) <= 0) return;
volume = Mth::clamp(volume, 0.0f, 1.0f);
volume = Mth::clamp( volume * _getVolumeMult(x, y, z), 0.0f, 1.0f);
if (/*!loaded || */options->sound == 0 || volume <= 0) return;
SoundDesc sound;
if (sounds.get(name, sound)) {
float dist = SOUND_DISTANCE;
if (volume > 1) dist *= volume;
soundSystem.playAt(sound, x-_x, y-_y, z-_z, volume, pitch);
}
}

View File

@@ -2,9 +2,10 @@
#define NET_MINECRAFT_CLIENT_SOUND__SoundEngine_H__
//package net.minecraft.client.sound;
#if defined(ANDROID) && !defined(PRE_ANDROID23)
#include "../../platform/audio/SoundSystemSL.h"
#elif (defined(__APPLE__) || defined (PLATFORM_DESKTOP)) && !defined(NO_SOUND)
#elif defined(__APPLE__) || defined(PLATFORM_DESKTOP)
#include "../../platform/audio/SoundSystemAL.h"
#else
#include "../../platform/audio/SoundSystem.h"
@@ -22,7 +23,7 @@ class SoundEngine
#if defined(ANDROID) && !defined(PRE_ANDROID23) && !defined(RPI)
SoundSystemSL soundSystem;
#elif (defined(__APPLE__) || defined (PLATFORM_DESKTOP)) && !defined(NO_SOUND)
#elif defined(__APPLE__) || defined(PLATFORM_DESKTOP)
SoundSystemAL soundSystem;
#else
SoundSystem soundSystem;