mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-12-03 13:35:56 +00:00
Refactor to derive_more
and clean up imports.
This commit is contained in:
parent
7055c53b9a
commit
3dada2fd8d
|
@ -12,6 +12,7 @@ alto = "3"
|
|||
anyhow = "1"
|
||||
bevy = { version = "0.6", default-features = false }
|
||||
claxon = "0.4"
|
||||
derive_more = "0.99"
|
||||
hound = "3"
|
||||
lewton = "0.10"
|
||||
minimp3 = "0.5"
|
26
src/lib.rs
26
src/lib.rs
|
@ -1,16 +1,11 @@
|
|||
use std::{
|
||||
collections::HashMap,
|
||||
io::Cursor,
|
||||
ops::{Deref, DerefMut},
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
pub use alto::efx;
|
||||
pub use alto::Context;
|
||||
pub use alto::Device;
|
||||
pub use alto::Source;
|
||||
use alto::{efx::AuxEffectSlot, ContextAttrs, SourceState};
|
||||
use alto::{Alto, Mono, StaticSource, Stereo};
|
||||
pub use alto::{efx, Context, Device, Source};
|
||||
use alto::{efx::AuxEffectSlot, Alto, ContextAttrs, Mono, SourceState, StaticSource, Stereo};
|
||||
use bevy::{
|
||||
asset::{AssetLoader, HandleId, LoadContext, LoadedAsset},
|
||||
prelude::*,
|
||||
|
@ -18,6 +13,7 @@ use bevy::{
|
|||
transform::TransformSystem,
|
||||
utils::BoxedFuture,
|
||||
};
|
||||
use derive_more::{Deref, DerefMut};
|
||||
use lewton::inside_ogg::OggStreamReader;
|
||||
use minimp3::{Decoder, Error};
|
||||
|
||||
|
@ -247,23 +243,9 @@ impl Sound {
|
|||
#[reflect(Component)]
|
||||
pub struct Listener;
|
||||
|
||||
#[derive(Default)]
|
||||
#[derive(Default, Deref, DerefMut)]
|
||||
pub struct GlobalEffects(Vec<AuxEffectSlot>);
|
||||
|
||||
impl Deref for GlobalEffects {
|
||||
type Target = Vec<AuxEffectSlot>;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl DerefMut for GlobalEffects {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
fn update_listener(
|
||||
context: ResMut<Context>,
|
||||
listener: Query<(Option<&Transform>, Option<&GlobalTransform>), With<Listener>>,
|
||||
|
|
Loading…
Reference in New Issue
Block a user