From cf4013b22bf93fcb5357fd8ca5f61418c4b1c8b6 Mon Sep 17 00:00:00 2001 From: James Gayfer <10660608+jgayfer@users.noreply.github.com> Date: Sun, 27 Oct 2024 20:44:05 -0700 Subject: [PATCH] Initial 0.15 support More work needed to move things over to required components and to ensure extraction is done correctly, but gets us to the point where bevy_light_2d is usable with bevy 0.15. --- Cargo.toml | 4 +-- examples/basic.rs | 2 +- examples/dungeon.rs | 50 ++++++++++++++++++------------------- examples/multiple.rs | 11 +++------ examples/occlusion.rs | 8 +++--- src/light.rs | 6 ++++- src/occluder.rs | 6 ++++- src/render/extract.rs | 57 ++++++++++++++++++++++++++++--------------- 8 files changed, 82 insertions(+), 62 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 80e236a..c6cc4e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ readme = "README.md" exclude = ["assets/*", "static/*"] [dependencies] -bevy = { version = "0.14", default-features = false, features = [ +bevy = { version = "0.15.0-rc.2", default-features = false, features = [ "bevy_render", "bevy_core_pipeline", "bevy_winit", @@ -20,7 +20,7 @@ bevy = { version = "0.14", default-features = false, features = [ smallvec = "1.13" [dev-dependencies] -bevy = { version = "0.14", default-features = false, features = [ +bevy = { version = "0.15.0-rc.2", default-features = false, features = [ "bevy_render", "bevy_core_pipeline", "bevy_winit", diff --git a/examples/basic.rs b/examples/basic.rs index 1829db6..df9fb63 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -9,7 +9,7 @@ fn main() { } fn setup(mut commands: Commands) { - commands.spawn(Camera2dBundle::default()); + commands.spawn(Camera2d); commands.spawn(PointLight2dBundle { point_light: PointLight2d { diff --git a/examples/dungeon.rs b/examples/dungeon.rs index 48166da..5b43211 100644 --- a/examples/dungeon.rs +++ b/examples/dungeon.rs @@ -38,10 +38,11 @@ struct Candle; struct AnimationTimer(Timer); fn setup_camera(mut commands: Commands) { - let mut camera = Camera2dBundle::default(); - camera.projection.scale = 0.25; + let mut projection = OrthographicProjection::default_2d(); + projection.scale = 0.25; commands.spawn(( - camera, + Camera2d, + projection, AmbientLight2d { brightness: 0.1, ..default() @@ -55,12 +56,14 @@ fn set_clear_color(mut clear_color: ResMut) { fn animate_candles( time: Res