diff --git a/Cargo.lock b/Cargo.lock index 982b7764..789467ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -771,6 +771,16 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "color-backtrace" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fcd4d200ae702628e8d54bafff5f7e7397b031a5849656a6f5bfe2c5fb780d" +dependencies = [ + "backtrace", + "termcolor", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -2346,13 +2356,16 @@ dependencies = [ name = "luminol" version = "0.4.0" dependencies = [ + "color-backtrace", "crc", "eframe", "egui", + "image 0.24.7", "once_cell", "parking_lot", "rfd", "steamworks", + "tracing-subscriber", "winres", ] @@ -2773,6 +2786,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-derive" version = "0.3.3" @@ -3054,6 +3077,12 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owned_ttf_parser" version = "0.19.0" @@ -3827,6 +3856,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shared_library" version = "0.1.9" @@ -4265,6 +4303,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "tiff" version = "0.8.1" @@ -4459,6 +4507,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", ] [[package]] @@ -4581,6 +4655,12 @@ dependencies = [ "getrandom", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vec_map" version = "0.8.2" diff --git a/Cargo.toml b/Cargo.toml index be77253d..ae547a29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,36 +1,6 @@ -[package] -name = "luminol" -version = "0.4.0" -authors = [ - "Lily Lyons ", - "Egor Poleshko ", -] -edition = "2021" -rust-version = "1.62" -description = "Luminol is a FOSS recreation of RPG Maker XP in Rust with love ❤️" -license = "GPL-3.0" -readme = "README.md" -repository = "https://github.com/Speak2Erase/Luminol" -keywords = ["gamedev", "rpg", "rpg-maker"] -categories = ["games"] -build = "build.rs" - - [workspace] -members = [ - "crates/luminol-audio", - "crates/luminol-components", - "crates/luminol-config", - "crates/luminol-core", - "crates/luminol-data", - "crates/luminol-filesystem", - "crates/luminol-graphics", - "crates/luminol-modals", - "crates/luminol-macros", - "crates/luminol-tabs", - "crates/luminol-term", - "crates/luminol-windows", -] +members = ["crates/*"] +resolver = "2" [workspace.dependencies] egui = "0.22.0" @@ -46,6 +16,8 @@ egui-wgpu = "0.22.0" wgpu = "0.16.3" +image = "0.24.7" + serde = { version = "1.0", features = ["derive"] } alox-48 = "0.4.1" ron = "0.8.1" @@ -77,30 +49,6 @@ itertools = "0.11.0" rfd = "0.12.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -eframe.workspace = true -egui.workspace = true - -rfd.workspace = true - -parking_lot.workspace = true -once_cell.workspace = true - -steamworks = { version = "0.10.0", optional = true } -crc = { version = "3.0.1", optional = true } - -[features] -steamworks = ["dep:steamworks", "crc"] - -[target.'cfg(windows)'.build-dependencies] -winres = "0.1" - -[package.metadata.winres] -OriginalFilename = "Luminol.exe" -ProductName = "Luminol" - # Fast and performant. [profile.release] opt-level = 3 @@ -141,7 +89,6 @@ opt-level = 3 # See why config is set up this way. # https://bevy-cheatbook.github.io/pitfalls/performance.html#why-not-use---release - [patch.crates-io] # We need this for rodio to work in WebAssembly until # https://github.com/RustAudio/cpal/pull/774 diff --git a/crates/luminol-core/src/lib.rs b/crates/luminol-core/src/lib.rs index 68cb01e5..2cf4a397 100644 --- a/crates/luminol-core/src/lib.rs +++ b/crates/luminol-core/src/lib.rs @@ -35,9 +35,6 @@ pub mod tab; /// Swaps between filesystem_native and filesystem_wasm depending on the target arch. pub mod filesystem; -/// Embedded icon 256x256 in size. -pub const ICON: &[u8] = include_bytes!("../../../assets/icon-256.png"); - #[allow(missing_docs)] #[derive(Default)] pub struct ToolbarState { diff --git a/crates/luminol/Cargo.toml b/crates/luminol/Cargo.toml new file mode 100644 index 00000000..7ed7d7f4 --- /dev/null +++ b/crates/luminol/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "luminol" +version = "0.4.0" +authors = [ + "Lily Lyons ", + "Egor Poleshko ", +] +edition = "2021" +rust-version = "1.62" +description = "Luminol is a FOSS recreation of RPG Maker XP in Rust with love ❤️" +license = "GPL-3.0" +readme = "README.md" +repository = "https://github.com/Speak2Erase/Luminol" +keywords = ["gamedev", "rpg", "rpg-maker"] +categories = ["games"] +build = "build.rs" + +default-run = "luminol" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +eframe.workspace = true +egui.workspace = true + +rfd.workspace = true + +parking_lot.workspace = true +once_cell.workspace = true + +image.workspace = true + +steamworks = { version = "0.10.0", optional = true } +crc = { version = "3.0.1", optional = true } + +tracing-subscriber = "0.3.17" +color-backtrace = "0.6.0" + + +[features] +steamworks = ["dep:steamworks", "crc"] + +[target.'cfg(windows)'.build-dependencies] +winres = "0.1" + +[package.metadata.winres] +OriginalFilename = "Luminol.exe" +ProductName = "Luminol" diff --git a/build.rs b/crates/luminol/build.rs similarity index 100% rename from build.rs rename to crates/luminol/build.rs diff --git a/src/app/mod.rs b/crates/luminol/src/app/mod.rs similarity index 100% rename from src/app/mod.rs rename to crates/luminol/src/app/mod.rs diff --git a/src/app/top_bar.rs b/crates/luminol/src/app/top_bar.rs similarity index 100% rename from src/app/top_bar.rs rename to crates/luminol/src/app/top_bar.rs diff --git a/src/lumi/assets/lumi-idle.svg b/crates/luminol/src/lumi/assets/lumi-idle.svg similarity index 100% rename from src/lumi/assets/lumi-idle.svg rename to crates/luminol/src/lumi/assets/lumi-idle.svg diff --git a/src/lumi/assets/lumi-speak.svg b/crates/luminol/src/lumi/assets/lumi-speak.svg similarity index 100% rename from src/lumi/assets/lumi-speak.svg rename to crates/luminol/src/lumi/assets/lumi-speak.svg diff --git a/src/lumi/mod.rs b/crates/luminol/src/lumi/mod.rs similarity index 100% rename from src/lumi/mod.rs rename to crates/luminol/src/lumi/mod.rs diff --git a/src/lumi/state.rs b/crates/luminol/src/lumi/state.rs similarity index 100% rename from src/lumi/state.rs rename to crates/luminol/src/lumi/state.rs diff --git a/src/main.rs b/crates/luminol/src/main.rs similarity index 96% rename from src/main.rs rename to crates/luminol/src/main.rs index 2ff44aee..90b7f3cb 100644 --- a/src/main.rs +++ b/crates/luminol/src/main.rs @@ -53,6 +53,9 @@ #[cfg(target_arch = "wasm32")] use wasm_bindgen::prelude::*; +/// Embedded icon 256x256 in size. +const ICON: &[u8] = include_bytes!("../../../assets/icon-256.png"); + mod app; mod lumi; mod steam; @@ -112,9 +115,11 @@ fn main() { // Log to stdout (if you run with `RUST_LOG=debug`). tracing_subscriber::fmt::init(); - color_eyre::install().expect("failed to setup eyre hooks"); + color_backtrace::BacktracePrinter::new() + .verbosity(color_backtrace::Verbosity::Full) + .install(color_backtrace::default_output_stream()); - let image = image::load_from_memory(luminol::ICON).expect("Failed to load Icon data."); + let image = image::load_from_memory(ICON).expect("Failed to load Icon data."); let native_options = eframe::NativeOptions { drag_and_drop_support: true, @@ -122,7 +127,7 @@ fn main() { icon_data: Some(eframe::IconData { width: image.width(), height: image.height(), - rgba: image.into_bytes(), + rgba: image.to_rgba8().into_vec(), }), wgpu_options: eframe::egui_wgpu::WgpuConfiguration { supported_backends: eframe::wgpu::util::backend_bits_from_env() diff --git a/src/steam.rs b/crates/luminol/src/steam.rs similarity index 100% rename from src/steam.rs rename to crates/luminol/src/steam.rs