Remove unneded use of nonsendsync

This commit is contained in:
griffi-gh 2024-05-13 23:44:48 +02:00
parent 1b096c07ed
commit db05b0902d
6 changed files with 8 additions and 8 deletions

View file

@ -1,4 +1,4 @@
use shipyard::{AllStoragesView, IntoIter, NonSendSync, Unique, UniqueView, UniqueViewMut, View}; use shipyard::{AllStoragesView, IntoIter, Unique, UniqueView, UniqueViewMut, View};
use crate::{events::InputDeviceEvent, rendering::Renderer}; use crate::{events::InputDeviceEvent, rendering::Renderer};
use winit::{ use winit::{
dpi::PhysicalPosition, event::{DeviceEvent, ElementState, RawKeyEvent}, keyboard::{KeyCode, PhysicalKey}, window::CursorGrabMode dpi::PhysicalPosition, event::{DeviceEvent, ElementState, RawKeyEvent}, keyboard::{KeyCode, PhysicalKey}, window::CursorGrabMode
@ -9,7 +9,7 @@ pub struct CursorLock(pub bool);
pub fn update_cursor_lock_state( pub fn update_cursor_lock_state(
lock: UniqueView<CursorLock>, lock: UniqueView<CursorLock>,
display: NonSendSync<UniqueView<Renderer>> display: UniqueView<Renderer>
) { ) {
if cfg!(target_os = "android") { if cfg!(target_os = "android") {
return return
@ -41,7 +41,7 @@ pub fn lock_cursor_now(
pub fn debug_toggle_lock( pub fn debug_toggle_lock(
mut lock: UniqueViewMut<CursorLock>, mut lock: UniqueViewMut<CursorLock>,
device_events: View<InputDeviceEvent>, device_events: View<InputDeviceEvent>,
ren: NonSendSync<UniqueView<Renderer>>, ren: UniqueView<Renderer>,
) { ) {
for evt in device_events.iter() { for evt in device_events.iter() {
if let DeviceEvent::Key(RawKeyEvent { if let DeviceEvent::Key(RawKeyEvent {

View file

@ -90,7 +90,7 @@ pub fn process_winit_events(world: &mut World, event: &Event<()>) {
// mut storages: AllStoragesViewMut, // mut storages: AllStoragesViewMut,
// ) { // ) {
// let (w, h) = { // let (w, h) = {
// let renderer = storages.borrow::<NonSendSync<UniqueView<Renderer>>>().unwrap(); // let renderer = storages.borrow::<UniqueView<Renderer>>().unwrap();
// (renderer.size().width, renderer.size().height) // (renderer.size().width, renderer.size().height)
// }; // };
// storages.add_entity(( // storages.add_entity((

View file

@ -13,7 +13,7 @@ pub struct UiState {
pub fn kubi_ui_init( pub fn kubi_ui_init(
storages: AllStoragesView storages: AllStoragesView
) { ) {
let renderer = storages.borrow::<NonSendSync<UniqueView<Renderer>>>().unwrap(); let renderer = storages.borrow::<UniqueView<Renderer>>().unwrap();
storages.add_unique_non_send_sync(UiState { storages.add_unique_non_send_sync(UiState {
hui: UiInstance::new(), hui: UiInstance::new(),
renderer: WgpuUiRenderer::new(renderer.device(), renderer.surface_config().format), renderer: WgpuUiRenderer::new(renderer.device(), renderer.surface_config().format),

View file

@ -310,7 +310,7 @@ pub fn kubi_main(
//Start rendering (maybe use custom views for this?) //Start rendering (maybe use custom views for this?)
// let target = { // let target = {
// let renderer = world.borrow::<NonSendSync<UniqueView<Renderer>>>().unwrap(); // let renderer = world.borrow::<UniqueView<Renderer>>().unwrap();
// renderer.display.draw() // renderer.display.draw()
// }; // };
// world.add_unique_non_send_sync(RenderTarget(target)); // world.add_unique_non_send_sync(RenderTarget(target));

View file

@ -76,7 +76,7 @@ pub struct UiFontPrefab(pub FontHandle);
pub fn load_prefabs( pub fn load_prefabs(
storages: AllStoragesView, storages: AllStoragesView,
renderer: NonSendSync<UniqueView<Renderer>>, renderer: UniqueView<Renderer>,
mut ui: NonSendSync<UniqueViewMut<UiState>>, mut ui: NonSendSync<UniqueViewMut<UiState>>,
assman: UniqueView<AssetManager> assman: UniqueView<AssetManager>
) { ) {

View file

@ -266,7 +266,7 @@ fn process_completed_tasks(
task_manager: UniqueView<ChunkTaskManager>, task_manager: UniqueView<ChunkTaskManager>,
mut world: UniqueViewMut<ChunkStorage>, mut world: UniqueViewMut<ChunkStorage>,
mut meshes: NonSendSync<UniqueViewMut<ChunkMeshStorage>>, mut meshes: NonSendSync<UniqueViewMut<ChunkMeshStorage>>,
renderer: NonSendSync<UniqueView<Renderer>>, renderer: UniqueView<Renderer>,
state: UniqueView<GameState>, state: UniqueView<GameState>,
mut queue: UniqueViewMut<BlockUpdateQueue>, mut queue: UniqueViewMut<BlockUpdateQueue>,
) { ) {