[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"]
categories = ["game-engines", "graphics", "rendering::engine"]
license.workspace = true
edition.workspace = true
rust-version.workspace = true
exclude = [
    "images/apps/*",
    "images/gallery/*",
    "images/hero.png",
    "images/dragon-attenuation.png",
    "images/live-demo.png",
    "images/logo2.png",
    "images/logo2.svg",
]

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

core = [
    "dep:freecs",
    "dep:bytemuck",
    "dep:bitflags",
    "dep:tracing",
    "dep:tracing-subscriber",
    "dep:thiserror",
    "dep:nalgebra",
    "dep:nalgebra-glm",
    "dep:raw-window-handle",
    "dep:web-time",
    "dep:winit",
    "dep:accesskit",
    "dep:accesskit_winit",
    "dep:mint",
    "dep:uuid",
    "dep:getrandom",
    "dep:console_error_panic_hook",
    "dep:tracing-web",
    "dep:pollster",
    "dep:petgraph",
    "dep:serde_json",
]

assets = [
    "core",
    "dep:gltf",
    "dep:half",
    "dep:image",
    "dep:bincode",
    "dep:serde_json",
    "dep:lz4_flex",
    "dep:bevy_mikktspace",
]

fbx = ["assets", "dep:ufbx"]

file_watcher = [
    "dep:notify",
]

scene_graph = ["assets"]

file_dialog = [
    "core",
    "dep:rfd",
    "dep:dirs",
]

runtime = [
    "core",
    "dep:cosmic-text",
]

engine = [
    "runtime",
    "assets",
    "scene_graph",
    "picking",
    "file_dialog",
    "screenshot",
    "dep:rand",
    "dep:ehttp",
    "dep:futures",
    "dep:js-sys",
    "dep:wasm-bindgen",
    "dep:wasm-bindgen-futures",
    "dep:web-sys",
]

shell = []
audio = ["dep:kira"]
debug_render = []
egui = ["dep:egui", "dep:egui_extras", "dep:egui-wgpu", "dep:egui-winit"]
gizmos = []
physics = ["dep:rapier3d"]
picking = []
screenshot = ["dep:image"]
navmesh = []
navmesh-bake = ["navmesh", "dep:rerecast", "dep:glam"]
gamepad = ["dep:gilrs"]
networking = ["dep:hearsay"]

full = [
    "engine",
    "wgpu",
    "shell",
    "audio",
    "physics",
    "gamepad",
    "navmesh",
    "networking",
    "grass",
    "terrain",
]

grass = []
terrain = ["grass"]

wgpu = ["dep:wgpu", "dep:naga_oil", "wgpu/wgsl", "wgpu/naga-ir", "wgpu/dx12", "wgpu/metal", "wgpu/vulkan", "wgpu/webgpu"]
steam = ["dep:steamworks", "dep:steamworks-sys"]
tracing = ["dep:tracing-appender", "dep:chrono"]
tracy = ["tracing", "dep:tracing-tracy"]
chrome = ["tracing", "dep:tracing-chrome"]
windows-app-icon = ["dep:winresource", "dep:ico", "dep:image"]

[dependencies]
serde = { workspace = true }
base64 = "0.22"
enum2schema = { version = "0.1.2", features = ["nalgebra-glm"] }

bincode = { workspace = true, optional = true }
bitflags = { workspace = true, optional = true }
bytemuck = { workspace = true, optional = true }
cosmic-text = { version = "0.16", 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 }
hearsay = { version = "0.1", optional = true }
kira = { workspace = true, optional = true }
bevy_mikktspace = { version = "1.0", 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 }
rapier3d = { workspace = true, optional = true }
raw-window-handle = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
lz4_flex = { version = "0.11", optional = true }
thiserror = { workspace = true, optional = true }
pollster = { version = "0.4", optional = true }
uuid = { version = "1.0", features = ["v4", "v5", "serde"], optional = true }
web-time = { workspace = true, optional = true }
winit = { workspace = true, optional = true }
ehttp = { workspace = true, optional = true }
taffy = { workspace = true }

wgpu = { workspace = true, optional = true }
naga_oil = { workspace = true, optional = true }

egui = { workspace = true, optional = true }
egui_extras = { workspace = true, optional = true }
egui-wgpu = { workspace = true, optional = true }
egui-winit = { workspace = true, optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
dirs = { version = "6.0", optional = true }
hearsay = { version = "0.1", features = ["spawn", "websockets"], optional = true }
ufbx = { version = "0.10", optional = true }
tracing-subscriber = { workspace = true, optional = true }
tracing-appender = { workspace = true, optional = true }
chrono = { workspace = true, optional = true }
tracing-tracy = { workspace = true, optional = true }
tracing-chrome = { workspace = true, optional = true }
image = { workspace = true, optional = true }
notify = { workspace = true, optional = true }
steamworks = { workspace = true, optional = true }
steamworks-sys = { workspace = true, optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
uuid = { version = "1.0", features = ["v4", "v5", "js", "serde"], optional = true }
console_error_panic_hook = { version = "0.1.7", optional = true }
tracing-subscriber = { workspace = true, optional = true }
tracing-web = { workspace = true, optional = true }
futures = { version = "0.3.32", optional = true }
image = { workspace = true, optional = true }
js-sys = { workspace = true, optional = true }
wasm-bindgen = { workspace = true, optional = true }
wasm-bindgen-futures = { workspace = true, optional = true }
web-sys = { workspace = true, features = [
    "Blob",
    "BlobPropertyBag",
    "ClipboardEvent",
    "DataTransfer",
    "DataTransferItem",
    "DataTransferItemList",
    "DedicatedWorkerGlobalScope",
    "Document",
    "DragEvent",
    "Element",
    "Event",
    "EventTarget",
    "File",
    "FileList",
    "FileReader",
    "FileSystemDirectoryEntry",
    "FileSystemDirectoryReader",
    "FileSystemEntry",
    "FileSystemFileEntry",
    "HtmlAnchorElement",
    "HtmlInputElement",
    "ProgressEvent",
    "Url",
    "Window",
], optional = true }

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

[target.'cfg(all(not(target_arch = "wasm32"), not(target_os = "android")))'.dependencies]
rfd = { version = "0.17", optional = true }
arboard = { workspace = true }
webbrowser = { workspace = true }
accesskit = { workspace = true, optional = true }
accesskit_winit = { workspace = true, optional = true }

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