From cd509a829aa3ea7c406706df92c93901185a84f6 Mon Sep 17 00:00:00 2001 From: Felix Wiegand Date: Mon, 27 Nov 2023 19:52:42 +0100 Subject: [PATCH] Fix wasm32 build --- src/gui/panels/menu_bar.rs | 4 ++-- src/simulation.rs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/panels/menu_bar.rs b/src/gui/panels/menu_bar.rs index f77fb3a..9e75415 100644 --- a/src/gui/panels/menu_bar.rs +++ b/src/gui/panels/menu_bar.rs @@ -38,7 +38,7 @@ impl MenuBarPanel { ui.separator(); // Opening files manually is not available on web assembly - #[cfg(all(not(target_arch = "wasm"), not(target_os = "android")))] + #[cfg(all(not(target_arch = "wasm32"), not(target_os = "android")))] if ui.selectable_label(false, "🗁 Open Log File").clicked() { if let Some(data_source) = open_log_file() { sam.data_source = Box::new(data_source); @@ -49,7 +49,7 @@ impl MenuBarPanel { ui.toggle_value(&mut sam.archive_window.open, "🗄 Flight Archive"); // Toggle archive panel - #[cfg(all(not(target_arch = "wasm"), not(target_os = "android")))] + #[cfg(all(not(target_arch = "wasm32"), not(target_os = "android")))] if ui.selectable_label(data_source_is_sim, "💻 Simulate").clicked() { sam.data_source = Box::new(SimulationDataSource::default()); } diff --git a/src/simulation.rs b/src/simulation.rs index d386ac9..8df5502 100644 --- a/src/simulation.rs +++ b/src/simulation.rs @@ -12,7 +12,10 @@ use mithril::telemetry::*; use crate::gui::windows::archive::ARCHIVE; +#[cfg(not(target_arch = "wasm32"))] type Rng = rand::rngs::StdRng; +#[cfg(target_arch = "wasm32")] +type Rng = rand::rngs::SmallRng; const GRAVITY: f32 = 9.80665;