mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-19 22:43:32 +00:00
Fix: Sounds (now properly)
This commit is contained in:
@@ -43,7 +43,6 @@ public:
|
|||||||
|
|
||||||
void destroy() const {
|
void destroy() const {
|
||||||
if (isValid()) {
|
if (isValid()) {
|
||||||
delete buffer;
|
|
||||||
buffer = 0;
|
buffer = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,14 +230,11 @@ 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) {
|
void SoundEngine::play(const std::string& name, float x, float y, float z, float volume, float pitch) {
|
||||||
if ((volume *= options->sound) <= 0) return;
|
if ((volume *= options->sound) <= 0) return;
|
||||||
|
|
||||||
volume = Mth::clamp( volume * _getVolumeMult(x, y, z), 0.0f, 1.0f);
|
volume = Mth::clamp(volume, 0.0f, 1.0f);
|
||||||
if (/*!loaded || */options->sound == 0 || volume <= 0) return;
|
|
||||||
|
|
||||||
SoundDesc sound;
|
SoundDesc sound;
|
||||||
if (sounds.get(name, sound)) {
|
if (sounds.get(name, sound)) {
|
||||||
float dist = SOUND_DISTANCE;
|
soundSystem.playAt(sound, x-_x, y-_y, z-_z, volume, pitch);
|
||||||
if (volume > 1) dist *= volume;
|
|
||||||
soundSystem.playAt(sound, x, y, z, volume, pitch);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void SoundEngine::playUI(const std::string& name, float volume, float pitch) {
|
void SoundEngine::playUI(const std::string& name, float volume, float pitch) {
|
||||||
|
|||||||
Reference in New Issue
Block a user