From f0086626d6a148e8985e4bfac6dc3c0444e53b4c Mon Sep 17 00:00:00 2001 From: Michael Hsu Date: Thu, 26 May 2022 10:52:33 -0700 Subject: [PATCH] fix some rebase issues --- crates/bevy_core/Cargo.toml | 1 - crates/bevy_render/Cargo.toml | 1 + crates/bevy_render/src/lib.rs | 2 +- crates/bevy_render/src/renderer/mod.rs | 2 +- crates/bevy_time/Cargo.toml | 3 ++ crates/bevy_time/src/lib.rs | 38 ++++++++++++++++++++++++-- crates/bevy_time/src/time.rs | 38 +------------------------- 7 files changed, 43 insertions(+), 42 deletions(-) diff --git a/crates/bevy_core/Cargo.toml b/crates/bevy_core/Cargo.toml index a5eef9febdeb74..7035d2fbc22350 100644 --- a/crates/bevy_core/Cargo.toml +++ b/crates/bevy_core/Cargo.toml @@ -19,5 +19,4 @@ bevy_tasks = { path = "../bevy_tasks", version = "0.8.0-dev" } bevy_utils = { path = "../bevy_utils", version = "0.8.0-dev" } # other -crossbeam-channel = "0.5.0" bytemuck = "1.5" diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index f81e2918b1470d..6a1de42e1633f8 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -36,6 +36,7 @@ bevy_ecs = { path = "../bevy_ecs", version = "0.8.0-dev" } bevy_encase_derive = { path = "../bevy_encase_derive", version = "0.8.0-dev" } bevy_math = { path = "../bevy_math", version = "0.8.0-dev" } bevy_reflect = { path = "../bevy_reflect", version = "0.8.0-dev", features = ["bevy"] } +bevy_time = { path = "../bevy_time", version = "0.8.0-dev" } bevy_transform = { path = "../bevy_transform", version = "0.8.0-dev" } bevy_window = { path = "../bevy_window", version = "0.8.0-dev" } bevy_utils = { path = "../bevy_utils", version = "0.8.0-dev" } diff --git a/crates/bevy_render/src/lib.rs b/crates/bevy_render/src/lib.rs index 5eac35b5a4476d..5e624fe34522e6 100644 --- a/crates/bevy_render/src/lib.rs +++ b/crates/bevy_render/src/lib.rs @@ -178,7 +178,7 @@ impl Plugin for RenderPlugin { .insert_resource(asset_server) .init_resource::(); - let (sender, receiver) = bevy_core::create_time_channels(); + let (sender, receiver) = bevy_time::create_time_channels(); app.insert_resource(receiver); render_app.insert_resource(sender); diff --git a/crates/bevy_render/src/renderer/mod.rs b/crates/bevy_render/src/renderer/mod.rs index cbabd7d34d40a5..115893d76d6731 100644 --- a/crates/bevy_render/src/renderer/mod.rs +++ b/crates/bevy_render/src/renderer/mod.rs @@ -10,8 +10,8 @@ use crate::{ settings::{WgpuSettings, WgpuSettingsPriority}, view::{ExtractedWindows, ViewTarget}, }; -use bevy_core::TimeSender; use bevy_ecs::prelude::*; +use bevy_time::TimeSender; use bevy_utils::Instant; use std::sync::Arc; use wgpu::{AdapterInfo, CommandEncoder, Instance, Queue, RequestAdapterOptions}; diff --git a/crates/bevy_time/Cargo.toml b/crates/bevy_time/Cargo.toml index b1b2c03ff8bf7b..897706ab57415e 100644 --- a/crates/bevy_time/Cargo.toml +++ b/crates/bevy_time/Cargo.toml @@ -15,3 +15,6 @@ bevy_app = { path = "../bevy_app", version = "0.8.0-dev" } bevy_ecs = { path = "../bevy_ecs", version = "0.8.0-dev", features = ["bevy_reflect"] } bevy_reflect = { path = "../bevy_reflect", version = "0.8.0-dev", features = ["bevy"] } bevy_utils = { path = "../bevy_utils", version = "0.8.0-dev" } + +# other +crossbeam-channel = "0.5.0" \ No newline at end of file diff --git a/crates/bevy_time/src/lib.rs b/crates/bevy_time/src/lib.rs index dc1f48552031c5..32ab248d05ae03 100644 --- a/crates/bevy_time/src/lib.rs +++ b/crates/bevy_time/src/lib.rs @@ -9,6 +9,10 @@ pub use stopwatch::*; pub use time::*; pub use timer::*; +use bevy_ecs::system::{Local, Res, ResMut}; +use bevy_utils::{tracing::warn, Instant}; +use crossbeam_channel::{Receiver, Sender}; + pub mod prelude { //! The Bevy Time Prelude. #[doc(hidden)] @@ -41,6 +45,36 @@ impl Plugin for TimePlugin { } } -fn time_system(mut time: ResMut