mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-23 00:13:31 +00:00
Fixes and enhancements from my MCPE repository. (https://github.com/mschiller890/mcpe64)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user