mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-11-21 17:05:55 +00:00
Partial fix for pausing/resuming sources.
This commit is contained in:
parent
ba375532b6
commit
e9f7f2b9ff
|
@ -236,7 +236,12 @@ fn source_update(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SoundState::Playing => {
|
SoundState::Playing => {
|
||||||
if sound.source.is_none() {
|
if let Some(source) = sound.source.as_mut() {
|
||||||
|
let source_state = source.state();
|
||||||
|
if source_state == SourceState::Paused {
|
||||||
|
source.play();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
let mut source = context.new_static_source().unwrap();
|
let mut source = context.new_static_source().unwrap();
|
||||||
if let Some(buffer) = buffers.0.get(&sound.buffer.id) {
|
if let Some(buffer) = buffers.0.get(&sound.buffer.id) {
|
||||||
source.set_buffer(buffer.clone()).unwrap();
|
source.set_buffer(buffer.clone()).unwrap();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user