Skip to content

Commit 6a2bac0

Browse files
committed
Fix up any references to the deprecated load methods.
1 parent 1a30557 commit 6a2bac0

6 files changed

Lines changed: 20 additions & 18 deletions

File tree

crates/bevy_asset/src/loader_builders.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ impl NestedLoader<'_, '_, DynamicTyped, Deferred> {
355355
self.meta_transform,
356356
)
357357
};
358-
// `load_erased_with_meta_transform` and `get_or_create_path_handle_erased` always returns a
358+
// `load_with_meta_transform_erased` and `get_or_create_path_handle_erased` always returns a
359359
// Strong variant, so we are safe to unwrap.
360360
let index = (&handle).try_into().unwrap();
361361
self.load_context.dependencies.insert(index);

crates/bevy_asset/src/reflect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ impl ReflectSerializerProcessor for HandleSerializeProcessor {
398398
pub trait LoadFromPath {
399399
/// Initiates the load for the given expected type ID, and the path.
400400
///
401-
/// See [`AssetServer::load_erased`] for more.
401+
/// See [`LoadBuilder::load_erased`](crate::LoadBuilder::load_erased) for more.
402402
fn load_from_path_erased(&mut self, type_id: TypeId, path: AssetPath<'static>)
403403
-> UntypedHandle;
404404
}

crates/bevy_gltf/src/loader/mod.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ pub struct GltfLoader {
174174
/// # use bevy_asset::{AssetServer, Handle};
175175
/// # use bevy_gltf::*;
176176
/// # let asset_server: AssetServer = panic!();
177-
/// let gltf_handle: Handle<Gltf> = asset_server.load_with_settings(
178-
/// "my.gltf",
179-
/// |s: &mut GltfLoaderSettings| {
180-
/// s.load_cameras = false;
181-
/// }
182-
/// );
177+
/// let gltf_handle: Handle<Gltf> = asset_server.load_builder().with_settings(
178+
/// |s: &mut GltfLoaderSettings| {
179+
/// s.load_cameras = false;
180+
/// }
181+
/// )
182+
/// .load("my.gltf");
183183
/// ```
184184
#[derive(Serialize, Deserialize)]
185185
pub struct GltfLoaderSettings {
@@ -672,7 +672,9 @@ impl GltfLoader {
672672
let mut named_materials = <HashMap<_, _>>::default();
673673
// Only include materials in the output if they're set to be retained in the MAIN_WORLD and/or RENDER_WORLD by the load_materials flag
674674
if !settings.load_materials.is_empty() {
675-
// NOTE: materials must be loaded after textures because image load() calls will happen before load_with_settings, preventing is_srgb from being set properly
675+
// NOTE: materials must be loaded after textures because image load() calls will happen
676+
// before load_builder().with_settings().load(), preventing is_srgb from being set
677+
// properly.
676678
for material in gltf.materials() {
677679
let (label, gltf_material) = load_material(
678680
&material,

crates/bevy_image/src/image.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,7 +2555,7 @@ mod test {
25552555
fn get_or_init_sampler_modifications() {
25562556
// given some sampler
25572557
let mut default_sampler = ImageSampler::Default;
2558-
// a load_with_settings call wants to customize the descriptor
2558+
// a LoadBuilder::with_settings call wants to customize the descriptor
25592559
let my_sampler_in_a_loader = default_sampler
25602560
.get_or_init_descriptor()
25612561
.set_filter(ImageFilterMode::Linear)
@@ -2572,7 +2572,7 @@ mod test {
25722572
fn get_or_init_sampler_anisotropy() {
25732573
// given some sampler
25742574
let mut default_sampler = ImageSampler::Default;
2575-
// a load_with_settings call wants to customize the descriptor
2575+
// a LoadBuilder::with_settings call wants to customize the descriptor
25762576
let my_sampler_in_a_loader = default_sampler
25772577
.get_or_init_descriptor()
25782578
.set_anisotropic_filter(8);

crates/bevy_pbr/src/pbr_material.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,12 @@ pub struct StandardMaterial {
396396
/// # use bevy_image::{Image, ImageLoaderSettings};
397397
/// #
398398
/// fn load_normal_map(asset_server: Res<AssetServer>) {
399-
/// let normal_handle: Handle<Image> = asset_server.load_with_settings(
400-
/// "textures/parallax_example/cube_normal.png",
401-
/// // The normal map texture is in linear color space. Lighting won't look correct
402-
/// // if `is_srgb` is `true`, which is the default.
403-
/// |settings: &mut ImageLoaderSettings| settings.is_srgb = false,
404-
/// );
399+
/// let normal_handle: Handle<Image> = asset_server.load_builder().with_settings(
400+
/// // The normal map texture is in linear color space. Lighting won't look correct
401+
/// // if `is_srgb` is `true`, which is the default.
402+
/// |settings: &mut ImageLoaderSettings| settings.is_srgb = false,
403+
/// )
404+
/// .load("textures/parallax_example/cube_normal.png");
405405
/// }
406406
/// ```
407407
#[texture(9)]

crates/bevy_scene2/src/scene_patch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl SceneListPatch {
151151
scene_list.register_dependencies(&mut dependencies);
152152
let dependencies = dependencies
153153
.iter()
154-
.map(|dep| assets.load_erased(dep.type_id, &dep.path))
154+
.map(|dep| assets.load_builder().load_erased(dep.type_id, &dep.path))
155155
.collect::<Vec<_>>();
156156
SceneListPatch {
157157
scene_list: Box::new(scene_list),

0 commit comments

Comments
 (0)