Skip to content

Commit

Permalink
Squash commit (updates for Bevy 0.13)
Browse files Browse the repository at this point in the history
* Use GitHub Actions config from master branch

* Fix formatting

* Fix deprecation warnings on add_plugin

Fix CI (#218)

Fix shader (#219)

Suggest to use `cargo add` in README.md (#222)

Use `SpatialBundle` (#221)

Use `configure_sets` API (#223)

Use `MaterialMesh2dBundle` with `ColorMaterial` (#224)

* Use `MaterialMesh2dBundle` with `ColorMaterial`

* clippy

* Fix green channel filtering bug

* Clippy again

Fix clippy (#229)

* Add `RenderAssetPersistencePolicy` to `Mesh::new` call

* Use built-in `Name` component in `svg` example

Fix CI (#234)

* Use `RenderAssetUsages`

* Specify which `RegularPolygon` to use

Fix CI (#237)

Update Cargo.toml

Update `README.md`

Update CHANGELOG.md
  • Loading branch information
Nilirad committed Feb 19, 2024
1 parent e77fc7c commit afdb6e7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 14 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
## 0.9.0
- Support for Bevy 0.11.

## 0.11.0
- Support for Bevy 0.13

## 0.10.0
- Support for Bevy 0.12

## 0.9.0
- `ShapeBundle` now contains the `spatial: SpatialBundle` field,
which bundles together
`Transform`,
`GlobalTransform`,
`Visibility`
and `InheritedVisibility`.

## 0.8.0
- Support for Bevy 0.10.
- Uses original render.
Expand Down
14 changes: 11 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@ license = "MIT OR Apache-2.0"
name = "bevy_prototype_lyon"
readme = "README.md"
repository = "https://github.com/Nilirad/bevy_prototype_lyon/"
version = "0.10.0"
version = "0.11.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy = { version = "0.12", default-features = false, features = ["bevy_sprite", "bevy_render", "bevy_core_pipeline", "bevy_asset"] }
bevy = { version = "0.13", default-features = false, features = [
"bevy_sprite",
"bevy_render",
"bevy_core_pipeline",
"bevy_asset",
] }
lyon_tessellation = "1"
lyon_algorithms = "1"
svgtypes = "0.12"

[dev-dependencies]
bevy = { version = "0.12", default-features = false, features = ["x11", "bevy_asset"] }
bevy = { version = "0.13", default-features = false, features = [
"x11",
"bevy_asset",
] }
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ I strive to support the latest version of Bevy. Support for a version of Bevy is
The following table shows the latest version of `bevy_prototype_lyon` that supports a certain version of Bevy.

|bevy|bevy_prototype_lyon|license|
|----|---|---|
|---|---|---|
|0.13|0.11|MIT/Apache 2.0|
|0.12|0.10|MIT/Apache 2.0|
|0.11|0.9|MIT/Apache 2.0|
|0.10|0.8|MIT/Apache 2.0|
Expand Down
7 changes: 2 additions & 5 deletions examples/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ fn main() {
.run();
}

#[derive(Component)]
struct Name(String);

#[derive(Component)]
struct BlacksmithMarker;

Expand All @@ -25,7 +22,7 @@ fn setup_system(mut commands: Commands) {

commands
.spawn((
Name("Blacksmith".to_owned()),
Name::new("Blacksmith"),
BlacksmithMarker,
SpatialBundle {
transform: Transform::from_translation(Vec3::new(-50., 0., 0.)),
Expand Down Expand Up @@ -62,7 +59,7 @@ fn setup_system(mut commands: Commands) {

commands
.spawn((
Name("Shack".to_owned()),
Name::new("Shack"),
ToolShackMarker,
SpatialBundle {
transform: Transform {
Expand Down
4 changes: 2 additions & 2 deletions src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl ShapePath {
///
/// ```
/// # use bevy::prelude::*;
/// # use bevy_prototype_lyon::prelude::*;
/// # use bevy_prototype_lyon::prelude::{RegularPolygon, *};
/// #
/// # #[derive(Component)]
/// # struct Player;
Expand Down Expand Up @@ -73,7 +73,7 @@ impl ShapePath {
///
/// ```
/// # use bevy::prelude::*;
/// # use bevy_prototype_lyon::prelude::*;
/// # use bevy_prototype_lyon::prelude::{RegularPolygon, *};
/// #
/// # #[derive(Component)]
/// # struct Player;
Expand Down
9 changes: 6 additions & 3 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use bevy::{
prelude::*,
render::{mesh::Indices, render_resource::PrimitiveTopology},
render::{mesh::Indices, render_asset::RenderAssetUsages, render_resource::PrimitiveTopology},
sprite::Mesh2dHandle,
};
use lyon_tessellation::{self as tess, BuffersBuilder};
Expand Down Expand Up @@ -127,8 +127,11 @@ fn stroke(
}

fn build_mesh(buffers: &VertexBuffers) -> Mesh {
let mut mesh = Mesh::new(PrimitiveTopology::TriangleList);
mesh.set_indices(Some(Indices::U32(buffers.indices.clone())));
let mut mesh = Mesh::new(
PrimitiveTopology::TriangleList,
RenderAssetUsages::RENDER_WORLD,
);
mesh.insert_indices(Indices::U32(buffers.indices.clone()));
mesh.insert_attribute(
Mesh::ATTRIBUTE_POSITION,
buffers
Expand Down

0 comments on commit afdb6e7

Please sign in to comment.