ALSpeaker start volume fix + 'master' channel is now forbidden to use in Lua
This commit is contained in:
parent
9e6b8caa94
commit
3b3c5f081c
@ -259,7 +259,7 @@ void ALSpeaker::play() {
|
|||||||
paused = false;
|
paused = false;
|
||||||
stopped = false;
|
stopped = false;
|
||||||
auto channel = get_channel(this->channel);
|
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));
|
AL_CHECK(alSourcePlay(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,11 @@ inline int extract_channel_index(lua_State* L, int idx) {
|
|||||||
if (!lua_isnoneornil(L, idx)) {
|
if (!lua_isnoneornil(L, idx)) {
|
||||||
channel = lua_tostring(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(
|
inline audio::speakerid_t play_sound(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user