From a791d7c3dc7b0eca2ee4b5408496464d1528dc1c Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Mon, 30 Jan 2023 01:46:22 +0100 Subject: [PATCH] restructure --- Cargo.toml | 53 ++++++------------ crabs.txt | 1 - kubi-server/Cargo.toml | 8 +++ kubi-server/src/main.rs | 3 + kubi-shared/Cargo.toml | 8 +++ kubi-shared/src/lib.rs | 14 +++++ kubi/Cargo.toml | 20 +++++++ README.md => kubi/README.md | 0 {assets => kubi/assets}/blocks/bedrock.png | Bin {assets => kubi/assets}/blocks/dirt.png | Bin {assets => kubi/assets}/blocks/grass_side.png | Bin .../assets}/blocks/grass_side_snow.png | Bin {assets => kubi/assets}/blocks/grass_top.png | Bin {assets => kubi/assets}/blocks/leaf.png | Bin {assets => kubi/assets}/blocks/sand.png | Bin {assets => kubi/assets}/blocks/snow.png | Bin {assets => kubi/assets}/blocks/stone.png | Bin {assets => kubi/assets}/blocks/tall_grass.png | Bin {assets => kubi/assets}/blocks/torch.png | Bin {assets => kubi/assets}/blocks/wood.png | Bin {assets => kubi/assets}/blocks/wood_top.png | Bin {shaders => kubi/shaders}/colored.frag | 0 {shaders => kubi/shaders}/colored.vert | 0 {shaders => kubi/shaders}/selection_box.frag | 0 {shaders => kubi/shaders}/selection_box.vert | 0 {shaders => kubi/shaders}/world.frag | 0 {shaders => kubi/shaders}/world.vert | 0 {src => kubi/src}/block_placement.rs | 0 {src => kubi/src}/camera.rs | 0 {src => kubi/src}/camera/frustum.rs | 0 {src => kubi/src}/camera/matrices.rs | 0 {src => kubi/src}/control_flow.rs | 0 {src => kubi/src}/cursor_lock.rs | 0 {src => kubi/src}/delta_time.rs | 0 {src => kubi/src}/events.rs | 0 {src => kubi/src}/events/player_actions.rs | 0 {src => kubi/src}/fly_controller.rs | 0 {src => kubi/src}/input.rs | 0 {src => kubi/src}/logging.rs | 0 {src => kubi/src}/main.rs | 0 {src => kubi/src}/player.rs | 0 {src => kubi/src}/prefabs.rs | 0 {src => kubi/src}/prefabs/shaders.rs | 0 {src => kubi/src}/prefabs/texture.rs | 0 {src => kubi/src}/rendering.rs | 0 {src => kubi/src}/rendering/primitives.rs | 0 {src => kubi/src}/rendering/selection_box.rs | 0 {src => kubi/src}/rendering/world.rs | 0 {src => kubi/src}/settings.rs | 0 {src => kubi/src}/transform.rs | 0 {src => kubi/src}/world.rs | 0 {src => kubi/src}/world/block.rs | 0 {src => kubi/src}/world/chunk.rs | 0 {src => kubi/src}/world/loading.rs | 0 {src => kubi/src}/world/mesh.rs | 0 {src => kubi/src}/world/mesh/data.rs | 0 {src => kubi/src}/world/neighbors.rs | 0 {src => kubi/src}/world/raycast.rs | 0 {src => kubi/src}/world/tasks.rs | 0 {src => kubi/src}/world/worldgen.rs | 0 60 files changed, 71 insertions(+), 36 deletions(-) delete mode 100644 crabs.txt create mode 100644 kubi-server/Cargo.toml create mode 100644 kubi-server/src/main.rs create mode 100644 kubi-shared/Cargo.toml create mode 100644 kubi-shared/src/lib.rs create mode 100644 kubi/Cargo.toml rename README.md => kubi/README.md (100%) rename {assets => kubi/assets}/blocks/bedrock.png (100%) rename {assets => kubi/assets}/blocks/dirt.png (100%) rename {assets => kubi/assets}/blocks/grass_side.png (100%) rename {assets => kubi/assets}/blocks/grass_side_snow.png (100%) rename {assets => kubi/assets}/blocks/grass_top.png (100%) rename {assets => kubi/assets}/blocks/leaf.png (100%) rename {assets => kubi/assets}/blocks/sand.png (100%) rename {assets => kubi/assets}/blocks/snow.png (100%) rename {assets => kubi/assets}/blocks/stone.png (100%) rename {assets => kubi/assets}/blocks/tall_grass.png (100%) rename {assets => kubi/assets}/blocks/torch.png (100%) rename {assets => kubi/assets}/blocks/wood.png (100%) rename {assets => kubi/assets}/blocks/wood_top.png (100%) rename {shaders => kubi/shaders}/colored.frag (100%) rename {shaders => kubi/shaders}/colored.vert (100%) rename {shaders => kubi/shaders}/selection_box.frag (100%) rename {shaders => kubi/shaders}/selection_box.vert (100%) rename {shaders => kubi/shaders}/world.frag (100%) rename {shaders => kubi/shaders}/world.vert (100%) rename {src => kubi/src}/block_placement.rs (100%) rename {src => kubi/src}/camera.rs (100%) rename {src => kubi/src}/camera/frustum.rs (100%) rename {src => kubi/src}/camera/matrices.rs (100%) rename {src => kubi/src}/control_flow.rs (100%) rename {src => kubi/src}/cursor_lock.rs (100%) rename {src => kubi/src}/delta_time.rs (100%) rename {src => kubi/src}/events.rs (100%) rename {src => kubi/src}/events/player_actions.rs (100%) rename {src => kubi/src}/fly_controller.rs (100%) rename {src => kubi/src}/input.rs (100%) rename {src => kubi/src}/logging.rs (100%) rename {src => kubi/src}/main.rs (100%) rename {src => kubi/src}/player.rs (100%) rename {src => kubi/src}/prefabs.rs (100%) rename {src => kubi/src}/prefabs/shaders.rs (100%) rename {src => kubi/src}/prefabs/texture.rs (100%) rename {src => kubi/src}/rendering.rs (100%) rename {src => kubi/src}/rendering/primitives.rs (100%) rename {src => kubi/src}/rendering/selection_box.rs (100%) rename {src => kubi/src}/rendering/world.rs (100%) rename {src => kubi/src}/settings.rs (100%) rename {src => kubi/src}/transform.rs (100%) rename {src => kubi/src}/world.rs (100%) rename {src => kubi/src}/world/block.rs (100%) rename {src => kubi/src}/world/chunk.rs (100%) rename {src => kubi/src}/world/loading.rs (100%) rename {src => kubi/src}/world/mesh.rs (100%) rename {src => kubi/src}/world/mesh/data.rs (100%) rename {src => kubi/src}/world/neighbors.rs (100%) rename {src => kubi/src}/world/raycast.rs (100%) rename {src => kubi/src}/world/tasks.rs (100%) rename {src => kubi/src}/world/worldgen.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index b558ff3..078f0ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,35 +1,18 @@ -[package] -name = "kubi" -version = "0.1.0" -edition = "2021" - -[dependencies] -glium = "0.32" -image = { version = "0.24", default_features = false, features = ["png"] } -log = "0.4" -env_logger = "0.10" -strum = { version = "0.24", features = ["derive"] } -glam = { version = "0.22", features = ["debug-glam-assert", "mint", "fast-math"] } -hashbrown = "0.13" -rayon = "1.6" -shipyard = { version = "0.6", features = ["thread_local"] } -nohash-hasher = "0.2.0" -anyhow = "1.0" -flume = "0.10" -bracket-noise = "0.8" -#rkyv = "0.7" - -[profile.dev] -opt-level = 1 - -[profile.dev.package."*"] -opt-level = 1 - -[profile.dev.package.glium] -opt-level = 3 - -[profile.dev.package.bracket-noise] -opt-level = 3 - -[profile.dev.package.rayon] -opt-level = 3 +[workspace] +members = ["kubi", "kubi-server", "kubi-shared"] +resolver = "2" + +[profile.dev] +opt-level = 1 + +[profile.dev.package."*"] +opt-level = 1 + +[profile.dev.package.glium] +opt-level = 3 + +[profile.dev.package.bracket-noise] +opt-level = 3 + +[profile.dev.package.rayon] +opt-level = 3 diff --git a/crabs.txt b/crabs.txt deleted file mode 100644 index aecc062..0000000 --- a/crabs.txt +++ /dev/null @@ -1 +0,0 @@ -sorry no crabs here diff --git a/kubi-server/Cargo.toml b/kubi-server/Cargo.toml new file mode 100644 index 0000000..abf3812 --- /dev/null +++ b/kubi-server/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "kubi-server" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/kubi-server/src/main.rs b/kubi-server/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/kubi-server/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/kubi-shared/Cargo.toml b/kubi-shared/Cargo.toml new file mode 100644 index 0000000..93a1ac2 --- /dev/null +++ b/kubi-shared/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "kubi-shared" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/kubi-shared/src/lib.rs b/kubi-shared/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/kubi-shared/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/kubi/Cargo.toml b/kubi/Cargo.toml new file mode 100644 index 0000000..0a454a3 --- /dev/null +++ b/kubi/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "kubi" +version = "0.1.0" +edition = "2021" + +[dependencies] +glium = "0.32" +image = { version = "0.24", default_features = false, features = ["png"] } +log = "0.4" +env_logger = "0.10" +strum = { version = "0.24", features = ["derive"] } +glam = { version = "0.22", features = ["debug-glam-assert", "mint", "fast-math"] } +hashbrown = "0.13" +rayon = "1.6" +shipyard = { version = "0.6", features = ["thread_local"] } +nohash-hasher = "0.2.0" +anyhow = "1.0" +flume = "0.10" +bracket-noise = "0.8" +#rkyv = "0.7" diff --git a/README.md b/kubi/README.md similarity index 100% rename from README.md rename to kubi/README.md diff --git a/assets/blocks/bedrock.png b/kubi/assets/blocks/bedrock.png similarity index 100% rename from assets/blocks/bedrock.png rename to kubi/assets/blocks/bedrock.png diff --git a/assets/blocks/dirt.png b/kubi/assets/blocks/dirt.png similarity index 100% rename from assets/blocks/dirt.png rename to kubi/assets/blocks/dirt.png diff --git a/assets/blocks/grass_side.png b/kubi/assets/blocks/grass_side.png similarity index 100% rename from assets/blocks/grass_side.png rename to kubi/assets/blocks/grass_side.png diff --git a/assets/blocks/grass_side_snow.png b/kubi/assets/blocks/grass_side_snow.png similarity index 100% rename from assets/blocks/grass_side_snow.png rename to kubi/assets/blocks/grass_side_snow.png diff --git a/assets/blocks/grass_top.png b/kubi/assets/blocks/grass_top.png similarity index 100% rename from assets/blocks/grass_top.png rename to kubi/assets/blocks/grass_top.png diff --git a/assets/blocks/leaf.png b/kubi/assets/blocks/leaf.png similarity index 100% rename from assets/blocks/leaf.png rename to kubi/assets/blocks/leaf.png diff --git a/assets/blocks/sand.png b/kubi/assets/blocks/sand.png similarity index 100% rename from assets/blocks/sand.png rename to kubi/assets/blocks/sand.png diff --git a/assets/blocks/snow.png b/kubi/assets/blocks/snow.png similarity index 100% rename from assets/blocks/snow.png rename to kubi/assets/blocks/snow.png diff --git a/assets/blocks/stone.png b/kubi/assets/blocks/stone.png similarity index 100% rename from assets/blocks/stone.png rename to kubi/assets/blocks/stone.png diff --git a/assets/blocks/tall_grass.png b/kubi/assets/blocks/tall_grass.png similarity index 100% rename from assets/blocks/tall_grass.png rename to kubi/assets/blocks/tall_grass.png diff --git a/assets/blocks/torch.png b/kubi/assets/blocks/torch.png similarity index 100% rename from assets/blocks/torch.png rename to kubi/assets/blocks/torch.png diff --git a/assets/blocks/wood.png b/kubi/assets/blocks/wood.png similarity index 100% rename from assets/blocks/wood.png rename to kubi/assets/blocks/wood.png diff --git a/assets/blocks/wood_top.png b/kubi/assets/blocks/wood_top.png similarity index 100% rename from assets/blocks/wood_top.png rename to kubi/assets/blocks/wood_top.png diff --git a/shaders/colored.frag b/kubi/shaders/colored.frag similarity index 100% rename from shaders/colored.frag rename to kubi/shaders/colored.frag diff --git a/shaders/colored.vert b/kubi/shaders/colored.vert similarity index 100% rename from shaders/colored.vert rename to kubi/shaders/colored.vert diff --git a/shaders/selection_box.frag b/kubi/shaders/selection_box.frag similarity index 100% rename from shaders/selection_box.frag rename to kubi/shaders/selection_box.frag diff --git a/shaders/selection_box.vert b/kubi/shaders/selection_box.vert similarity index 100% rename from shaders/selection_box.vert rename to kubi/shaders/selection_box.vert diff --git a/shaders/world.frag b/kubi/shaders/world.frag similarity index 100% rename from shaders/world.frag rename to kubi/shaders/world.frag diff --git a/shaders/world.vert b/kubi/shaders/world.vert similarity index 100% rename from shaders/world.vert rename to kubi/shaders/world.vert diff --git a/src/block_placement.rs b/kubi/src/block_placement.rs similarity index 100% rename from src/block_placement.rs rename to kubi/src/block_placement.rs diff --git a/src/camera.rs b/kubi/src/camera.rs similarity index 100% rename from src/camera.rs rename to kubi/src/camera.rs diff --git a/src/camera/frustum.rs b/kubi/src/camera/frustum.rs similarity index 100% rename from src/camera/frustum.rs rename to kubi/src/camera/frustum.rs diff --git a/src/camera/matrices.rs b/kubi/src/camera/matrices.rs similarity index 100% rename from src/camera/matrices.rs rename to kubi/src/camera/matrices.rs diff --git a/src/control_flow.rs b/kubi/src/control_flow.rs similarity index 100% rename from src/control_flow.rs rename to kubi/src/control_flow.rs diff --git a/src/cursor_lock.rs b/kubi/src/cursor_lock.rs similarity index 100% rename from src/cursor_lock.rs rename to kubi/src/cursor_lock.rs diff --git a/src/delta_time.rs b/kubi/src/delta_time.rs similarity index 100% rename from src/delta_time.rs rename to kubi/src/delta_time.rs diff --git a/src/events.rs b/kubi/src/events.rs similarity index 100% rename from src/events.rs rename to kubi/src/events.rs diff --git a/src/events/player_actions.rs b/kubi/src/events/player_actions.rs similarity index 100% rename from src/events/player_actions.rs rename to kubi/src/events/player_actions.rs diff --git a/src/fly_controller.rs b/kubi/src/fly_controller.rs similarity index 100% rename from src/fly_controller.rs rename to kubi/src/fly_controller.rs diff --git a/src/input.rs b/kubi/src/input.rs similarity index 100% rename from src/input.rs rename to kubi/src/input.rs diff --git a/src/logging.rs b/kubi/src/logging.rs similarity index 100% rename from src/logging.rs rename to kubi/src/logging.rs diff --git a/src/main.rs b/kubi/src/main.rs similarity index 100% rename from src/main.rs rename to kubi/src/main.rs diff --git a/src/player.rs b/kubi/src/player.rs similarity index 100% rename from src/player.rs rename to kubi/src/player.rs diff --git a/src/prefabs.rs b/kubi/src/prefabs.rs similarity index 100% rename from src/prefabs.rs rename to kubi/src/prefabs.rs diff --git a/src/prefabs/shaders.rs b/kubi/src/prefabs/shaders.rs similarity index 100% rename from src/prefabs/shaders.rs rename to kubi/src/prefabs/shaders.rs diff --git a/src/prefabs/texture.rs b/kubi/src/prefabs/texture.rs similarity index 100% rename from src/prefabs/texture.rs rename to kubi/src/prefabs/texture.rs diff --git a/src/rendering.rs b/kubi/src/rendering.rs similarity index 100% rename from src/rendering.rs rename to kubi/src/rendering.rs diff --git a/src/rendering/primitives.rs b/kubi/src/rendering/primitives.rs similarity index 100% rename from src/rendering/primitives.rs rename to kubi/src/rendering/primitives.rs diff --git a/src/rendering/selection_box.rs b/kubi/src/rendering/selection_box.rs similarity index 100% rename from src/rendering/selection_box.rs rename to kubi/src/rendering/selection_box.rs diff --git a/src/rendering/world.rs b/kubi/src/rendering/world.rs similarity index 100% rename from src/rendering/world.rs rename to kubi/src/rendering/world.rs diff --git a/src/settings.rs b/kubi/src/settings.rs similarity index 100% rename from src/settings.rs rename to kubi/src/settings.rs diff --git a/src/transform.rs b/kubi/src/transform.rs similarity index 100% rename from src/transform.rs rename to kubi/src/transform.rs diff --git a/src/world.rs b/kubi/src/world.rs similarity index 100% rename from src/world.rs rename to kubi/src/world.rs diff --git a/src/world/block.rs b/kubi/src/world/block.rs similarity index 100% rename from src/world/block.rs rename to kubi/src/world/block.rs diff --git a/src/world/chunk.rs b/kubi/src/world/chunk.rs similarity index 100% rename from src/world/chunk.rs rename to kubi/src/world/chunk.rs diff --git a/src/world/loading.rs b/kubi/src/world/loading.rs similarity index 100% rename from src/world/loading.rs rename to kubi/src/world/loading.rs diff --git a/src/world/mesh.rs b/kubi/src/world/mesh.rs similarity index 100% rename from src/world/mesh.rs rename to kubi/src/world/mesh.rs diff --git a/src/world/mesh/data.rs b/kubi/src/world/mesh/data.rs similarity index 100% rename from src/world/mesh/data.rs rename to kubi/src/world/mesh/data.rs diff --git a/src/world/neighbors.rs b/kubi/src/world/neighbors.rs similarity index 100% rename from src/world/neighbors.rs rename to kubi/src/world/neighbors.rs diff --git a/src/world/raycast.rs b/kubi/src/world/raycast.rs similarity index 100% rename from src/world/raycast.rs rename to kubi/src/world/raycast.rs diff --git a/src/world/tasks.rs b/kubi/src/world/tasks.rs similarity index 100% rename from src/world/tasks.rs rename to kubi/src/world/tasks.rs diff --git a/src/world/worldgen.rs b/kubi/src/world/worldgen.rs similarity index 100% rename from src/world/worldgen.rs rename to kubi/src/world/worldgen.rs