diff --git a/Cargo.lock b/Cargo.lock index 24b3183..fb1b231 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -287,7 +287,7 @@ dependencies = [ "fastrand 2.0.1", "geo", "itertools 0.12.0", - "puffin", + "puffin 0.18.1", "puffin_egui", "rand", "ron", @@ -4431,6 +4431,18 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d135ede8821cf6376eb7a64148901e1690b788c11ae94dc297ae917dbc91dc0e" +[[package]] +name = "puffin" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02330f795caafc2007510f742624c10aa813b8c3097c77ff344b1b86eb6be846" +dependencies = [ + "anyhow", + "byteorder", + "cfg-if", + "once_cell", +] + [[package]] name = "puffin" version = "0.19.0" @@ -4449,16 +4461,16 @@ dependencies = [ [[package]] name = "puffin_egui" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c967110bf23431eb332ef2290419825f5aa915192ff26b56c294019cab3399d" +checksum = "49058d85ba61f403263d90fe72df1da7f60522a2fcd3a44a4f6acd5459106081" dependencies = [ - "egui 0.25.0", + "egui 0.26.2", "indexmap", "natord", "once_cell", "parking_lot", - "puffin", + "puffin 0.19.0", "time", "vec1", "web-time", diff --git a/Cargo.toml b/Cargo.toml index 28fa983..2a1de21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,8 +29,8 @@ rotsprite = "0.1" egui = "0.25" bevy_egui = "0.25" -puffin = "0.19" -puffin_egui = "0.25" +puffin = "0.18" +puffin_egui = "0.26" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] bevy_dylib = "0.13" diff --git a/src/chunk.rs b/src/chunk.rs index 15a238a..6c6023b 100644 --- a/src/chunk.rs +++ b/src/chunk.rs @@ -1,4 +1,4 @@ -use bevy::render::render_resource::*; +use bevy::render::{render_asset::RenderAssetUsages, render_resource::*}; use std::collections::HashSet; use crate::{prelude::*, rigidbody}; @@ -69,6 +69,7 @@ impl Chunk { TextureDimension::D2, vec![0; CHUNK_LENGHT.pow(2) * 4], TextureFormat::Rgba8UnormSrgb, + RenderAssetUsages::RENDER_WORLD ) } diff --git a/src/debug.rs b/src/debug.rs index 16dd094..f8fa173 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -175,8 +175,8 @@ fn render_actors(mut gizmos: Gizmos, actors: Query<&Actor>) { } fn _camera(keys: Res>, mut camera_q: Query<&mut Transform, With>) { - let x = -(keys.pressed(KeyCode::A) as u8 as f32) + keys.pressed(KeyCode::D) as u8 as f32; - let y = -(keys.pressed(KeyCode::S) as u8 as f32) + keys.pressed(KeyCode::W) as u8 as f32; + let x = -(keys.pressed(KeyCode::KeyA) as u8 as f32) + keys.pressed(KeyCode::KeyD) as u8 as f32; + let y = -(keys.pressed(KeyCode::KeyS) as u8 as f32) + keys.pressed(KeyCode::KeyW) as u8 as f32; let v = Vec2::new(x, y).normalize_or_zero().extend(0.); camera_q.single_mut().translation += v * _CAMERA_SPEED; @@ -221,7 +221,7 @@ pub fn grab_rigidbodies( let (camera, camera_transform) = camera_q.single(); let window = window.single(); - if input.pressed(KeyCode::R) { + if input.pressed(KeyCode::KeyR) { if let Some(world_position) = window .cursor_position() .and_then(|cursor| camera.viewport_to_world(camera_transform, cursor)) diff --git a/src/main.rs b/src/main.rs index d808b3b..87cef9e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,7 +60,7 @@ fn main() { let mut app = App::new(); - app.add_state::() + app.init_state::() .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest())) //local plugins .add_plugins(( diff --git a/src/player.rs b/src/player.rs index 8fd5238..fb5e362 100644 --- a/src/player.rs +++ b/src/player.rs @@ -233,7 +233,7 @@ pub fn tool_system( mut tool: Query<(&mut Transform, &GlobalTransform, &mut Sprite), With>, mut camera: Query<(&Camera, &GlobalTransform), Without>, tool_front_ent: Query>, - querys: (Query<&Window>, Query<(&mut TextureAtlas, &Player)>), + querys: (Query<&Window>, Query<(&mut Sprite, &Player)>), resources: (ResMut, ResMut, Res), materials: (Res>, Res), ) { @@ -379,10 +379,10 @@ pub fn get_input( } //Movement - if keys.pressed(KeyCode::A) { + if keys.pressed(KeyCode::KeyA) { inputs.left = 1.; } - if keys.pressed(KeyCode::D) { + if keys.pressed(KeyCode::KeyD) { inputs.right = 1.; } @@ -395,13 +395,13 @@ pub fn get_input( } //Numbers, to select atoms - if keys.just_pressed(KeyCode::Key1) { + if keys.just_pressed(KeyCode::Digit1) { inputs.numbers[0] = true; - } else if keys.just_pressed(KeyCode::Key2) { + } else if keys.just_pressed(KeyCode::Digit2) { inputs.numbers[1] = true; - } else if keys.just_pressed(KeyCode::Key3) { + } else if keys.just_pressed(KeyCode::Digit3) { inputs.numbers[2] = true; - } else if keys.just_pressed(KeyCode::Key4) { + } else if keys.just_pressed(KeyCode::Digit4) { inputs.numbers[3] = true; } }