From bded7763d01907e287fe1ed4c0885fc1e0c85574 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 27 Mar 2024 20:37:03 +0300 Subject: [PATCH 1/2] ALSpeaker start volume fix + 'master' channel is now forbidden to use in Lua --- src/audio/AL/ALAudio.cpp | 2 +- src/logic/scripting/lua/libaudio.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/audio/AL/ALAudio.cpp b/src/audio/AL/ALAudio.cpp index 1aa231e0..01cc71f6 100644 --- a/src/audio/AL/ALAudio.cpp +++ b/src/audio/AL/ALAudio.cpp @@ -259,7 +259,7 @@ void ALSpeaker::play() { paused = false; stopped = false; auto channel = get_channel(this->channel); - AL_CHECK(alSourcef(source, AL_GAIN, volume * channel->getVolume())); + AL_CHECK(alSourcef(source, AL_GAIN, volume * channel->getVolume() * get_channel(0)->getVolume())); AL_CHECK(alSourcePlay(source)); } diff --git a/src/logic/scripting/lua/libaudio.cpp b/src/logic/scripting/lua/libaudio.cpp index 04401ea5..19c7975a 100644 --- a/src/logic/scripting/lua/libaudio.cpp +++ b/src/logic/scripting/lua/libaudio.cpp @@ -13,7 +13,11 @@ inline int extract_channel_index(lua_State* L, int idx) { if (!lua_isnoneornil(L, idx)) { channel = lua_tostring(L, idx); } - return audio::get_channel_index(channel); + int index = audio::get_channel_index(channel); + if (index == 0) { + return -1; + } + return index; } inline audio::speakerid_t play_sound( From c7f503ad42194fd084a35c05bc024c4b1fd07383 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 27 Mar 2024 20:52:39 +0300 Subject: [PATCH 2/2] download link fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b6e6260..b248c8ed 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Run with compiled executable file: -[Download | Скачать](https://github.com/MihailRis/VoxelEngine-Cpp/releases/tag/v20.0) +[Download | Скачать](https://github.com/MihailRis/VoxelEngine-Cpp/releases/latest) # Controls: