mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-17 04:45:02 +01:00
Inspect World as well
This commit is contained in:
parent
a11d69eee2
commit
3938654843
3 changed files with 7 additions and 7 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
|
@ -192,7 +192,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "egui-inspect"
|
name = "egui-inspect"
|
||||||
version = "0.1.0"
|
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 = [
|
dependencies = [
|
||||||
"egui",
|
"egui",
|
||||||
"egui-inspect-derive",
|
"egui-inspect-derive",
|
||||||
|
|
@ -201,7 +201,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "egui-inspect-derive"
|
name = "egui-inspect-derive"
|
||||||
version = "0.1.0"
|
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 = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ use self::player::Player;
|
||||||
#[derivative(Debug)]
|
#[derivative(Debug)]
|
||||||
pub struct GameState {
|
pub struct GameState {
|
||||||
pub camera_offset: WorldPos,
|
pub camera_offset: WorldPos,
|
||||||
#[opaque]
|
|
||||||
pub world: World,
|
pub world: World,
|
||||||
pub player: Player,
|
pub player: Player,
|
||||||
pub gravity: f32,
|
pub gravity: f32,
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,17 @@
|
||||||
|
use egui_inspect::derive::Inspect;
|
||||||
use fnv::FnvHashMap;
|
use fnv::FnvHashMap;
|
||||||
|
|
||||||
use crate::worldgen::Worldgen;
|
use crate::worldgen::Worldgen;
|
||||||
|
|
||||||
pub type ChunkPosScalar = u16;
|
pub type ChunkPosScalar = u16;
|
||||||
|
|
||||||
#[derive(Hash, PartialEq, Eq, Debug, Clone, Copy)]
|
#[derive(Hash, PartialEq, Eq, Debug, Clone, Copy, Inspect)]
|
||||||
pub struct ChunkPos {
|
pub struct ChunkPos {
|
||||||
pub x: ChunkPosScalar,
|
pub x: ChunkPosScalar,
|
||||||
pub y: ChunkPosScalar,
|
pub y: ChunkPosScalar,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug, Inspect)]
|
||||||
pub struct World {
|
pub struct World {
|
||||||
/// The currently loaded chunks
|
/// The currently loaded chunks
|
||||||
chunks: FnvHashMap<ChunkPos, Chunk>,
|
chunks: FnvHashMap<ChunkPos, Chunk>,
|
||||||
|
|
@ -99,7 +100,7 @@ const CHUNK_N_TILES: usize = CHUNK_EXTENT as usize * CHUNK_EXTENT as usize;
|
||||||
|
|
||||||
type ChunkTiles = [Tile; CHUNK_N_TILES];
|
type ChunkTiles = [Tile; CHUNK_N_TILES];
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Inspect)]
|
||||||
pub struct Chunk {
|
pub struct Chunk {
|
||||||
tiles: ChunkTiles,
|
tiles: ChunkTiles,
|
||||||
}
|
}
|
||||||
|
|
@ -136,7 +137,7 @@ impl Chunk {
|
||||||
|
|
||||||
pub type TileId = u16;
|
pub type TileId = u16;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug, Inspect)]
|
||||||
pub struct Tile {
|
pub struct Tile {
|
||||||
/// Background wall behind entities
|
/// Background wall behind entities
|
||||||
pub bg: TileId,
|
pub bg: TileId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue