Refactor to derive_more and clean up imports.

This commit is contained in:
Nolan Darilek 2022-01-25 12:27:07 -06:00
parent 7055c53b9a
commit 3dada2fd8d
2 changed files with 5 additions and 22 deletions

View File

@ -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"

View File

@ -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>>,