[package]
name = "nightshade"
version.workspace = true
authors.workspace = true
description = "A cross-platform data-oriented game engine."
readme = "README.md"
homepage.workspace = true
repository.workspace = true
keywords = ["gamedev", "engine", "ecs", "wgpu", "webgpu"]
license.workspace = true
edition.workspace = true
rust-version.workspace = true

[features]
default = ["engine", "wgpu"]

engine = [
    "picking",
    "dep:bincode",
    "dep:bitflags",
    "dep:bytemuck",
    "dep:dirs",
    "dep:fontdue",
    "dep:freecs",
    "dep:getrandom",
    "dep:gltf",
    "dep:half",
    "dep:tracing",
    "dep:mint",
    "dep:nalgebra",
    "dep:nalgebra-glm",
    "dep:noise",
    "dep:petgraph",
    "dep:rand",
    "dep:raw-window-handle",
    "dep:rfd",
    "dep:serde_json",
    "dep:strum",
    "dep:thiserror",
    "dep:uuid",
    "dep:web-time",
    "dep:winit",
    "dep:tracing-subscriber",
    "dep:image",
    "dep:tokio",
    "dep:console_error_panic_hook",
    "dep:tracing-web",
    "dep:futures",
    "dep:js-sys",
    "dep:wasm-bindgen",
    "dep:wasm-bindgen-futures",
    "dep:web-sys",
    "dep:ehttp",
]

egui = ["dep:egui", "dep:egui_extras", "dep:egui-winit", "dep:egui-wgpu", "dep:egui_tiles"]
shell = ["egui"]
audio = ["dep:kira"]
physics = ["dep:rapier3d"]
picking = []
lattice = []
navmesh = ["dep:rerecast", "dep:glam"]
gamepad = ["dep:gilrs"]
fbx = []
base = ["egui", "gamepad", "physics"]

full = [
    "engine",
    "wgpu",
    "egui",
    "audio",
    "physics",
    "gamepad",
    "navmesh",
    "scripting",
]

wgpu = ["dep:wgpu", "wgpu/wgsl", "wgpu/dx12", "wgpu/metal", "wgpu/vulkan", "wgpu/webgpu"]
openxr = ["dep:openxr", "dep:ash", "dep:wgpu-hal", "dep:gpu-allocator", "wgpu/vulkan"]
steam = ["dep:steamworks", "dep:steamworks-sys"]
tracing = ["dep:tracing-appender"]
tracy = ["tracing", "dep:tracing-tracy"]
chrome = ["tracing", "dep:tracing-chrome"]
plugins = []
plugin_runtime = ["dep:wasmtime", "dep:wasmtime-wasi", "dep:anyhow"]
scripting = ["dep:rhai"]
windows-app-icon = ["dep:winresource", "dep:ico", "dep:image"]

[dependencies]
serde = { workspace = true }
postcard = { version = "1.1", features = ["alloc"] }
base64 = "0.22"

bincode = { workspace = true, optional = true }
bitflags = { workspace = true, optional = true }
bytemuck = { workspace = true, optional = true }
egui = { workspace = true, optional = true }
egui_extras = { workspace = true, optional = true }
fontdue = { version = "0.9", optional = true }
freecs = { workspace = true, optional = true }
getrandom = { version = "0.3", features = ["wasm_js"], optional = true }
gilrs = { workspace = true, optional = true }
gltf = { workspace = true, optional = true }
half = { workspace = true, optional = true }
kira = { workspace = true, optional = true }
tracing = { workspace = true, optional = true }
mint = { workspace = true, optional = true }
nalgebra = { workspace = true, optional = true }
nalgebra-glm = { workspace = true, optional = true }
petgraph = { workspace = true, optional = true }
rand = { version = "0.9", optional = true }
rerecast = { version = "0.2", default-features = false, features = ["std"], optional = true }
glam = { version = "0.30", optional = true }
noise = { workspace = true, optional = true }
rapier3d = { workspace = true, optional = true }
raw-window-handle = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
strum = { version = "0.27", features = ["derive"], optional = true }
thiserror = { workspace = true, optional = true }
uuid = { version = "1.0", features = ["v4"], optional = true }
web-time = { workspace = true, optional = true }
winit = { workspace = true, optional = true }
ehttp = { workspace = true, optional = true }

egui-wgpu = { workspace = true, optional = true }
egui_tiles = { version = "0.14", optional = true }
wgpu = { workspace = true, optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
dirs = { version = "6.0", optional = true }
rfd = { version = "0.17", optional = true }
rhai = { version = "1.23", optional = true, features = ["sync"] }
tracing-subscriber = { workspace = true, optional = true }
tracing-appender = { workspace = true, optional = true }
tracing-tracy = { workspace = true, optional = true }
tracing-chrome = { workspace = true, optional = true }
egui-winit = { workspace = true, optional = true }
image = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
openxr = { workspace = true, optional = true }
ash = { workspace = true, optional = true }
wgpu-hal = { workspace = true, optional = true }
gpu-allocator = { workspace = true, optional = true }
steamworks = { workspace = true, optional = true }
steamworks-sys = { workspace = true, optional = true }
wasmtime = { version = "40.0", optional = true }
wasmtime-wasi = { version = "40.0", optional = true }
anyhow = { version = "1.0", optional = true }
ufbx = { version = "0.10" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
uuid = { version = "1.0", features = ["v4", "js"], optional = true }
rhai = { version = "1.23", optional = true, features = ["sync", "wasm-bindgen"] }
console_error_panic_hook = { version = "0.1.7", optional = true }
tracing-subscriber = { workspace = true, optional = true }
tracing-web = { workspace = true, optional = true }
egui-winit = { workspace = true, default-features = false, optional = true }
futures = { version = "0.3.31", optional = true }
image = { workspace = true, optional = true }
js-sys = { version = "0.3", optional = true }
wasm-bindgen = { version = "0.2", optional = true }
wasm-bindgen-futures = { version = "0.4.56", optional = true }
web-sys = { version = "0.3", features = [
    "Blob",
    "BlobPropertyBag",
    "DataTransfer",
    "Document",
    "DragEvent",
    "Element",
    "Event",
    "EventTarget",
    "File",
    "FileList",
    "FileReader",
    "HtmlAnchorElement",
    "HtmlInputElement",
    "ProgressEvent",
    "Url",
    "Window",
], optional = true }

[target.'cfg(windows)'.dependencies]
winresource = { version = "0.1", optional = true }
ico = { version = "0.5", optional = true }

[package.metadata.cargo-machete]
ignored = ["nalgebra", "getrandom"]
