bevy/crates
arunke 835f572e2a Fix duplicate asset loader registration warning (#17105)
# Objective

The original fix (bevyengine/bevy#11870) did not actually implement the
described logic. It checked if there were independently multiple loaders
for a given asset type and multiple loaders for a given extension.
However, this did not handle the case where those loaders were not the
same. For example, there could be a loader for type `Foo` and extension
`.foo`. Anther loader could exist for type `Bar` but extension `.bar`.
If a third loader was added for type `Foo` but extension `.bar`, the
warning would have been incorrectly logged.

## Solution

Instead of independently checking to see if there are preexisting
loaders for both the extension and type, look up the indices of the
loaders for the type in question. Then check to see if the loaders
registered for the extensions has any overlap. Only log if there are
loaders that fit this criteria.

## Testing

Ran CI tests. Locally tested the situation describe in the objective
section for the normal `App::init_asset_loader` flow. I think testing
could be done on the pre-registration flow for loaders still. I tested
on Windows, but the changes should not be affected by platform.
2025-02-06 22:30:49 +01:00
..
bevy_a11y Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_animation Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_app Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_asset Fix duplicate asset loader registration warning (#17105) 2025-02-06 22:30:49 +01:00
bevy_audio Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_color Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_core Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_core_pipeline Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_derive Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_dev_tools Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_diagnostic Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_dylib Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_ecs Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_encase_derive Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_gilrs Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_gizmos Fix 2D Gizmos not always drawn on top (#17085) 2025-02-06 22:30:49 +01:00
bevy_gltf Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_hierarchy Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_image Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_input Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_internal Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_log Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_macro_utils Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_math Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_mesh Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_mikktspace Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_pbr Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_picking Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_ptr Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_reflect Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_remote Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_render Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_scene Add missing #[reflect(Component, Default)] to SceneRoot and DynamicSceneRoot. (#16816) 2025-02-06 22:30:46 +01:00
bevy_sprite Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_state Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_tasks Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_text Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_time Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_transform Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_ui Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_utils Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_window Release 0.15.1 2025-01-03 19:43:53 +01:00
bevy_winit Release 0.15.1 2025-01-03 19:43:53 +01:00