From 393865484377ea1575fe1c9cdc39d69c5f247c81 Mon Sep 17 00:00:00 2001 From: crumblingstatue Date: Fri, 7 Apr 2023 00:50:15 +0200 Subject: [PATCH] Inspect World as well --- Cargo.lock | 4 ++-- src/game.rs | 1 - src/world.rs | 9 +++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 357d0c2..512d975 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -192,7 +192,7 @@ dependencies = [ [[package]] name = "egui-inspect" version = "0.1.0" -source = "git+https://github.com/crumblingstatue/egui-inspect.git#135c81eb0264ddbec69f98b0a9d5c7ec22867736" +source = "git+https://github.com/crumblingstatue/egui-inspect.git#5cf1f05c0f4f6625eb9a46ee0faebdb27919f9bf" dependencies = [ "egui", "egui-inspect-derive", @@ -201,7 +201,7 @@ dependencies = [ [[package]] name = "egui-inspect-derive" version = "0.1.0" -source = "git+https://github.com/crumblingstatue/egui-inspect.git#135c81eb0264ddbec69f98b0a9d5c7ec22867736" +source = "git+https://github.com/crumblingstatue/egui-inspect.git#5cf1f05c0f4f6625eb9a46ee0faebdb27919f9bf" dependencies = [ "proc-macro2", "quote", diff --git a/src/game.rs b/src/game.rs index 3e25dc4..78038eb 100644 --- a/src/game.rs +++ b/src/game.rs @@ -26,7 +26,6 @@ use self::player::Player; #[derivative(Debug)] pub struct GameState { pub camera_offset: WorldPos, - #[opaque] pub world: World, pub player: Player, pub gravity: f32, diff --git a/src/world.rs b/src/world.rs index b089702..b45ec49 100644 --- a/src/world.rs +++ b/src/world.rs @@ -1,16 +1,17 @@ +use egui_inspect::derive::Inspect; use fnv::FnvHashMap; use crate::worldgen::Worldgen; pub type ChunkPosScalar = u16; -#[derive(Hash, PartialEq, Eq, Debug, Clone, Copy)] +#[derive(Hash, PartialEq, Eq, Debug, Clone, Copy, Inspect)] pub struct ChunkPos { pub x: ChunkPosScalar, pub y: ChunkPosScalar, } -#[derive(Default, Debug)] +#[derive(Default, Debug, Inspect)] pub struct World { /// The currently loaded chunks chunks: FnvHashMap, @@ -99,7 +100,7 @@ const CHUNK_N_TILES: usize = CHUNK_EXTENT as usize * CHUNK_EXTENT as usize; type ChunkTiles = [Tile; CHUNK_N_TILES]; -#[derive(Debug)] +#[derive(Debug, Inspect)] pub struct Chunk { tiles: ChunkTiles, } @@ -136,7 +137,7 @@ impl Chunk { pub type TileId = u16; -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, Inspect)] pub struct Tile { /// Background wall behind entities pub bg: TileId,