From 41afd6b81cd259f0d47a09beb28f5d0bb2fbb67d Mon Sep 17 00:00:00 2001 From: Martin Indra Date: Fri, 21 Jul 2023 14:59:47 +0200 Subject: [PATCH] WIP --- CONTRIBUTING.md | 1 + Cargo.lock | 477 +++++++++++++++++++++------------- Cargo.toml | 10 +- crates/audio/src/music.rs | 9 +- crates/behaviour/src/chase.rs | 12 +- crates/camera/src/camera.rs | 89 +++---- crates/core/src/baseset.rs | 110 +++----- crates/core/src/transition.rs | 47 +--- 8 files changed, 396 insertions(+), 359 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5ace6e657..aefb98393 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -174,6 +174,7 @@ all the sub-crates. The crate inter-dependencies form an orderly DAG. ### Bevy Schedule +TODO fix this See de_core::baseset::GameSet. ### Coordinate Systems diff --git a/Cargo.lock b/Cargo.lock index 6df570b7e..d08bc20fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,24 +20,24 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "accesskit" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704d532b1cd3d912bb37499c55a81ac748cc1afa737eedd100ba441acdd47d38" +checksum = "02c98a5d094590335462354da402d754fe2cb78f0e6ce5024611c28ed539c1de" [[package]] name = "accesskit_consumer" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ba8b23cfca3944012ee2e5c71c02077a400e034c720eed6bd927cb6b4d1fd9" +checksum = "ca541e0fdb600916d196a940228df99b86d804fd2e6ef13894d7814f2799db43" dependencies = [ "accesskit", ] [[package]] name = "accesskit_macos" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d062544d6cc36f4213323b7cb3a0d74ddff4b0d2311ab5e7596f4278bb2cc9" +checksum = "4baea9413f0daf1cd4aab199bc09f8139cd726ce7673d523c27d186b8b878325" dependencies = [ "accesskit", "accesskit_consumer", @@ -47,9 +47,9 @@ dependencies = [ [[package]] name = "accesskit_windows" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf5b3c3828397ee832ba4a72fb1a4ace10f781e31885f774cbd531014059115" +checksum = "e11c7f177739f23bd19bb856e4a64fdd96eb8638ec0a6a6dde9a7019a9e91c53" dependencies = [ "accesskit", "accesskit_consumer", @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "accesskit_winit" -version = "0.12.4" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcb615217efc79c4bed3094c4ca76c4bc554751d1da16f3ed4ba0459b1e8f31" +checksum = "14f1bd64cd0b480cafb7bdd91eb489a1ff50f0f5702437b9efa32a25b8bb82a1" dependencies = [ "accesskit", "accesskit_macos", @@ -389,9 +389,9 @@ checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" [[package]] name = "android_log-sys" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" +checksum = "27f0fc03f560e1aebde41c2398b691cb98b5ea5996a6184a7a67bbbb77448969" [[package]] name = "android_system_properties" @@ -484,7 +484,7 @@ version = "0.37.3+1.3.251" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" dependencies = [ - "libloading", + "libloading 0.7.4", ] [[package]] @@ -734,18 +734,18 @@ dependencies = [ [[package]] name = "bevy" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93f906133305915d63f04108e6873c1b93a6605fe374b8f3391f6bda093e396" +checksum = "04a90fe8e9c03fa2d30acf39a5178a48526df00c1ccea2fc43fa6d9ca4d8a168" dependencies = [ "bevy_internal", ] [[package]] name = "bevy_a11y" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037c4063f7dac1a5d596eb47f40782a04ca5838dc4274dbbadc90eb81efe5169" +checksum = "f758f437d9d862bf10a8e3a0f76b426095c19a87d118c945dcb935358d856076" dependencies = [ "accesskit", "bevy_app", @@ -755,9 +755,9 @@ dependencies = [ [[package]] name = "bevy_animation" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0dc19f21846ebf8ba4d96617c2517b5119038774aa5dbbaf1bff122332b359c" +checksum = "3d130cb8b7e2b81304591c5c8e511accd2df58b8d8185ab4836ed2f377e6a61f" dependencies = [ "bevy_app", "bevy_asset", @@ -766,6 +766,7 @@ dependencies = [ "bevy_hierarchy", "bevy_math", "bevy_reflect", + "bevy_render", "bevy_time", "bevy_transform", "bevy_utils", @@ -773,13 +774,14 @@ dependencies = [ [[package]] name = "bevy_app" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01db46963eb9486f7884121527ec69751d0e448f9e1d5329e80ea3424118a31a" +checksum = "1817e8d5b1146ea9e7730a7264d3470394840e0754d15abded26473f867967a0" dependencies = [ "bevy_derive", "bevy_ecs", "bevy_reflect", + "bevy_tasks", "bevy_utils", "downcast-rs", "wasm-bindgen", @@ -788,9 +790,9 @@ dependencies = [ [[package]] name = "bevy_asset" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98609b4b0694a23bde0628aed626644967991f167aad9db2afb68dacb0017540" +checksum = "4e12f951d4af2ad4ad230cd7bcb05248149c415eec17c34bf26731c4cd8b897f" dependencies = [ "anyhow", "bevy_app", @@ -816,13 +818,14 @@ dependencies = [ [[package]] name = "bevy_audio" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42b9f9b87b0d094268ce52bb75ff346ae0054573f7acc5d66bf032e2c88f748d" +checksum = "a6bade3f5389f9463e150af874aebe672b5101df4268d28b0109a66f9cdce56e" dependencies = [ "anyhow", "bevy_app", "bevy_asset", + "bevy_derive", "bevy_ecs", "bevy_math", "bevy_reflect", @@ -835,9 +838,9 @@ dependencies = [ [[package]] name = "bevy_core" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee53d7b4691b57207d72e996992c995a53f3e8d21ca7151ca3956d9ce7d232e" +checksum = "263b6a943ecba176c8390a1100615021f61a3b2d7a87e8eecf4009b6ed4457e0" dependencies = [ "bevy_app", "bevy_ecs", @@ -850,12 +853,13 @@ dependencies = [ [[package]] name = "bevy_core_pipeline" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093ae5ced77251602ad6e43521e2acc1a5570bf85b80f232f1a7fdd43b50f8d8" +checksum = "50c70113b5c4106855b888f96d8574697eb9082713f976c9b6487c1f5ab28589" dependencies = [ "bevy_app", "bevy_asset", + "bevy_core", "bevy_derive", "bevy_ecs", "bevy_math", @@ -863,27 +867,27 @@ dependencies = [ "bevy_render", "bevy_transform", "bevy_utils", - "bitflags 1.3.2", + "bitflags 2.3.3", "radsort", "serde", ] [[package]] name = "bevy_derive" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff0add5ab4a6b2b7e86e18f9043bb48b6386faa3b56abaa0ed97a3d669a1992" +checksum = "e1477347b17df781756ba0dfd677e2975e57e930752cd3cd42e6cdd8fdaa3223" dependencies = [ "bevy_macro_utils", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "bevy_diagnostic" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c778422643b0adee9e82abbd07e1e906eb9947c274a9b18e0f7fbf137d4c34" +checksum = "37a594f970c261007cdd3edeccd61651c2cb4513de3d0b8b35d93f5d9c32c059" dependencies = [ "bevy_app", "bevy_core", @@ -896,9 +900,9 @@ dependencies = [ [[package]] name = "bevy_ecs" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed2f74687ccf13046c0f8e3b00dc61d7e656877b4a1380cf04635bb74d8e586" +checksum = "032c81ba7d919c1004b0abc33cc6c588c8f896a4d7c55a7c7aa1e46382242f43" dependencies = [ "async-channel", "bevy_ecs_macros", @@ -911,26 +915,27 @@ dependencies = [ "fixedbitset", "rustc-hash", "serde", + "thiserror", "thread_local", ] [[package]] name = "bevy_ecs_macros" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97fd126a0db7b30fb1833614b3a657b44ac88485741c33b2780e25de0f96d78" +checksum = "a15ff7fcafdb8fe464ddd300b4860a76d5c6f9d684472e4bf21852d6f0ff3991" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "bevy_encase_derive" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c086ebdc1f5522787d63772943277cc74a279445fb65db4d58c2c5330654648e" +checksum = "6bdf808dbdc68a0c519e09026c627bda85250205a40ac02794866bff254d6b56" dependencies = [ "bevy_macro_utils", "encase_derive_impl", @@ -938,22 +943,45 @@ dependencies = [ [[package]] name = "bevy_gilrs" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f32eb07e8c9ea4be7195ccec10d8f9ad70200f3ae2e13adc4b84df9f50bb1c6" +checksum = "b877a371caa64edd6ec5d66b47c67b9e9e9acff2f3bcc51e31e175463e89f6ba" dependencies = [ "bevy_app", "bevy_ecs", "bevy_input", + "bevy_log", + "bevy_time", "bevy_utils", "gilrs", + "thiserror", +] + +[[package]] +name = "bevy_gizmos" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7938b43b4bdf9d039b7d3b310f871ed5ffa5a185e861a9c85731c40182019f8d" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_core", + "bevy_core_pipeline", + "bevy_ecs", + "bevy_math", + "bevy_pbr", + "bevy_reflect", + "bevy_render", + "bevy_sprite", + "bevy_transform", + "bevy_utils", ] [[package]] name = "bevy_gltf" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2707632208617c3660ea7a1d2ef2ccc84b59f217c2f01a1d0abe81db4ae7bbde" +checksum = "f09b699698a2f5843ef63064010a5e7783403f99a697a04f41a2f8141cb4245d" dependencies = [ "anyhow", "base64 0.13.1", @@ -975,14 +1003,16 @@ dependencies = [ "bevy_utils", "gltf", "percent-encoding", + "serde", + "serde_json", "thiserror", ] [[package]] name = "bevy_hierarchy" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d04099865a13d1fd8bf3c044a80148cb3d23bfe8c3d5f082dda2ce091d85532" +checksum = "ba41e1bb0c367b31e59b53ab858de56764c78bee87c121843c1ff033efa0086c" dependencies = [ "bevy_app", "bevy_core", @@ -995,9 +1025,9 @@ dependencies = [ [[package]] name = "bevy_input" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15d40aa636bb656967ac16ca36066ab7a7bb9179e1b0390c5705e54208e8fd7" +checksum = "7221091c7b219a63a1f3f019512e8b72bed673230b97c3fcbca37ba566b1cffb" dependencies = [ "bevy_app", "bevy_ecs", @@ -1009,9 +1039,9 @@ dependencies = [ [[package]] name = "bevy_internal" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862b11931c5874cb00778ffb715fc526ee49e52a493d3bcf50e8010f301858b3" +checksum = "0f232e7bd2566abd05656789e3c6278a5ca2a24f1232dff525e5b0233a99a610" dependencies = [ "bevy_a11y", "bevy_animation", @@ -1024,6 +1054,7 @@ dependencies = [ "bevy_diagnostic", "bevy_ecs", "bevy_gilrs", + "bevy_gizmos", "bevy_gltf", "bevy_hierarchy", "bevy_input", @@ -1047,9 +1078,9 @@ dependencies = [ [[package]] name = "bevy_log" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25980c90ceaad34d09a53291e72ca56fcc754a974cd4654fffcf5b68b283b7a7" +checksum = "487dfd1fc75fada8f3f2f4773addf3fbba53a2a91cb913616e6dc6c26dd62995" dependencies = [ "android_log-sys", "bevy_app", @@ -1063,20 +1094,21 @@ dependencies = [ [[package]] name = "bevy_macro_utils" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b2fee53b2497cdc3bffff2ddf52afa751242424a5fd0d51d227d4dab081d0d9" +checksum = "fd3868e555723249fde3786891f35893b3001b2be4efb51f431467cb7fc378cd" dependencies = [ "quote", - "syn 1.0.109", + "rustc-hash", + "syn 2.0.25", "toml_edit", ] [[package]] name = "bevy_math" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6a1109d06fe947990db032e719e162414cf9bf7a478dcc52742f1c7136c42a" +checksum = "25088c6598fe0b8ded992c781dc49e613993c7a4e6a731c0f2ab0408add6afdb" dependencies = [ "glam", "serde", @@ -1084,18 +1116,18 @@ dependencies = [ [[package]] name = "bevy_mikktspace" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39106bc2ee21fce9496d2e15e0ba7925dff63e3eae10f7c1fc0094b56ad9f2bb" +checksum = "99dde80034660f7dbb473141c31f0a746acc7229f5a06ce769aba5f16fd592ab" dependencies = [ "glam", ] [[package]] name = "bevy_pbr" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f507cef55812aa70c2ec2b30fb996eb285fa7497d974cf03f76ec49c77fbe27" +checksum = "3efec2ae4b4f9fd38b82b93350499dac2dc6f07e63ef50a03c00c52075e2dea8" dependencies = [ "bevy_app", "bevy_asset", @@ -1108,22 +1140,23 @@ dependencies = [ "bevy_transform", "bevy_utils", "bevy_window", - "bitflags 1.3.2", + "bitflags 2.3.3", "bytemuck", + "naga_oil", "radsort", ] [[package]] name = "bevy_ptr" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b88451d4c5a353bff67dbaa937b6886efd26ae114769c17f2b35099c7a4de" +checksum = "c74fcf37593a0053f539c3b088f34f268cbefed031d8eb8ff0fb10d175160242" [[package]] name = "bevy_reflect" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc3979471890e336f3ba87961ef3ecd45c331cf2cb2f582c885e541af228b48" +checksum = "362492a6b66f676176705cc06017b012320fa260a9cf4baf3513387e9c05693e" dependencies = [ "bevy_math", "bevy_ptr", @@ -1136,28 +1169,29 @@ dependencies = [ "parking_lot 0.12.1", "serde", "smallvec", + "smol_str", "thiserror", ] [[package]] name = "bevy_reflect_derive" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc7ea7c9bc2c531eb29ba5619976613d6680453ff5dd4a7fcd08848e8bec5ad" +checksum = "8e974d78eaf1b45e1b4146711b5c16e37c24234e12f3a52f5f2e28332c969d3c" dependencies = [ "bevy_macro_utils", "bit-set", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", "uuid", ] [[package]] name = "bevy_render" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee1e126226f0a4d439bf82fe07c1104f894a6a365888e3eba7356f9647e77a83" +checksum = "46e4b6a82c3a2be1c0d0cbecf62debb8251b72c0ae76285f66265aabc5bf2d37" dependencies = [ "anyhow", "async-channel", @@ -1178,16 +1212,18 @@ dependencies = [ "bevy_transform", "bevy_utils", "bevy_window", - "bitflags 1.3.2", + "bitflags 2.3.3", + "bytemuck", "codespan-reporting", "downcast-rs", "encase", "futures-lite", "hexasphere", "image", + "js-sys", "ktx2", "naga", - "once_cell", + "naga_oil", "parking_lot 0.12.1", "regex", "ruzstd", @@ -1195,27 +1231,29 @@ dependencies = [ "smallvec", "thiserror", "thread_local", + "wasm-bindgen", + "web-sys", "wgpu", "wgpu-hal", ] [[package]] name = "bevy_render_macros" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "652f8c4d9577c6e6a8b3dfd8a4ce331e8b6ecdbb99636a4b2701dec50104d6bc" +checksum = "07c4d937f966644f5e1e3c9157736acdd36286bcce06142ff9ad25cd71348c09" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "bevy_scene" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de59637d27726251091120ce6f63917328ffd60aaccbda4d65a615873aff631" +checksum = "cf1e00eb30e2053d9fff0802b2f557350b4e66bac58d531de30882048b4e3232" dependencies = [ "anyhow", "bevy_app", @@ -1235,9 +1273,9 @@ dependencies = [ [[package]] name = "bevy_sprite" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c110358fe3651a5796fd1c07989635680738f5b5c7e9b8a463dd50d12bb78410" +checksum = "03f64119444ef9788dcdd05012a60f0fa3b7ddb396d434ebcfc3edefd76c91b5" dependencies = [ "bevy_app", "bevy_asset", @@ -1250,7 +1288,7 @@ dependencies = [ "bevy_render", "bevy_transform", "bevy_utils", - "bitflags 1.3.2", + "bitflags 2.3.3", "bytemuck", "fixedbitset", "guillotiere", @@ -1260,24 +1298,23 @@ dependencies = [ [[package]] name = "bevy_tasks" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3de86364316e151aeb0897eaaa917c3ad5ee5ef1471a939023cf7f2d5ab76955" +checksum = "faab904296a3d6976bb8a12bc0f42f6c98fb6cd87a96244e0151d359f684ec2d" dependencies = [ "async-channel", "async-executor", "async-task", "concurrent-queue", "futures-lite", - "once_cell", "wasm-bindgen-futures", ] [[package]] name = "bevy_text" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "995188f59dc06da3fc951e1f58a105cde2c817d5330ae67ddc0a140f46482f6b" +checksum = "b52a19b3d0caf20acd1bdb47b6a00717accc834b46c4f204a63de15cea45ec4b" dependencies = [ "ab_glyph", "anyhow", @@ -1298,9 +1335,9 @@ dependencies = [ [[package]] name = "bevy_time" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3edbd605df1bced312eb9888d6be3d5a5fcac3d4140038bbe3233d218399eef" +checksum = "d09225ad2ffef14da000080143730b36ba225844ae479e4791cdb9d08066d06a" dependencies = [ "bevy_app", "bevy_ecs", @@ -1312,9 +1349,9 @@ dependencies = [ [[package]] name = "bevy_transform" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24383dfb97d8a14b17721ecfdf58556eff5ea9a4b2a3d91accf2b472783880b0" +checksum = "da8a0cd3780e120e20be333cc48d41cb74620d798dc61bc18eb2a82d3545e184" dependencies = [ "bevy_app", "bevy_ecs", @@ -1325,9 +1362,9 @@ dependencies = [ [[package]] name = "bevy_ui" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb597aeed4e1bf5e6913879c3e22a7d50a843b822a7f71a4a80ebdfdf79e68d4" +checksum = "bb85992eb5809936b3326940dc8d6e7b219af3dde1ecbca5948addd6a78694cc" dependencies = [ "bevy_a11y", "bevy_app", @@ -1355,14 +1392,14 @@ dependencies = [ [[package]] name = "bevy_utils" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a88ebbca55d360d72e9fe78df0d22e25cd419933c9559e79dae2757f7c4d066" +checksum = "10bfde141f0cdd15e07bca72f4439a9db80877c283738f581d061972ef483b1b" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "bevy_utils_proc_macros", "getrandom", - "hashbrown 0.12.3", + "hashbrown 0.14.0", "instant", "petgraph", "thiserror", @@ -1372,20 +1409,20 @@ dependencies = [ [[package]] name = "bevy_utils_proc_macros" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630b92e32fa5cd7917c7d4fdbf63a90af958b01e096239f71bc4f8f3cf40c0d2" +checksum = "9e37f2e885b0e8af59dc19871c313d3cf2a2495db35bb4d4ae0a61b3f87d5401" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "bevy_window" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad31234754268fbe12050290b0496e2296252a16995a38f94bfb9680a4f09fda" +checksum = "0528832361e3d942df287c90537ef6fafb726c4934468a7c3a5d53d659bfbf54" dependencies = [ "bevy_app", "bevy_ecs", @@ -1398,9 +1435,9 @@ dependencies = [ [[package]] name = "bevy_winit" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf17bd6330f7e633b7c56754c776511a8f52cde4bf54c0278f34d7527548f253" +checksum = "24c6709dc70cfee1eb94d5f125d29612c4a9345dfc1a70dd3189af927b2fd503" dependencies = [ "accesskit_winit", "approx", @@ -1411,10 +1448,10 @@ dependencies = [ "bevy_hierarchy", "bevy_input", "bevy_math", + "bevy_tasks", "bevy_utils", "bevy_window", "crossbeam-channel", - "once_cell", "raw-window-handle", "wasm-bindgen", "web-sys", @@ -1707,7 +1744,7 @@ checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", - "libloading", + "libloading 0.7.4", ] [[package]] @@ -1827,6 +1864,21 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6051f239ecec86fde3410901ab7860d458d160371533842974fc61f96d15879b" +[[package]] +name = "const_soft_float" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ca1caa64ef4ed453e68bb3db612e51cf1b2f5b871337f0fcab1c8f87cc3dff" + +[[package]] +name = "constgebra" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd23e864550e6dafc1e41ac78ce4f1ccddc8672b40c403524a04ff3f0518420" +dependencies = [ + "const_soft_float", +] + [[package]] name = "convert_case" version = "0.4.0" @@ -2080,7 +2132,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" dependencies = [ "bitflags 1.3.2", - "libloading", + "libloading 0.7.4", "winapi", ] @@ -2090,6 +2142,12 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + [[package]] name = "de_audio" version = "0.1.0-dev" @@ -2168,7 +2226,7 @@ dependencies = [ name = "de_connector" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "anyhow", "assert_cmd", "async-std", @@ -2186,7 +2244,7 @@ dependencies = [ name = "de_construction" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "bevy", "de_core", "de_index", @@ -2202,7 +2260,7 @@ dependencies = [ name = "de_controller" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "bevy", "de_behaviour", "de_camera", @@ -2292,7 +2350,7 @@ dependencies = [ name = "de_index" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "bevy", "criterion", "de_core", @@ -2344,7 +2402,7 @@ dependencies = [ name = "de_lobby_client" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "anyhow", "async-compat", "bevy", @@ -2384,7 +2442,7 @@ dependencies = [ name = "de_map" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "async-std", "async-tar", "bevy", @@ -2433,7 +2491,7 @@ dependencies = [ name = "de_multiplayer" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "async-std", "bevy", "bincode", @@ -2449,7 +2507,7 @@ dependencies = [ name = "de_net" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "async-std", "bincode", "fastrand", @@ -2463,7 +2521,7 @@ dependencies = [ name = "de_objects" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "anyhow", "bevy", "de_core", @@ -2481,7 +2539,7 @@ dependencies = [ name = "de_pathing" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "approx", "bevy", "criterion", @@ -2502,7 +2560,7 @@ dependencies = [ name = "de_signs" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "bevy", "de_camera", "de_core", @@ -2515,7 +2573,7 @@ dependencies = [ name = "de_spawner" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "bevy", "de_core", "de_energy", @@ -2531,7 +2589,7 @@ dependencies = [ name = "de_terrain" version = "0.1.0-dev" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "bevy", "de_core", "de_map", @@ -2646,9 +2704,9 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "encase" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6591f13a63571c4821802eb5b10fd1155b1290bce87086440003841c8c3909b" +checksum = "8fce2eeef77fd4a293a54b62aa00ac9daebfbcda4bf8998c5a815635b004aa1c" dependencies = [ "const_panic", "encase_derive", @@ -2658,22 +2716,22 @@ dependencies = [ [[package]] name = "encase_derive" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1da6deed1f8b6f5909616ffa695f63a5de54d6a0f084fa715c70c8ed3abac9" +checksum = "0e520cde08cbf4f7cc097f61573ec06ce467019803de8ae82fb2823fa1554a0e" dependencies = [ "encase_derive_impl", ] [[package]] name = "encase_derive_impl" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae489d58959f3c4cdd1250866a05acfb341469affe4fced71aff3ba228be1693" +checksum = "3fe2568f851fd6144a45fa91cfed8fe5ca8fc0b56ba6797bfc1ed2771b90e37c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] @@ -3001,15 +3059,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -3074,9 +3123,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "glam" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e4afd9ad95555081e109fe1d21f2a30c691b5f0919c67dfa690a2e1eb6bd51c" +checksum = "42218cb640844e3872cc3c153dc975229e080a6c4733b34709ef445610550226" dependencies = [ "bytemuck", "serde", @@ -3213,6 +3262,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "grid" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0634107a3a005070dd73e27e74ecb691a94e9e5ba7829f434db7fbf73a6b5c47" +dependencies = [ + "no-std-compat", +] + [[package]] name = "guillotiere" version = "0.6.2" @@ -3264,7 +3322,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash 0.7.6", - "serde", ] [[package]] @@ -3275,6 +3332,7 @@ checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" dependencies = [ "ahash 0.8.3", "allocator-api2", + "serde", ] [[package]] @@ -3288,14 +3346,14 @@ dependencies = [ [[package]] name = "hassle-rs" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90601c6189668c7345fc53842cb3f3a3d872203d523be1b3cb44a36a3e62fb85" +checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" dependencies = [ "bitflags 1.3.2", "com-rs", "libc", - "libloading", + "libloading 0.7.4", "thiserror", "widestring", "winapi", @@ -3337,12 +3395,12 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hexasphere" -version = "8.1.0" +version = "9.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd41d443f978bfa380a6dad58b62a08c43bcb960631f13e9d015b911eaf73588" +checksum = "7cb3df16a7bcb1b5bc092abd55e14f77ca70aea14445026e264586fc62889a10" dependencies = [ + "constgebra", "glam", - "once_cell", ] [[package]] @@ -3607,12 +3665,13 @@ checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "iyes_progress" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c445a5cfe8748bab1353bdeb93ee607d387395ce0c250b8937db3ef97e2d30f2" +checksum = "c3f093e3b8f18730767ecf5b60c455b4f6b806d3c79ae2a31ca89d285718d635" dependencies = [ "bevy_app", "bevy_ecs", + "bevy_utils", ] [[package]] @@ -3703,7 +3762,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" dependencies = [ "libc", - "libloading", + "libloading 0.7.4", "pkg-config", ] @@ -3790,6 +3849,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "libloading" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "libm" version = "0.2.7" @@ -3977,9 +4046,9 @@ dependencies = [ [[package]] name = "naga" -version = "0.11.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c3d4269bcb7d50121097702fde1afb75f4ea8083aeb7a55688dcf289a853271" +checksum = "bbcc2e0513220fd2b598e6068608d4462db20322c0e77e47f6f488dfcfc279cb" dependencies = [ "bit-set", "bitflags 1.3.2", @@ -3988,7 +4057,6 @@ dependencies = [ "indexmap 1.9.3", "log", "num-traits", - "petgraph", "pp-rs", "rustc-hash", "spirv", @@ -3997,6 +4065,26 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "naga_oil" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9c27fc9c84580434af75123d13ad98d9a56e16d033b16dcfa6940728c8c225" +dependencies = [ + "bit-set", + "codespan-reporting", + "data-encoding", + "indexmap 1.9.3", + "naga", + "once_cell", + "regex", + "regex-syntax 0.6.29", + "rustc-hash", + "thiserror", + "tracing", + "unicode-ident", +] + [[package]] name = "nalgebra" version = "0.32.3" @@ -4097,6 +4185,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "nom" version = "7.1.3" @@ -4109,9 +4203,9 @@ dependencies = [ [[package]] name = "notify" -version = "5.2.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729f63e1ca555a43fe3efa4f3efdf4801c479da85b432242a7b726f353c88486" +checksum = "5738a2795d57ea20abec2d6d76c6081186709c0024187cd5977265eda6598b51" dependencies = [ "bitflags 1.3.2", "crossbeam-channel", @@ -4964,9 +5058,9 @@ checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "renderdoc-sys" -version = "0.7.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" +checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" [[package]] name = "reqwest" @@ -5130,11 +5224,12 @@ dependencies = [ [[package]] name = "ruzstd" -version = "0.2.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cada0ef59efa6a5f4dc5e491f93d9f31e3fc7758df421ff1de8a706338e1100" +checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" dependencies = [ "byteorder", + "thiserror-core", "twox-hash", ] @@ -5396,6 +5491,15 @@ dependencies = [ "serde", ] +[[package]] +name = "smol_str" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c" +dependencies = [ + "serde", +] + [[package]] name = "socket2" version = "0.4.9" @@ -5654,9 +5758,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.28.4" +version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b" +checksum = "6b949f01f9c23823744b71e0060472ecbde578ef68cc2a9e46d114efd77c3034" dependencies = [ "cfg-if", "core-foundation-sys 0.8.4", @@ -5673,6 +5777,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3540ec65df399929a04a485feb50144475735920cc47eaf8eba09c70b1df4055" dependencies = [ "arrayvec", + "grid", "num-traits", "slotmap", ] @@ -5715,6 +5820,26 @@ dependencies = [ "thiserror-impl", ] +[[package]] +name = "thiserror-core" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d97345f6437bb2004cd58819d8a9ef8e36cdd7661c2abc4bbde0a7c40d9f497" +dependencies = [ + "thiserror-core-impl", +] + +[[package]] +name = "thiserror-core-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ac1c5050e43014d16b2f94d0d2ce79e65ffdd8b38d8048f9c8f6a8a6da62ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "thiserror-impl" version = "1.0.43" @@ -6309,9 +6434,9 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.15.1" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d745a1b6d91d85c33defbb29f0eee0450e1d2614d987e14bf6baf26009d132d7" +checksum = "480c965c9306872eb6255fa55e4b4953be55a8b64d57e61d7ff840d3dcc051cd" dependencies = [ "arrayvec", "cfg-if", @@ -6333,20 +6458,20 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.15.1" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131408d940e335792645a98f03639573b0480e9e2e7cddbbab74f7c6d9f3fff" +checksum = "8f478237b4bf0d5b70a39898a66fa67ca3a007d79f2520485b8b0c3dfc46f8c2" dependencies = [ "arrayvec", "bit-vec", - "bitflags 1.3.2", + "bitflags 2.3.3", "codespan-reporting", - "fxhash", "log", "naga", "parking_lot 0.12.1", "profiling", "raw-window-handle", + "rustc-hash", "smallvec", "thiserror", "web-sys", @@ -6356,20 +6481,19 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.15.4" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdcf61a283adc744bb5453dd88ea91f3f86d5ca6b027661c6c73c7734ae0288b" +checksum = "1ecb3258078e936deee14fd4e0febe1cfe9bbb5ffef165cb60218d2ee5eb4448" dependencies = [ "android_system_properties", "arrayvec", "ash", "bit-set", - "bitflags 1.3.2", + "bitflags 2.3.3", "block", "core-graphics-types", "d3d12", "foreign-types", - "fxhash", "glow", "gpu-alloc", "gpu-allocator", @@ -6378,7 +6502,7 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading", + "libloading 0.8.0", "log", "metal", "naga", @@ -6388,6 +6512,7 @@ dependencies = [ "range-alloc", "raw-window-handle", "renderdoc-sys", + "rustc-hash", "smallvec", "thiserror", "wasm-bindgen", @@ -6398,11 +6523,11 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.15.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32444e121b0bd00cb02c0de32fde457a9491bd44e03e7a5db6df9b1da2f6f110" +checksum = "d0c153280bb108c2979eb5c7391cb18c56642dd3c072e55f52065e13e2a1252a" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.3.3", "js-sys", "web-sys", ] @@ -6419,9 +6544,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" diff --git a/Cargo.toml b/Cargo.toml index fad181f3a..4bd552db6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,14 +104,14 @@ de_uom = { path = "crates/uom", version = "0.1.0-dev" } # Other ab_glyph = "0.2.21" -ahash = "0.7.6" +ahash = "0.8.3" anyhow = "1.0" approx = "0.5.1" assert_cmd = "2.0.10" async-compat = "0.2.1" async-std = "1.11" async-tar = "0.4.2" -bevy = { version = "0.10", features = ["mp3"] } +bevy = { version = "0.11", features = ["mp3"] } bincode = "2.0.0-rc.3" chrono = "0.4.24" clap = { version = "4.0", features = ["derive"] } @@ -124,12 +124,12 @@ fern = "0.6.2" flate2 = "1.0.26" futures = "0.3.28" futures-lite = "1.13.0" -glam = "0.23" +glam = "0.24" gltf = "1.0" itertools = "0.11.0" -iyes_progress = "0.8.0" +iyes_progress = "0.9.0" log = "0.4.17" -nalgebra = { version = "0.32.2", features = ["convert-glam023"] } +nalgebra = { version = "0.32.3", features = ["convert-glam024"] } nix = "0.26.2" ntest = "0.9.0" parry2d = "0.13.1" diff --git a/crates/audio/src/music.rs b/crates/audio/src/music.rs index 7c0d30441..d845a806c 100644 --- a/crates/audio/src/music.rs +++ b/crates/audio/src/music.rs @@ -7,9 +7,12 @@ pub(crate) struct MusicPlugin; impl Plugin for MusicPlugin { fn build(&self, app: &mut App) { - app.add_system(setup.in_schedule(OnEnter(AppState::AppLoading))) - .add_system(load.track_progress().run_if(in_state(AppState::AppLoading))) - .add_system(start.in_schedule(OnExit(AppState::AppLoading))); + app.add_systems(OnEnter(AppState::AppLoading), setup) + .add_systems( + Update, + load.track_progress().run_if(in_state(AppState::AppLoading)), + ) + .add_systems(Update, start.in_schedule(OnExit(AppState::AppLoading))); } } diff --git a/crates/behaviour/src/chase.rs b/crates/behaviour/src/chase.rs index e1aa80403..fb1394a1f 100644 --- a/crates/behaviour/src/chase.rs +++ b/crates/behaviour/src/chase.rs @@ -1,5 +1,5 @@ use bevy::prelude::*; -use de_core::{baseset::GameSet, gamestate::GameState, projection::ToFlat}; +use de_core::{gamestate::GameState, projection::ToFlat}; use de_pathing::{PathQueryProps, PathTarget, UpdateEntityPath}; pub(crate) struct ChasePlugin; @@ -7,17 +7,13 @@ pub(crate) struct ChasePlugin; impl Plugin for ChasePlugin { fn build(&self, app: &mut App) { app.add_event::() - .add_system( + .add_systems( + PreUpdate, handle_chase_events - .in_base_set(GameSet::PreUpdate) .run_if(in_state(GameState::Playing)) .in_set(ChaseSet::ChaseTargetEvent), ) - .add_system( - chase - .in_base_set(GameSet::Update) - .run_if(in_state(GameState::Playing)), - ); + .add_systems(Update, chase.run_if(in_state(GameState::Playing))); } } diff --git a/crates/camera/src/camera.rs b/crates/camera/src/camera.rs index 00b68dbb3..c3063236d 100644 --- a/crates/camera/src/camera.rs +++ b/crates/camera/src/camera.rs @@ -45,77 +45,62 @@ impl Plugin for CameraPlugin { .add_plugin(ResendEventPlugin::::default()) .add_event::() .add_event::() - .add_system(setup.in_schedule(OnEnter(AppState::InGame))) - .add_system(cleanup.in_schedule(OnExit(AppState::InGame))) - .add_system( + .add_systems(OnEnter(AppState::InGame), setup) + .add_systems(OnExit(AppState::InGame), cleanup) + .add_systems( + GameSet::PreMovement, update_focus - .in_base_set(GameSet::PreMovement) .run_if(in_state(GameState::Playing)) .run_if(on_event::()) .in_set(InternalCameraSet::UpdateFocus), ) - .add_system( - handle_horizontal_events - .in_base_set(GameSet::Input) - .run_if(in_state(GameState::Playing)) - .in_set(CameraSet::MoveHorizontallEvent), - ) - .add_system( - handle_zoom_events - .in_base_set(GameSet::Input) - .run_if(in_state(GameState::Playing)) - .in_set(CameraSet::ZoomEvent), + .add_systems( + GameSet::Input, + ( + handle_horizontal_events + .run_if(in_state(GameState::Playing)) + .in_set(CameraSet::MoveHorizontallEvent), + handle_zoom_events + .run_if(in_state(GameState::Playing)) + .in_set(CameraSet::ZoomEvent), + handle_rotate_events + .run_if(in_state(GameState::Playing)) + .in_set(CameraSet::RotateEvent), + handle_tilt_events + .run_if(in_state(GameState::Playing)) + .in_set(CameraSet::TiltEvent), + ), ) - .add_system( - handle_rotate_events - .in_base_set(GameSet::Input) - .run_if(in_state(GameState::Playing)) - .in_set(CameraSet::RotateEvent), + .add_systems( + GameSet::PreMovement, + ( + process_move_focus_events + .run_if(in_state(GameState::Playing)) + .in_set(InternalCameraSet::MoveFocus) + .after(InternalCameraSet::UpdateFocus), + update_translation_handler + .run_if(in_state(GameState::Playing)) + .run_if(on_event::()) + .after(InternalCameraSet::MoveFocus), + ), ) - .add_system( - handle_tilt_events - .in_base_set(GameSet::Input) - .run_if(in_state(GameState::Playing)) - .in_set(CameraSet::TiltEvent), - ) - .add_system( - process_move_focus_events - .in_base_set(GameSet::PreMovement) - .run_if(in_state(GameState::Playing)) - .in_set(InternalCameraSet::MoveFocus) - .after(InternalCameraSet::UpdateFocus), - ) - .add_system( - update_translation_handler - .in_base_set(GameSet::PreMovement) - .run_if(in_state(GameState::Playing)) - .run_if(on_event::()) - .after(InternalCameraSet::MoveFocus), - ) - .add_system( - zoom.in_base_set(GameSet::Movement) - .run_if(in_state(GameState::Playing)) + .add_system(GameSet::Movement( + zoom.run_if(in_state(GameState::Playing)) .in_set(InternalCameraSet::Zoom), - ) - .add_system( pivot - .in_base_set(GameSet::Movement) .run_if(in_state(GameState::Playing)) - .in_set(InternalCameraSet::Pivot) .run_if( resource_exists_and_changed::() .or_else(resource_exists_and_changed::()), - ), - ) - .add_system( + ) + .in_set(InternalCameraSet::Pivot), move_horizontaly - .in_base_set(GameSet::Movement) .run_if(in_state(GameState::Playing)) // Zooming changes camera focus point so do it // after other types of camera movement. .after(InternalCameraSet::Zoom) .after(InternalCameraSet::Pivot), - ); + )); } } diff --git a/crates/core/src/baseset.rs b/crates/core/src/baseset.rs index d2d9d83b9..2319aa0f5 100644 --- a/crates/core/src/baseset.rs +++ b/crates/core/src/baseset.rs @@ -1,88 +1,40 @@ -use bevy::prelude::*; +use bevy::{app::MainScheduleOrder, ecs::schedule::ScheduleLabel, prelude::*}; +// TODO rename pub struct GameSetsPlugin; impl Plugin for GameSetsPlugin { fn build(&self, app: &mut App) { - app.edit_schedule(CoreSchedule::Main, |schedule| { - schedule.configure_sets( - ( - GameSet::Input, - GameSet::InputFlush, - GameSet::PreMovement, - GameSet::PreMovementFlush, - GameSet::Movement, - GameSet::MovementFlush, - GameSet::PostMovement, - GameSet::PostMovementFlush, - GameSet::PreUpdate, - GameSet::PreUpdateFlush, - GameSet::Update, - GameSet::UpdateFlush, - GameSet::PostUpdate, - GameSet::PostUpdateFlush, - ) - .chain(), - ); + let mut main = app.world.get_resource_mut::().unwrap(); - schedule.configure_sets((CoreSet::StateTransitions, GameSet::Input).chain()); - schedule.configure_sets( - ( - GameSet::InputFlush, - CoreSet::FixedUpdate, - GameSet::PreMovement, - ) - .chain(), - ); - schedule.configure_sets((GameSet::PostUpdateFlush, CoreSet::Update).chain()); - - schedule.add_system(apply_system_buffers.in_base_set(GameSet::InputFlush)); - schedule.add_system(apply_system_buffers.in_base_set(GameSet::PreMovementFlush)); - schedule.add_system(apply_system_buffers.in_base_set(GameSet::MovementFlush)); - schedule.add_system(apply_system_buffers.in_base_set(GameSet::PostMovementFlush)); - schedule.add_system(apply_system_buffers.in_base_set(GameSet::PreUpdateFlush)); - schedule.add_system(apply_system_buffers.in_base_set(GameSet::UpdateFlush)); - schedule.add_system(apply_system_buffers.in_base_set(GameSet::PostUpdateFlush)); - }); + main.insert_after(First, Input); + main.insert_after(Input, PreMovement); + main.insert_after(PreMovement, Movement); + main.insert_after(Movement, PostMovement); } } -#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)] -#[system_set(base)] -pub enum GameSet { - /// All user input is handled during this stage. - Input, - InputFlush, - /// The game state is prepared for movement stage during this stage. The - /// preparation includes, among other things, global path finding & - /// planning related updates. - PreMovement, - PreMovementFlush, - /// All of "game active" entity movement (changes to [`bevy::prelude::Transform`]) - /// happens during this stage (an in no other stage). - /// - /// "Game active" entities are those which impact the game dynamics. For - /// example buildings, units or the terrain. Auxiliary entities, for - /// example building drafts, might be moved during other stages. - Movement, - MovementFlush, - /// This stage includes for example update to spatial index of movable - /// objects. - PostMovement, - PostMovementFlush, - /// This stage includes all necessary preparation for the game update, e.g. - /// insertion of components which need to be present during game update. - PreUpdate, - PreUpdateFlush, - /// Most of the (movement unrelated) game logic happens during this stage. - /// For example unit AI, attacking, object health updates and so on. - /// - /// This is the only stage during which "game active" entities are - /// (de)spawned. - Update, - UpdateFlush, - /// For example this stage includes update to spatial index necessary due - /// to (de)spawning of objects to the game. - PostUpdate, - PostUpdateFlush, -} +// TODO update nomenclature +/// All user input is handled during this stage. +#[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)] +pub struct Input; + +/// The game state is prepared for movement stage during this stage. The +/// preparation includes, among other things, global path finding & planning +/// related updates. +#[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)] +pub struct PreMovement; + +/// All of "game active" entity movement (changes to +/// [`bevy::prelude::Transform`]) happens during this stage (an in no other +/// stage). +/// +/// "Game active" entities are those which impact the game dynamics. For +/// example buildings, units or the terrain. Auxiliary entities, for example +/// building drafts, might be moved during other stages. +#[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)] +pub struct Movement; + +/// This stage includes for example update to spatial index of movable objects. +#[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)] +pub struct PostMovement; diff --git a/crates/core/src/transition.rs b/crates/core/src/transition.rs index 1db2c8799..47699e4fa 100644 --- a/crates/core/src/transition.rs +++ b/crates/core/src/transition.rs @@ -1,7 +1,4 @@ -use bevy::{ - ecs::schedule::{run_enter_schedule, FreeSystemSet}, - prelude::*, -}; +use bevy::{ecs::schedule::run_enter_schedule, prelude::*}; pub trait DeStateTransition { /// This method is almost equal to Bevy's [`App::add_state`]. The only @@ -11,45 +8,23 @@ pub trait DeStateTransition { } pub trait StateWithSet { - type Set: FreeSystemSet; + type Set: SystemSet; fn state_set() -> Self::Set; } impl DeStateTransition for App { fn add_state_with_set(&mut self) -> &mut Self { - self.init_resource::>(); - self.init_resource::>(); - - let mut schedules = self.world.resource_mut::(); - - let Some(default_schedule) = schedules.get_mut(&*self.default_schedule_label) else { - let schedule_label = &self.default_schedule_label; - panic!("Default schedule {schedule_label:?} does not exist.") - }; - - default_schedule.add_systems( - ( - run_enter_schedule::.run_if(run_once()), - apply_state_transition::.in_set(S::state_set()), - ) - .chain() - .in_base_set(CoreSet::StateTransitions), - ); - - for variant in S::variants() { - default_schedule.configure_set( - OnUpdate(variant.clone()) - .in_base_set(CoreSet::Update) - .run_if(in_state(variant)), + self.init_resource::>() + .init_resource::>() + .add_systems( + StateTransition, + ( + run_enter_schedule::.run_if(run_once()), + apply_state_transition::.in_set(S::state_set()), + ) + .chain(), ); - } - - // These are different for loops to avoid conflicting access to self - for variant in S::variants() { - self.add_schedule(OnEnter(variant.clone()), Schedule::new()); - self.add_schedule(OnExit(variant), Schedule::new()); - } self }