From 719379a8a76ab0685f2bd14bebe2f0cd1e97f06b Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:14:36 -0600 Subject: Bevy 0.10 (#79) * replace 0.9.1 with 0.10.0 * start migrating to bevy .10 * well it compiles * doesn't immediately panic * remove unused imports * fmt * delete azalea-ecs * make RelativeEntityUpdate an EntityCommand * fix a doc test * explain what FixedUpdate does --- azalea-client/src/task_pool.rs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'azalea-client/src/task_pool.rs') diff --git a/azalea-client/src/task_pool.rs b/azalea-client/src/task_pool.rs index 59f70487..8df554f0 100644 --- a/azalea-client/src/task_pool.rs +++ b/azalea-client/src/task_pool.rs @@ -1,11 +1,16 @@ //! Borrowed from `bevy_core`. -use azalea_ecs::{ - app::{App, Plugin}, - schedule::IntoSystemDescriptor, - system::Resource, +use std::marker::PhantomData; + +use bevy_app::{App, CoreSet, Plugin}; +use bevy_ecs::{ + schedule::IntoSystemConfig, + system::{NonSend, Resource}, +}; +use bevy_tasks::{ + tick_global_task_pools_on_main_thread, AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool, + TaskPoolBuilder, }; -use bevy_tasks::{AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool, TaskPoolBuilder}; /// Setup of default task pools: `AsyncComputeTaskPool`, `ComputeTaskPool`, /// `IoTaskPool`. @@ -22,13 +27,16 @@ impl Plugin for TaskPoolPlugin { self.task_pool_options.create_default_pools(); #[cfg(not(target_arch = "wasm32"))] - app.add_system_to_stage( - azalea_ecs::app::CoreStage::Last, - bevy_tasks::tick_global_task_pools_on_main_thread.at_end(), - ); + app.add_system(tick_global_task_pools.in_base_set(CoreSet::Last)); } } +pub struct NonSendMarker(PhantomData<*mut ()>); +#[cfg(not(target_arch = "wasm32"))] +fn tick_global_task_pools(_main_thread_marker: Option>) { + tick_global_task_pools_on_main_thread(); +} + /// Helper for configuring and creating the default task pools. For end-users /// who want full control, set up [`TaskPoolPlugin`](TaskPoolPlugin) #[derive(Clone, Resource)] -- cgit v1.2.3