Skip to content

Commit

Permalink
Update Bevy to 0.11 and syn to 2.0 (#54)
Browse files Browse the repository at this point in the history
Co-authored-by: Hennadii Chernyshchyk <genaloner@gmail.com>
  • Loading branch information
GodGotzi and Shatur authored Jul 21, 2023
1 parent 2ef39e2 commit fb230b4
Show file tree
Hide file tree
Showing 21 changed files with 134 additions and 144 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ repository = "https://github.com/JonahPlusPlus/bevy_atmosphere"
exclude = ["/assets/", "/examples/", "/.github/"]

[dependencies]
bevy = {version = "0.10", default-features = false, features = ["bevy_asset", "bevy_render", "bevy_pbr"]}
bevy_atmosphere_macros = {path = "macros", version = "0.2"}
bevy = {version = "0.11", default-features = false, features = ["bevy_asset", "bevy_render", "bevy_pbr"]}
bevy_atmosphere_macros = { path = "macros", version = "0.2.1" }
cfg-if = "1.0"

[dev-dependencies]
bevy_spectator = "0.2"
bevy = { version = "0.10", features = ["bevy_core_pipeline", "x11"] } # load all in case docs.rs complains
bevy_spectator = "0.3"
bevy = { version = "0.11.0", features = ["bevy_core_pipeline", "x11"] } # load all in case docs.rs complains

[features]
default = ["basic", "all_models"]
Expand Down
5 changes: 0 additions & 5 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
unmaintained = "deny"
yanked = "deny"
notice = "deny"
ignore = [
"RUSTSEC-2020-0056", # ignore stdweb (from gilrs)
"RUSTSEC-2021-0139", # ignore ansi_term until there is a replacement
"RUSTSEC-2022-0048", # ignore xml-rs as it is needed by winit
]

[licenses]
copyleft = "deny"
Expand Down
4 changes: 2 additions & 2 deletions examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use bevy_atmosphere::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(AtmospherePlugin)
.add_startup_system(setup)
.add_plugins(AtmospherePlugin)
.add_systems(Startup, setup)
.run();
}

Expand Down
16 changes: 9 additions & 7 deletions examples/cycle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bevy::prelude::*;
use bevy_atmosphere::prelude::*;
use bevy_spectator::*;
use bevy_spectator::{Spectator, SpectatorPlugin};

fn main() {
App::new()
Expand All @@ -10,11 +10,13 @@ fn main() {
bevy::utils::Duration::from_millis(50), // Update our atmosphere every 50ms (in a real game, this would be much slower, but for the sake of an example we use a faster update)
TimerMode::Repeating,
)))
.add_plugins(DefaultPlugins)
.add_plugin(SpectatorPlugin) // Simple movement for this example
.add_plugin(AtmospherePlugin) // Default AtmospherePlugin
.add_startup_system(setup_environment)
.add_system(daylight_cycle)
.add_plugins((
DefaultPlugins,
SpectatorPlugin, // Simple movement for this example
AtmospherePlugin, // Default AtmospherePlugin
))
.add_systems(Startup, setup_environment)
.add_systems(Update, daylight_cycle)
.run();
}

