Skip to content
Draft
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/actions/prepare/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ runs:
~/.cargo/git/db/
target/
key: ${{inputs.cache-key}}
- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Install alsa and udev
components: rustfmt, clippy
- name: Install Bevy dependencies
shell: bash
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
run: sudo apt-get update; sudo apt-get install --no-install-recommends g++ pkg-config libx11-dev libasound2-dev libudev-dev libxkbcommon-x11-0 libwayland-dev libxkbcommon-dev
if: runner.os == 'linux'
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:
- uses: ./.github/actions/prepare/
with:
cache-key: ${{ runner.os }}-cargo-progress-tracking-test-${{ hashFiles('**/Cargo.toml') }}
- name: Build & run tests progress tracking
run: cargo test --features "progress_tracking" -p bevy_asset_loader
full-test:
strategy:
matrix:
Expand All @@ -56,7 +54,7 @@ jobs:
with:
cache-key: ${{ runner.os }}-cargo-full-test-${{ hashFiles('**/Cargo.toml') }}
- name: Build & run tests progress tracking and 2d,3d,dynamic
run: cargo test --features "2d, 3d, standard_dynamic_assets, progress_tracking" -p bevy_asset_loader
run: cargo test --features "2d, 3d, standard_dynamic_assets" -p bevy_asset_loader
lint:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

- support for Bevy 0.17
- depend on Bevy subcrates ([@benfrankel](https://github.com/benfrankel) in [#256](https://github.com/NiklasEi/bevy_asset_loader/pull/256))

## v0.23.0 - 18.05.2024
- support for Bevy 0.16
- renamed `init_resource` to `finally_init_resource` to emphasize the difference to Bevy's `init_resource`
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,7 @@ Both `finally_init_resource` methods from `bevy_asset_loader` do the same as Bev

## Progress tracking

With the feature `progress_tracking`, you can integrate with [`iyes_progress`][iyes_progress] to track asset loading during a loading state. This, for example, enables progress bars.

See [`progress_tracking`](/bevy_asset_loader/examples/progress_tracking.rs) for a complete example.
> This feature is removed in the release candidate
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I wait for a dependency to update for Bevy 0.17 support, I published a release candidate of bevy_asset_loader (0.24.0-rc.1). That release candidate does not have the progress tracking feature, because the feature requires the dependency that is not yet updated for Bevy 0.17.
If you need the feature, you will have to wait. If you don't, use the release candidate.


### A note on system ordering

Expand Down Expand Up @@ -537,6 +535,7 @@ Compatibility of `bevy_asset_loader` versions:

| Bevy version | `bevy_asset_loader` version |
|:-------------|:----------------------------|
| `0.17` | `0.24` |
| `0.16` | `0.23` |
| `0.15` | `0.22` |
| `0.14` | `0.21` |
Expand Down
42 changes: 18 additions & 24 deletions bevy_asset_loader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_asset_loader"
version = "0.23.0"
version = "0.24.0-rc.1"
authors = ["Niklas Eicker <git@nikl.me>"]
edition = "2024"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -30,35 +30,33 @@ readme = "README.md"
"bevy_asset_loader_derive/3d",
]
standard_dynamic_assets = ["dep:bevy_common_assets", "dep:serde"]
progress_tracking = ["dep:iyes_progress"]

[dependencies]
bevy_app = { version = "0.16.0", default-features = false }
bevy_asset = { version = "0.16.0", default-features = false }
bevy_ecs = { version = "0.16.0", default-features = false }
bevy_image = { version = "0.16.0", default-features = false, optional = true }
bevy_log = { version = "0.16.0", default-features = false }
bevy_math = { version = "0.16.0", default-features = false, optional = true }
bevy_pbr = { version = "0.16.0", default-features = false, optional = true }
bevy_platform = { version = "0.16.0", default-features = false }
bevy_reflect = { version = "0.16.0", default-features = false }
bevy_render = { version = "0.16.0", default-features = false, optional = true }
bevy_sprite = { version = "0.16.0", default-features = false, optional = true }
bevy_state = { version = "0.16.0", default-features = false }
bevy_utils = { version = "0.16.0", default-features = false }
bevy_asset_loader_derive = { version = "0.23.0", path = "../bevy_asset_loader_derive" }
bevy_app = { version = "0.17.1", default-features = false }
bevy_asset = { version = "0.17.1", default-features = false }
bevy_ecs = { version = "0.17.1", default-features = false }
bevy_image = { version = "0.17.1", default-features = false, optional = true }
bevy_log = { version = "0.17.1", default-features = false }
bevy_math = { version = "0.17.1", default-features = false, optional = true }
bevy_pbr = { version = "0.17.1", default-features = false, optional = true }
bevy_platform = { version = "0.17.1", default-features = false }
bevy_reflect = { version = "0.17.1", default-features = false }
bevy_render = { version = "0.17.1", default-features = false, optional = true }
bevy_sprite = { version = "0.17.1", default-features = false, optional = true }
bevy_state = { version = "0.17.1", default-features = false }
bevy_utils = { version = "0.17.1", default-features = false }
bevy_asset_loader_derive = { version = "0.24.0-rc.1", path = "../bevy_asset_loader_derive" }
anyhow = "1"
path-slash = "0.2"

bevy_common_assets = { version = "0.13.0", features = ["ron"], optional = true }
bevy_common_assets = { version = "0.14.0", features = ["ron"], optional = true }
serde = { version = "1", optional = true }
iyes_progress = { version = "0.14.0", optional = true }

[dev-dependencies]
bevy = { version = "0.16.0", features = ["vorbis"] }
bevy = { version = "0.17.1", features = ["vorbis"] }
anyhow = "1"
iyes_progress = { version = "0.14.0" }
bevy_common_assets = { version = "0.13.0", features = ["ron"] }
bevy_common_assets = { version = "0.14.0", features = ["ron"] }
serde = { version = "1" }
ron = "0.8.1"
trybuild = { version = "1.0" }
Expand Down Expand Up @@ -103,10 +101,6 @@ name = "standard_material"
path = "examples/standard_material.rs"
required-features = ["3d"]

[[example]]
name = "progress_tracking"
path = "examples/progress_tracking.rs"
required-features = ["progress_tracking", "2d"]

[[example]]
name = "failure_state"
Expand Down
1 change: 0 additions & 1 deletion bevy_asset_loader/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ with `cargo run --example <example>`.
| [`finally_init_resource.rs`](finally_init_resource.rs) | Inserting a `FromWorld` resource when all asset collections are loaded |
| [`manual_dynamic_asset.rs`](manual_dynamic_asset.rs) | Load an image asset from a path resolved at run time |
| [`no_loading_state.rs`](no_loading_state.rs) | How to use asset collections without a loading state |
| [`progress_tracking.rs`](progress_tracking.rs) | How to set up progress tracking using `iyes_progress` |
| [`standard_material.rs`](standard_material.rs) | Loading a standard material from a png file |
| [`sub_state.rs`](sub_state.rs) | How to use a sub state |
| [`two_collections.rs`](two_collections.rs) | Load multiple asset collections |
Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/asset_maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct AudioAssets {
custom: HashMap<MyAudio, Handle<AudioSource>>,
}

fn use_audio_assets(audio_assets: Res<AudioAssets>, mut quit: EventWriter<AppExit>) {
fn use_audio_assets(audio_assets: Res<AudioAssets>, mut quit: MessageWriter<AppExit>) {
audio_assets
.full_path
.get("audio/plop.ogg")
Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/atlas_from_grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct AnimationTimer(Timer);
fn animate_sprite_system(time: Res<Time>, mut query: Query<(&mut AnimationTimer, &mut Sprite)>) {
for (mut timer, mut sprite) in &mut query {
timer.0.tick(time.delta());
if timer.0.finished() {
if timer.0.is_finished() {
if let Some(atlas) = &mut sprite.texture_atlas {
atlas.index = (atlas.index + 1) % 8;
}
Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/custom_dynamic_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy::ecs::system::SystemState;
use bevy::platform::collections::HashMap;
use bevy::prelude::*;
use bevy::reflect::TypePath;
use bevy::render::render_asset::RenderAssetUsages;
use bevy_asset::RenderAssetUsages;
use bevy_asset_loader::prelude::*;
use bevy_common_assets::ron::RonAssetPlugin;

Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/dynamic_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct AnimationTimer(Timer);
fn animate_sprite_system(time: Res<Time>, mut query: Query<(&mut AnimationTimer, &mut Sprite)>) {
for (mut timer, mut sprite) in &mut query {
timer.0.tick(time.delta());
if timer.0.finished() {
if timer.0.is_finished() {
if let Some(atlas) = &mut sprite.texture_atlas {
atlas.index = (atlas.index + 1) % 8;
}
Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/dynamic_asset_arrays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct AnimationTimer(Timer);
fn animate_sprite_system(time: Res<Time>, mut query: Query<(&mut AnimationTimer, &mut Sprite)>) {
for (mut timer, mut sprite) in &mut query {
timer.0.tick(time.delta());
if timer.0.finished() {
if timer.0.is_finished() {
if let Some(atlas) = &mut sprite.texture_atlas {
atlas.index = (atlas.index + 1) % 8;
}
Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/failure_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn fail() {
panic!("The library should have switched to the failure state!");
}

fn ok(mut quit: EventWriter<AppExit>) {
fn ok(mut quit: MessageWriter<AppExit>) {
info!("As expected, bevy_asset_loader switched to the failure state");
info!("Quitting the application...");
quit.write(AppExit::Success);
Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/full_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn expectations(
standard_materials: Res<Assets<StandardMaterial>>,
texture_atlas_layouts: Res<Assets<TextureAtlasLayout>>,
images: Res<Assets<Image>>,
mut quit: EventWriter<AppExit>,
mut quit: MessageWriter<AppExit>,
) {
info!("Done loading the collection. Checking expectations...");

Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/full_dynamic_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn expectations(
standard_materials: Res<Assets<StandardMaterial>>,
texture_atlas_layouts: Res<Assets<TextureAtlasLayout>>,
images: Res<Assets<Image>>,
mut quit: EventWriter<AppExit>,
mut quit: MessageWriter<AppExit>,
) {
info!("Done loading the collection. Checking expectations...");

Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/manual_dynamic_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn text(bundle: impl Bundle, font_assets: &FontAssets) -> impl Bundle {
..default()
},
TextColor(Color::linear_rgb(1., 1., 1.)),
TextLayout::new_with_justify(JustifyText::Center),
TextLayout::new_with_justify(Justify::Center),
)
}

Expand Down
2 changes: 1 addition & 1 deletion bevy_asset_loader/examples/no_loading_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct AnimationTimer(Timer);
fn animate_sprite_system(time: Res<Time>, mut query: Query<(&mut AnimationTimer, &mut Sprite)>) {
for (mut timer, mut sprite) in &mut query {
timer.0.tick(time.delta());
if timer.0.finished() {
if timer.0.is_finished() {
if let Some(atlas) = &mut sprite.texture_atlas {
atlas.index = (atlas.index + 1) % 8;
}
Expand Down
140 changes: 0 additions & 140 deletions bevy_asset_loader/examples/progress_tracking.rs

This file was deleted.

Loading
Loading