Workspace cleanup

master
Mark 2024-01-02 22:11:33 -08:00
parent c20bd5d7a4
commit 0e8fb47973
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
14 changed files with 172 additions and 99 deletions

23
Cargo.lock generated
View File

@ -579,7 +579,6 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cgmath", "cgmath",
"crossbeam",
"galactica-behavior", "galactica-behavior",
"galactica-constants", "galactica-constants",
"galactica-content", "galactica-content",
@ -587,19 +586,14 @@ dependencies = [
"galactica-render", "galactica-render",
"galactica-ui", "galactica-ui",
"galactica-world", "galactica-world",
"image",
"nalgebra",
"pollster", "pollster",
"rand",
"rapier2d",
"walkdir",
"wgpu", "wgpu",
"winit", "winit",
] ]
[[package]] [[package]]
name = "galactica-behavior" name = "galactica-behavior"
version = "0.0.0" version = "0.1.0"
dependencies = [ dependencies = [
"cgmath", "cgmath",
"galactica-content", "galactica-content",
@ -608,11 +602,11 @@ dependencies = [
[[package]] [[package]]
name = "galactica-constants" name = "galactica-constants"
version = "0.0.0" version = "0.1.0"
[[package]] [[package]]
name = "galactica-content" name = "galactica-content"
version = "0.0.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cgmath", "cgmath",
@ -625,20 +619,17 @@ dependencies = [
[[package]] [[package]]
name = "galactica-gameobject" name = "galactica-gameobject"
version = "0.0.0" version = "0.1.0"
dependencies = [ dependencies = [
"cgmath", "cgmath",
"crossbeam",
"galactica-content", "galactica-content",
"galactica-render", "galactica-render",
"nalgebra",
"rand", "rand",
"rapier2d",
] ]
[[package]] [[package]]
name = "galactica-render" name = "galactica-render"
version = "0.0.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytemuck", "bytemuck",
@ -653,7 +644,7 @@ dependencies = [
[[package]] [[package]]
name = "galactica-ui" name = "galactica-ui"
version = "0.0.0" version = "0.1.0"
dependencies = [ dependencies = [
"cgmath", "cgmath",
"galactica-content", "galactica-content",
@ -664,7 +655,7 @@ dependencies = [
[[package]] [[package]]
name = "galactica-world" name = "galactica-world"
version = "0.0.0" version = "0.1.0"
dependencies = [ dependencies = [
"cgmath", "cgmath",
"crossbeam", "crossbeam",

View File

@ -1,8 +1,3 @@
[package]
name = "galactica"
version = "0.1.0"
edition = "2021"
[profile.dev] [profile.dev]
opt-level = 0 opt-level = 0
debug = true debug = true
@ -26,42 +21,45 @@ panic = "abort"
incremental = false incremental = false
rpath = false rpath = false
[workspace] [workspace]
members = [ members = ["crates/*"]
"crates/content", default-members = ["crates/galactica"]
"crates/render", resolver = "2"
"crates/constants",
"crates/world",
"crates/behavior",
"crates/gameobject",
"crates/ui",
]
[workspace.package]
keywords = []
version = "0.1.0"
edition = "2021"
rust-version = "1.70"
categories = []
authors = []
homepage = ""
repository = ""
license = ""
[dependencies] [workspace.dependencies]
# Internal crates
galactica-constants = { path = "crates/constants" }
galactica-content = { path = "crates/content" } galactica-content = { path = "crates/content" }
galactica-render = { path = "crates/render" } galactica-render = { path = "crates/render" }
galactica-constants = { path = "crates/constants" }
galactica-world = { path = "crates/world" } galactica-world = { path = "crates/world" }
galactica-behavior = { path = "crates/behavior" } galactica-behavior = { path = "crates/behavior" }
galactica-gameobject = { path = "crates/gameobject" } galactica-gameobject = { path = "crates/gameobject" }
galactica-ui = { path = "crates/ui" } galactica-ui = { path = "crates/ui" }
galactica = { path = "crates/galactica" }
# Files
image = { version = "0.24", features = ["png"] } image = { version = "0.24", features = ["png"] }
# Graphics serde = { version = "1.0.193", features = ["derive"] }
winit = "0.28" winit = "0.28"
wgpu = "0.18" wgpu = "0.18"
# Physics bytemuck = { version = "1.12", features = ["derive"] }
rapier2d = { version = "0.17.2" } rapier2d = { version = "0.17.2" }
nalgebra = "0.32.3" nalgebra = "0.32.3"
crossbeam = "0.8.3" crossbeam = "0.8.3"
# Misc helpers
pollster = "0.3" pollster = "0.3"
anyhow = "1.0" anyhow = "1.0"
# TODO: migrate to nalgebra # TODO: migrate to nalgebra
cgmath = "0.18.0" cgmath = "0.18.0"
rand = "0.8.5" rand = "0.8.5"
walkdir = "2.4.0" walkdir = "2.4.0"
toml = "0.8.8"

View File

@ -1,9 +1,17 @@
[package] [package]
name = "galactica-behavior" name = "galactica-behavior"
version = "0.0.0" description = "AI behaviors for Galaictica"
edition = "2021" categories = { workspace = true }
keywords = { workspace = true }
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
[dependencies] [dependencies]
galactica-content = { path = "../content" } galactica-content = { workspace = true }
galactica-world = { path = "../world" } galactica-world = { workspace = true }
cgmath = "0.18.0" cgmath = { workspace = true }

View File

@ -1,4 +1,12 @@
[package] [package]
name = "galactica-constants" name = "galactica-constants"
version = "0.0.0" description = "Compile-time parameters for Galactica"
edition = "2021" categories = { workspace = true }
keywords = { workspace = true }
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }

View File

@ -1,13 +1,21 @@
[package] [package]
name = "galactica-content" name = "galactica-content"
version = "0.0.0" description = "Galactica's game content parser"
edition = "2021" categories = { workspace = true }
keywords = { workspace = true }
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
[dependencies] [dependencies]
toml = "0.8.8" serde = { workspace = true }
serde = { version = "1.0.193", features = ["derive"] } toml = { workspace = true }
anyhow = "1.0" anyhow = { workspace = true }
cgmath = "0.18.0" cgmath = { workspace = true }
walkdir = "2.4.0" walkdir = { workspace = true }
nalgebra = "0.32.3" nalgebra = { workspace = true }
image = { version = "0.24", features = ["png"] } image = { workspace = true }

View File

@ -0,0 +1,31 @@
[[bin]]
name = "galactic"
path = "src/main.rs"
[package]
name = "galactica"
description = "TODO"
categories = { workspace = true }
keywords = { workspace = true }
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
[dependencies]
galactica-content = { workspace = true }
galactica-render = { workspace = true }
galactica-constants = { workspace = true }
galactica-world = { workspace = true }
galactica-behavior = { workspace = true }
galactica-gameobject = { workspace = true }
galactica-ui = { workspace = true }
winit = { workspace = true }
wgpu = { workspace = true }
pollster = { workspace = true }
anyhow = { workspace = true }
cgmath = { workspace = true }

View File

@ -4,9 +4,11 @@ use std::time::Instant;
use winit::event::{ElementState, MouseButton, MouseScrollDelta, TouchPhase, VirtualKeyCode}; use winit::event::{ElementState, MouseButton, MouseScrollDelta, TouchPhase, VirtualKeyCode};
use crate::camera::Camera; use crate::camera::Camera;
use crate::{content, inputstatus::InputStatus}; use crate::inputstatus::InputStatus;
use galactica_behavior::{behavior, ShipBehavior}; use galactica_behavior::{behavior, ShipBehavior};
use galactica_constants; use galactica_constants;
use galactica_content as content;
use galactica_gameobject as object; use galactica_gameobject as object;
use galactica_render::{ObjectSprite, ParticleBuilder, UiSprite}; use galactica_render::{ObjectSprite, ParticleBuilder, UiSprite};
use galactica_ui as ui; use galactica_ui as ui;
@ -16,15 +18,17 @@ pub struct Game {
pub input: InputStatus, pub input: InputStatus,
pub last_update: Instant, pub last_update: Instant,
pub player: ShipPhysicsHandle, pub player: ShipPhysicsHandle,
pub system: object::System,
pub camera: Camera,
paused: bool, paused: bool,
pub time_scale: f32, pub time_scale: f32,
world: World,
shipbehaviors: Vec<Box<dyn ShipBehavior>>, shipbehaviors: Vec<Box<dyn ShipBehavior>>,
playerbehavior: behavior::Player, playerbehavior: behavior::Player,
content: content::Content, content: content::Content,
pub system: object::System,
pub camera: Camera,
world: World,
pub start_instant: Instant, pub start_instant: Instant,
// TODO: clean this up // TODO: clean this up

View File

@ -1,14 +1,19 @@
[package] [package]
name = "galactica-gameobject" name = "galactica-gameobject"
version = "0.0.0" description = "Galactica's game data manager"
edition = "2021" categories = { workspace = true }
keywords = { workspace = true }
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
[dependencies] [dependencies]
galactica-render = { path = "../render" } galactica-render = { workspace = true }
galactica-content = { path = "../content" } galactica-content = { workspace = true }
rapier2d = { version = "0.17.2" } cgmath = { workspace = true }
nalgebra = "0.32.3" rand = { workspace = true }
crossbeam = "0.8.3"
cgmath = "0.18.0"
rand = "0.8.5"

View File

@ -1,20 +1,24 @@
[package] [package]
name = "galactica-render" name = "galactica-render"
version = "0.0.0" description = "Galactica's rendering backend"
edition = "2021" categories = { workspace = true }
keywords = { workspace = true }
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
[dependencies] [dependencies]
# Internal crates galactica-content = { workspace = true }
galactica-content = { path = "../content" } galactica-constants = { workspace = true }
galactica-constants = { path = "../constants" }
# Misc helpers anyhow = { workspace = true }
anyhow = "1.0" cgmath = { workspace = true }
cgmath = "0.18.0" rand = { workspace = true }
rand = "0.8.5" image = { workspace = true }
# Files winit = { workspace = true }
image = { version = "0.24", features = ["png"] } wgpu = { workspace = true }
# Graphics bytemuck = { workspace = true }
winit = "0.28"
wgpu = "0.18"
bytemuck = { version = "1.12", features = ["derive"] }

View File

@ -1,11 +1,19 @@
[package] [package]
name = "galactica-ui" name = "galactica-ui"
version = "0.0.0" description = "UI routines for Galactica"
edition = "2021" categories = { workspace = true }
keywords = { workspace = true }
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
[dependencies] [dependencies]
galactica-content = { path = "../content" } galactica-content = { workspace = true }
galactica-world = { path = "../world" } galactica-world = { workspace = true }
galactica-render = { path = "../render" } galactica-render = { workspace = true }
galactica-gameobject = { path = "../gameobject" } galactica-gameobject = { workspace = true }
cgmath = "0.18.0" cgmath = { workspace = true }

View File

@ -1,15 +1,23 @@
[package] [package]
name = "galactica-world" name = "galactica-world"
version = "0.0.0" description = "World interactions for Galactica"
edition = "2021" categories = { workspace = true }
keywords = { workspace = true }
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
[dependencies] [dependencies]
galactica-render = { path = "../render" } galactica-render = { workspace = true }
galactica-content = { path = "../content" } galactica-content = { workspace = true }
galactica-gameobject = { path = "../gameobject" } galactica-gameobject = { workspace = true }
rapier2d = { version = "0.17.2" } rapier2d = { workspace = true }
nalgebra = "0.32.3" nalgebra = { workspace = true }
crossbeam = "0.8.3" crossbeam = { workspace = true }
cgmath = "0.18.0" cgmath = { workspace = true }
rand = "0.8.5" rand = { workspace = true }