Expand All @@ -36,7 +38,7 @@ fn daylight_cycle(
timer.0.tick(time.delta());

if timer.0.finished() {
let t = time.elapsed_seconds_wrapped() as f32 / 2.0;
let t = time.elapsed_seconds_wrapped() / 2.0;
atmosphere.sun_position = Vec3::new(0., t.sin(), t.cos());

if let Some((mut light_trans, mut directional)) = query.single_mut().into() {
Expand Down
7 changes: 3 additions & 4 deletions examples/detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ use bevy_atmosphere::prelude::*;
fn main() {
println!("Demonstrates adding/removing an `AtmosphereCamera`\n\t- Left Mouse Button: Add `AtmosphereCamera`\n\t- Right Mouse Button: Remove `AtmosphereCamera`");
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(AtmospherePlugin)
.add_startup_system(setup)
.add_system(update)
.add_plugins((DefaultPlugins, AtmospherePlugin))
.add_systems(Startup, setup)
.add_systems(Update, update)
.run();
}

Expand Down
10 changes: 4 additions & 6 deletions examples/gradient.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
use bevy::prelude::*;
use bevy_atmosphere::prelude::*;
use bevy_spectator::*;
use bevy_spectator::{Spectator, SpectatorPlugin};

fn main() {
println!("Demonstrates using the `Gradient` model\n\t- 1-9 number keys: Change preset\n\t- 0 number key: Remove `Gradient` model");
App::new()
.add_plugins(DefaultPlugins)
.insert_resource(AtmosphereModel::new(Gradient::default()))
.add_plugin(AtmospherePlugin)
.add_plugin(SpectatorPlugin)
.add_startup_system(setup)
.add_system(change_gradient)
.add_plugins((DefaultPlugins, AtmospherePlugin, SpectatorPlugin))
.add_systems(Startup, setup)
.add_systems(Update, change_gradient)
.run();
}

Expand Down
11 changes: 5 additions & 6 deletions examples/models.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
use bevy::prelude::*;
use bevy_atmosphere::prelude::*;
use bevy_spectator::*;
use bevy_spectator::{Spectator, SpectatorPlugin};

fn main() {
println!("Demonstrates changing the atmosphere model\n\t- G: Gradient\n\t- N: Nishita");

App::new()
.add_plugins(DefaultPlugins)
.add_plugin(AtmospherePlugin)
.add_plugin(SpectatorPlugin)
.add_startup_system(setup)
.add_system(change_model)
.add_plugins((DefaultPlugins, AtmospherePlugin, SpectatorPlugin))
.add_systems(Startup, setup)
.add_systems(Update, change_model)
.run();
}

Expand Down
10 changes: 4 additions & 6 deletions examples/nishita.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
use bevy::prelude::*;
use bevy_atmosphere::prelude::*;
use bevy_spectator::*;
use bevy_spectator::{Spectator, SpectatorPlugin};

fn main() {
println!("Demonstrates using the `Nishita` model\n\t- 1-9 number keys: Change preset\n\t- 0 number key: Remove `Nishita` model");
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(AtmospherePlugin)
.add_plugin(SpectatorPlugin)
.add_startup_system(setup)
.add_system(change_nishita)
.add_plugins((DefaultPlugins, AtmospherePlugin, SpectatorPlugin))
.add_systems(Startup, setup)
.add_systems(Update, change_nishita)
.run();
}

Expand Down
10 changes: 4 additions & 6 deletions examples/settings.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bevy::prelude::*;
use bevy_atmosphere::prelude::*;
use bevy_spectator::*;
use bevy_spectator::{Spectator, SpectatorPlugin};

fn main() {
println!("Demonstrates using the `AtmosphereSettings` resource\n\t- Spacebar: Toggle dithering\n\t- 1-9 number keys: Change resolution\n\t- 0 number key: Remove `AtmosphereSettings` resource");
Expand All @@ -9,11 +9,9 @@ fn main() {
resolution: 16,
..default()
})
.add_plugins(DefaultPlugins)
.add_plugin(AtmospherePlugin)
.add_plugin(SpectatorPlugin)
.add_startup_system(setup)
.add_system(change_resolution)
.add_plugins((DefaultPlugins, AtmospherePlugin, SpectatorPlugin))
.add_systems(Startup, setup)
.add_systems(Update, change_resolution)
.run();
}

Expand Down
12 changes: 5 additions & 7 deletions examples/splitscreen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use bevy::{
window::WindowResized,
};
use bevy_atmosphere::prelude::*;
use bevy_spectator::*;
use bevy_spectator::{Spectator, SpectatorPlugin, SpectatorSettings};

fn main() {
println!("Demonstrates using `AtmosphereCamera.render_layers` to have multiple skyboxes in the scene at once\n\t- E: Switch camera");
Expand All @@ -23,12 +23,10 @@ fn main() {
alt_speed: 1.0,
..default()
})
.add_plugins(DefaultPlugins)
.add_plugin(AtmospherePlugin)
.add_plugin(SpectatorPlugin)
.add_startup_system(setup)
.add_system(set_camera_viewports)
.add_system(switch_camera)
.add_plugins((DefaultPlugins, AtmospherePlugin, SpectatorPlugin))
.add_systems(Startup, setup)
.add_systems(Update, set_camera_viewports)
.add_systems(Update, switch_camera)
.run();
}

Expand Down
6 changes: 3 additions & 3 deletions macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevy_atmosphere_macros"
description = "Proc macros for bevy_atmosphere"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
authors = ["JonahPlusPlus <33059163+JonahPlusPlus@users.noreply.github.com>"]
license = "MIT OR Apache-2.0"
Expand All @@ -15,8 +15,8 @@ proc-macro = true

[dependencies]
proc-macro-crate = "1.3"
bevy_macro_utils = "0.10"
bevy_macro_utils = "0.11"

syn = "1.0"
syn = "2.0"
proc-macro2 = "1.0"
quote = "1.0"
Loading

0 comments on commit fb230b4

Please sign in to comment.