Skip to content

Commit

Permalink
Fix a lot of everything else
Browse files Browse the repository at this point in the history
  • Loading branch information
distransient committed Jul 14, 2019
1 parent 535fb78 commit 8a54251
Show file tree
Hide file tree
Showing 76 changed files with 198 additions and 192 deletions.
8 changes: 3 additions & 5 deletions amethyst_assets/examples/hl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ use serde::{Deserialize, Serialize};

use amethyst_assets::*;
use amethyst_core::{
ecs::{
prelude::{
Builder, Dispatcher, DispatcherBuilder, Read, ReadExpect, System, VecStorage, World, WorldExt,
Write,
},
ecs::prelude::{
Builder, Dispatcher, DispatcherBuilder, Read, ReadExpect, System, VecStorage, World,
WorldExt, Write,
},
Time,
};
Expand Down
5 changes: 4 additions & 1 deletion amethyst_assets/src/helper.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use std::{borrow::Borrow, hash::Hash};

use amethyst_core::ecs::{Read, ReadExpect, World, shred::{SystemData, ResourceId}};
use amethyst_core::ecs::{
shred::{ResourceId, SystemData},
Read, ReadExpect, World,
};

use crate::{Asset, AssetStorage, Format, Handle, Loader, Progress};

Expand Down
3 changes: 2 additions & 1 deletion amethyst_assets/src/prefab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ use std::marker::PhantomData;
use serde::{Deserialize, Serialize};

use amethyst_core::ecs::prelude::{
Component, DenseVecStorage, Entity, FlaggedStorage, Read, ReadExpect, SystemData, WriteStorage, World, ResourceId
Component, DenseVecStorage, Entity, FlaggedStorage, Read, ReadExpect, ResourceId, SystemData,
World, WriteStorage,
};
use amethyst_error::Error;

Expand Down
2 changes: 1 addition & 1 deletion amethyst_assets/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use rayon::ThreadPool;

use amethyst_core::{
ecs::{
hibitset::BitSet,
prelude::{Component, Read, ReadExpect, System, VecStorage, Write},
storage::UnprotectedStorage,
hibitset::BitSet
},
Time,
};
Expand Down
3 changes: 2 additions & 1 deletion amethyst_audio/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ pub fn outputs() -> OutputIterator {
/// Initialize default output
pub fn init_output(world: &mut World) {
if let Some(o) = default_output() {
world.entry::<AudioSink>()
world
.entry::<AudioSink>()
.or_insert_with(|| AudioSink::new(&o));
world.entry::<Output>().or_insert_with(|| o);
} else {
Expand Down
2 changes: 1 addition & 1 deletion amethyst_audio/src/systems/dj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use thread_profiler::profile_scope;

use amethyst_assets::AssetStorage;
use amethyst_core::{
ecs::prelude::{Read, System, World, WriteExpect, SystemData},
ecs::prelude::{Read, System, SystemData, World, WriteExpect},
shred::Resource,
};

Expand Down
8 changes: 2 additions & 6 deletions amethyst_controls/src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ impl FreeRotationSystem {
pub fn new(mut world: &mut World, sensitivity_x: f32, sensitivity_y: f32) -> Self {
use amethyst_core::ecs::prelude::SystemData;
<Self as System<'_>>::SystemData::setup(&mut world);
let event_reader = world
.fetch_mut::<EventChannel<Event>>()
.register_reader();
let event_reader = world.fetch_mut::<EventChannel<Event>>().register_reader();
FreeRotationSystem {
sensitivity_x,
sensitivity_y,
Expand Down Expand Up @@ -191,9 +189,7 @@ impl MouseFocusUpdateSystem {
pub fn new(mut world: &mut World) -> MouseFocusUpdateSystem {
use amethyst_core::ecs::prelude::SystemData;
<Self as System<'_>>::SystemData::setup(&mut world);
let event_reader = world
.fetch_mut::<EventChannel<Event>>()
.register_reader();
let event_reader = world.fetch_mut::<EventChannel<Event>>().register_reader();
Self { event_reader }
}
}
Expand Down
2 changes: 1 addition & 1 deletion amethyst_core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub trait EventReader<'a> {
#[cfg(test)]
mod tests {
use crate::ecs::Read;
use shrev::{EventChannel, ReaderId};
use crate::shrev::{EventChannel, ReaderId};

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion amethyst_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ pub use alga;
pub use approx;
pub use nalgebra as math;
pub use num_traits as num;
pub use specs as ecs;
pub use specs::shred;
pub use specs::shrev;
pub use specs as ecs;

use rayon;

Expand Down
10 changes: 5 additions & 5 deletions amethyst_core/src/transform/systems.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//! Scene graph system and types
use crate::ecs::{
hibitset::BitSet,
prelude::{
ComponentEvent, Entities, Join, ReadExpect, ReadStorage, ReaderId, System, World, WriteStorage,
ComponentEvent, Entities, Join, ReadExpect, ReadStorage, ReaderId, System, World,
WriteStorage,
},
hibitset::BitSet,
};

use crate::transform::{HierarchyEvent, Parent, ParentHierarchy, Transform};
Expand Down Expand Up @@ -126,12 +127,11 @@ impl<'a> System<'a> for TransformSystem {
mod tests {
use crate::{
ecs::{
prelude::{Builder, World, WorldExt},
shred::RunNow,
prelude::{Builder, World},
},
math::{Matrix4, Quaternion, Unit, Vector3},
};
use shred::RunNow;
use specs_hierarchy::{Hierarchy, HierarchySystem};

use crate::transform::{Parent, Transform, TransformSystem};
Expand All @@ -154,7 +154,7 @@ mod tests {
fn transform_world() -> (World, HierarchySystem<Parent>, TransformSystem) {
let mut world = World::new();
let mut hs = HierarchySystem::<Parent>::new();
let mut ts = TransformSystem::new();
let mut ts = TransformSystem::new(&mut world);
hs.setup(&mut world);
ts.setup(&mut world);

Expand Down
2 changes: 1 addition & 1 deletion amethyst_derive/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use amethyst_derive::{EventReader, PrefabData};

use amethyst_assets::{PrefabData, ProgressCounter};
use amethyst_core::{
ecs::{Component, DenseVecStorage, Entity, Read, World, SystemData, WriteStorage},
ecs::{Component, DenseVecStorage, Entity, Read, SystemData, World, WriteStorage},
shrev::{EventChannel, ReaderId},
EventReader,
};
Expand Down
2 changes: 1 addition & 1 deletion amethyst_input/src/sdl_events_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use sdl2::{
};

use amethyst_core::{
ecs::prelude::{World, RunNow, SystemData, Write},
ecs::prelude::{RunNow, SystemData, World, Write},
shrev::EventChannel,
};

Expand Down
9 changes: 2 additions & 7 deletions amethyst_input/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,11 @@ impl<T: BindingTypes> InputSystem<T> {
pub fn new(mut world: &mut World, bindings: Option<Bindings<T>>) -> Self {
use amethyst_core::ecs::prelude::SystemData;
<Self as System<'_>>::SystemData::setup(&mut world);
let reader = world
.fetch_mut::<EventChannel<Event>>()
.register_reader();
let reader = world.fetch_mut::<EventChannel<Event>>().register_reader();
if let Some(ref bindings) = bindings {
world.fetch_mut::<InputHandler<T>>().bindings = bindings.clone();
}
InputSystem {
reader,
bindings,
}
InputSystem { reader, bindings }
}

fn process_event(
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/pass/base_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
};
use amethyst_assets::{AssetStorage, Handle};
use amethyst_core::{
ecs::{Join, Read, ReadExpect, ReadStorage, World, SystemData},
ecs::{Join, Read, ReadExpect, ReadStorage, SystemData, World},
transform::Transform,
Hidden, HiddenPropagate,
};
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/pass/debug_lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
types::Backend,
util,
};
use amethyst_core::ecs::{Join, Read, World, SystemData, Write, WriteStorage};
use amethyst_core::ecs::{Join, Read, SystemData, World, Write, WriteStorage};
use derivative::Derivative;
use glsl_layout::*;
use rendy::{
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/pass/flat2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
};
use amethyst_assets::AssetStorage;
use amethyst_core::{
ecs::{Join, Read, ReadExpect, ReadStorage, World, SystemData},
ecs::{Join, Read, ReadExpect, ReadStorage, SystemData, World},
transform::Transform,
Hidden, HiddenPropagate,
};
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/pass/skybox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
types::Backend,
util,
};
use amethyst_core::ecs::{Read, World, SystemData};
use amethyst_core::ecs::{Read, SystemData, World};
use derivative::Derivative;
use glsl_layout::{vec3, AsStd140};
use rendy::{
Expand Down
8 changes: 2 additions & 6 deletions amethyst_rendy/src/render_test_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{marker::PhantomData, ops::Deref, sync::Arc};
use amethyst_assets::Processor;
use amethyst_core::{
bundle::SystemBundle,
ecs::{DispatcherBuilder, ReadExpect, World, SystemData},
ecs::{DispatcherBuilder, ReadExpect, SystemData, World},
};
use amethyst_error::Error;
use amethyst_window::{ScreenDimensions, Window};
Expand Down Expand Up @@ -185,11 +185,7 @@ where
false
}

fn builder(
&mut self,
_factory: &mut Factory<B>,
_world: &World,
) -> GraphBuilder<B, World> {
fn builder(&mut self, _factory: &mut Factory<B>, _world: &World) -> GraphBuilder<B, World> {
GraphBuilder::new()
}
}
4 changes: 2 additions & 2 deletions amethyst_rendy/src/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use crate::types::Mesh;
use amethyst_assets::{AssetStorage, Handle, Loader, PrefabData, Progress, ProgressCounter};
use amethyst_core::{
ecs::{
shred::{SystemData, ResourceId},
prelude::{Entity, Read, ReadExpect, WriteStorage, World},
prelude::{Entity, Read, ReadExpect, World, WriteStorage},
shred::{ResourceId, SystemData},
},
math::Vector3,
};
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/sprite/prefab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ mod tests {
Texture,
};
use amethyst_assets::{Handle, Loader};
use amethyst_core::ecs::{Builder, Read, ReadExpect, World};
use amethyst_core::ecs::{Builder, Read, ReadExpect, World, WorldExt};
use rayon::ThreadPoolBuilder;
use std::sync::Arc;

Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/sprite_visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crate::{
};
use amethyst_core::{
ecs::{
hibitset::BitSet,
prelude::{Entities, Entity, Join, Read, ReadStorage, System, Write},
hibitset::BitSet,
},
math::{Point3, Vector3},
Hidden, HiddenPropagate, Transform,
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/submodules/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{
util::{self, TapCountIter},
};
use amethyst_core::{
ecs::{Join, ReadStorage, World, SystemData},
ecs::{Join, ReadStorage, SystemData, World},
math::{convert, Vector3},
transform::Transform,
};
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/submodules/gather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
resources::AmbientColor,
};
use amethyst_core::{
ecs::{Join, Read, ReadExpect, ReadStorage, World, SystemData},
ecs::{Join, Read, ReadExpect, ReadStorage, SystemData, World},
math::{convert, Matrix4, Vector3},
transform::Transform,
};
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/submodules/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{
util,
};
use amethyst_assets::{AssetStorage, Handle};
use amethyst_core::ecs::{Read, World, SystemData};
use amethyst_core::ecs::{Read, SystemData, World};
use glsl_layout::*;

#[cfg(feature = "profiler")]
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/submodules/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
util,
};
use amethyst_assets::{AssetStorage, Handle};
use amethyst_core::ecs::{Read, World, SystemData};
use amethyst_core::ecs::{Read, SystemData, World};

#[cfg(feature = "profiler")]
use thread_profiler::profile_scope;
Expand Down
2 changes: 1 addition & 1 deletion amethyst_rendy/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use amethyst_assets::{
};
use amethyst_core::{
components::Transform,
ecs::{Read, ReadExpect, ReadStorage, World, RunNow, SystemData, Write, WriteExpect},
ecs::{Read, ReadExpect, ReadStorage, RunNow, SystemData, World, Write, WriteExpect},
timing::Time,
Hidden, HiddenPropagate,
};
Expand Down
6 changes: 3 additions & 3 deletions amethyst_rendy/src/visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use crate::{
};
use amethyst_core::{
ecs::{
hibitset::BitSet,
prelude::{
Component, DenseVecStorage, Entities, Entity, Join, Read, ReadExpect, ReadStorage, System,
Write,
Component, DenseVecStorage, Entities, Entity, Join, Read, ReadExpect, ReadStorage,
System, Write,
},
hibitset::BitSet,
},
math::{convert, distance_squared, Matrix4, Point3, Vector4},
Hidden, HiddenPropagate, Transform,
Expand Down
Loading

0 comments on commit 8a54251

Please sign in to comment.