mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 06:21:50 +00:00
Merge branch 'main' into release-0.20
This commit is contained in:
commit
19f3708585
1 changed files with 3 additions and 1 deletions
|
|
@ -232,7 +232,7 @@ State ALSpeaker::getState() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
float ALSpeaker::getVolume() const {
|
float ALSpeaker::getVolume() const {
|
||||||
return AL::getSourcef(source, AL_GAIN);
|
return volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ALSpeaker::setVolume(float volume) {
|
void ALSpeaker::setVolume(float volume) {
|
||||||
|
|
@ -258,6 +258,8 @@ void ALSpeaker::setLoop(bool loop) {
|
||||||
void ALSpeaker::play() {
|
void ALSpeaker::play() {
|
||||||
paused = false;
|
paused = false;
|
||||||
stopped = false;
|
stopped = false;
|
||||||
|
auto channel = get_channel(this->channel);
|
||||||
|
AL_CHECK(alSourcef(source, AL_GAIN, volume * channel->getVolume()));
|
||||||
AL_CHECK(alSourcePlay(source));
|
AL_CHECK(alSourcePlay(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue