diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0654245..ac6d5ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Install Dependencies - 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 libasound2-dev libudev-dev libwayland-dev - name: Run cargo test run: cargo test @@ -59,7 +59,7 @@ jobs: with: components: clippy - name: Install Dependencies - 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 libasound2-dev libudev-dev libwayland-dev - name: Run clippy run: cargo clippy -- -D warnings diff --git a/Cargo.toml b/Cargo.toml index 30f8662..ea4b34f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,21 +11,20 @@ license = "MIT OR Apache-2.0" name = "bevy_prototype_lyon" readme = "README.md" repository = "https://github.com/rparrett/bevy_prototype_lyon/" -version = "0.14.1" +version = "0.15.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { version = "0.16", default-features = false, features = [ +bevy = { version = "0.17", default-features = false, features = [ "bevy_asset", - "bevy_core_pipeline", "bevy_log", "bevy_render", - "bevy_sprite", + "bevy_sprite_render", ] } lyon_tessellation = "1" lyon_algorithms = "1" svgtypes = "0.15" [dev-dependencies] -bevy = "0.16" +bevy = "0.17" diff --git a/README.md b/README.md index e0874d9..581891b 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ The following table shows the latest version of `bevy_prototype_lyon` that suppo |bevy|bevy_prototype_lyon|license| |---|---|---| +|0.17|0.15|MIT/Apache 2.0| |0.16|0.14|MIT/Apache 2.0| |0.15|0.13|MIT/Apache 2.0| |0.14|0.12|MIT/Apache 2.0| diff --git a/examples/dynamic_stroke_size.rs b/examples/dynamic_stroke_size.rs index d350c7f..c21ba95 100644 --- a/examples/dynamic_stroke_size.rs +++ b/examples/dynamic_stroke_size.rs @@ -98,8 +98,10 @@ fn setup_system(mut commands: Commands) { Transform::default().with_translation(Vec3::new(0.0, 0.0, 1.0)), HexagonShape, )); - commands.spawn((ShapeBuilder::with(&big_square) - .fill(ORANGE) - .stroke((BLACK, 10.0)) - .build(),)); + commands.spawn( + ShapeBuilder::with(&big_square) + .fill(ORANGE) + .stroke((BLACK, 10.0)) + .build(), + ); } diff --git a/src/entity.rs b/src/entity.rs index 5f63c18..f21acd6 100644 --- a/src/entity.rs +++ b/src/entity.rs @@ -1,5 +1,4 @@ //! Custom Bevy ECS bundle for shapes. -#![expect(deprecated)] use bevy::prelude::*; use lyon_algorithms::path::Builder; @@ -11,30 +10,6 @@ use crate::{ plugin::COLOR_MATERIAL_HANDLE, }; -/// A Bevy `Bundle` to represent a shape. -#[deprecated(since = "0.14.0", note = "please use the `Shape` component instead.")] -#[allow(missing_docs)] -#[derive(Bundle, Clone)] -pub struct ShapeBundle { - pub path: Shape, - pub mesh: Mesh2d, - pub material: MeshMaterial2d, - pub transform: Transform, - pub visibility: Visibility, -} - -impl Default for ShapeBundle { - fn default() -> Self { - Self { - path: default(), - mesh: default(), - material: MeshMaterial2d(COLOR_MATERIAL_HANDLE), - transform: default(), - visibility: default(), - } - } -} - /// `Component` describing a geometric shape. /// /// It can be constructed using `ShapeBuilder`. diff --git a/src/plugin.rs b/src/plugin.rs index d9c7586..115a948 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -4,9 +4,10 @@ //! boilerplate. use bevy::{ - asset::weak_handle, + asset::{RenderAssetUsages, uuid_handle}, + mesh::Indices, prelude::*, - render::{mesh::Indices, render_asset::RenderAssetUsages, render_resource::PrimitiveTopology}, + render::render_resource::PrimitiveTopology, }; use lyon_tessellation::{self as tess, BuffersBuilder}; @@ -17,7 +18,7 @@ use crate::{ }; pub(crate) const COLOR_MATERIAL_HANDLE: Handle = - weak_handle!("7cc661a1-0cd6-c147-129a-2c01882d9580"); + uuid_handle!("7cc661a1-0cd6-c147-129a-2c01882d9580"); /// A plugin that provides resources and a system to draw shapes in Bevy with /// less boilerplate. @@ -32,20 +33,23 @@ impl Plugin for ShapePlugin { .configure_sets( PostUpdate, BuildShapes - .after(bevy::transform::TransformSystem::TransformPropagate) - .before(bevy::asset::AssetEvents), + .after(bevy::transform::TransformSystems::Propagate) + .before(bevy::asset::AssetEventSystems), ) .add_systems(PostUpdate, mesh_shapes_system.in_set(BuildShapes)); - app.world_mut() - .resource_mut::>() - .insert( + if let Some(mut materials) = app.world_mut().get_resource_mut::>() { + // `insert` will not fail for uuid assets + let _ = materials.insert( &COLOR_MATERIAL_HANDLE, ColorMaterial { color: Color::WHITE, ..default() }, ); + } else { + error!("Failed to get Assets resource"); + } } }