diff --git a/bevy_asset_loader/examples/full_collection.rs b/bevy_asset_loader/examples/full_collection.rs index 115e890..f90e976 100644 --- a/bevy_asset_loader/examples/full_collection.rs +++ b/bevy_asset_loader/examples/full_collection.rs @@ -1,7 +1,7 @@ use bevy::app::AppExit; use bevy::asset::UntypedAssetId; +use bevy::image::{ImageSampler, ImageSamplerDescriptor}; use bevy::prelude::*; -use bevy::render::texture::{ImageSampler, ImageSamplerDescriptor}; use bevy::utils::HashMap; use bevy_asset_loader::prelude::*; diff --git a/bevy_asset_loader/examples/full_dynamic_collection.rs b/bevy_asset_loader/examples/full_dynamic_collection.rs index 3a3d0a7..4a8a9c3 100644 --- a/bevy_asset_loader/examples/full_dynamic_collection.rs +++ b/bevy_asset_loader/examples/full_dynamic_collection.rs @@ -1,14 +1,13 @@ +//! This example requires the `standard_dynamic_assets` feature for loading the ron file +//! and the `2d` and `3d` features for `TextureAtlas` and `StandardMaterial` dynamic assets. +//! It showcases all possible configurations for dynamic assets. use bevy::app::AppExit; use bevy::asset::UntypedAssetId; +use bevy::image::{ImageAddressMode, ImageSampler, ImageSamplerDescriptor}; use bevy::prelude::*; -use bevy::render::texture::{ImageAddressMode, ImageSampler, ImageSamplerDescriptor}; use bevy::utils::HashMap; use bevy_asset_loader::prelude::*; -/// This example requires the `standard_dynamic_assets` feature for loading the ron file -/// and the `2d` and `3d` features for `TextureAtlas` and `StandardMaterial` dynamic assets. -/// It showcases all possible configurations for dynamic assets. - const FOLDER_SIZE: usize = 8; fn main() { diff --git a/bevy_asset_loader/examples/progress_tracking.rs b/bevy_asset_loader/examples/progress_tracking.rs index d390be5..1c7313a 100644 --- a/bevy_asset_loader/examples/progress_tracking.rs +++ b/bevy_asset_loader/examples/progress_tracking.rs @@ -68,7 +68,7 @@ struct TextureAssets { } fn render_description(mut commands: Commands) { - commands.spawn(Camera2d::default()); + commands.spawn(Camera2d); commands.spawn(Text::new( r#" See the console for progress output diff --git a/bevy_asset_loader/src/standard_dynamic_asset.rs b/bevy_asset_loader/src/standard_dynamic_asset.rs index 55e3f84..e858450 100644 --- a/bevy_asset_loader/src/standard_dynamic_asset.rs +++ b/bevy_asset_loader/src/standard_dynamic_asset.rs @@ -18,9 +18,7 @@ use bevy::sprite::TextureAtlasLayout; #[cfg(any(feature = "3d", feature = "2d"))] use bevy::ecs::change_detection::ResMut; #[cfg(any(feature = "3d", feature = "2d"))] -use bevy::render::texture::{ - Image, ImageAddressMode, ImageFilterMode, ImageSampler, ImageSamplerDescriptor, -}; +use bevy::image::{Image, ImageAddressMode, ImageFilterMode, ImageSampler, ImageSamplerDescriptor}; /// These asset variants can be loaded from configuration files. They will then replace /// a dynamic asset based on their keys. diff --git a/bevy_asset_loader_derive/src/assets.rs b/bevy_asset_loader_derive/src/assets.rs index dafba20..89c0011 100644 --- a/bevy_asset_loader_derive/src/assets.rs +++ b/bevy_asset_loader_derive/src/assets.rs @@ -155,7 +155,7 @@ impl AssetField { let label = Lit::Str(LitStr::new(&field_ident.to_string(), token_stream.span())); quote!(#token_stream #field_ident : { - use bevy::render::texture::{ImageAddressMode, ImageFilterMode, ImageSampler, ImageSamplerDescriptor}; + use bevy::image::{ImageAddressMode, ImageFilterMode, ImageSampler, ImageSamplerDescriptor}; let mut system_state = ::bevy::ecs::system::SystemState::<( ResMut<::bevy::prelude::Assets<::bevy::prelude::Image>>, Res<::bevy::prelude::AssetServer>, @@ -282,7 +282,7 @@ impl AssetField { Res<::bevy::prelude::AssetServer>, )>::new(world); let (mut materials, asset_server) = system_state.get_mut(world); - materials.add(::bevy::pbr::StandardMaterial::from(asset_server.load::<::bevy::render::texture::Image>(#asset_path))) + materials.add(::bevy::pbr::StandardMaterial::from(asset_server.load::<::bevy::image::Image>(#asset_path))) },) } AssetField::TextureAtlasLayout(texture_atlas) => { @@ -537,7 +537,7 @@ impl AssetField { let asset_path = asset_path.clone(); quote!(#token_stream { let asset_server = world.get_resource::<::bevy::prelude::AssetServer>().expect("Cannot get AssetServer"); - handles.push(asset_server.load::<::bevy::render::texture::Image>(#asset_path).untyped()); + handles.push(asset_server.load::<::bevy::image::Image>(#asset_path).untyped()); }) } AssetField::Files(assets, _, _) => {